From 244363b1244e8a4fc1c6e74964eb4b408acb73c4 Mon Sep 17 00:00:00 2001 From: Maurelian Date: Wed, 24 Mar 2021 16:50:39 -0400 Subject: [PATCH 01/10] Add coverage config --- .solcover.js | 11 + hardhat.config.ts | 1 + package.json | 4 +- yarn.lock | 598 +++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 581 insertions(+), 33 deletions(-) create mode 100644 .solcover.js diff --git a/.solcover.js b/.solcover.js new file mode 100644 index 000000000..e36016982 --- /dev/null +++ b/.solcover.js @@ -0,0 +1,11 @@ +module.exports = { + skipFiles: [ + './test-helpers', + './test-libraries', + './optimistic-ethereum/mockOVM' + ], + mocha: { + grep: "@skip-on-coverage", + invert: true + } +}; diff --git a/hardhat.config.ts b/hardhat.config.ts index fdf9f3230..53eaacebc 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,4 +1,5 @@ import { HardhatUserConfig } from 'hardhat/types' +import "solidity-coverage" import { DEFAULT_ACCOUNTS_HARDHAT, diff --git a/package.json b/package.json index b49e408f4..ddf66a97d 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "test": "yarn run test:contracts", "test:contracts": "hardhat test --show-stack-traces", "test:gas": "hardhat test \"test/contracts/OVM/execution/OVM_StateManager.gas-spec.ts\" --no-compile --show-stack-traces", + "test-coverage": "NODE_OPTIONS=--max_old_space_size=8192 hardhat coverage", "lint": "yarn run lint:typescript", "lint:typescript": "tslint --format stylish --project .", "lint:fix": "yarn run lint:fix:typescript", @@ -42,7 +43,8 @@ "@openzeppelin/contracts": "^3.3.0", "@typechain/hardhat": "^1.0.1", "ganache-core": "^2.12.1", - "glob": "^7.1.6" + "glob": "^7.1.6", + "solidity-coverage": "^0.7.16" }, "devDependencies": { "@eth-optimism/dev": "^1.1.1", diff --git a/yarn.lock b/yarn.lock index feeb979a5..9a4d67b92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -668,6 +668,27 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.43.0.tgz#031bad4b8a3525c5e14210afde0bc09c79564026" integrity sha512-QWfQjea3ekh9ZU+JeL2tJC9cTKLZ/JrcS0JGatLejpRYxQajvnHvHfh0dbHOKXEaXfCskEPTZ3f1kzuts742GA== +"@nodelib/fs.scandir@2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" + integrity sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA== + dependencies: + "@nodelib/fs.stat" "2.0.4" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.4", "@nodelib/fs.stat@^2.0.2": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" + integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" + integrity sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow== + dependencies: + "@nodelib/fs.scandir" "2.1.4" + fastq "^1.6.0" + "@nomiclabs/ethereumjs-vm@4.2.2": version "4.2.2" resolved "https://registry.yarnpkg.com/@nomiclabs/ethereumjs-vm/-/ethereumjs-vm-4.2.2.tgz#2f8817113ca0fb6c44c1b870d0a809f0e026a6cc" @@ -848,6 +869,11 @@ resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.11.1.tgz#fa840af64840c930f24a9c82c08d4a092a068add" integrity sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ== +"@solidity-parser/parser@^0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.12.0.tgz#18a0fb2a9d2484b23176f63b16093c64794fc323" + integrity sha512-DT3f/Aa4tQysZwUsuqBwvr8YRJzKkvPUKV/9o2/o5EVw3xqlbzmtx4O60lTUcZdCawL+N8bBLNUyOGpHjGlJVQ== + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -906,7 +932,12 @@ resolved "https://registry.yarnpkg.com/@truffle/error/-/error-0.0.11.tgz#2789c0042d7e796dcbb840c7a9b5d2bcd8e0e2d8" integrity sha512-ju6TucjlJkfYMmdraYY/IBJaFb+Sa+huhYtOoyOJ+G29KcgytUVnDzKGwC7Kgk6IsxQMm62Mc1E0GZzFbGGipw== -"@truffle/interface-adapter@^0.4.16": +"@truffle/error@^0.0.12": + version "0.0.12" + resolved "https://registry.yarnpkg.com/@truffle/error/-/error-0.0.12.tgz#83e02e6ffe1d154fe274141d90038a91fd1e186d" + integrity sha512-kZqqnPR9YDJG7KCDOcN1qH16Qs0oz1PzF0Y93AWdhXuL9S9HYo/RUUeqGKbPpRBEZldQUS8aa4EzfK08u5pu6g== + +"@truffle/interface-adapter@^0.4.16", "@truffle/interface-adapter@^0.4.19": version "0.4.19" resolved "https://registry.yarnpkg.com/@truffle/interface-adapter/-/interface-adapter-0.4.19.tgz#19248ac88099f8df34f58a3d43a95ba3470dc89a" integrity sha512-+Zz6Fr8+I2wYSS8RM3WBOMzf22QffMQTnlsYsRgRHzv3gYoRA9ZDLb84lFRfmWyw+IdXTo90tjRHEb5krC6uxg== @@ -916,6 +947,15 @@ source-map-support "^0.5.19" web3 "1.2.9" +"@truffle/provider@^0.2.24": + version "0.2.26" + resolved "https://registry.yarnpkg.com/@truffle/provider/-/provider-0.2.26.tgz#88e31b79973c2427c4a17d9a59411e6fbc810190" + integrity sha512-YKPmhB9S9AQkT2ePGtadwjDduxU23DXXy+5zyM5fevw5GCbXSnf+jG6rICXjPkVFjuKBlXuq5JbuERZn43522Q== + dependencies: + "@truffle/error" "^0.0.12" + "@truffle/interface-adapter" "^0.4.19" + web3 "1.2.9" + "@trufflesuite/chromafi@^2.2.1": version "2.2.2" resolved "https://registry.yarnpkg.com/@trufflesuite/chromafi/-/chromafi-2.2.2.tgz#d3fc507aa8504faffc50fb892cedcfe98ff57f77" @@ -979,7 +1019,7 @@ resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.15.tgz#b7a6d263c2cecf44b6de9a051cf496249b154553" integrity sha512-rYff6FI+ZTKAPkJUoyz7Udq3GaoDZnxYDEvdEdFZASiA7PoErltHezDishqQiSDWrGxvxmplH304jyzQmjp0AQ== -"@types/glob@^7.1.3": +"@types/glob@^7.1.1", "@types/glob@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== @@ -1119,6 +1159,16 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +abbrev@1.0.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= + abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" @@ -1184,6 +1234,11 @@ accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +address@^1.0.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" + integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA== + adm-zip@^0.4.16: version "0.4.16" resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" @@ -1216,6 +1271,11 @@ ajv@^6.10.0, ajv@^6.12.3: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= + ansi-colors@3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" @@ -1360,6 +1420,11 @@ array-flatten@1.1.1: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -1414,6 +1479,11 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== +async@1.x, async@^1.4.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= + async@2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" @@ -1421,11 +1491,6 @@ async@2.6.2: dependencies: lodash "^4.17.11" -async@^1.4.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= - async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.1: version "2.6.3" resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" @@ -2173,7 +2238,7 @@ braces@^2.3.1: split-string "^3.0.2" to-regex "^3.0.1" -braces@~3.0.2: +braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -2848,7 +2913,7 @@ cross-fetch@^2.1.0, cross-fetch@^2.1.1: node-fetch "2.1.2" whatwg-fetch "2.0.4" -cross-spawn@^6.0.5: +cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== @@ -2912,7 +2977,12 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +death@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/death/-/death-1.1.0.tgz#01aa9c401edd92750514470b8266390c66c67318" + integrity sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg= + +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -2993,6 +3063,11 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + defer-to-connect@^1.0.1: version "1.1.3" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" @@ -3105,6 +3180,14 @@ detect-libc@^1.0.3: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= +detect-port@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/detect-port/-/detect-port-1.3.0.tgz#d9c40e9accadd4df5cac6a782aefd014d573d1f1" + integrity sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ== + dependencies: + address "^1.0.1" + debug "^2.6.0" + diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -3129,6 +3212,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + dom-serializer@^1.0.1, dom-serializer@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.2.0.tgz#3433d9136aeb3c627981daa385fc7f32d27c48f1" @@ -3381,6 +3471,18 @@ escape-string-regexp@4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escodegen@1.8.x: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + eslint-plugin-prettier@^2.2.0: version "2.7.0" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.7.0.tgz#b4312dcf2c1d965379d7f9d5b5f8aaadc6a45904" @@ -3389,11 +3491,21 @@ eslint-plugin-prettier@^2.2.0: fast-diff "^1.1.1" jest-docblock "^21.0.0" +esprima@2.7.x, esprima@^2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -3927,6 +4039,19 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -4049,11 +4174,28 @@ fast-diff@^1.1.1: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== +fast-glob@^3.0.3: + version "3.2.5" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" + integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + picomatch "^2.2.1" + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + fast-redact@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.0.0.tgz#ac2f9e36c9f4976f5db9fb18c6ffbaf308cf316d" @@ -4064,6 +4206,13 @@ fast-safe-stringify@^2.0.7: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== +fastq@^1.6.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" + integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== + dependencies: + reusify "^1.0.4" + fetch-ponyfill@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" @@ -4280,6 +4429,15 @@ fs-extra@^7.0.0, fs-extra@^7.0.1: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-extra@^9.0.1: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -4322,6 +4480,15 @@ functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +ganache-cli@^6.11.0: + version "6.12.2" + resolved "https://registry.yarnpkg.com/ganache-cli/-/ganache-cli-6.12.2.tgz#c0920f7db0d4ac062ffe2375cb004089806f627a" + integrity sha512-bnmwnJDBDsOWBUP8E/BExWf85TsdDEFelQSzihSJm9VChVO1SHp94YXLP5BlA4j/OTxp0wR4R1Tje9OHOuAJVw== + dependencies: + ethereumjs-util "6.2.1" + source-map-support "0.5.12" + yargs "13.2.4" + ganache-core@^2.10.2, ganache-core@^2.12.1: version "2.13.2" resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.2.tgz#27e6fc5417c10e6e76e2e646671869d7665814a3" @@ -4402,7 +4569,7 @@ get-stream@^3.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= -get-stream@^4.1.0: +get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== @@ -4428,11 +4595,26 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +ghost-testrpc@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz#c4de9557b1d1ae7b2d20bbe474a91378ca90ce92" + integrity sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ== + dependencies: + chalk "^2.4.2" + node-emoji "^1.10.0" + github-from-package@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= +glob-parent@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob-parent@~5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" @@ -4452,7 +4634,7 @@ glob@7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.1.6, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.6, glob@~7.1.6: +glob@7.1.6, glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.6, glob@~7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -4464,6 +4646,33 @@ glob@7.1.6, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.6, glo once "^1.3.0" path-is-absolute "^1.0.0" +glob@^5.0.15: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-modules@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" + integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A== + dependencies: + global-prefix "^3.0.0" + +global-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" + integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== + dependencies: + ini "^1.3.5" + kind-of "^6.0.2" + which "^1.3.1" + global@~4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" @@ -4477,6 +4686,20 @@ globals@^9.18.0: resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== +globby@^10.0.1: + version "10.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.2.tgz#277593e745acaa4646c3ab411289ec47a0392543" + integrity sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg== + dependencies: + "@types/glob" "^7.1.1" + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.0.3" + glob "^7.1.3" + ignore "^5.1.1" + merge2 "^1.2.3" + slash "^3.0.0" + got@9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -4524,6 +4747,18 @@ growl@1.10.5: resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== +handlebars@^4.0.1: + version "4.7.7" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" + integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== + dependencies: + minimist "^1.2.5" + neo-async "^2.6.0" + source-map "^0.6.1" + wordwrap "^1.0.0" + optionalDependencies: + uglify-js "^3.1.4" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -4594,6 +4829,11 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -4821,6 +5061,11 @@ ieee754@^1.1.13: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== +ignore@^5.1.1: + version "5.1.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + immediate@^3.2.3: version "3.3.0" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" @@ -4854,11 +5099,16 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -ini@~1.3.0: +ini@^1.3.5, ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== +interpret@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" + integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== + invariant@2, invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -4871,6 +5121,11 @@ invert-kv@^1.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + io-ts@1.10.4: version "1.10.4" resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" @@ -5107,7 +5362,7 @@ is-retry-allowed@^1.0.0: resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== -is-stream@^1.0.0, is-stream@^1.0.1: +is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= @@ -5228,14 +5483,7 @@ js-yaml@3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f" - integrity sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q== - dependencies: - argparse "^2.0.1" - -js-yaml@^3.13.1: +js-yaml@3.x, js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -5243,6 +5491,13 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f" + integrity sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q== + dependencies: + argparse "^2.0.1" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -5349,6 +5604,11 @@ jsonify@~0.0.0: resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= +jsonschema@^1.2.4: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.0.tgz#1afa34c4bc22190d8e42271ec17ac8b3404f87b2" + integrity sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw== + jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -5419,6 +5679,13 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" + level-codec@^9.0.0: version "9.0.2" resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" @@ -5616,6 +5883,14 @@ levelup@^4.3.2: level-supports "~1.0.0" xtend "~4.0.0" +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -5685,6 +5960,11 @@ lodash.sum@^4.0.2: resolved "https://registry.yarnpkg.com/lodash.sum/-/lodash.sum-4.0.2.tgz#ad90e397965d803d4f1ff7aa5b2d0197f3b4637b" integrity sha1-rZDjl5ZdgD1PH/eqWy0Bl/O0Y3s= +lodash.toarray@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561" + integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE= + lodash@4.17.20, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.4: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" @@ -5772,6 +6052,13 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -5798,6 +6085,15 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + memdown@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" @@ -5844,6 +6140,11 @@ merge-descriptors@1.0.1: resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= +merge2@^1.2.3, merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + merkle-patricia-tree@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz#448d85415565df72febc33ca362b8b614f5a58f8" @@ -5917,6 +6218,14 @@ micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -5942,6 +6251,11 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -5974,7 +6288,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@3.0.4, minimatch@^3.0.3, minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -6026,7 +6340,7 @@ mkdirp@*, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@0.5.5, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3: +mkdirp@0.5.5, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -6206,6 +6520,11 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== +neo-async@^2.6.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + next-tick@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" @@ -6233,6 +6552,13 @@ node-addon-api@^3.0.2: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.1.0.tgz#98b21931557466c6729e51cb77cd39c965f42239" integrity sha512-flmrDNB06LIl5lywUz7YlNGZH/5p0M7W28k8hzd9Lshtdh1wshD2Y+U4h9LD6KObOy1f+fEVdgprPrEymjM5uw== +node-emoji@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.10.0.tgz#8886abd25d9c7bb61802a658523d1f8d2a89b2da" + integrity sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw== + dependencies: + lodash.toarray "^4.4.0" + node-environment-flags@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" @@ -6296,6 +6622,13 @@ noop-logger@^0.1.1: resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" integrity sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI= +nopt@3.x: + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= + dependencies: + abbrev "1" + normalize-package-data@^2.3.2: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -6316,6 +6649,13 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + npmlog@^4.0.1: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -6457,13 +6797,25 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@1.x, once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -6476,6 +6828,15 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" +os-locale@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== + dependencies: + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" + os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -6491,11 +6852,21 @@ p-cancelable@^1.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== + p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -6650,7 +7021,7 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-key@^2.0.1: +path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= @@ -6674,6 +7045,11 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + pathval@^1.1.0, pathval@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" @@ -6695,7 +7071,7 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picomatch@^2.0.4, picomatch@^2.2.1: +picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: version "2.2.2" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== @@ -6705,6 +7081,11 @@ pify@^2.0.0, pify@^2.3.0: resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -6791,6 +7172,11 @@ precond@0.2: resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" integrity sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw= +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -6969,6 +7355,11 @@ querystring@0.2.0: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + quick-format-unescaped@4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.1.tgz#437a5ea1a0b61deb7605f8ab6a8fd3858dbeb701" @@ -7102,6 +7493,20 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= + dependencies: + resolve "^1.1.6" + +recursive-readdir@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" + integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg== + dependencies: + minimatch "3.0.4" + regenerate@^1.2.1: version "1.4.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" @@ -7231,6 +7636,11 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= +resolve@1.1.x: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= + resolve@1.17.0, resolve@~1.17.0: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" @@ -7238,7 +7648,7 @@ resolve@1.17.0, resolve@~1.17.0: dependencies: path-parse "^1.0.6" -resolve@^1.10.0, resolve@^1.3.2, resolve@^1.8.1: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.3.2, resolve@^1.8.1: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -7265,6 +7675,11 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rimraf@^2.2.8, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -7294,6 +7709,13 @@ rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3, rlp@^2.2.4, rlp@^2.2.6: dependencies: bn.js "^4.11.1" +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + rustbn.js@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" @@ -7335,6 +7757,26 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +sc-istanbul@^0.4.5: + version "0.4.6" + resolved "https://registry.yarnpkg.com/sc-istanbul/-/sc-istanbul-0.4.6.tgz#cf6784355ff2076f92d70d59047d71c13703e839" + integrity sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g== + dependencies: + abbrev "1.0.x" + async "1.x" + escodegen "1.8.x" + esprima "2.7.x" + glob "^5.0.15" + handlebars "^4.0.1" + js-yaml "3.x" + mkdirp "0.5.x" + nopt "3.x" + once "1.x" + resolve "1.1.x" + supports-color "^3.1.0" + which "^1.1.1" + wordwrap "^1.0.0" + scrypt-js@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" @@ -7500,6 +7942,15 @@ shebang-regex@^1.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shelljs@^0.8.3: + version "0.8.4" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" + integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + signal-exit@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" @@ -7613,6 +8064,31 @@ solc@^0.6.3: semver "^5.5.0" tmp "0.0.33" +solidity-coverage@^0.7.16: + version "0.7.16" + resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.7.16.tgz#c8c8c46baa361e2817bbf275116ddd2ec90a55fb" + integrity sha512-ttBOStywE6ZOTJmmABSg4b8pwwZfYKG8zxu40Nz+sRF5bQX7JULXWj/XbX0KXps3Fsp8CJXg8P29rH3W54ipxw== + dependencies: + "@solidity-parser/parser" "^0.12.0" + "@truffle/provider" "^0.2.24" + chalk "^2.4.2" + death "^1.1.0" + detect-port "^1.3.0" + fs-extra "^8.1.0" + ganache-cli "^6.11.0" + ghost-testrpc "^0.0.2" + global-modules "^2.0.0" + globby "^10.0.1" + jsonschema "^1.2.4" + lodash "^4.17.15" + node-emoji "^1.10.0" + pify "^4.0.1" + recursive-readdir "^2.2.2" + sc-istanbul "^0.4.5" + semver "^7.3.4" + shelljs "^0.8.3" + web3-utils "^1.3.0" + sonic-boom@^1.0.2: version "1.4.0" resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-1.4.0.tgz#d6d35196c32609b46193145afc1174a8c692d21e" @@ -7665,11 +8141,18 @@ source-map@^0.5.6, source-map@^0.5.7: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0: +source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= + dependencies: + amdefine ">=0.0.4" + spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -7870,6 +8353,11 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + strip-hex-prefix@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" @@ -7916,6 +8404,13 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= +supports-color@^3.1.0: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= + dependencies: + has-flag "^1.0.0" + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -8231,6 +8726,13 @@ tweetnacl@^1.0.0, tweetnacl@^1.0.3: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + type-detect@^4.0.0, type-detect@^4.0.5: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -8321,6 +8823,11 @@ u2f-api@0.2.7: resolved "https://registry.yarnpkg.com/u2f-api/-/u2f-api-0.2.7.tgz#17bf196b242f6bf72353d9858e6a7566cc192720" integrity sha512-fqLNg8vpvLOD5J/z4B6wpPg4Lvowz1nJ9xdHcCzdUPKcFE/qNCceV2gNZxSJd5vhAZemHr/K/hbzVA0zxB5mkg== +uglify-js@^3.1.4: + version "3.13.2" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.2.tgz#fe10319861bccc8682bfe2e8151fbdd8aa921c44" + integrity sha512-SbMu4D2Vo95LMC/MetNaso1194M1htEA+JrqE9Hk+G2DhI+itfS9TRu9ZKeCahLDNa/J3n4MqUJ/fOHMzQpRWw== + ultron@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" @@ -9220,7 +9727,7 @@ web3-utils@1.2.9: underscore "1.9.1" utf8 "3.0.0" -web3-utils@1.3.4, web3-utils@^1.0.0-beta.31: +web3-utils@1.3.4, web3-utils@^1.0.0-beta.31, web3-utils@^1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.4.tgz#9b1aa30d7549f860b573e7bb7e690999e7192198" integrity sha512-/vC2v0MaZNpWooJfpRw63u0Y3ag2gNjAWiLtMSL6QQLmCqCy4SQIndMt/vRyx0uMoeGt1YTwSXEcHjUzOhLg0A== @@ -9330,7 +9837,7 @@ which-typed-array@^1.1.2: has-symbols "^1.0.1" is-typed-array "^1.1.3" -which@1.3.1, which@^1.2.9: +which@1.3.1, which@^1.1.1, which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -9356,6 +9863,16 @@ window-size@^0.2.0: resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wordwrap@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + workerpool@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.0.tgz#a8e038b4c94569596852de7a8ea4228eefdeb37b" @@ -9502,7 +10019,7 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@13.1.2, yargs-parser@^13.1.2: +yargs-parser@13.1.2, yargs-parser@^13.1.0, yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== @@ -9547,6 +10064,23 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" +yargs@13.2.4: + version "13.2.4" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.4.tgz#0b562b794016eb9651b98bd37acf364aa5d6dc83" + integrity sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + os-locale "^3.1.0" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.0" + yargs@13.3.2, yargs@^13.3.0: version "13.3.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" From c70bc259ce6446b2d4fef290910eee7798ca20ab Mon Sep 17 00:00:00 2001 From: Maurelian Date: Wed, 24 Mar 2021 20:25:02 -0400 Subject: [PATCH 02/10] Add flags to skip gas tests when running coverage --- .../OVM/chain/OVM_CanonicalTransactionChain.gas.spec.ts | 2 +- test/contracts/OVM/execution/OVM_ExecutionManager.gas-spec.ts | 2 +- test/contracts/OVM/execution/OVM_StateManager.gas-spec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/contracts/OVM/chain/OVM_CanonicalTransactionChain.gas.spec.ts b/test/contracts/OVM/chain/OVM_CanonicalTransactionChain.gas.spec.ts index 7cadde783..fa70bc310 100644 --- a/test/contracts/OVM/chain/OVM_CanonicalTransactionChain.gas.spec.ts +++ b/test/contracts/OVM/chain/OVM_CanonicalTransactionChain.gas.spec.ts @@ -129,7 +129,7 @@ describe('[GAS BENCHMARK] OVM_CanonicalTransactionChain', () => { ) }) - describe('appendSequencerBatch', () => { + describe('appendSequencerBatch [ @skip-on-coverage ]', () => { beforeEach(() => { OVM_CanonicalTransactionChain = OVM_CanonicalTransactionChain.connect( sequencer diff --git a/test/contracts/OVM/execution/OVM_ExecutionManager.gas-spec.ts b/test/contracts/OVM/execution/OVM_ExecutionManager.gas-spec.ts index af28dd7fd..85adb57a6 100644 --- a/test/contracts/OVM/execution/OVM_ExecutionManager.gas-spec.ts +++ b/test/contracts/OVM/execution/OVM_ExecutionManager.gas-spec.ts @@ -101,7 +101,7 @@ describe('OVM_ExecutionManager gas consumption', () => { ).connect(wallet) }) - describe('Measure cost of a very simple contract', async () => { + describe('Measure cost of a very simple contract [ @skip-on-coverage ]', async () => { it('Gas cost of run', async () => { const gasCost = await gasMeasurement.getGasCost( OVM_ExecutionManager, diff --git a/test/contracts/OVM/execution/OVM_StateManager.gas-spec.ts b/test/contracts/OVM/execution/OVM_StateManager.gas-spec.ts index adc62e5f9..5d7490929 100644 --- a/test/contracts/OVM/execution/OVM_StateManager.gas-spec.ts +++ b/test/contracts/OVM/execution/OVM_StateManager.gas-spec.ts @@ -21,7 +21,7 @@ const DUMMY_KEY = DUMMY_BYTES32[0] const DUMMY_VALUE_1 = DUMMY_BYTES32[1] const DUMMY_VALUE_2 = DUMMY_BYTES32[2] -describe('OVM_StateManager gas consumption', () => { +describe('OVM_StateManager gas consumption [ @skip-on-coverage ]', () => { let owner: Signer before(async () => { ;[owner] = await ethers.getSigners() From fb631f2471903e9b8ab76c66e18f308d92930cae Mon Sep 17 00:00:00 2001 From: Maurelian Date: Wed, 24 Mar 2021 21:49:13 -0400 Subject: [PATCH 03/10] Check-in coverage output --- coverage.json | 1 + .../OVM_ECDSAContractAccount.sol.html | 485 ++ coverage/OVM/accounts/OVM_ProxyEOA.sol.html | 428 ++ coverage/OVM/accounts/index.html | 106 + .../Abs_BaseCrossDomainMessenger.sol.html | 443 ++ .../OVM_L1CrossDomainMessenger.sol.html | 947 +++ .../OVM_L1MultiMessageRelayer.sol.html | 275 + .../OVM_L2CrossDomainMessenger.sol.html | 473 ++ coverage/OVM/bridge/messaging/index.html | 132 + .../bridge/tokens/Abs_L1TokenGateway.sol.html | 692 ++ .../tokens/Abs_L2DepositedToken.sol.html | 755 +++ .../bridge/tokens/OVM_L1ERC20Gateway.sol.html | 365 ++ .../bridge/tokens/OVM_L1ETHGateway.sol.html | 557 ++ .../tokens/OVM_L2DepositedERC20.sol.html | 266 + coverage/OVM/bridge/tokens/index.html | 145 + .../OVM_CanonicalTransactionChain.sol.html | 3755 +++++++++++ .../chain/OVM_ChainStorageContainer.sol.html | 680 ++ .../chain/OVM_StateCommitmentChain.sol.html | 1307 ++++ coverage/OVM/chain/index.html | 119 + .../execution/OVM_ExecutionManager.sol.html | 5654 +++++++++++++++++ .../OVM/execution/OVM_SafetyChecker.sol.html | 509 ++ .../OVM/execution/OVM_StateManager.sol.html | 2279 +++++++ .../OVM_StateManagerFactory.sol.html | 188 + coverage/OVM/execution/index.html | 132 + .../OVM/predeploys/ERC1820Registry.sol.html | 662 ++ .../predeploys/OVM_DeployerWhitelist.sol.html | 701 ++ coverage/OVM/predeploys/OVM_ETH.sol.html | 167 + .../predeploys/OVM_L1MessageSender.sol.html | 194 + .../OVM_L2ToL1MessagePasser.sol.html | 215 + .../OVM_ProxySequencerEntrypoint.sol.html | 413 ++ .../OVM_SequencerEntrypoint.sol.html | 446 ++ coverage/OVM/predeploys/index.html | 171 + .../Abs_FraudContributor.sol.html | 119 + .../OVM/verification/OVM_BondManager.sol.html | 689 ++ .../verification/OVM_FraudVerifier.sol.html | 953 +++ .../OVM_StateTransitioner.sol.html | 1484 +++++ .../OVM_StateTransitionerFactory.sol.html | 266 + coverage/OVM/verification/index.html | 145 + coverage/base.css | 213 + coverage/coverage-final.json | 78 + .../iOVM_ECDSAContractAccount.sol.html | 137 + coverage/iOVM/accounts/index.html | 93 + .../iAbs_BaseCrossDomainMessenger.sol.html | 173 + .../iOVM_L1CrossDomainMessenger.sol.html | 257 + .../iOVM_L1MultiMessageRelayer.sol.html | 119 + .../iOVM_L2CrossDomainMessenger.sol.html | 155 + coverage/iOVM/bridge/messaging/index.html | 132 + .../bridge/tokens/iOVM_L1ETHGateway.sol.html | 230 + .../tokens/iOVM_L1TokenGateway.sol.html | 218 + .../tokens/iOVM_L2DepositedToken.sol.html | 218 + coverage/iOVM/bridge/tokens/index.html | 119 + .../iOVM_CanonicalTransactionChain.sol.html | 782 +++ .../chain/iOVM_ChainStorageContainer.sol.html | 398 ++ .../chain/iOVM_StateCommitmentChain.sol.html | 419 ++ coverage/iOVM/chain/index.html | 119 + .../execution/iOVM_ExecutionManager.sol.html | 533 ++ .../execution/iOVM_SafetyChecker.sol.html | 107 + .../iOVM/execution/iOVM_StateManager.sol.html | 296 + .../iOVM_StateManagerFactory.sol.html | 134 + coverage/iOVM/execution/index.html | 132 + .../iOVM_DeployerWhitelist.sol.html | 125 + coverage/iOVM/predeploys/iOVM_ERC20.sol.html | 224 + .../predeploys/iOVM_L1MessageSender.sol.html | 107 + .../iOVM_L2ToL1MessagePasser.sol.html | 140 + coverage/iOVM/predeploys/index.html | 132 + .../verification/iOVM_BondManager.sol.html | 389 ++ .../verification/iOVM_FraudVerifier.sol.html | 260 + .../iOVM_StateTransitioner.sol.html | 314 + .../iOVM_StateTransitionerFactory.sol.html | 143 + coverage/iOVM/verification/index.html | 132 + coverage/index.html | 366 ++ .../OVM_ECDSAContractAccount.sol.html | 485 ++ .../OVM/accounts/OVM_ProxyEOA.sol.html | 428 ++ coverage/lcov-report/OVM/accounts/index.html | 106 + .../Abs_BaseCrossDomainMessenger.sol.html | 443 ++ .../OVM_L1CrossDomainMessenger.sol.html | 947 +++ .../OVM_L1MultiMessageRelayer.sol.html | 275 + .../OVM_L2CrossDomainMessenger.sol.html | 473 ++ .../OVM/bridge/messaging/index.html | 132 + .../bridge/tokens/Abs_L1TokenGateway.sol.html | 692 ++ .../tokens/Abs_L2DepositedToken.sol.html | 755 +++ .../bridge/tokens/OVM_L1ERC20Gateway.sol.html | 365 ++ .../bridge/tokens/OVM_L1ETHGateway.sol.html | 557 ++ .../tokens/OVM_L2DepositedERC20.sol.html | 266 + .../lcov-report/OVM/bridge/tokens/index.html | 145 + .../OVM_CanonicalTransactionChain.sol.html | 3755 +++++++++++ .../chain/OVM_ChainStorageContainer.sol.html | 680 ++ .../chain/OVM_StateCommitmentChain.sol.html | 1307 ++++ coverage/lcov-report/OVM/chain/index.html | 119 + .../execution/OVM_ExecutionManager.sol.html | 5654 +++++++++++++++++ .../OVM/execution/OVM_SafetyChecker.sol.html | 509 ++ .../OVM/execution/OVM_StateManager.sol.html | 2279 +++++++ .../OVM_StateManagerFactory.sol.html | 188 + coverage/lcov-report/OVM/execution/index.html | 132 + .../OVM/predeploys/ERC1820Registry.sol.html | 662 ++ .../predeploys/OVM_DeployerWhitelist.sol.html | 701 ++ .../OVM/predeploys/OVM_ETH.sol.html | 167 + .../predeploys/OVM_L1MessageSender.sol.html | 194 + .../OVM_L2ToL1MessagePasser.sol.html | 215 + .../OVM_ProxySequencerEntrypoint.sol.html | 413 ++ .../OVM_SequencerEntrypoint.sol.html | 446 ++ .../lcov-report/OVM/predeploys/index.html | 171 + .../Abs_FraudContributor.sol.html | 119 + .../OVM/verification/OVM_BondManager.sol.html | 689 ++ .../verification/OVM_FraudVerifier.sol.html | 953 +++ .../OVM_StateTransitioner.sol.html | 1484 +++++ .../OVM_StateTransitionerFactory.sol.html | 266 + .../lcov-report/OVM/verification/index.html | 145 + coverage/lcov-report/base.css | 213 + .../iOVM_ECDSAContractAccount.sol.html | 137 + coverage/lcov-report/iOVM/accounts/index.html | 93 + .../iAbs_BaseCrossDomainMessenger.sol.html | 173 + .../iOVM_L1CrossDomainMessenger.sol.html | 257 + .../iOVM_L1MultiMessageRelayer.sol.html | 119 + .../iOVM_L2CrossDomainMessenger.sol.html | 155 + .../iOVM/bridge/messaging/index.html | 132 + .../bridge/tokens/iOVM_L1ETHGateway.sol.html | 230 + .../tokens/iOVM_L1TokenGateway.sol.html | 218 + .../tokens/iOVM_L2DepositedToken.sol.html | 218 + .../lcov-report/iOVM/bridge/tokens/index.html | 119 + .../iOVM_CanonicalTransactionChain.sol.html | 782 +++ .../chain/iOVM_ChainStorageContainer.sol.html | 398 ++ .../chain/iOVM_StateCommitmentChain.sol.html | 419 ++ coverage/lcov-report/iOVM/chain/index.html | 119 + .../execution/iOVM_ExecutionManager.sol.html | 533 ++ .../execution/iOVM_SafetyChecker.sol.html | 107 + .../iOVM/execution/iOVM_StateManager.sol.html | 296 + .../iOVM_StateManagerFactory.sol.html | 134 + .../lcov-report/iOVM/execution/index.html | 132 + .../iOVM_DeployerWhitelist.sol.html | 125 + .../iOVM/predeploys/iOVM_ERC20.sol.html | 224 + .../predeploys/iOVM_L1MessageSender.sol.html | 107 + .../iOVM_L2ToL1MessagePasser.sol.html | 140 + .../lcov-report/iOVM/predeploys/index.html | 132 + .../verification/iOVM_BondManager.sol.html | 389 ++ .../verification/iOVM_FraudVerifier.sol.html | 260 + .../iOVM_StateTransitioner.sol.html | 314 + .../iOVM_StateTransitionerFactory.sol.html | 143 + .../lcov-report/iOVM/verification/index.html | 132 + coverage/lcov-report/index.html | 366 ++ .../bridge/OVM_CrossDomainEnabled.sol.html | 308 + .../lcov-report/libraries/bridge/index.html | 93 + .../libraries/codec/Lib_OVMCodec.sol.html | 1178 ++++ .../lcov-report/libraries/codec/index.html | 93 + .../resolver/Lib_AddressManager.sol.html | 272 + .../resolver/Lib_AddressResolver.sol.html | 209 + .../libraries/resolver/Lib_Ownable.sol.html | 293 + .../Lib_ResolvedDelegateProxy.sol.html | 281 + .../lcov-report/libraries/resolver/index.html | 132 + .../libraries/rlp/Lib_RLPReader.sol.html | 1925 ++++++ .../libraries/rlp/Lib_RLPWriter.sol.html | 911 +++ coverage/lcov-report/libraries/rlp/index.html | 106 + .../standards/IUniswapV2ERC20.sol.html | 137 + .../libraries/standards/UniSafeMath.sol.html | 119 + .../standards/UniswapV2ERC20.sol.html | 359 ++ .../libraries/standards/index.html | 119 + .../libraries/trie/Lib_MerkleTrie.sol.html | 2945 +++++++++ .../trie/Lib_SecureMerkleTrie.sol.html | 548 ++ .../lcov-report/libraries/trie/index.html | 106 + .../libraries/utils/Lib_Bytes32Utils.sol.html | 416 ++ .../libraries/utils/Lib_BytesUtils.sol.html | 728 +++ .../libraries/utils/Lib_ECDSAUtils.sol.html | 356 ++ .../libraries/utils/Lib_ErrorUtils.sol.html | 170 + .../libraries/utils/Lib_EthUtils.sol.html | 629 ++ .../libraries/utils/Lib_Math.sol.html | 170 + .../libraries/utils/Lib_MerkleTree.sol.html | 725 +++ .../utils/Lib_ReentrancyGuard.sol.html | 248 + .../libraries/utils/Lib_RingBuffer.sol.html | 1193 ++++ .../lcov-report/libraries/utils/index.html | 197 + .../Lib_SafeExecutionManagerWrapper.sol.html | 1205 ++++ .../wrappers/Lib_SafeMathWrapper.sol.html | 566 ++ .../lcov-report/libraries/wrappers/index.html | 106 + .../OVM_ECDSAContractAccount.sol.html | 485 ++ .../OVM/accounts/OVM_ProxyEOA.sol.html | 428 ++ .../OVM/accounts/index.html | 106 + .../Abs_BaseCrossDomainMessenger.sol.html | 443 ++ .../OVM_L1CrossDomainMessenger.sol.html | 947 +++ .../OVM_L1MultiMessageRelayer.sol.html | 275 + .../OVM_L2CrossDomainMessenger.sol.html | 473 ++ .../OVM/bridge/messaging/index.html | 132 + .../bridge/tokens/Abs_L1TokenGateway.sol.html | 692 ++ .../tokens/Abs_L2DepositedToken.sol.html | 755 +++ .../bridge/tokens/OVM_L1ERC20Gateway.sol.html | 365 ++ .../bridge/tokens/OVM_L1ETHGateway.sol.html | 557 ++ .../tokens/OVM_L2DepositedERC20.sol.html | 266 + .../OVM/bridge/tokens/index.html | 145 + .../OVM_CanonicalTransactionChain.sol.html | 3755 +++++++++++ .../chain/OVM_ChainStorageContainer.sol.html | 680 ++ .../chain/OVM_StateCommitmentChain.sol.html | 1307 ++++ .../optimistic-ethereum/OVM/chain/index.html | 119 + .../execution/OVM_ExecutionManager.sol.html | 5654 +++++++++++++++++ .../OVM/execution/OVM_SafetyChecker.sol.html | 509 ++ .../OVM/execution/OVM_StateManager.sol.html | 2279 +++++++ .../OVM_StateManagerFactory.sol.html | 188 + .../OVM/execution/index.html | 132 + .../OVM/predeploys/ERC1820Registry.sol.html | 662 ++ .../predeploys/OVM_DeployerWhitelist.sol.html | 701 ++ .../OVM/predeploys/OVM_ETH.sol.html | 167 + .../predeploys/OVM_L1MessageSender.sol.html | 194 + .../OVM_L2ToL1MessagePasser.sol.html | 215 + .../OVM_ProxySequencerEntrypoint.sol.html | 413 ++ .../OVM_SequencerEntrypoint.sol.html | 446 ++ .../OVM/predeploys/index.html | 171 + .../Abs_FraudContributor.sol.html | 119 + .../OVM/verification/OVM_BondManager.sol.html | 689 ++ .../verification/OVM_FraudVerifier.sol.html | 953 +++ .../OVM_StateTransitioner.sol.html | 1484 +++++ .../OVM_StateTransitionerFactory.sol.html | 266 + .../OVM/verification/index.html | 145 + .../iOVM_ECDSAContractAccount.sol.html | 137 + .../iOVM/accounts/index.html | 93 + .../iAbs_BaseCrossDomainMessenger.sol.html | 173 + .../iOVM_L1CrossDomainMessenger.sol.html | 257 + .../iOVM_L1MultiMessageRelayer.sol.html | 119 + .../iOVM_L2CrossDomainMessenger.sol.html | 155 + .../iOVM/bridge/messaging/index.html | 132 + .../bridge/tokens/iOVM_L1ETHGateway.sol.html | 230 + .../tokens/iOVM_L1TokenGateway.sol.html | 218 + .../tokens/iOVM_L2DepositedToken.sol.html | 218 + .../iOVM/bridge/tokens/index.html | 119 + .../iOVM_CanonicalTransactionChain.sol.html | 782 +++ .../chain/iOVM_ChainStorageContainer.sol.html | 398 ++ .../chain/iOVM_StateCommitmentChain.sol.html | 419 ++ .../optimistic-ethereum/iOVM/chain/index.html | 119 + .../execution/iOVM_ExecutionManager.sol.html | 533 ++ .../execution/iOVM_SafetyChecker.sol.html | 107 + .../iOVM/execution/iOVM_StateManager.sol.html | 296 + .../iOVM_StateManagerFactory.sol.html | 134 + .../iOVM/execution/index.html | 132 + .../iOVM_DeployerWhitelist.sol.html | 125 + .../iOVM/predeploys/iOVM_ERC20.sol.html | 224 + .../predeploys/iOVM_L1MessageSender.sol.html | 107 + .../iOVM_L2ToL1MessagePasser.sol.html | 140 + .../iOVM/predeploys/index.html | 132 + .../verification/iOVM_BondManager.sol.html | 389 ++ .../verification/iOVM_FraudVerifier.sol.html | 260 + .../iOVM_StateTransitioner.sol.html | 314 + .../iOVM_StateTransitionerFactory.sol.html | 143 + .../iOVM/verification/index.html | 132 + .../bridge/OVM_CrossDomainEnabled.sol.html | 308 + .../libraries/bridge/index.html | 93 + .../libraries/codec/Lib_OVMCodec.sol.html | 1178 ++++ .../libraries/codec/index.html | 93 + .../resolver/Lib_AddressManager.sol.html | 272 + .../resolver/Lib_AddressResolver.sol.html | 209 + .../libraries/resolver/Lib_Ownable.sol.html | 293 + .../Lib_ResolvedDelegateProxy.sol.html | 281 + .../libraries/resolver/index.html | 132 + .../libraries/rlp/Lib_RLPReader.sol.html | 1925 ++++++ .../libraries/rlp/Lib_RLPWriter.sol.html | 911 +++ .../libraries/rlp/index.html | 106 + .../standards/IUniswapV2ERC20.sol.html | 137 + .../libraries/standards/UniSafeMath.sol.html | 119 + .../standards/UniswapV2ERC20.sol.html | 359 ++ .../libraries/standards/index.html | 119 + .../libraries/trie/Lib_MerkleTrie.sol.html | 2945 +++++++++ .../trie/Lib_SecureMerkleTrie.sol.html | 548 ++ .../libraries/trie/index.html | 106 + .../libraries/utils/Lib_Bytes32Utils.sol.html | 416 ++ .../libraries/utils/Lib_BytesUtils.sol.html | 728 +++ .../libraries/utils/Lib_ECDSAUtils.sol.html | 356 ++ .../libraries/utils/Lib_ErrorUtils.sol.html | 170 + .../libraries/utils/Lib_EthUtils.sol.html | 629 ++ .../libraries/utils/Lib_Math.sol.html | 170 + .../libraries/utils/Lib_MerkleTree.sol.html | 725 +++ .../utils/Lib_ReentrancyGuard.sol.html | 248 + .../libraries/utils/Lib_RingBuffer.sol.html | 1193 ++++ .../libraries/utils/index.html | 197 + .../Lib_SafeExecutionManagerWrapper.sol.html | 1205 ++++ .../wrappers/Lib_SafeMathWrapper.sol.html | 566 ++ .../libraries/wrappers/index.html | 106 + .../mockOVM/accounts/index.html | 93 + .../mockOVM_ECDSAContractAccount.sol.html | 350 + .../mockOVM/bridge/index.html | 106 + .../mockOVM_CrossDomainMessenger.sol.html | 500 ++ ...ckOVM_GenericCrossDomainMessenger.sol.html | 206 + .../mockOVM/verification/index.html | 93 + .../verification/mockOVM_BondManager.sol.html | 329 + coverage/lcov-report/prettify.css | 1 + coverage/lcov-report/prettify.js | 1 + coverage/lcov-report/sort-arrow-sprite.png | Bin 0 -> 209 bytes coverage/lcov-report/sorter.js | 158 + .../test-helpers/Helper_GasMeasurer.sol.html | 164 + .../Helper_ModifiableStorage.sol.html | 233 + .../Helper_PrecompileCaller.sol.html | 224 + .../test-helpers/Helper_SimpleProxy.sol.html | 212 + .../test-helpers/Helper_TestRunner.sol.html | 647 ++ .../test-helpers/Mock_FraudVerifier.sol.html | 170 + .../test-helpers/TestERC20.sol.html | 269 + coverage/lcov-report/test-helpers/index.html | 171 + .../codec/TestLib_OVMCodec.sol.html | 245 + .../test-libraries/codec/index.html | 93 + .../rlp/TestLib_RLPReader.sol.html | 368 ++ .../rlp/TestLib_RLPWriter.sol.html | 356 ++ .../lcov-report/test-libraries/rlp/index.html | 106 + .../trie/TestLib_MerkleTrie.sol.html | 377 ++ .../trie/TestLib_SecureMerkleTrie.sol.html | 380 ++ .../test-libraries/trie/index.html | 106 + .../utils/TestLib_Bytes32Utils.sol.html | 242 + .../utils/TestLib_BytesUtils.sol.html | 428 ++ .../utils/TestLib_ECDSAUtils.sol.html | 164 + .../utils/TestLib_EthUtils.sol.html | 419 ++ .../utils/TestLib_MerkleTree.sol.html | 209 + .../utils/TestLib_RingBuffer.sol.html | 278 + .../test-libraries/utils/index.html | 158 + coverage/lcov.info | 3736 +++++++++++ .../bridge/OVM_CrossDomainEnabled.sol.html | 308 + coverage/libraries/bridge/index.html | 93 + .../libraries/codec/Lib_OVMCodec.sol.html | 1178 ++++ coverage/libraries/codec/index.html | 93 + .../resolver/Lib_AddressManager.sol.html | 272 + .../resolver/Lib_AddressResolver.sol.html | 209 + .../libraries/resolver/Lib_Ownable.sol.html | 293 + .../Lib_ResolvedDelegateProxy.sol.html | 281 + coverage/libraries/resolver/index.html | 132 + coverage/libraries/rlp/Lib_RLPReader.sol.html | 1925 ++++++ coverage/libraries/rlp/Lib_RLPWriter.sol.html | 911 +++ coverage/libraries/rlp/index.html | 106 + .../standards/IUniswapV2ERC20.sol.html | 137 + .../libraries/standards/UniSafeMath.sol.html | 119 + .../standards/UniswapV2ERC20.sol.html | 359 ++ coverage/libraries/standards/index.html | 119 + .../libraries/trie/Lib_MerkleTrie.sol.html | 2945 +++++++++ .../trie/Lib_SecureMerkleTrie.sol.html | 548 ++ coverage/libraries/trie/index.html | 106 + .../libraries/utils/Lib_Bytes32Utils.sol.html | 416 ++ .../libraries/utils/Lib_BytesUtils.sol.html | 728 +++ .../libraries/utils/Lib_ECDSAUtils.sol.html | 356 ++ .../libraries/utils/Lib_ErrorUtils.sol.html | 170 + .../libraries/utils/Lib_EthUtils.sol.html | 629 ++ coverage/libraries/utils/Lib_Math.sol.html | 170 + .../libraries/utils/Lib_MerkleTree.sol.html | 725 +++ .../utils/Lib_ReentrancyGuard.sol.html | 248 + .../libraries/utils/Lib_RingBuffer.sol.html | 1193 ++++ coverage/libraries/utils/index.html | 197 + .../Lib_SafeExecutionManagerWrapper.sol.html | 1205 ++++ .../wrappers/Lib_SafeMathWrapper.sol.html | 566 ++ coverage/libraries/wrappers/index.html | 106 + .../OVM_ECDSAContractAccount.sol.html | 485 ++ .../OVM/accounts/OVM_ProxyEOA.sol.html | 428 ++ .../OVM/accounts/index.html | 106 + .../Abs_BaseCrossDomainMessenger.sol.html | 443 ++ .../OVM_L1CrossDomainMessenger.sol.html | 947 +++ .../OVM_L1MultiMessageRelayer.sol.html | 275 + .../OVM_L2CrossDomainMessenger.sol.html | 473 ++ .../OVM/bridge/messaging/index.html | 132 + .../bridge/tokens/Abs_L1TokenGateway.sol.html | 692 ++ .../tokens/Abs_L2DepositedToken.sol.html | 755 +++ .../bridge/tokens/OVM_L1ERC20Gateway.sol.html | 365 ++ .../bridge/tokens/OVM_L1ETHGateway.sol.html | 557 ++ .../tokens/OVM_L2DepositedERC20.sol.html | 266 + .../OVM/bridge/tokens/index.html | 145 + .../OVM_CanonicalTransactionChain.sol.html | 3755 +++++++++++ .../chain/OVM_ChainStorageContainer.sol.html | 680 ++ .../chain/OVM_StateCommitmentChain.sol.html | 1307 ++++ .../optimistic-ethereum/OVM/chain/index.html | 119 + .../execution/OVM_ExecutionManager.sol.html | 5654 +++++++++++++++++ .../OVM/execution/OVM_SafetyChecker.sol.html | 509 ++ .../OVM/execution/OVM_StateManager.sol.html | 2279 +++++++ .../OVM_StateManagerFactory.sol.html | 188 + .../OVM/execution/index.html | 132 + .../OVM/predeploys/ERC1820Registry.sol.html | 662 ++ .../predeploys/OVM_DeployerWhitelist.sol.html | 701 ++ .../OVM/predeploys/OVM_ETH.sol.html | 167 + .../predeploys/OVM_L1MessageSender.sol.html | 194 + .../OVM_L2ToL1MessagePasser.sol.html | 215 + .../OVM_ProxySequencerEntrypoint.sol.html | 413 ++ .../OVM_SequencerEntrypoint.sol.html | 446 ++ .../OVM/predeploys/index.html | 171 + .../Abs_FraudContributor.sol.html | 119 + .../OVM/verification/OVM_BondManager.sol.html | 689 ++ .../verification/OVM_FraudVerifier.sol.html | 953 +++ .../OVM_StateTransitioner.sol.html | 1484 +++++ .../OVM_StateTransitionerFactory.sol.html | 266 + .../OVM/verification/index.html | 145 + .../iOVM_ECDSAContractAccount.sol.html | 137 + .../iOVM/accounts/index.html | 93 + .../iAbs_BaseCrossDomainMessenger.sol.html | 173 + .../iOVM_L1CrossDomainMessenger.sol.html | 257 + .../iOVM_L1MultiMessageRelayer.sol.html | 119 + .../iOVM_L2CrossDomainMessenger.sol.html | 155 + .../iOVM/bridge/messaging/index.html | 132 + .../bridge/tokens/iOVM_L1ETHGateway.sol.html | 230 + .../tokens/iOVM_L1TokenGateway.sol.html | 218 + .../tokens/iOVM_L2DepositedToken.sol.html | 218 + .../iOVM/bridge/tokens/index.html | 119 + .../iOVM_CanonicalTransactionChain.sol.html | 782 +++ .../chain/iOVM_ChainStorageContainer.sol.html | 398 ++ .../chain/iOVM_StateCommitmentChain.sol.html | 419 ++ .../optimistic-ethereum/iOVM/chain/index.html | 119 + .../execution/iOVM_ExecutionManager.sol.html | 533 ++ .../execution/iOVM_SafetyChecker.sol.html | 107 + .../iOVM/execution/iOVM_StateManager.sol.html | 296 + .../iOVM_StateManagerFactory.sol.html | 134 + .../iOVM/execution/index.html | 132 + .../iOVM_DeployerWhitelist.sol.html | 125 + .../iOVM/predeploys/iOVM_ERC20.sol.html | 224 + .../predeploys/iOVM_L1MessageSender.sol.html | 107 + .../iOVM_L2ToL1MessagePasser.sol.html | 140 + .../iOVM/predeploys/index.html | 132 + .../verification/iOVM_BondManager.sol.html | 389 ++ .../verification/iOVM_FraudVerifier.sol.html | 260 + .../iOVM_StateTransitioner.sol.html | 314 + .../iOVM_StateTransitionerFactory.sol.html | 143 + .../iOVM/verification/index.html | 132 + .../bridge/OVM_CrossDomainEnabled.sol.html | 308 + .../libraries/bridge/index.html | 93 + .../libraries/codec/Lib_OVMCodec.sol.html | 1178 ++++ .../libraries/codec/index.html | 93 + .../resolver/Lib_AddressManager.sol.html | 272 + .../resolver/Lib_AddressResolver.sol.html | 209 + .../libraries/resolver/Lib_Ownable.sol.html | 293 + .../Lib_ResolvedDelegateProxy.sol.html | 281 + .../libraries/resolver/index.html | 132 + .../libraries/rlp/Lib_RLPReader.sol.html | 1925 ++++++ .../libraries/rlp/Lib_RLPWriter.sol.html | 911 +++ .../libraries/rlp/index.html | 106 + .../standards/IUniswapV2ERC20.sol.html | 137 + .../libraries/standards/UniSafeMath.sol.html | 119 + .../standards/UniswapV2ERC20.sol.html | 359 ++ .../libraries/standards/index.html | 119 + .../libraries/trie/Lib_MerkleTrie.sol.html | 2945 +++++++++ .../trie/Lib_SecureMerkleTrie.sol.html | 548 ++ .../libraries/trie/index.html | 106 + .../libraries/utils/Lib_Bytes32Utils.sol.html | 416 ++ .../libraries/utils/Lib_BytesUtils.sol.html | 728 +++ .../libraries/utils/Lib_ECDSAUtils.sol.html | 356 ++ .../libraries/utils/Lib_ErrorUtils.sol.html | 170 + .../libraries/utils/Lib_EthUtils.sol.html | 629 ++ .../libraries/utils/Lib_Math.sol.html | 170 + .../libraries/utils/Lib_MerkleTree.sol.html | 725 +++ .../utils/Lib_ReentrancyGuard.sol.html | 248 + .../libraries/utils/Lib_RingBuffer.sol.html | 1193 ++++ .../libraries/utils/index.html | 197 + .../Lib_SafeExecutionManagerWrapper.sol.html | 1205 ++++ .../wrappers/Lib_SafeMathWrapper.sol.html | 566 ++ .../libraries/wrappers/index.html | 106 + .../mockOVM/accounts/index.html | 93 + .../mockOVM_ECDSAContractAccount.sol.html | 350 + .../mockOVM/bridge/index.html | 106 + .../mockOVM_CrossDomainMessenger.sol.html | 500 ++ ...ckOVM_GenericCrossDomainMessenger.sol.html | 206 + .../mockOVM/verification/index.html | 93 + .../verification/mockOVM_BondManager.sol.html | 329 + coverage/prettify.css | 1 + coverage/prettify.js | 1 + coverage/sort-arrow-sprite.png | Bin 0 -> 209 bytes coverage/sorter.js | 158 + .../test-helpers/Helper_GasMeasurer.sol.html | 164 + .../Helper_ModifiableStorage.sol.html | 233 + .../Helper_PrecompileCaller.sol.html | 224 + .../test-helpers/Helper_SimpleProxy.sol.html | 212 + .../test-helpers/Helper_TestRunner.sol.html | 647 ++ .../test-helpers/Mock_FraudVerifier.sol.html | 170 + coverage/test-helpers/TestERC20.sol.html | 269 + coverage/test-helpers/index.html | 171 + .../codec/TestLib_OVMCodec.sol.html | 245 + coverage/test-libraries/codec/index.html | 93 + .../rlp/TestLib_RLPReader.sol.html | 368 ++ .../rlp/TestLib_RLPWriter.sol.html | 356 ++ coverage/test-libraries/rlp/index.html | 106 + .../trie/TestLib_MerkleTrie.sol.html | 377 ++ .../trie/TestLib_SecureMerkleTrie.sol.html | 380 ++ coverage/test-libraries/trie/index.html | 106 + .../utils/TestLib_Bytes32Utils.sol.html | 242 + .../utils/TestLib_BytesUtils.sol.html | 428 ++ .../utils/TestLib_ECDSAUtils.sol.html | 164 + .../utils/TestLib_EthUtils.sol.html | 419 ++ .../utils/TestLib_MerkleTree.sol.html | 209 + .../utils/TestLib_RingBuffer.sol.html | 278 + coverage/test-libraries/utils/index.html | 158 + 471 files changed, 224273 insertions(+) create mode 100644 coverage.json create mode 100644 coverage/OVM/accounts/OVM_ECDSAContractAccount.sol.html create mode 100644 coverage/OVM/accounts/OVM_ProxyEOA.sol.html create mode 100644 coverage/OVM/accounts/index.html create mode 100644 coverage/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html create mode 100644 coverage/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html create mode 100644 coverage/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html create mode 100644 coverage/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html create mode 100644 coverage/OVM/bridge/messaging/index.html create mode 100644 coverage/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html create mode 100644 coverage/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html create mode 100644 coverage/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html create mode 100644 coverage/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html create mode 100644 coverage/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html create mode 100644 coverage/OVM/bridge/tokens/index.html create mode 100644 coverage/OVM/chain/OVM_CanonicalTransactionChain.sol.html create mode 100644 coverage/OVM/chain/OVM_ChainStorageContainer.sol.html create mode 100644 coverage/OVM/chain/OVM_StateCommitmentChain.sol.html create mode 100644 coverage/OVM/chain/index.html create mode 100644 coverage/OVM/execution/OVM_ExecutionManager.sol.html create mode 100644 coverage/OVM/execution/OVM_SafetyChecker.sol.html create mode 100644 coverage/OVM/execution/OVM_StateManager.sol.html create mode 100644 coverage/OVM/execution/OVM_StateManagerFactory.sol.html create mode 100644 coverage/OVM/execution/index.html create mode 100644 coverage/OVM/predeploys/ERC1820Registry.sol.html create mode 100644 coverage/OVM/predeploys/OVM_DeployerWhitelist.sol.html create mode 100644 coverage/OVM/predeploys/OVM_ETH.sol.html create mode 100644 coverage/OVM/predeploys/OVM_L1MessageSender.sol.html create mode 100644 coverage/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html create mode 100644 coverage/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html create mode 100644 coverage/OVM/predeploys/OVM_SequencerEntrypoint.sol.html create mode 100644 coverage/OVM/predeploys/index.html create mode 100644 coverage/OVM/verification/Abs_FraudContributor.sol.html create mode 100644 coverage/OVM/verification/OVM_BondManager.sol.html create mode 100644 coverage/OVM/verification/OVM_FraudVerifier.sol.html create mode 100644 coverage/OVM/verification/OVM_StateTransitioner.sol.html create mode 100644 coverage/OVM/verification/OVM_StateTransitionerFactory.sol.html create mode 100644 coverage/OVM/verification/index.html create mode 100644 coverage/base.css create mode 100644 coverage/coverage-final.json create mode 100644 coverage/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html create mode 100644 coverage/iOVM/accounts/index.html create mode 100644 coverage/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html create mode 100644 coverage/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html create mode 100644 coverage/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html create mode 100644 coverage/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html create mode 100644 coverage/iOVM/bridge/messaging/index.html create mode 100644 coverage/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html create mode 100644 coverage/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html create mode 100644 coverage/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html create mode 100644 coverage/iOVM/bridge/tokens/index.html create mode 100644 coverage/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html create mode 100644 coverage/iOVM/chain/iOVM_ChainStorageContainer.sol.html create mode 100644 coverage/iOVM/chain/iOVM_StateCommitmentChain.sol.html create mode 100644 coverage/iOVM/chain/index.html create mode 100644 coverage/iOVM/execution/iOVM_ExecutionManager.sol.html create mode 100644 coverage/iOVM/execution/iOVM_SafetyChecker.sol.html create mode 100644 coverage/iOVM/execution/iOVM_StateManager.sol.html create mode 100644 coverage/iOVM/execution/iOVM_StateManagerFactory.sol.html create mode 100644 coverage/iOVM/execution/index.html create mode 100644 coverage/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html create mode 100644 coverage/iOVM/predeploys/iOVM_ERC20.sol.html create mode 100644 coverage/iOVM/predeploys/iOVM_L1MessageSender.sol.html create mode 100644 coverage/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html create mode 100644 coverage/iOVM/predeploys/index.html create mode 100644 coverage/iOVM/verification/iOVM_BondManager.sol.html create mode 100644 coverage/iOVM/verification/iOVM_FraudVerifier.sol.html create mode 100644 coverage/iOVM/verification/iOVM_StateTransitioner.sol.html create mode 100644 coverage/iOVM/verification/iOVM_StateTransitionerFactory.sol.html create mode 100644 coverage/iOVM/verification/index.html create mode 100644 coverage/index.html create mode 100644 coverage/lcov-report/OVM/accounts/OVM_ECDSAContractAccount.sol.html create mode 100644 coverage/lcov-report/OVM/accounts/OVM_ProxyEOA.sol.html create mode 100644 coverage/lcov-report/OVM/accounts/index.html create mode 100644 coverage/lcov-report/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html create mode 100644 coverage/lcov-report/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/OVM/bridge/messaging/index.html create mode 100644 coverage/lcov-report/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html create mode 100644 coverage/lcov-report/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html create mode 100644 coverage/lcov-report/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html create mode 100644 coverage/lcov-report/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html create mode 100644 coverage/lcov-report/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html create mode 100644 coverage/lcov-report/OVM/bridge/tokens/index.html create mode 100644 coverage/lcov-report/OVM/chain/OVM_CanonicalTransactionChain.sol.html create mode 100644 coverage/lcov-report/OVM/chain/OVM_ChainStorageContainer.sol.html create mode 100644 coverage/lcov-report/OVM/chain/OVM_StateCommitmentChain.sol.html create mode 100644 coverage/lcov-report/OVM/chain/index.html create mode 100644 coverage/lcov-report/OVM/execution/OVM_ExecutionManager.sol.html create mode 100644 coverage/lcov-report/OVM/execution/OVM_SafetyChecker.sol.html create mode 100644 coverage/lcov-report/OVM/execution/OVM_StateManager.sol.html create mode 100644 coverage/lcov-report/OVM/execution/OVM_StateManagerFactory.sol.html create mode 100644 coverage/lcov-report/OVM/execution/index.html create mode 100644 coverage/lcov-report/OVM/predeploys/ERC1820Registry.sol.html create mode 100644 coverage/lcov-report/OVM/predeploys/OVM_DeployerWhitelist.sol.html create mode 100644 coverage/lcov-report/OVM/predeploys/OVM_ETH.sol.html create mode 100644 coverage/lcov-report/OVM/predeploys/OVM_L1MessageSender.sol.html create mode 100644 coverage/lcov-report/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html create mode 100644 coverage/lcov-report/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html create mode 100644 coverage/lcov-report/OVM/predeploys/OVM_SequencerEntrypoint.sol.html create mode 100644 coverage/lcov-report/OVM/predeploys/index.html create mode 100644 coverage/lcov-report/OVM/verification/Abs_FraudContributor.sol.html create mode 100644 coverage/lcov-report/OVM/verification/OVM_BondManager.sol.html create mode 100644 coverage/lcov-report/OVM/verification/OVM_FraudVerifier.sol.html create mode 100644 coverage/lcov-report/OVM/verification/OVM_StateTransitioner.sol.html create mode 100644 coverage/lcov-report/OVM/verification/OVM_StateTransitionerFactory.sol.html create mode 100644 coverage/lcov-report/OVM/verification/index.html create mode 100644 coverage/lcov-report/base.css create mode 100644 coverage/lcov-report/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html create mode 100644 coverage/lcov-report/iOVM/accounts/index.html create mode 100644 coverage/lcov-report/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html create mode 100644 coverage/lcov-report/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/iOVM/bridge/messaging/index.html create mode 100644 coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html create mode 100644 coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html create mode 100644 coverage/lcov-report/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html create mode 100644 coverage/lcov-report/iOVM/bridge/tokens/index.html create mode 100644 coverage/lcov-report/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html create mode 100644 coverage/lcov-report/iOVM/chain/iOVM_ChainStorageContainer.sol.html create mode 100644 coverage/lcov-report/iOVM/chain/iOVM_StateCommitmentChain.sol.html create mode 100644 coverage/lcov-report/iOVM/chain/index.html create mode 100644 coverage/lcov-report/iOVM/execution/iOVM_ExecutionManager.sol.html create mode 100644 coverage/lcov-report/iOVM/execution/iOVM_SafetyChecker.sol.html create mode 100644 coverage/lcov-report/iOVM/execution/iOVM_StateManager.sol.html create mode 100644 coverage/lcov-report/iOVM/execution/iOVM_StateManagerFactory.sol.html create mode 100644 coverage/lcov-report/iOVM/execution/index.html create mode 100644 coverage/lcov-report/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html create mode 100644 coverage/lcov-report/iOVM/predeploys/iOVM_ERC20.sol.html create mode 100644 coverage/lcov-report/iOVM/predeploys/iOVM_L1MessageSender.sol.html create mode 100644 coverage/lcov-report/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html create mode 100644 coverage/lcov-report/iOVM/predeploys/index.html create mode 100644 coverage/lcov-report/iOVM/verification/iOVM_BondManager.sol.html create mode 100644 coverage/lcov-report/iOVM/verification/iOVM_FraudVerifier.sol.html create mode 100644 coverage/lcov-report/iOVM/verification/iOVM_StateTransitioner.sol.html create mode 100644 coverage/lcov-report/iOVM/verification/iOVM_StateTransitionerFactory.sol.html create mode 100644 coverage/lcov-report/iOVM/verification/index.html create mode 100644 coverage/lcov-report/index.html create mode 100644 coverage/lcov-report/libraries/bridge/OVM_CrossDomainEnabled.sol.html create mode 100644 coverage/lcov-report/libraries/bridge/index.html create mode 100644 coverage/lcov-report/libraries/codec/Lib_OVMCodec.sol.html create mode 100644 coverage/lcov-report/libraries/codec/index.html create mode 100644 coverage/lcov-report/libraries/resolver/Lib_AddressManager.sol.html create mode 100644 coverage/lcov-report/libraries/resolver/Lib_AddressResolver.sol.html create mode 100644 coverage/lcov-report/libraries/resolver/Lib_Ownable.sol.html create mode 100644 coverage/lcov-report/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html create mode 100644 coverage/lcov-report/libraries/resolver/index.html create mode 100644 coverage/lcov-report/libraries/rlp/Lib_RLPReader.sol.html create mode 100644 coverage/lcov-report/libraries/rlp/Lib_RLPWriter.sol.html create mode 100644 coverage/lcov-report/libraries/rlp/index.html create mode 100644 coverage/lcov-report/libraries/standards/IUniswapV2ERC20.sol.html create mode 100644 coverage/lcov-report/libraries/standards/UniSafeMath.sol.html create mode 100644 coverage/lcov-report/libraries/standards/UniswapV2ERC20.sol.html create mode 100644 coverage/lcov-report/libraries/standards/index.html create mode 100644 coverage/lcov-report/libraries/trie/Lib_MerkleTrie.sol.html create mode 100644 coverage/lcov-report/libraries/trie/Lib_SecureMerkleTrie.sol.html create mode 100644 coverage/lcov-report/libraries/trie/index.html create mode 100644 coverage/lcov-report/libraries/utils/Lib_Bytes32Utils.sol.html create mode 100644 coverage/lcov-report/libraries/utils/Lib_BytesUtils.sol.html create mode 100644 coverage/lcov-report/libraries/utils/Lib_ECDSAUtils.sol.html create mode 100644 coverage/lcov-report/libraries/utils/Lib_ErrorUtils.sol.html create mode 100644 coverage/lcov-report/libraries/utils/Lib_EthUtils.sol.html create mode 100644 coverage/lcov-report/libraries/utils/Lib_Math.sol.html create mode 100644 coverage/lcov-report/libraries/utils/Lib_MerkleTree.sol.html create mode 100644 coverage/lcov-report/libraries/utils/Lib_ReentrancyGuard.sol.html create mode 100644 coverage/lcov-report/libraries/utils/Lib_RingBuffer.sol.html create mode 100644 coverage/lcov-report/libraries/utils/index.html create mode 100644 coverage/lcov-report/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html create mode 100644 coverage/lcov-report/libraries/wrappers/Lib_SafeMathWrapper.sol.html create mode 100644 coverage/lcov-report/libraries/wrappers/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/accounts/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/chain/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/accounts/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/chain/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/bridge/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/codec/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/rlp/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/standards/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/trie/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Math.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/wrappers/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html create mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/verification/index.html create mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html create mode 100644 coverage/lcov-report/prettify.css create mode 100644 coverage/lcov-report/prettify.js create mode 100644 coverage/lcov-report/sort-arrow-sprite.png create mode 100644 coverage/lcov-report/sorter.js create mode 100644 coverage/lcov-report/test-helpers/Helper_GasMeasurer.sol.html create mode 100644 coverage/lcov-report/test-helpers/Helper_ModifiableStorage.sol.html create mode 100644 coverage/lcov-report/test-helpers/Helper_PrecompileCaller.sol.html create mode 100644 coverage/lcov-report/test-helpers/Helper_SimpleProxy.sol.html create mode 100644 coverage/lcov-report/test-helpers/Helper_TestRunner.sol.html create mode 100644 coverage/lcov-report/test-helpers/Mock_FraudVerifier.sol.html create mode 100644 coverage/lcov-report/test-helpers/TestERC20.sol.html create mode 100644 coverage/lcov-report/test-helpers/index.html create mode 100644 coverage/lcov-report/test-libraries/codec/TestLib_OVMCodec.sol.html create mode 100644 coverage/lcov-report/test-libraries/codec/index.html create mode 100644 coverage/lcov-report/test-libraries/rlp/TestLib_RLPReader.sol.html create mode 100644 coverage/lcov-report/test-libraries/rlp/TestLib_RLPWriter.sol.html create mode 100644 coverage/lcov-report/test-libraries/rlp/index.html create mode 100644 coverage/lcov-report/test-libraries/trie/TestLib_MerkleTrie.sol.html create mode 100644 coverage/lcov-report/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html create mode 100644 coverage/lcov-report/test-libraries/trie/index.html create mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_Bytes32Utils.sol.html create mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_BytesUtils.sol.html create mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_ECDSAUtils.sol.html create mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_EthUtils.sol.html create mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_MerkleTree.sol.html create mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_RingBuffer.sol.html create mode 100644 coverage/lcov-report/test-libraries/utils/index.html create mode 100644 coverage/lcov.info create mode 100644 coverage/libraries/bridge/OVM_CrossDomainEnabled.sol.html create mode 100644 coverage/libraries/bridge/index.html create mode 100644 coverage/libraries/codec/Lib_OVMCodec.sol.html create mode 100644 coverage/libraries/codec/index.html create mode 100644 coverage/libraries/resolver/Lib_AddressManager.sol.html create mode 100644 coverage/libraries/resolver/Lib_AddressResolver.sol.html create mode 100644 coverage/libraries/resolver/Lib_Ownable.sol.html create mode 100644 coverage/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html create mode 100644 coverage/libraries/resolver/index.html create mode 100644 coverage/libraries/rlp/Lib_RLPReader.sol.html create mode 100644 coverage/libraries/rlp/Lib_RLPWriter.sol.html create mode 100644 coverage/libraries/rlp/index.html create mode 100644 coverage/libraries/standards/IUniswapV2ERC20.sol.html create mode 100644 coverage/libraries/standards/UniSafeMath.sol.html create mode 100644 coverage/libraries/standards/UniswapV2ERC20.sol.html create mode 100644 coverage/libraries/standards/index.html create mode 100644 coverage/libraries/trie/Lib_MerkleTrie.sol.html create mode 100644 coverage/libraries/trie/Lib_SecureMerkleTrie.sol.html create mode 100644 coverage/libraries/trie/index.html create mode 100644 coverage/libraries/utils/Lib_Bytes32Utils.sol.html create mode 100644 coverage/libraries/utils/Lib_BytesUtils.sol.html create mode 100644 coverage/libraries/utils/Lib_ECDSAUtils.sol.html create mode 100644 coverage/libraries/utils/Lib_ErrorUtils.sol.html create mode 100644 coverage/libraries/utils/Lib_EthUtils.sol.html create mode 100644 coverage/libraries/utils/Lib_Math.sol.html create mode 100644 coverage/libraries/utils/Lib_MerkleTree.sol.html create mode 100644 coverage/libraries/utils/Lib_ReentrancyGuard.sol.html create mode 100644 coverage/libraries/utils/Lib_RingBuffer.sol.html create mode 100644 coverage/libraries/utils/index.html create mode 100644 coverage/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html create mode 100644 coverage/libraries/wrappers/Lib_SafeMathWrapper.sol.html create mode 100644 coverage/libraries/wrappers/index.html create mode 100644 coverage/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/accounts/index.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/index.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/index.html create mode 100644 coverage/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/chain/index.html create mode 100644 coverage/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/execution/index.html create mode 100644 coverage/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/predeploys/index.html create mode 100644 coverage/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html create mode 100644 coverage/optimistic-ethereum/OVM/verification/index.html create mode 100644 coverage/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/accounts/index.html create mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/index.html create mode 100644 coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/bridge/tokens/index.html create mode 100644 coverage/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/chain/index.html create mode 100644 coverage/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/execution/index.html create mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/index.html create mode 100644 coverage/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html create mode 100644 coverage/optimistic-ethereum/iOVM/verification/index.html create mode 100644 coverage/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/bridge/index.html create mode 100644 coverage/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/codec/index.html create mode 100644 coverage/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/resolver/index.html create mode 100644 coverage/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/rlp/index.html create mode 100644 coverage/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/standards/index.html create mode 100644 coverage/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/trie/index.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_Math.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/utils/index.html create mode 100644 coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html create mode 100644 coverage/optimistic-ethereum/libraries/wrappers/index.html create mode 100644 coverage/optimistic-ethereum/mockOVM/accounts/index.html create mode 100644 coverage/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html create mode 100644 coverage/optimistic-ethereum/mockOVM/bridge/index.html create mode 100644 coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html create mode 100644 coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html create mode 100644 coverage/optimistic-ethereum/mockOVM/verification/index.html create mode 100644 coverage/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html create mode 100644 coverage/prettify.css create mode 100644 coverage/prettify.js create mode 100644 coverage/sort-arrow-sprite.png create mode 100644 coverage/sorter.js create mode 100644 coverage/test-helpers/Helper_GasMeasurer.sol.html create mode 100644 coverage/test-helpers/Helper_ModifiableStorage.sol.html create mode 100644 coverage/test-helpers/Helper_PrecompileCaller.sol.html create mode 100644 coverage/test-helpers/Helper_SimpleProxy.sol.html create mode 100644 coverage/test-helpers/Helper_TestRunner.sol.html create mode 100644 coverage/test-helpers/Mock_FraudVerifier.sol.html create mode 100644 coverage/test-helpers/TestERC20.sol.html create mode 100644 coverage/test-helpers/index.html create mode 100644 coverage/test-libraries/codec/TestLib_OVMCodec.sol.html create mode 100644 coverage/test-libraries/codec/index.html create mode 100644 coverage/test-libraries/rlp/TestLib_RLPReader.sol.html create mode 100644 coverage/test-libraries/rlp/TestLib_RLPWriter.sol.html create mode 100644 coverage/test-libraries/rlp/index.html create mode 100644 coverage/test-libraries/trie/TestLib_MerkleTrie.sol.html create mode 100644 coverage/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html create mode 100644 coverage/test-libraries/trie/index.html create mode 100644 coverage/test-libraries/utils/TestLib_Bytes32Utils.sol.html create mode 100644 coverage/test-libraries/utils/TestLib_BytesUtils.sol.html create mode 100644 coverage/test-libraries/utils/TestLib_ECDSAUtils.sol.html create mode 100644 coverage/test-libraries/utils/TestLib_EthUtils.sol.html create mode 100644 coverage/test-libraries/utils/TestLib_MerkleTree.sol.html create mode 100644 coverage/test-libraries/utils/TestLib_RingBuffer.sol.html create mode 100644 coverage/test-libraries/utils/index.html diff --git a/coverage.json b/coverage.json new file mode 100644 index 000000000..6556e7153 --- /dev/null +++ b/coverage.json @@ -0,0 +1 @@ +{"contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol":{"l":{"23":78,"37":9,"42":6,"47":3,"65":22,"79":7},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol","s":{"1":78,"2":9,"3":6,"4":22,"5":7},"b":{"1":[6,3],"2":[3,3]},"f":{"1":78,"2":9,"3":22,"4":7},"fnMap":{"1":{"name":"constructor","line":20,"loc":{"start":{"line":20,"column":4},"end":{"line":24,"column":4}}},"2":{"name":"onlyFromCrossDomainAccount","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"getCrossDomainMessenger","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":66,"column":4}}},"4":{"name":"sendCrossDomainMessage","line":74,"loc":{"start":{"line":74,"column":4},"end":{"line":80,"column":4}}}},"statementMap":{"1":{"start":{"line":23,"column":8},"end":{"line":23,"column":29}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1159}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":1311}},"4":{"start":{"line":65,"column":8},"end":{"line":65,"column":55}},"5":{"start":{"line":79,"column":8},"end":{"line":79,"column":82}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":8}},{"start":{"line":42,"column":8},"end":{"line":42,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol":{"l":{"119":7,"120":1,"131":1,"141":6,"143":6,"168":5,"195":5,"196":2,"205":3,"207":3,"208":3,"209":3,"210":3,"211":1,"213":2,"215":3,"216":3,"217":3,"218":3,"219":3,"221":3,"239":25,"264":25,"281":1,"303":1,"308":1,"313":1,"318":1,"319":1,"321":1,"338":6,"340":6,"362":107},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol","s":{"1":7,"2":1,"3":1,"4":6,"5":6,"6":5,"7":5,"8":2,"9":3,"10":3,"11":3,"12":3,"13":3,"14":1,"15":2,"16":3,"17":3,"18":3,"19":3,"20":3,"21":3,"22":25,"23":25,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":6,"32":6,"33":107},"b":{"1":[1,6],"2":[2,3],"3":[1,2]},"f":{"1":7,"2":5,"3":5,"4":25,"5":25,"6":1,"7":1,"8":6,"9":107},"fnMap":{"1":{"name":"decodeEIP155Transaction","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":153,"column":4}}},"2":{"name":"decompressEIP155Transaction","line":160,"loc":{"start":{"line":160,"column":4},"end":{"line":177,"column":4}}},"3":{"name":"encodeEIP155Transaction","line":185,"loc":{"start":{"line":185,"column":4},"end":{"line":223,"column":4}}},"4":{"name":"encodeTransaction","line":230,"loc":{"start":{"line":230,"column":4},"end":{"line":248,"column":4}}},"5":{"name":"hashTransaction","line":255,"loc":{"start":{"line":255,"column":4},"end":{"line":265,"column":4}}},"6":{"name":"toEVMAccount","line":272,"loc":{"start":{"line":272,"column":4},"end":{"line":287,"column":4}}},"7":{"name":"encodeEVMAccount","line":294,"loc":{"start":{"line":294,"column":4},"end":{"line":322,"column":4}}},"8":{"name":"decodeEVMAccount","line":329,"loc":{"start":{"line":329,"column":4},"end":{"line":346,"column":4}}},"9":{"name":"hashBatchHeader","line":353,"loc":{"start":{"line":353,"column":4},"end":{"line":370,"column":4}}}},"statementMap":{"1":{"start":{"line":119,"column":8},"end":{"line":119,"column":2703}},"2":{"start":{"line":120,"column":12},"end":{"line":120,"column":2747}},"3":{"start":{"line":131,"column":12},"end":{"line":131,"column":3104}},"4":{"start":{"line":141,"column":12},"end":{"line":141,"column":89}},"5":{"start":{"line":143,"column":12},"end":{"line":143,"column":3487}},"6":{"start":{"line":168,"column":8},"end":{"line":168,"column":4339}},"7":{"start":{"line":195,"column":8},"end":{"line":195,"column":5277}},"8":{"start":{"line":196,"column":12},"end":{"line":196,"column":5321}},"9":{"start":{"line":205,"column":12},"end":{"line":205,"column":47}},"10":{"start":{"line":207,"column":12},"end":{"line":207,"column":63}},"11":{"start":{"line":208,"column":12},"end":{"line":208,"column":66}},"12":{"start":{"line":209,"column":12},"end":{"line":209,"column":66}},"13":{"start":{"line":210,"column":12},"end":{"line":210,"column":5856}},"14":{"start":{"line":211,"column":16},"end":{"line":211,"column":52}},"15":{"start":{"line":213,"column":16},"end":{"line":213,"column":67}},"16":{"start":{"line":215,"column":12},"end":{"line":215,"column":46}},"17":{"start":{"line":216,"column":12},"end":{"line":216,"column":63}},"18":{"start":{"line":217,"column":12},"end":{"line":217,"column":65}},"19":{"start":{"line":218,"column":12},"end":{"line":218,"column":55}},"20":{"start":{"line":219,"column":12},"end":{"line":219,"column":55}},"21":{"start":{"line":221,"column":12},"end":{"line":221,"column":47}},"22":{"start":{"line":239,"column":8},"end":{"line":239,"column":6746}},"23":{"start":{"line":264,"column":8},"end":{"line":264,"column":57}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":7723}},"25":{"start":{"line":303,"column":8},"end":{"line":303,"column":43}},"26":{"start":{"line":308,"column":8},"end":{"line":308,"column":8466}},"27":{"start":{"line":313,"column":8},"end":{"line":313,"column":8623}},"28":{"start":{"line":318,"column":8},"end":{"line":318,"column":80}},"29":{"start":{"line":319,"column":8},"end":{"line":319,"column":77}},"30":{"start":{"line":321,"column":8},"end":{"line":321,"column":43}},"31":{"start":{"line":338,"column":8},"end":{"line":338,"column":86}},"32":{"start":{"line":340,"column":8},"end":{"line":340,"column":9427}},"33":{"start":{"line":362,"column":8},"end":{"line":362,"column":10058}}},"branchMap":{"1":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":8},"end":{"line":119,"column":8}},{"start":{"line":119,"column":8},"end":{"line":119,"column":8}}]},"2":{"line":195,"type":"if","locations":[{"start":{"line":195,"column":8},"end":{"line":195,"column":8}},{"start":{"line":195,"column":8},"end":{"line":195,"column":8}}]},"3":{"line":210,"type":"if","locations":[{"start":{"line":210,"column":12},"end":{"line":210,"column":12}},{"start":{"line":210,"column":12},"end":{"line":210,"column":12}}]}}},"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol":{"l":{"39":379,"40":379,"50":2107,"67":2486},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol","s":{"1":379,"2":379,"3":2107,"4":2486},"b":{},"f":{"1":379,"2":2107,"3":2486},"fnMap":{"1":{"name":"setAddress","line":37,"loc":{"start":{"line":32,"column":4},"end":{"line":41,"column":4}}},"2":{"name":"getAddress","line":43,"loc":{"start":{"line":43,"column":4},"end":{"line":51,"column":4}}},"3":{"name":"_getNameHash","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":68,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":40}},"2":{"start":{"line":40,"column":8},"end":{"line":40,"column":48}},"3":{"start":{"line":50,"column":8},"end":{"line":50,"column":45}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":49}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol":{"l":{"29":1041,"46":2076},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol","s":{"1":1041,"2":2076},"b":{},"f":{"1":1041,"2":2076},"fnMap":{"1":{"name":"constructor","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":30,"column":4}}},"2":{"name":"resolve","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":47,"column":4}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":65}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":50}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol":{"l":{"32":120,"33":120,"42":379,"46":379,"59":0,"60":0,"68":0,"73":0,"74":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol","s":{"1":120,"2":120,"3":379,"4":0,"5":0,"6":0,"7":0,"8":0},"b":{"1":[379,0],"2":[0,0]},"f":{"1":120,"2":379,"3":0,"4":0},"fnMap":{"1":{"name":"constructor","line":31,"loc":{"start":{"line":31,"column":4},"end":{"line":34,"column":4}}},"2":{"name":"onlyOwner","line":41,"loc":{"start":{"line":41,"column":4},"end":{"line":47,"column":4}}},"3":{"name":"renounceOwnership","line":57,"loc":{"start":{"line":54,"column":4},"end":{"line":61,"column":4}}},"4":{"name":"transferOwnership","line":66,"loc":{"start":{"line":63,"column":4},"end":{"line":75,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":25}},"2":{"start":{"line":33,"column":8},"end":{"line":33,"column":52}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":791}},"4":{"start":{"line":59,"column":8},"end":{"line":59,"column":52}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":25}},"6":{"start":{"line":68,"column":8},"end":{"line":68,"column":1280}},"7":{"start":{"line":73,"column":8},"end":{"line":73,"column":51}},"8":{"start":{"line":74,"column":8},"end":{"line":74,"column":24}}},"branchMap":{"1":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":8}},{"start":{"line":42,"column":8},"end":{"line":42,"column":8}}]},"2":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":8},"end":{"line":68,"column":8}},{"start":{"line":68,"column":8},"end":{"line":68,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol":{"l":{"42":36,"43":36,"54":31,"55":31,"60":31,"62":31,"63":22,"67":9},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol","s":{"1":36,"2":36,"3":31,"4":31,"5":31,"6":31},"b":{"1":[31,0],"2":[22,9]},"f":{"1":36,"2":31},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":4}}},"2":{"name":null,"line":51,"loc":{"start":{"line":51,"column":4},"end":{"line":71,"column":4}}}},"statementMap":{"1":{"start":{"line":42,"column":8},"end":{"line":42,"column":77}},"2":{"start":{"line":43,"column":8},"end":{"line":43,"column":62}},"3":{"start":{"line":54,"column":8},"end":{"line":54,"column":102}},"4":{"start":{"line":55,"column":8},"end":{"line":55,"column":1765}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":79}},"6":{"start":{"line":62,"column":8},"end":{"line":62,"column":1960}}},"branchMap":{"1":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":8},"end":{"line":55,"column":8}},{"start":{"line":55,"column":8},"end":{"line":55,"column":8}}]},"2":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol":{"l":{"55":512,"56":512,"60":512,"80":450,"86":446,"95":446,"97":446,"98":446,"99":446,"100":4230,"105":4230,"113":4230,"118":4230,"119":4230,"123":446,"127":446,"144":450,"163":651,"169":651,"174":651,"191":4,"210":5,"227":5,"246":68,"251":68,"257":68,"262":68,"263":68,"264":68,"273":68,"290":0,"309":56,"326":8,"345":2,"350":2,"351":2,"352":2,"356":2,"373":2,"392":7,"393":1,"396":6,"401":6,"418":1,"437":776,"463":5399,"468":5395,"469":5395,"470":5395,"474":5395,"477":33,"481":4334,"483":4334,"488":4334,"491":536,"493":536,"498":536,"499":536,"507":536,"512":536,"515":89,"517":89,"522":89,"525":403,"527":403,"532":403,"533":403,"541":403,"546":403,"568":1427,"569":1427,"570":1,"573":1426,"574":1426,"575":1426,"580":1426,"581":2634,"585":2634,"586":2634,"590":1426,"591":1426,"601":1426,"618":776},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol","s":{"1":512,"2":512,"3":450,"4":446,"5":446,"6":446,"7":446,"8":446,"9":4230,"10":4230,"11":4230,"12":4230,"13":4230,"14":446,"15":450,"16":651,"17":651,"18":651,"19":4,"20":5,"21":5,"22":68,"23":68,"24":68,"25":68,"26":68,"27":68,"28":0,"29":56,"30":8,"31":2,"32":2,"33":2,"34":2,"35":2,"36":7,"37":1,"38":6,"39":6,"40":1,"41":776,"42":5399,"43":5395,"44":5395,"45":5395,"46":33,"47":5362,"48":4334,"49":4334,"50":4334,"51":1028,"52":536,"53":536,"54":536,"55":536,"56":536,"57":492,"58":89,"59":89,"60":89,"61":403,"62":403,"63":403,"64":403,"65":403,"66":1427,"67":1427,"68":1,"69":1426,"70":1426,"71":1426,"72":2634,"73":2634,"74":1426,"75":1426,"76":776},"b":{"1":[446,0],"2":[4230,0],"3":[651,0],"4":[68,0],"5":[68,0],"6":[2,0],"7":[1,6],"8":[6,0],"9":[5395,4],"10":[33,5362],"11":[4334,1028],"12":[4334,0],"13":[536,492],"14":[536,0],"15":[536,0],"16":[89,403],"17":[89,0],"18":[403,0],"19":[403,0],"20":[1,1426]},"f":{"1":512,"2":450,"3":450,"4":651,"5":4,"6":5,"7":5,"8":68,"9":0,"10":56,"11":8,"12":2,"13":2,"14":7,"15":1,"16":776,"17":5399,"18":1427,"19":776},"fnMap":{"1":{"name":"toRLPItem","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":64,"column":4}}},"2":{"name":"readList","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":128,"column":4}}},"3":{"name":"readList","line":135,"loc":{"start":{"line":135,"column":4},"end":{"line":147,"column":4}}},"4":{"name":"readBytes","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":175,"column":4}}},"5":{"name":"readBytes","line":182,"loc":{"start":{"line":182,"column":4},"end":{"line":194,"column":4}}},"6":{"name":"readString","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":211,"column":4}}},"7":{"name":"readString","line":218,"loc":{"start":{"line":218,"column":4},"end":{"line":230,"column":4}}},"8":{"name":"readBytes32","line":237,"loc":{"start":{"line":237,"column":4},"end":{"line":274,"column":4}}},"9":{"name":"readBytes32","line":281,"loc":{"start":{"line":281,"column":4},"end":{"line":293,"column":4}}},"10":{"name":"readUint256","line":300,"loc":{"start":{"line":300,"column":4},"end":{"line":310,"column":4}}},"11":{"name":"readUint256","line":317,"loc":{"start":{"line":317,"column":4},"end":{"line":329,"column":4}}},"12":{"name":"readBool","line":336,"loc":{"start":{"line":336,"column":4},"end":{"line":357,"column":4}}},"13":{"name":"readBool","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":376,"column":4}}},"14":{"name":"readAddress","line":383,"loc":{"start":{"line":383,"column":4},"end":{"line":402,"column":4}}},"15":{"name":"readAddress","line":409,"loc":{"start":{"line":409,"column":4},"end":{"line":421,"column":4}}},"16":{"name":"readRawBytes","line":428,"loc":{"start":{"line":428,"column":4},"end":{"line":438,"column":4}}},"17":{"name":"_decodeLength","line":452,"loc":{"start":{"line":452,"column":4},"end":{"line":548,"column":4}}},"18":{"name":"_copy","line":557,"loc":{"start":{"line":557,"column":4},"end":{"line":602,"column":4}}},"19":{"name":"_copy","line":609,"loc":{"start":{"line":609,"column":4},"end":{"line":619,"column":4}}}},"statementMap":{"1":{"start":{"line":55,"column":8},"end":{"line":55,"column":19}},"2":{"start":{"line":60,"column":8},"end":{"line":60,"column":1063}},"3":{"start":{"line":80,"column":8},"end":{"line":80,"column":1475}},"4":{"start":{"line":86,"column":8},"end":{"line":86,"column":1575}},"5":{"start":{"line":95,"column":8},"end":{"line":95,"column":61}},"6":{"start":{"line":97,"column":8},"end":{"line":97,"column":29}},"7":{"start":{"line":98,"column":8},"end":{"line":98,"column":35}},"8":{"start":{"line":99,"column":8},"end":{"line":99,"column":2213}},"9":{"start":{"line":100,"column":12},"end":{"line":100,"column":2259}},"10":{"start":{"line":105,"column":12},"end":{"line":105,"column":2405}},"11":{"start":{"line":113,"column":12},"end":{"line":113,"column":2630}},"12":{"start":{"line":118,"column":12},"end":{"line":118,"column":25}},"13":{"start":{"line":119,"column":12},"end":{"line":119,"column":44}},"14":{"start":{"line":127,"column":8},"end":{"line":127,"column":18}},"15":{"start":{"line":144,"column":8},"end":{"line":144,"column":3303}},"16":{"start":{"line":163,"column":8},"end":{"line":163,"column":3665}},"17":{"start":{"line":169,"column":8},"end":{"line":169,"column":3783}},"18":{"start":{"line":174,"column":8},"end":{"line":174,"column":53}},"19":{"start":{"line":191,"column":8},"end":{"line":191,"column":4230}},"20":{"start":{"line":210,"column":8},"end":{"line":210,"column":37}},"21":{"start":{"line":227,"column":8},"end":{"line":227,"column":4903}},"22":{"start":{"line":246,"column":8},"end":{"line":246,"column":5252}},"23":{"start":{"line":251,"column":8},"end":{"line":251,"column":5374}},"24":{"start":{"line":257,"column":8},"end":{"line":257,"column":5492}},"25":{"start":{"line":262,"column":8},"end":{"line":262,"column":42}},"26":{"start":{"line":263,"column":8},"end":{"line":263,"column":19}},"27":{"start":{"line":273,"column":8},"end":{"line":273,"column":18}},"28":{"start":{"line":290,"column":8},"end":{"line":290,"column":6212}},"29":{"start":{"line":309,"column":8},"end":{"line":309,"column":40}},"30":{"start":{"line":326,"column":8},"end":{"line":326,"column":6888}},"31":{"start":{"line":345,"column":8},"end":{"line":345,"column":7220}},"32":{"start":{"line":350,"column":8},"end":{"line":350,"column":29}},"33":{"start":{"line":351,"column":8},"end":{"line":351,"column":19}},"34":{"start":{"line":356,"column":8},"end":{"line":356,"column":23}},"35":{"start":{"line":373,"column":8},"end":{"line":373,"column":7731}},"36":{"start":{"line":392,"column":8},"end":{"line":392,"column":8078}},"37":{"start":{"line":393,"column":12},"end":{"line":393,"column":29}},"38":{"start":{"line":396,"column":8},"end":{"line":396,"column":8151}},"39":{"start":{"line":401,"column":8},"end":{"line":401,"column":40}},"40":{"start":{"line":418,"column":8},"end":{"line":418,"column":8577}},"41":{"start":{"line":437,"column":8},"end":{"line":437,"column":25}},"42":{"start":{"line":463,"column":8},"end":{"line":463,"column":9468}},"43":{"start":{"line":468,"column":8},"end":{"line":468,"column":29}},"44":{"start":{"line":469,"column":8},"end":{"line":469,"column":22}},"45":{"start":{"line":474,"column":8},"end":{"line":474,"column":9691}},"46":{"start":{"line":477,"column":12},"end":{"line":477,"column":48}},"47":{"start":{"line":478,"column":15},"end":{"line":478,"column":9807}},"48":{"start":{"line":481,"column":12},"end":{"line":481,"column":42}},"49":{"start":{"line":483,"column":12},"end":{"line":483,"column":9932}},"50":{"start":{"line":488,"column":12},"end":{"line":488,"column":53}},"51":{"start":{"line":489,"column":15},"end":{"line":489,"column":10104}},"52":{"start":{"line":491,"column":12},"end":{"line":491,"column":47}},"53":{"start":{"line":493,"column":12},"end":{"line":493,"column":10220}},"54":{"start":{"line":498,"column":12},"end":{"line":498,"column":26}},"55":{"start":{"line":507,"column":12},"end":{"line":507,"column":10602}},"56":{"start":{"line":512,"column":12},"end":{"line":512,"column":67}},"57":{"start":{"line":513,"column":15},"end":{"line":513,"column":10801}},"58":{"start":{"line":515,"column":12},"end":{"line":515,"column":43}},"59":{"start":{"line":517,"column":12},"end":{"line":517,"column":10912}},"60":{"start":{"line":522,"column":12},"end":{"line":522,"column":54}},"61":{"start":{"line":525,"column":12},"end":{"line":525,"column":48}},"62":{"start":{"line":527,"column":12},"end":{"line":527,"column":11179}},"63":{"start":{"line":532,"column":12},"end":{"line":532,"column":27}},"64":{"start":{"line":541,"column":12},"end":{"line":541,"column":11561}},"65":{"start":{"line":546,"column":12},"end":{"line":546,"column":69}},"66":{"start":{"line":568,"column":8},"end":{"line":568,"column":45}},"67":{"start":{"line":569,"column":8},"end":{"line":569,"column":12253}},"68":{"start":{"line":570,"column":12},"end":{"line":570,"column":22}},"69":{"start":{"line":573,"column":8},"end":{"line":573,"column":36}},"70":{"start":{"line":574,"column":8},"end":{"line":574,"column":20}},"71":{"start":{"line":580,"column":8},"end":{"line":580,"column":12497}},"72":{"start":{"line":585,"column":12},"end":{"line":585,"column":20}},"73":{"start":{"line":586,"column":12},"end":{"line":586,"column":21}},"74":{"start":{"line":590,"column":8},"end":{"line":590,"column":55}},"75":{"start":{"line":601,"column":8},"end":{"line":601,"column":18}},"76":{"start":{"line":618,"column":8},"end":{"line":618,"column":44}}},"branchMap":{"1":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"2":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":12},"end":{"line":100,"column":12}},{"start":{"line":100,"column":12},"end":{"line":100,"column":12}}]},"3":{"line":169,"type":"if","locations":[{"start":{"line":169,"column":8},"end":{"line":169,"column":8}},{"start":{"line":169,"column":8},"end":{"line":169,"column":8}}]},"4":{"line":246,"type":"if","locations":[{"start":{"line":246,"column":8},"end":{"line":246,"column":8}},{"start":{"line":246,"column":8},"end":{"line":246,"column":8}}]},"5":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":8},"end":{"line":257,"column":8}},{"start":{"line":257,"column":8},"end":{"line":257,"column":8}}]},"6":{"line":345,"type":"if","locations":[{"start":{"line":345,"column":8},"end":{"line":345,"column":8}},{"start":{"line":345,"column":8},"end":{"line":345,"column":8}}]},"7":{"line":392,"type":"if","locations":[{"start":{"line":392,"column":8},"end":{"line":392,"column":8}},{"start":{"line":392,"column":8},"end":{"line":392,"column":8}}]},"8":{"line":396,"type":"if","locations":[{"start":{"line":396,"column":8},"end":{"line":396,"column":8}},{"start":{"line":396,"column":8},"end":{"line":396,"column":8}}]},"9":{"line":463,"type":"if","locations":[{"start":{"line":463,"column":8},"end":{"line":463,"column":8}},{"start":{"line":463,"column":8},"end":{"line":463,"column":8}}]},"10":{"line":474,"type":"if","locations":[{"start":{"line":474,"column":8},"end":{"line":474,"column":8}},{"start":{"line":474,"column":8},"end":{"line":474,"column":8}}]},"11":{"line":478,"type":"if","locations":[{"start":{"line":478,"column":15},"end":{"line":478,"column":15}},{"start":{"line":478,"column":15},"end":{"line":478,"column":15}}]},"12":{"line":483,"type":"if","locations":[{"start":{"line":483,"column":12},"end":{"line":483,"column":12}},{"start":{"line":483,"column":12},"end":{"line":483,"column":12}}]},"13":{"line":489,"type":"if","locations":[{"start":{"line":489,"column":15},"end":{"line":489,"column":15}},{"start":{"line":489,"column":15},"end":{"line":489,"column":15}}]},"14":{"line":493,"type":"if","locations":[{"start":{"line":493,"column":12},"end":{"line":493,"column":12}},{"start":{"line":493,"column":12},"end":{"line":493,"column":12}}]},"15":{"line":507,"type":"if","locations":[{"start":{"line":507,"column":12},"end":{"line":507,"column":12}},{"start":{"line":507,"column":12},"end":{"line":507,"column":12}}]},"16":{"line":513,"type":"if","locations":[{"start":{"line":513,"column":15},"end":{"line":513,"column":15}},{"start":{"line":513,"column":15},"end":{"line":513,"column":15}}]},"17":{"line":517,"type":"if","locations":[{"start":{"line":517,"column":12},"end":{"line":517,"column":12}},{"start":{"line":517,"column":12},"end":{"line":517,"column":12}}]},"18":{"line":527,"type":"if","locations":[{"start":{"line":527,"column":12},"end":{"line":527,"column":12}},{"start":{"line":527,"column":12},"end":{"line":527,"column":12}}]},"19":{"line":541,"type":"if","locations":[{"start":{"line":541,"column":12},"end":{"line":541,"column":12}},{"start":{"line":541,"column":12},"end":{"line":541,"column":12}}]},"20":{"line":569,"type":"if","locations":[{"start":{"line":569,"column":8},"end":{"line":569,"column":8}},{"start":{"line":569,"column":8},"end":{"line":569,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol":{"l":{"32":324,"34":324,"35":16,"37":308,"40":324,"57":157,"58":157,"75":139,"92":30,"109":52,"126":0,"127":0,"128":0,"152":465,"154":465,"155":415,"156":415,"158":50,"159":50,"160":50,"161":72,"162":72,"165":50,"166":50,"167":50,"168":72,"172":465,"190":52,"192":52,"193":52,"194":1643,"195":24,"199":52,"200":52,"201":45,"204":52,"222":1030,"223":1030,"224":1030,"226":1030,"227":420,"230":420,"231":420,"234":1030,"235":1030,"257":157,"258":8,"261":149,"262":149,"263":149,"264":1030,"267":149,"268":149,"269":149,"271":149,"272":1030,"274":1030,"275":1030,"277":1030,"278":1030,"281":149},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol","s":{"1":324,"2":324,"3":16,"4":308,"5":324,"6":157,"7":157,"8":139,"9":30,"10":52,"11":0,"12":0,"13":0,"14":465,"15":465,"16":415,"17":415,"18":50,"19":50,"20":50,"21":72,"22":50,"23":50,"24":50,"25":72,"26":465,"27":52,"28":52,"29":52,"30":1643,"31":52,"32":52,"33":45,"34":52,"35":1030,"36":1030,"37":1030,"38":1030,"39":420,"40":420,"41":1030,"42":157,"43":8,"44":149,"45":149,"46":149,"47":1030,"48":149,"49":149,"50":149,"51":1030,"52":1030,"53":1030,"54":1030,"55":149},"b":{"1":[16,308],"2":[415,50],"3":[24,1619],"4":[8,149]},"f":{"1":324,"2":157,"3":139,"4":30,"5":52,"6":0,"7":465,"8":52,"9":1030,"10":157},"fnMap":{"1":{"name":"writeBytes","line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":41,"column":4}}},"2":{"name":"writeList","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":59,"column":4}}},"3":{"name":"writeString","line":66,"loc":{"start":{"line":66,"column":4},"end":{"line":76,"column":4}}},"4":{"name":"writeAddress","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":93,"column":4}}},"5":{"name":"writeUint","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":110,"column":4}}},"6":{"name":"writeBool","line":117,"loc":{"start":{"line":117,"column":4},"end":{"line":129,"column":4}}},"7":{"name":"_writeLength","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":173,"column":4}}},"8":{"name":"_toBinary","line":181,"loc":{"start":{"line":181,"column":4},"end":{"line":205,"column":4}}},"9":{"name":"_memcpy","line":214,"loc":{"start":{"line":214,"column":4},"end":{"line":240,"column":4}}},"10":{"name":"_flatten","line":248,"loc":{"start":{"line":248,"column":4},"end":{"line":282,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":28}},"2":{"start":{"line":34,"column":8},"end":{"line":34,"column":711}},"3":{"start":{"line":35,"column":12},"end":{"line":35,"column":24}},"4":{"start":{"line":37,"column":12},"end":{"line":37,"column":73}},"5":{"start":{"line":40,"column":8},"end":{"line":40,"column":22}},"6":{"start":{"line":57,"column":8},"end":{"line":57,"column":41}},"7":{"start":{"line":58,"column":8},"end":{"line":58,"column":69}},"8":{"start":{"line":75,"column":8},"end":{"line":75,"column":37}},"9":{"start":{"line":92,"column":8},"end":{"line":92,"column":48}},"10":{"start":{"line":109,"column":8},"end":{"line":109,"column":41}},"11":{"start":{"line":126,"column":8},"end":{"line":126,"column":43}},"12":{"start":{"line":127,"column":8},"end":{"line":127,"column":55}},"13":{"start":{"line":128,"column":8},"end":{"line":128,"column":22}},"14":{"start":{"line":152,"column":8},"end":{"line":152,"column":28}},"15":{"start":{"line":154,"column":8},"end":{"line":154,"column":3384}},"16":{"start":{"line":155,"column":12},"end":{"line":155,"column":33}},"17":{"start":{"line":156,"column":12},"end":{"line":156,"column":58}},"18":{"start":{"line":158,"column":12},"end":{"line":158,"column":26}},"19":{"start":{"line":159,"column":12},"end":{"line":159,"column":25}},"20":{"start":{"line":160,"column":12},"end":{"line":160,"column":3586}},"21":{"start":{"line":162,"column":16},"end":{"line":162,"column":23}},"22":{"start":{"line":165,"column":12},"end":{"line":165,"column":42}},"23":{"start":{"line":166,"column":12},"end":{"line":166,"column":65}},"24":{"start":{"line":167,"column":12},"end":{"line":167,"column":3802}},"25":{"start":{"line":168,"column":16},"end":{"line":168,"column":73}},"26":{"start":{"line":172,"column":8},"end":{"line":172,"column":22}},"27":{"start":{"line":190,"column":8},"end":{"line":190,"column":45}},"28":{"start":{"line":192,"column":8},"end":{"line":192,"column":21}},"29":{"start":{"line":193,"column":8},"end":{"line":193,"column":4434}},"30":{"start":{"line":194,"column":12},"end":{"line":194,"column":4472}},"31":{"start":{"line":199,"column":8},"end":{"line":199,"column":44}},"32":{"start":{"line":200,"column":8},"end":{"line":200,"column":4587}},"33":{"start":{"line":201,"column":12},"end":{"line":201,"column":26}},"34":{"start":{"line":204,"column":8},"end":{"line":204,"column":18}},"35":{"start":{"line":222,"column":8},"end":{"line":222,"column":28}},"36":{"start":{"line":223,"column":8},"end":{"line":223,"column":26}},"37":{"start":{"line":224,"column":8},"end":{"line":224,"column":26}},"38":{"start":{"line":226,"column":8},"end":{"line":226,"column":5212}},"39":{"start":{"line":230,"column":12},"end":{"line":230,"column":21}},"40":{"start":{"line":231,"column":12},"end":{"line":231,"column":20}},"41":{"start":{"line":234,"column":8},"end":{"line":234,"column":44}},"42":{"start":{"line":257,"column":8},"end":{"line":257,"column":6057}},"43":{"start":{"line":258,"column":12},"end":{"line":258,"column":31}},"44":{"start":{"line":261,"column":8},"end":{"line":261,"column":19}},"45":{"start":{"line":262,"column":8},"end":{"line":262,"column":21}},"46":{"start":{"line":263,"column":8},"end":{"line":263,"column":6178}},"47":{"start":{"line":264,"column":12},"end":{"line":264,"column":33}},"48":{"start":{"line":267,"column":8},"end":{"line":267,"column":47}},"49":{"start":{"line":268,"column":8},"end":{"line":268,"column":28}},"50":{"start":{"line":271,"column":8},"end":{"line":271,"column":6403}},"51":{"start":{"line":272,"column":12},"end":{"line":272,"column":40}},"52":{"start":{"line":274,"column":12},"end":{"line":274,"column":27}},"53":{"start":{"line":277,"column":12},"end":{"line":277,"column":54}},"54":{"start":{"line":278,"column":12},"end":{"line":278,"column":42}},"55":{"start":{"line":281,"column":8},"end":{"line":281,"column":24}}},"branchMap":{"1":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":8}},{"start":{"line":34,"column":8},"end":{"line":34,"column":8}}]},"2":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":8},"end":{"line":154,"column":8}},{"start":{"line":154,"column":8},"end":{"line":154,"column":8}}]},"3":{"line":194,"type":"if","locations":[{"start":{"line":194,"column":12},"end":{"line":194,"column":12}},{"start":{"line":194,"column":12},"end":{"line":194,"column":12}}]},"4":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":8},"end":{"line":257,"column":8}},{"start":{"line":257,"column":8},"end":{"line":257,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol":{"l":{"8":6,"12":10,"16":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol","s":{"1":6,"2":10,"3":0},"b":{"1":[6,0],"2":[10,0],"3":[0,0]},"f":{"1":6,"2":10,"3":0},"fnMap":{"1":{"name":"add","line":7,"loc":{"start":{"line":7,"column":4},"end":{"line":9,"column":4}}},"2":{"name":"sub","line":11,"loc":{"start":{"line":11,"column":4},"end":{"line":13,"column":4}}},"3":{"name":"mul","line":15,"loc":{"start":{"line":15,"column":4},"end":{"line":17,"column":4}}}},"statementMap":{"1":{"start":{"line":8,"column":8},"end":{"line":8,"column":56}},"2":{"start":{"line":12,"column":8},"end":{"line":12,"column":57}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":70}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":8},"end":{"line":8,"column":8}},{"start":{"line":8,"column":8},"end":{"line":8,"column":8}}]},"2":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":8},"end":{"line":12,"column":8}},{"start":{"line":12,"column":8},"end":{"line":12,"column":8}}]},"3":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":8},"end":{"line":16,"column":8}},{"start":{"line":16,"column":8},"end":{"line":16,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol":{"l":{"26":39,"27":39,"29":39,"30":39,"33":39,"45":1,"46":1,"47":1,"51":2,"52":2,"53":2,"57":2,"58":2,"62":4,"63":4,"64":4,"68":2,"69":2,"73":2,"74":2,"78":2,"79":2,"81":2,"82":2,"86":0,"87":0,"94":0,"95":0,"96":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol","s":{"1":39,"2":39,"3":39,"4":39,"5":1,"6":1,"7":1,"8":2,"9":2,"10":2,"11":2,"12":2,"13":4,"14":4,"15":4,"16":2,"17":2,"18":2,"19":2,"20":2,"21":2,"22":2,"23":2,"24":0,"25":0,"26":0,"27":0,"28":0},"b":{"1":[2,0],"2":[0,0],"3":[0,0]},"f":{"1":39,"2":1,"3":2,"4":2,"5":4,"6":2,"7":2,"8":2,"9":0},"fnMap":{"1":{"name":"constructor","line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":42,"column":4}}},"2":{"name":"_mint","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"_burn","line":50,"loc":{"start":{"line":50,"column":4},"end":{"line":54,"column":4}}},"4":{"name":"_approve","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":59,"column":4}}},"5":{"name":"_transfer","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":65,"column":4}}},"6":{"name":"approve","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":70,"column":4}}},"7":{"name":"transfer","line":72,"loc":{"start":{"line":72,"column":4},"end":{"line":75,"column":4}}},"8":{"name":"transferFrom","line":77,"loc":{"start":{"line":77,"column":4},"end":{"line":83,"column":4}}},"9":{"name":"permit","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":97,"column":4}}}},"statementMap":{"1":{"start":{"line":26,"column":8},"end":{"line":26,"column":19}},"2":{"start":{"line":27,"column":8},"end":{"line":27,"column":23}},"3":{"start":{"line":29,"column":8},"end":{"line":29,"column":20}},"4":{"start":{"line":33,"column":8},"end":{"line":33,"column":1051}},"5":{"start":{"line":45,"column":8},"end":{"line":45,"column":43}},"6":{"start":{"line":46,"column":8},"end":{"line":46,"column":47}},"7":{"start":{"line":47,"column":8},"end":{"line":47,"column":44}},"8":{"start":{"line":51,"column":8},"end":{"line":51,"column":51}},"9":{"start":{"line":52,"column":8},"end":{"line":52,"column":43}},"10":{"start":{"line":53,"column":8},"end":{"line":53,"column":46}},"11":{"start":{"line":57,"column":8},"end":{"line":57,"column":40}},"12":{"start":{"line":58,"column":8},"end":{"line":58,"column":44}},"13":{"start":{"line":62,"column":8},"end":{"line":62,"column":51}},"14":{"start":{"line":63,"column":8},"end":{"line":63,"column":47}},"15":{"start":{"line":64,"column":8},"end":{"line":64,"column":38}},"16":{"start":{"line":68,"column":8},"end":{"line":68,"column":43}},"17":{"start":{"line":69,"column":8},"end":{"line":69,"column":19}},"18":{"start":{"line":73,"column":8},"end":{"line":73,"column":39}},"19":{"start":{"line":74,"column":8},"end":{"line":74,"column":19}},"20":{"start":{"line":78,"column":8},"end":{"line":78,"column":2609}},"21":{"start":{"line":79,"column":12},"end":{"line":79,"column":79}},"22":{"start":{"line":81,"column":8},"end":{"line":81,"column":33}},"23":{"start":{"line":82,"column":8},"end":{"line":82,"column":19}},"24":{"start":{"line":86,"column":8},"end":{"line":86,"column":65}},"25":{"start":{"line":87,"column":8},"end":{"line":87,"column":3019}},"26":{"start":{"line":94,"column":8},"end":{"line":94,"column":61}},"27":{"start":{"line":95,"column":8},"end":{"line":95,"column":107}},"28":{"start":{"line":96,"column":8},"end":{"line":96,"column":38}}},"branchMap":{"1":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]},"2":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"3":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":8},"end":{"line":95,"column":8}},{"start":{"line":95,"column":8},"end":{"line":95,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol":{"l":{"85":25,"90":24,"116":0,"120":0,"147":22,"148":0,"151":22,"152":22,"153":22,"155":22,"178":77,"179":73,"181":58,"183":58,"188":58,"190":58,"212":0,"245":95,"246":95,"248":95,"249":95,"250":95,"251":95,"254":95,"255":243,"256":243,"260":243,"262":243,"264":95,"270":148,"276":0,"282":229,"283":147,"285":0,"289":147,"290":147,"291":147,"292":147,"293":147,"296":82,"297":82,"298":82,"299":82,"300":82,"301":82,"303":82,"304":80,"310":73,"314":80,"315":80,"317":1,"320":0,"321":0,"325":1,"326":1,"327":1,"330":1,"333":0,"338":80,"339":80,"366":22,"369":22,"370":22,"376":22,"377":22,"379":22,"382":22,"383":22,"385":0,"388":0,"389":0,"393":0,"394":0,"397":0,"398":0,"402":0,"403":0,"405":0,"408":0,"409":0,"410":0,"413":0,"414":0,"418":0,"420":0,"424":0,"428":0,"430":0,"432":0,"435":0,"436":0,"440":0,"441":0,"446":0,"450":0,"453":0,"455":0,"456":0,"461":0,"463":0,"464":0,"466":0,"467":0,"473":22,"492":22,"495":22,"496":22,"497":22,"500":22,"502":65,"503":65,"505":65,"508":22,"509":22,"512":1,"513":1,"517":1,"519":1,"524":42,"526":42,"527":42,"528":42,"533":65,"538":22,"555":99,"556":95,"558":95,"559":265,"560":265,"566":95,"585":148,"587":148,"589":0,"592":148,"595":148,"612":172,"630":45,"647":51,"665":65,"666":0,"668":65,"686":87,"687":42,"689":45,"690":45,"692":45,"693":44,"695":1,"699":0,"719":82,"720":82,"721":4991,"723":82,"740":65,"742":65,"762":42,"763":42,"764":714,"766":42,"785":1,"786":1,"787":1,"788":1,"789":1,"811":22,"812":22,"813":22,"814":22,"815":22,"829":0,"830":0,"831":0,"833":0,"852":0,"853":0,"854":0,"875":42,"876":42,"877":42,"896":23,"897":23,"898":23,"899":23,"900":23,"917":45,"918":26,"920":19,"946":22,"949":22,"950":43,"954":22,"955":22,"958":22},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol","s":{"1":25,"2":24,"3":0,"4":0,"5":22,"6":0,"7":22,"8":22,"9":22,"10":22,"11":77,"12":73,"13":58,"14":58,"15":58,"16":58,"17":0,"18":95,"19":95,"20":95,"21":95,"22":95,"23":95,"24":95,"25":243,"26":243,"27":243,"28":243,"29":95,"30":148,"31":148,"32":0,"33":229,"34":147,"35":147,"36":147,"37":147,"38":147,"39":82,"40":82,"41":82,"42":82,"43":82,"44":82,"45":82,"46":82,"47":80,"48":73,"49":80,"50":2,"51":1,"52":0,"53":1,"54":1,"55":1,"56":0,"57":80,"58":80,"59":22,"60":22,"61":22,"62":22,"63":22,"64":22,"65":22,"66":22,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":22,"105":22,"106":22,"107":22,"108":22,"109":22,"110":65,"111":65,"112":65,"113":22,"114":22,"115":43,"116":1,"117":1,"118":1,"119":1,"120":42,"121":42,"122":42,"123":42,"124":42,"125":65,"126":22,"127":99,"128":95,"129":95,"130":265,"131":265,"132":95,"133":148,"134":148,"135":0,"136":148,"137":148,"138":172,"139":45,"140":51,"141":65,"142":0,"143":65,"144":87,"145":42,"146":45,"147":45,"148":45,"149":45,"150":44,"151":1,"152":1,"153":0,"154":82,"155":82,"156":82,"157":65,"158":65,"159":42,"160":42,"161":714,"162":42,"163":1,"164":1,"165":1,"166":1,"167":1,"168":22,"169":22,"170":22,"171":22,"172":22,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":42,"181":42,"182":42,"183":23,"184":23,"185":23,"186":23,"187":23,"188":45,"189":26,"190":19,"191":22,"192":22,"193":43,"194":22,"195":22,"196":22},"b":{"1":[0,22],"2":[58,0],"3":[95,148],"4":[88,7],"5":[148,0],"6":[141,7],"7":[0,0],"8":[147,82],"9":[0,147],"10":[82,0],"11":[80,2],"12":[73,7],"13":[1,1],"14":[0,1],"15":[22,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[22,43],"24":[1,42],"25":[1,0],"26":[42,0],"27":[42,0],"28":[0,148],"29":[0,65],"30":[42,45],"31":[45,0],"32":[44,1],"33":[1,0],"34":[26,19]},"f":{"1":25,"2":0,"3":22,"4":77,"5":0,"6":95,"7":22,"8":22,"9":99,"10":148,"11":172,"12":45,"13":51,"14":65,"15":87,"16":82,"17":65,"18":42,"19":1,"20":22,"21":0,"22":0,"23":42,"24":23,"25":45,"26":22},"fnMap":{"1":{"name":"verifyInclusionProof","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":93,"column":4}}},"2":{"name":"verifyExclusionProof","line":105,"loc":{"start":{"line":105,"column":4},"end":{"line":121,"column":4}}},"3":{"name":"update","line":134,"loc":{"start":{"line":134,"column":4},"end":{"line":156,"column":4}}},"4":{"name":"get","line":166,"loc":{"start":{"line":166,"column":4},"end":{"line":194,"column":4}}},"5":{"name":"getSingleNodeRootHash","line":202,"loc":{"start":{"line":202,"column":4},"end":{"line":216,"column":4}}},"6":{"name":"_walkNodePath","line":232,"loc":{"start":{"line":232,"column":4},"end":{"line":340,"column":4}}},"7":{"name":"_getNewPath","line":354,"loc":{"start":{"line":354,"column":4},"end":{"line":474,"column":4}}},"8":{"name":"_getUpdatedTrieRoot","line":482,"loc":{"start":{"line":482,"column":4},"end":{"line":539,"column":4}}},"9":{"name":"_parseProof","line":546,"loc":{"start":{"line":546,"column":4},"end":{"line":567,"column":4}}},"10":{"name":"_getNodeID","line":576,"loc":{"start":{"line":576,"column":4},"end":{"line":596,"column":4}}},"11":{"name":"_getNodePath","line":603,"loc":{"start":{"line":603,"column":4},"end":{"line":613,"column":4}}},"12":{"name":"_getNodeKey","line":621,"loc":{"start":{"line":621,"column":4},"end":{"line":631,"column":4}}},"13":{"name":"_getNodeValue","line":638,"loc":{"start":{"line":638,"column":4},"end":{"line":648,"column":4}}},"14":{"name":"_getNodeHash","line":656,"loc":{"start":{"line":656,"column":4},"end":{"line":670,"column":4}}},"15":{"name":"_getNodeType","line":677,"loc":{"start":{"line":677,"column":4},"end":{"line":700,"column":4}}},"16":{"name":"_getSharedNibbleLength","line":709,"loc":{"start":{"line":709,"column":4},"end":{"line":724,"column":4}}},"17":{"name":"_makeNode","line":731,"loc":{"start":{"line":731,"column":4},"end":{"line":746,"column":4}}},"18":{"name":"_makeNode","line":753,"loc":{"start":{"line":753,"column":4},"end":{"line":767,"column":4}}},"19":{"name":"_makeExtensionNode","line":775,"loc":{"start":{"line":775,"column":4},"end":{"line":790,"column":4}}},"20":{"name":"_makeLeafNode","line":801,"loc":{"start":{"line":801,"column":4},"end":{"line":816,"column":4}}},"21":{"name":"_makeEmptyBranchNode","line":822,"loc":{"start":{"line":822,"column":4},"end":{"line":834,"column":4}}},"22":{"name":"_editBranchValue","line":842,"loc":{"start":{"line":842,"column":4},"end":{"line":855,"column":4}}},"23":{"name":"_editBranchIndex","line":864,"loc":{"start":{"line":864,"column":4},"end":{"line":878,"column":4}}},"24":{"name":"_addHexPrefix","line":886,"loc":{"start":{"line":886,"column":4},"end":{"line":901,"column":4}}},"25":{"name":"_removeHexPrefix","line":908,"loc":{"start":{"line":908,"column":4},"end":{"line":922,"column":4}}},"26":{"name":"_joinNodeArrays","line":934,"loc":{"start":{"line":934,"column":4},"end":{"line":959,"column":4}}}},"statementMap":{"1":{"start":{"line":85,"column":8},"end":{"line":85,"column":2923}},"2":{"start":{"line":90,"column":8},"end":{"line":90,"column":3001}},"3":{"start":{"line":116,"column":8},"end":{"line":116,"column":3811}},"4":{"start":{"line":120,"column":8},"end":{"line":120,"column":30}},"5":{"start":{"line":147,"column":8},"end":{"line":147,"column":4811}},"6":{"start":{"line":148,"column":12},"end":{"line":148,"column":54}},"7":{"start":{"line":151,"column":8},"end":{"line":151,"column":53}},"8":{"start":{"line":152,"column":8},"end":{"line":152,"column":93}},"9":{"start":{"line":153,"column":8},"end":{"line":153,"column":88}},"10":{"start":{"line":155,"column":8},"end":{"line":155,"column":49}},"11":{"start":{"line":178,"column":8},"end":{"line":178,"column":53}},"12":{"start":{"line":179,"column":8},"end":{"line":179,"column":109}},"13":{"start":{"line":181,"column":8},"end":{"line":181,"column":46}},"14":{"start":{"line":183,"column":8},"end":{"line":183,"column":6018}},"15":{"start":{"line":188,"column":8},"end":{"line":188,"column":86}},"16":{"start":{"line":190,"column":8},"end":{"line":190,"column":6213}},"17":{"start":{"line":212,"column":8},"end":{"line":212,"column":6704}},"18":{"start":{"line":245,"column":8},"end":{"line":245,"column":30}},"19":{"start":{"line":246,"column":8},"end":{"line":246,"column":57}},"20":{"start":{"line":248,"column":8},"end":{"line":248,"column":37}},"21":{"start":{"line":249,"column":8},"end":{"line":249,"column":35}},"22":{"start":{"line":250,"column":8},"end":{"line":250,"column":39}},"23":{"start":{"line":251,"column":8},"end":{"line":251,"column":35}},"24":{"start":{"line":254,"column":8},"end":{"line":254,"column":7917}},"25":{"start":{"line":255,"column":12},"end":{"line":255,"column":34}},"26":{"start":{"line":256,"column":12},"end":{"line":256,"column":49}},"27":{"start":{"line":260,"column":12},"end":{"line":260,"column":26}},"28":{"start":{"line":262,"column":12},"end":{"line":262,"column":8247}},"29":{"start":{"line":264,"column":16},"end":{"line":264,"column":8359}},"30":{"start":{"line":268,"column":19},"end":{"line":268,"column":8511}},"31":{"start":{"line":270,"column":16},"end":{"line":270,"column":8647}},"32":{"start":{"line":276,"column":16},"end":{"line":276,"column":8893}},"33":{"start":{"line":282,"column":12},"end":{"line":282,"column":9077}},"34":{"start":{"line":283,"column":16},"end":{"line":283,"column":9153}},"35":{"start":{"line":289,"column":20},"end":{"line":289,"column":65}},"36":{"start":{"line":290,"column":20},"end":{"line":290,"column":90}},"37":{"start":{"line":291,"column":20},"end":{"line":291,"column":55}},"38":{"start":{"line":292,"column":20},"end":{"line":292,"column":42}},"39":{"start":{"line":295,"column":19},"end":{"line":295,"column":9813}},"40":{"start":{"line":296,"column":16},"end":{"line":296,"column":61}},"41":{"start":{"line":297,"column":16},"end":{"line":297,"column":45}},"42":{"start":{"line":298,"column":16},"end":{"line":298,"column":45}},"43":{"start":{"line":299,"column":16},"end":{"line":299,"column":79}},"44":{"start":{"line":300,"column":16},"end":{"line":300,"column":86}},"45":{"start":{"line":301,"column":16},"end":{"line":301,"column":96}},"46":{"start":{"line":303,"column":16},"end":{"line":303,"column":10325}},"47":{"start":{"line":304,"column":20},"end":{"line":304,"column":10412}},"48":{"start":{"line":310,"column":24},"end":{"line":310,"column":60}},"49":{"start":{"line":314,"column":20},"end":{"line":314,"column":52}},"50":{"start":{"line":316,"column":23},"end":{"line":316,"column":11009}},"51":{"start":{"line":317,"column":20},"end":{"line":317,"column":11106}},"52":{"start":{"line":320,"column":24},"end":{"line":320,"column":56}},"53":{"start":{"line":325,"column":24},"end":{"line":325,"column":73}},"54":{"start":{"line":326,"column":24},"end":{"line":326,"column":63}},"55":{"start":{"line":330,"column":20},"end":{"line":330,"column":67}},"56":{"start":{"line":333,"column":16},"end":{"line":333,"column":54}},"57":{"start":{"line":338,"column":8},"end":{"line":338,"column":61}},"58":{"start":{"line":339,"column":8},"end":{"line":339,"column":84}},"59":{"start":{"line":366,"column":8},"end":{"line":366,"column":49}},"60":{"start":{"line":369,"column":8},"end":{"line":369,"column":57}},"61":{"start":{"line":370,"column":8},"end":{"line":370,"column":54}},"62":{"start":{"line":376,"column":8},"end":{"line":376,"column":54}},"63":{"start":{"line":377,"column":8},"end":{"line":377,"column":33}},"64":{"start":{"line":379,"column":8},"end":{"line":379,"column":13744}},"65":{"start":{"line":382,"column":12},"end":{"line":382,"column":81}},"66":{"start":{"line":383,"column":12},"end":{"line":383,"column":29}},"67":{"start":{"line":384,"column":15},"end":{"line":384,"column":14072}},"68":{"start":{"line":385,"column":12},"end":{"line":385,"column":14131}},"69":{"start":{"line":388,"column":16},"end":{"line":388,"column":75}},"70":{"start":{"line":389,"column":16},"end":{"line":389,"column":33}},"71":{"start":{"line":393,"column":16},"end":{"line":393,"column":49}},"72":{"start":{"line":394,"column":16},"end":{"line":394,"column":33}},"73":{"start":{"line":397,"column":16},"end":{"line":397,"column":101}},"74":{"start":{"line":398,"column":16},"end":{"line":398,"column":33}},"75":{"start":{"line":402,"column":12},"end":{"line":402,"column":60}},"76":{"start":{"line":403,"column":12},"end":{"line":403,"column":90}},"77":{"start":{"line":405,"column":12},"end":{"line":405,"column":15218}},"78":{"start":{"line":408,"column":16},"end":{"line":408,"column":99}},"79":{"start":{"line":409,"column":16},"end":{"line":409,"column":94}},"80":{"start":{"line":410,"column":16},"end":{"line":410,"column":33}},"81":{"start":{"line":413,"column":16},"end":{"line":413,"column":82}},"82":{"start":{"line":414,"column":16},"end":{"line":414,"column":84}},"83":{"start":{"line":418,"column":12},"end":{"line":418,"column":62}},"84":{"start":{"line":420,"column":12},"end":{"line":420,"column":16068}},"85":{"start":{"line":424,"column":16},"end":{"line":424,"column":79}},"86":{"start":{"line":428,"column":16},"end":{"line":428,"column":55}},"87":{"start":{"line":430,"column":16},"end":{"line":430,"column":65}},"88":{"start":{"line":432,"column":16},"end":{"line":432,"column":16734}},"89":{"start":{"line":435,"column":20},"end":{"line":435,"column":106}},"90":{"start":{"line":436,"column":20},"end":{"line":436,"column":109}},"91":{"start":{"line":437,"column":23},"end":{"line":437,"column":17169}},"92":{"start":{"line":440,"column":20},"end":{"line":440,"column":111}},"93":{"start":{"line":441,"column":20},"end":{"line":441,"column":109}},"94":{"start":{"line":446,"column":20},"end":{"line":446,"column":94}},"95":{"start":{"line":450,"column":12},"end":{"line":450,"column":17956}},"96":{"start":{"line":453,"column":16},"end":{"line":453,"column":62}},"97":{"start":{"line":455,"column":16},"end":{"line":455,"column":50}},"98":{"start":{"line":456,"column":16},"end":{"line":456,"column":33}},"99":{"start":{"line":461,"column":16},"end":{"line":461,"column":67}},"100":{"start":{"line":463,"column":16},"end":{"line":463,"column":50}},"101":{"start":{"line":464,"column":16},"end":{"line":464,"column":33}},"102":{"start":{"line":466,"column":16},"end":{"line":466,"column":76}},"103":{"start":{"line":467,"column":16},"end":{"line":467,"column":33}},"104":{"start":{"line":473,"column":8},"end":{"line":473,"column":79}},"105":{"start":{"line":492,"column":8},"end":{"line":492,"column":57}},"106":{"start":{"line":495,"column":8},"end":{"line":495,"column":35}},"107":{"start":{"line":496,"column":8},"end":{"line":496,"column":32}},"108":{"start":{"line":497,"column":8},"end":{"line":497,"column":37}},"109":{"start":{"line":500,"column":8},"end":{"line":500,"column":19924}},"110":{"start":{"line":502,"column":12},"end":{"line":502,"column":38}},"111":{"start":{"line":503,"column":12},"end":{"line":503,"column":54}},"112":{"start":{"line":505,"column":12},"end":{"line":505,"column":20127}},"113":{"start":{"line":508,"column":16},"end":{"line":508,"column":63}},"114":{"start":{"line":509,"column":16},"end":{"line":509,"column":78}},"115":{"start":{"line":510,"column":19},"end":{"line":510,"column":20465}},"116":{"start":{"line":512,"column":16},"end":{"line":512,"column":63}},"117":{"start":{"line":513,"column":16},"end":{"line":513,"column":78}},"118":{"start":{"line":517,"column":16},"end":{"line":517,"column":20887}},"119":{"start":{"line":519,"column":20},"end":{"line":519,"column":78}},"120":{"start":{"line":521,"column":19},"end":{"line":521,"column":21106}},"121":{"start":{"line":524,"column":16},"end":{"line":524,"column":21310}},"122":{"start":{"line":526,"column":20},"end":{"line":526,"column":64}},"123":{"start":{"line":527,"column":20},"end":{"line":527,"column":69}},"124":{"start":{"line":528,"column":20},"end":{"line":528,"column":91}},"125":{"start":{"line":533,"column":12},"end":{"line":533,"column":63}},"126":{"start":{"line":538,"column":8},"end":{"line":538,"column":45}},"127":{"start":{"line":555,"column":8},"end":{"line":555,"column":77}},"128":{"start":{"line":556,"column":8},"end":{"line":556,"column":62}},"129":{"start":{"line":558,"column":8},"end":{"line":558,"column":22490}},"130":{"start":{"line":559,"column":12},"end":{"line":559,"column":68}},"131":{"start":{"line":560,"column":12},"end":{"line":560,"column":22622}},"132":{"start":{"line":566,"column":8},"end":{"line":566,"column":20}},"133":{"start":{"line":585,"column":8},"end":{"line":585,"column":27}},"134":{"start":{"line":587,"column":8},"end":{"line":587,"column":23295}},"135":{"start":{"line":589,"column":12},"end":{"line":589,"column":53}},"136":{"start":{"line":592,"column":12},"end":{"line":592,"column":50}},"137":{"start":{"line":595,"column":8},"end":{"line":595,"column":47}},"138":{"start":{"line":612,"column":8},"end":{"line":612,"column":82}},"139":{"start":{"line":630,"column":8},"end":{"line":630,"column":52}},"140":{"start":{"line":647,"column":8},"end":{"line":647,"column":79}},"141":{"start":{"line":665,"column":8},"end":{"line":665,"column":25348}},"142":{"start":{"line":666,"column":12},"end":{"line":666,"column":27}},"143":{"start":{"line":668,"column":12},"end":{"line":668,"column":56}},"144":{"start":{"line":686,"column":8},"end":{"line":686,"column":25851}},"145":{"start":{"line":687,"column":12},"end":{"line":687,"column":38}},"146":{"start":{"line":688,"column":15},"end":{"line":688,"column":25956}},"147":{"start":{"line":689,"column":12},"end":{"line":689,"column":51}},"148":{"start":{"line":690,"column":12},"end":{"line":690,"column":41}},"149":{"start":{"line":692,"column":12},"end":{"line":692,"column":26130}},"150":{"start":{"line":693,"column":16},"end":{"line":693,"column":40}},"151":{"start":{"line":694,"column":19},"end":{"line":694,"column":26254}},"152":{"start":{"line":695,"column":16},"end":{"line":695,"column":45}},"153":{"start":{"line":699,"column":8},"end":{"line":699,"column":34}},"154":{"start":{"line":719,"column":8},"end":{"line":719,"column":21}},"155":{"start":{"line":720,"column":8},"end":{"line":720,"column":26891}},"156":{"start":{"line":723,"column":8},"end":{"line":723,"column":16}},"157":{"start":{"line":740,"column":8},"end":{"line":740,"column":60}},"158":{"start":{"line":742,"column":8},"end":{"line":742,"column":27417}},"159":{"start":{"line":762,"column":8},"end":{"line":762,"column":55}},"160":{"start":{"line":763,"column":8},"end":{"line":763,"column":27962}},"161":{"start":{"line":764,"column":12},"end":{"line":764,"column":57}},"162":{"start":{"line":766,"column":8},"end":{"line":766,"column":29}},"163":{"start":{"line":785,"column":8},"end":{"line":785,"column":43}},"164":{"start":{"line":786,"column":8},"end":{"line":786,"column":53}},"165":{"start":{"line":787,"column":8},"end":{"line":787,"column":73}},"166":{"start":{"line":788,"column":8},"end":{"line":788,"column":48}},"167":{"start":{"line":789,"column":8},"end":{"line":789,"column":29}},"168":{"start":{"line":811,"column":8},"end":{"line":811,"column":43}},"169":{"start":{"line":812,"column":8},"end":{"line":812,"column":52}},"170":{"start":{"line":813,"column":8},"end":{"line":813,"column":73}},"171":{"start":{"line":814,"column":8},"end":{"line":814,"column":48}},"172":{"start":{"line":815,"column":8},"end":{"line":815,"column":29}},"173":{"start":{"line":829,"column":8},"end":{"line":829,"column":60}},"174":{"start":{"line":830,"column":8},"end":{"line":830,"column":30021}},"175":{"start":{"line":831,"column":12},"end":{"line":831,"column":34}},"176":{"start":{"line":833,"column":8},"end":{"line":833,"column":29}},"177":{"start":{"line":852,"column":8},"end":{"line":852,"column":63}},"178":{"start":{"line":853,"column":8},"end":{"line":853,"column":85}},"179":{"start":{"line":854,"column":8},"end":{"line":854,"column":41}},"180":{"start":{"line":875,"column":8},"end":{"line":875,"column":93}},"181":{"start":{"line":876,"column":8},"end":{"line":876,"column":65}},"182":{"start":{"line":877,"column":8},"end":{"line":877,"column":41}},"183":{"start":{"line":896,"column":8},"end":{"line":896,"column":58}},"184":{"start":{"line":897,"column":8},"end":{"line":897,"column":45}},"185":{"start":{"line":898,"column":8},"end":{"line":898,"column":53}},"186":{"start":{"line":899,"column":8},"end":{"line":899,"column":44}},"187":{"start":{"line":900,"column":8},"end":{"line":900,"column":47}},"188":{"start":{"line":917,"column":8},"end":{"line":917,"column":32479}},"189":{"start":{"line":918,"column":12},"end":{"line":918,"column":49}},"190":{"start":{"line":920,"column":12},"end":{"line":920,"column":49}},"191":{"start":{"line":946,"column":8},"end":{"line":946,"column":67}},"192":{"start":{"line":949,"column":8},"end":{"line":949,"column":33473}},"193":{"start":{"line":950,"column":12},"end":{"line":950,"column":25}},"194":{"start":{"line":954,"column":8},"end":{"line":954,"column":33609}},"195":{"start":{"line":955,"column":12},"end":{"line":955,"column":36}},"196":{"start":{"line":958,"column":8},"end":{"line":958,"column":18}}},"branchMap":{"1":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":8},"end":{"line":147,"column":8}},{"start":{"line":147,"column":8},"end":{"line":147,"column":8}}]},"2":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":8},"end":{"line":183,"column":8}},{"start":{"line":183,"column":8},"end":{"line":183,"column":8}}]},"3":{"line":262,"type":"if","locations":[{"start":{"line":262,"column":12},"end":{"line":262,"column":12}},{"start":{"line":262,"column":12},"end":{"line":262,"column":12}}]},"4":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":16},"end":{"line":264,"column":16}},{"start":{"line":264,"column":16},"end":{"line":264,"column":16}}]},"5":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":19},"end":{"line":268,"column":19}},{"start":{"line":268,"column":19},"end":{"line":268,"column":19}}]},"6":{"line":270,"type":"if","locations":[{"start":{"line":270,"column":16},"end":{"line":270,"column":16}},{"start":{"line":270,"column":16},"end":{"line":270,"column":16}}]},"7":{"line":276,"type":"if","locations":[{"start":{"line":276,"column":16},"end":{"line":276,"column":16}},{"start":{"line":276,"column":16},"end":{"line":276,"column":16}}]},"8":{"line":282,"type":"if","locations":[{"start":{"line":282,"column":12},"end":{"line":282,"column":12}},{"start":{"line":282,"column":12},"end":{"line":282,"column":12}}]},"9":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":16},"end":{"line":283,"column":16}},{"start":{"line":283,"column":16},"end":{"line":283,"column":16}}]},"10":{"line":295,"type":"if","locations":[{"start":{"line":295,"column":19},"end":{"line":295,"column":19}},{"start":{"line":295,"column":19},"end":{"line":295,"column":19}}]},"11":{"line":303,"type":"if","locations":[{"start":{"line":303,"column":16},"end":{"line":303,"column":16}},{"start":{"line":303,"column":16},"end":{"line":303,"column":16}}]},"12":{"line":304,"type":"if","locations":[{"start":{"line":304,"column":20},"end":{"line":304,"column":20}},{"start":{"line":304,"column":20},"end":{"line":304,"column":20}}]},"13":{"line":316,"type":"if","locations":[{"start":{"line":316,"column":23},"end":{"line":316,"column":23}},{"start":{"line":316,"column":23},"end":{"line":316,"column":23}}]},"14":{"line":317,"type":"if","locations":[{"start":{"line":317,"column":20},"end":{"line":317,"column":20}},{"start":{"line":317,"column":20},"end":{"line":317,"column":20}}]},"15":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"16":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":15},"end":{"line":384,"column":15}},{"start":{"line":384,"column":15},"end":{"line":384,"column":15}}]},"17":{"line":385,"type":"if","locations":[{"start":{"line":385,"column":12},"end":{"line":385,"column":12}},{"start":{"line":385,"column":12},"end":{"line":385,"column":12}}]},"18":{"line":405,"type":"if","locations":[{"start":{"line":405,"column":12},"end":{"line":405,"column":12}},{"start":{"line":405,"column":12},"end":{"line":405,"column":12}}]},"19":{"line":420,"type":"if","locations":[{"start":{"line":420,"column":12},"end":{"line":420,"column":12}},{"start":{"line":420,"column":12},"end":{"line":420,"column":12}}]},"20":{"line":432,"type":"if","locations":[{"start":{"line":432,"column":16},"end":{"line":432,"column":16}},{"start":{"line":432,"column":16},"end":{"line":432,"column":16}}]},"21":{"line":437,"type":"if","locations":[{"start":{"line":437,"column":23},"end":{"line":437,"column":23}},{"start":{"line":437,"column":23},"end":{"line":437,"column":23}}]},"22":{"line":450,"type":"if","locations":[{"start":{"line":450,"column":12},"end":{"line":450,"column":12}},{"start":{"line":450,"column":12},"end":{"line":450,"column":12}}]},"23":{"line":505,"type":"if","locations":[{"start":{"line":505,"column":12},"end":{"line":505,"column":12}},{"start":{"line":505,"column":12},"end":{"line":505,"column":12}}]},"24":{"line":510,"type":"if","locations":[{"start":{"line":510,"column":19},"end":{"line":510,"column":19}},{"start":{"line":510,"column":19},"end":{"line":510,"column":19}}]},"25":{"line":517,"type":"if","locations":[{"start":{"line":517,"column":16},"end":{"line":517,"column":16}},{"start":{"line":517,"column":16},"end":{"line":517,"column":16}}]},"26":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":19},"end":{"line":521,"column":19}},{"start":{"line":521,"column":19},"end":{"line":521,"column":19}}]},"27":{"line":524,"type":"if","locations":[{"start":{"line":524,"column":16},"end":{"line":524,"column":16}},{"start":{"line":524,"column":16},"end":{"line":524,"column":16}}]},"28":{"line":587,"type":"if","locations":[{"start":{"line":587,"column":8},"end":{"line":587,"column":8}},{"start":{"line":587,"column":8},"end":{"line":587,"column":8}}]},"29":{"line":665,"type":"if","locations":[{"start":{"line":665,"column":8},"end":{"line":665,"column":8}},{"start":{"line":665,"column":8},"end":{"line":665,"column":8}}]},"30":{"line":686,"type":"if","locations":[{"start":{"line":686,"column":8},"end":{"line":686,"column":8}},{"start":{"line":686,"column":8},"end":{"line":686,"column":8}}]},"31":{"line":688,"type":"if","locations":[{"start":{"line":688,"column":15},"end":{"line":688,"column":15}},{"start":{"line":688,"column":15},"end":{"line":688,"column":15}}]},"32":{"line":692,"type":"if","locations":[{"start":{"line":692,"column":12},"end":{"line":692,"column":12}},{"start":{"line":692,"column":12},"end":{"line":692,"column":12}}]},"33":{"line":694,"type":"if","locations":[{"start":{"line":694,"column":19},"end":{"line":694,"column":19}},{"start":{"line":694,"column":19},"end":{"line":694,"column":19}}]},"34":{"line":917,"type":"if","locations":[{"start":{"line":917,"column":8},"end":{"line":917,"column":8}},{"start":{"line":917,"column":8},"end":{"line":917,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol":{"l":{"41":15,"42":15,"66":0,"67":0,"93":12,"94":12,"117":20,"118":20,"137":0,"138":0,"160":47},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol","s":{"1":15,"2":15,"3":0,"4":0,"5":12,"6":12,"7":20,"8":20,"9":0,"10":0,"11":47},"b":{},"f":{"1":15,"2":0,"3":12,"4":20,"5":0,"6":47},"fnMap":{"1":{"name":"verifyInclusionProof","line":29,"loc":{"start":{"line":29,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"verifyExclusionProof","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":68,"column":4}}},"3":{"name":"update","line":81,"loc":{"start":{"line":81,"column":4},"end":{"line":95,"column":4}}},"4":{"name":"get","line":105,"loc":{"start":{"line":105,"column":4},"end":{"line":119,"column":4}}},"5":{"name":"getSingleNodeRootHash","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":139,"column":4}}},"6":{"name":"_getSecureKey","line":151,"loc":{"start":{"line":151,"column":4},"end":{"line":161,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":46}},"2":{"start":{"line":42,"column":8},"end":{"line":42,"column":78}},"3":{"start":{"line":66,"column":8},"end":{"line":66,"column":46}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":70}},"5":{"start":{"line":93,"column":8},"end":{"line":93,"column":46}},"6":{"start":{"line":94,"column":8},"end":{"line":94,"column":64}},"7":{"start":{"line":117,"column":8},"end":{"line":117,"column":46}},"8":{"start":{"line":118,"column":8},"end":{"line":118,"column":53}},"9":{"start":{"line":137,"column":8},"end":{"line":137,"column":46}},"10":{"start":{"line":138,"column":8},"end":{"line":138,"column":64}},"11":{"start":{"line":160,"column":8},"end":{"line":160,"column":48}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol":{"l":{"27":40,"44":2,"61":31,"78":19,"95":3,"97":3,"115":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol","s":{"1":40,"2":2,"3":31,"4":19,"5":3,"6":3},"b":{},"f":{"1":40,"2":2,"3":31,"4":19,"5":3},"fnMap":{"1":{"name":"toBool","line":18,"loc":{"start":{"line":18,"column":4},"end":{"line":28,"column":4}}},"2":{"name":"fromBool","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":45,"column":4}}},"3":{"name":"toAddress","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":62,"column":4}}},"4":{"name":"fromAddress","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":79,"column":4}}},"5":{"name":"removeLeadingZeros","line":86,"loc":{"start":{"line":86,"column":4},"end":{"line":116,"column":4}}}},"statementMap":{"1":{"start":{"line":27,"column":8},"end":{"line":27,"column":23}},"2":{"start":{"line":44,"column":8},"end":{"line":44,"column":44}},"3":{"start":{"line":61,"column":8},"end":{"line":61,"column":45}},"4":{"start":{"line":78,"column":8},"end":{"line":78,"column":36}},"5":{"start":{"line":95,"column":8},"end":{"line":95,"column":24}},"6":{"start":{"line":115,"column":8},"end":{"line":115,"column":18}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol":{"l":{"22":311,"23":311,"24":311,"26":308,"28":308,"81":308,"92":299,"93":73,"96":226,"106":1,"107":1,"108":1,"111":1,"121":164,"122":2,"123":2,"126":2,"129":162,"139":3,"143":15,"144":15,"145":15,"147":15,"151":15,"155":12,"156":12,"157":12,"159":12,"163":12,"167":5,"168":5,"169":5,"171":5,"175":5,"185":292,"187":292,"188":9144,"189":9144,"192":292,"202":26,"204":26,"205":708,"208":26,"219":26},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol","s":{"1":311,"2":311,"3":311,"4":308,"5":308,"6":299,"7":73,"8":226,"9":1,"10":1,"11":1,"12":164,"13":2,"14":2,"15":162,"16":3,"17":15,"18":15,"19":15,"20":15,"21":12,"22":12,"23":12,"24":12,"25":5,"26":5,"27":5,"28":5,"29":292,"30":292,"31":9144,"32":9144,"33":292,"34":26,"35":26,"36":708,"37":26,"38":26},"b":{"1":[311,0],"2":[311,0],"3":[308,3],"4":[73,226],"5":[2,162],"6":[15,0],"7":[15,0],"8":[12,0],"9":[12,0],"10":[5,0],"11":[5,0]},"f":{"1":311,"2":299,"3":1,"4":164,"5":3,"6":15,"7":12,"8":5,"9":292,"10":26,"11":26},"fnMap":{"1":{"name":"slice","line":13,"loc":{"start":{"line":13,"column":4},"end":{"line":82,"column":4}}},"2":{"name":"slice","line":84,"loc":{"start":{"line":84,"column":4},"end":{"line":97,"column":4}}},"3":{"name":"toBytes32PadLeft","line":99,"loc":{"start":{"line":99,"column":4},"end":{"line":112,"column":4}}},"4":{"name":"toBytes32","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":130,"column":4}}},"5":{"name":"toUint256","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"6":{"name":"toUint24","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":152,"column":4}}},"7":{"name":"toUint8","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":164,"column":4}}},"8":{"name":"toAddress","line":166,"loc":{"start":{"line":166,"column":4},"end":{"line":176,"column":4}}},"9":{"name":"toNibbles","line":178,"loc":{"start":{"line":178,"column":4},"end":{"line":193,"column":4}}},"10":{"name":"fromNibbles","line":195,"loc":{"start":{"line":195,"column":4},"end":{"line":209,"column":4}}},"11":{"name":"equal","line":211,"loc":{"start":{"line":211,"column":4},"end":{"line":220,"column":4}}}},"statementMap":{"1":{"start":{"line":22,"column":8},"end":{"line":22,"column":57}},"2":{"start":{"line":23,"column":8},"end":{"line":23,"column":60}},"3":{"start":{"line":24,"column":8},"end":{"line":24,"column":70}},"4":{"start":{"line":26,"column":8},"end":{"line":26,"column":30}},"5":{"start":{"line":81,"column":8},"end":{"line":81,"column":24}},"6":{"start":{"line":92,"column":8},"end":{"line":92,"column":3245}},"7":{"start":{"line":93,"column":12},"end":{"line":93,"column":28}},"8":{"start":{"line":96,"column":8},"end":{"line":96,"column":60}},"9":{"start":{"line":106,"column":8},"end":{"line":106,"column":19}},"10":{"start":{"line":107,"column":8},"end":{"line":107,"column":62}},"11":{"start":{"line":111,"column":8},"end":{"line":111,"column":18}},"12":{"start":{"line":121,"column":8},"end":{"line":121,"column":3855}},"13":{"start":{"line":122,"column":12},"end":{"line":122,"column":23}},"14":{"start":{"line":126,"column":12},"end":{"line":126,"column":22}},"15":{"start":{"line":129,"column":8},"end":{"line":129,"column":43}},"16":{"start":{"line":139,"column":8},"end":{"line":139,"column":41}},"17":{"start":{"line":143,"column":8},"end":{"line":143,"column":57}},"18":{"start":{"line":144,"column":8},"end":{"line":144,"column":68}},"19":{"start":{"line":145,"column":8},"end":{"line":145,"column":23}},"20":{"start":{"line":151,"column":8},"end":{"line":151,"column":23}},"21":{"start":{"line":155,"column":8},"end":{"line":155,"column":56}},"22":{"start":{"line":156,"column":8},"end":{"line":156,"column":67}},"23":{"start":{"line":157,"column":8},"end":{"line":157,"column":22}},"24":{"start":{"line":163,"column":8},"end":{"line":163,"column":23}},"25":{"start":{"line":167,"column":8},"end":{"line":167,"column":59}},"26":{"start":{"line":168,"column":8},"end":{"line":168,"column":69}},"27":{"start":{"line":169,"column":8},"end":{"line":169,"column":27}},"28":{"start":{"line":175,"column":8},"end":{"line":175,"column":26}},"29":{"start":{"line":185,"column":8},"end":{"line":185,"column":59}},"30":{"start":{"line":187,"column":8},"end":{"line":187,"column":5646}},"31":{"start":{"line":188,"column":12},"end":{"line":188,"column":42}},"32":{"start":{"line":189,"column":12},"end":{"line":189,"column":61}},"33":{"start":{"line":192,"column":8},"end":{"line":192,"column":22}},"34":{"start":{"line":202,"column":8},"end":{"line":202,"column":55}},"35":{"start":{"line":204,"column":8},"end":{"line":204,"column":6036}},"36":{"start":{"line":205,"column":12},"end":{"line":205,"column":62}},"37":{"start":{"line":208,"column":8},"end":{"line":208,"column":18}},"38":{"start":{"line":219,"column":8},"end":{"line":219,"column":53}}},"branchMap":{"1":{"line":22,"type":"if","locations":[{"start":{"line":22,"column":8},"end":{"line":22,"column":8}},{"start":{"line":22,"column":8},"end":{"line":22,"column":8}}]},"2":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":8},"end":{"line":23,"column":8}},{"start":{"line":23,"column":8},"end":{"line":23,"column":8}}]},"3":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":8}},{"start":{"line":24,"column":8},"end":{"line":24,"column":8}}]},"4":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":8}},{"start":{"line":92,"column":8},"end":{"line":92,"column":8}}]},"5":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":8},"end":{"line":121,"column":8}},{"start":{"line":121,"column":8},"end":{"line":121,"column":8}}]},"6":{"line":143,"type":"if","locations":[{"start":{"line":143,"column":8},"end":{"line":143,"column":8}},{"start":{"line":143,"column":8},"end":{"line":143,"column":8}}]},"7":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"8":{"line":155,"type":"if","locations":[{"start":{"line":155,"column":8},"end":{"line":155,"column":8}},{"start":{"line":155,"column":8},"end":{"line":155,"column":8}}]},"9":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"10":{"line":167,"type":"if","locations":[{"start":{"line":167,"column":8},"end":{"line":167,"column":8}},{"start":{"line":167,"column":8},"end":{"line":167,"column":8}}]},"11":{"line":168,"type":"if","locations":[{"start":{"line":168,"column":8},"end":{"line":168,"column":8}},{"start":{"line":168,"column":8},"end":{"line":168,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol":{"l":{"35":22,"37":22,"52":24,"53":9,"55":15,"77":15,"94":9,"95":9,"96":9},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol","s":{"1":22,"2":22,"3":24,"4":9,"5":15,"6":15,"7":9,"8":9,"9":9},"b":{"1":[9,15]},"f":{"1":22,"2":24,"3":15,"4":9},"fnMap":{"1":{"name":"recover","line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"getMessageHash","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":56,"column":4}}},"3":{"name":"getNativeMessageHash","line":68,"loc":{"start":{"line":68,"column":4},"end":{"line":78,"column":4}}},"4":{"name":"getEthSignedMessageHash","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":97,"column":4}}}},"statementMap":{"1":{"start":{"line":35,"column":8},"end":{"line":35,"column":75}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1000}},"3":{"start":{"line":52,"column":8},"end":{"line":52,"column":1277}},"4":{"start":{"line":53,"column":12},"end":{"line":53,"column":52}},"5":{"start":{"line":55,"column":8},"end":{"line":55,"column":45}},"6":{"start":{"line":77,"column":8},"end":{"line":77,"column":34}},"7":{"start":{"line":94,"column":8},"end":{"line":94,"column":64}},"8":{"start":{"line":95,"column":8},"end":{"line":95,"column":49}},"9":{"start":{"line":96,"column":8},"end":{"line":96,"column":63}}},"branchMap":{"1":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol":{"l":{"30":10},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol","s":{"1":10},"b":{},"f":{"1":10},"fnMap":{"1":{"name":"encodeRevertString","line":21,"loc":{"start":{"line":21,"column":4},"end":{"line":34,"column":4}}}},"statementMap":{"1":{"start":{"line":30,"column":8},"end":{"line":30,"column":830}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol":{"l":{"37":34,"44":34,"61":18,"82":212,"86":212,"103":19,"107":19,"128":27,"136":27,"155":27,"156":27,"157":27,"159":27,"160":27,"179":0,"186":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol","s":{"1":34,"2":18,"3":212,"4":19,"5":27,"6":27,"7":27,"8":27,"9":27,"10":27,"11":0,"12":0},"b":{},"f":{"1":34,"2":18,"3":212,"4":19,"5":27,"6":27,"7":0},"fnMap":{"1":{"name":"getCode","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":45,"column":4}}},"2":{"name":"getCode","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":66,"column":4}}},"3":{"name":"getCodeSize","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":87,"column":4}}},"4":{"name":"getCodeHash","line":94,"loc":{"start":{"line":94,"column":4},"end":{"line":108,"column":4}}},"5":{"name":"createContract","line":120,"loc":{"start":{"line":120,"column":4},"end":{"line":137,"column":4}}},"6":{"name":"getAddressForCREATE","line":145,"loc":{"start":{"line":145,"column":4},"end":{"line":161,"column":4}}},"7":{"name":"getAddressForCREATE2","line":170,"loc":{"start":{"line":170,"column":4},"end":{"line":187,"column":4}}}},"statementMap":{"1":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":1471}},"3":{"start":{"line":86,"column":8},"end":{"line":86,"column":24}},"4":{"start":{"line":107,"column":8},"end":{"line":107,"column":24}},"5":{"start":{"line":136,"column":8},"end":{"line":136,"column":23}},"6":{"start":{"line":155,"column":8},"end":{"line":155,"column":47}},"7":{"start":{"line":156,"column":8},"end":{"line":156,"column":56}},"8":{"start":{"line":157,"column":8},"end":{"line":157,"column":51}},"9":{"start":{"line":159,"column":8},"end":{"line":159,"column":67}},"10":{"start":{"line":160,"column":8},"end":{"line":160,"column":65}},"11":{"start":{"line":179,"column":8},"end":{"line":179,"column":4349}},"12":{"start":{"line":186,"column":8},"end":{"line":186,"column":53}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol":{"l":{"29":0,"30":0,"33":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol","s":{"1":0,"2":0,"3":0},"b":{"1":[0,0]},"f":{"1":0},"fnMap":{"1":{"name":"min","line":19,"loc":{"start":{"line":19,"column":4},"end":{"line":34,"column":4}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":550}},"2":{"start":{"line":30,"column":12},"end":{"line":30,"column":21}},"3":{"start":{"line":33,"column":8},"end":{"line":33,"column":17}}},"branchMap":{"1":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":8},"end":{"line":29,"column":8}},{"start":{"line":29,"column":8},"end":{"line":29,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol":{"l":{"32":118,"37":117,"38":0,"41":117,"61":117,"64":117,"65":117,"68":117,"71":117,"74":117,"75":117,"77":117,"78":273,"79":273,"81":273,"82":4620,"83":4620,"84":4620,"89":4620,"92":273,"93":27,"94":27,"95":27,"100":27,"103":273,"104":273,"107":117,"134":102,"139":101,"144":100,"149":99,"151":99,"152":653,"153":146,"160":507,"168":653,"171":99,"193":100,"198":100,"199":3,"204":97,"205":97,"206":97,"207":776,"208":206,"209":206,"214":97,"215":70,"218":97},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol","s":{"1":118,"2":117,"3":0,"4":117,"5":117,"6":117,"7":117,"8":117,"9":117,"10":117,"11":117,"12":117,"13":273,"14":273,"15":273,"16":4620,"17":4620,"18":4620,"19":273,"20":27,"21":27,"22":27,"23":273,"24":117,"25":102,"26":101,"27":100,"28":99,"29":99,"30":653,"31":146,"32":507,"33":653,"34":99,"35":100,"36":100,"37":3,"38":97,"39":97,"40":97,"41":776,"42":206,"43":206,"44":97,"45":70,"46":97},"b":{"1":[117,1],"2":[0,117],"3":[27,246],"4":[101,1],"5":[100,1],"6":[99,1],"7":[146,507],"8":[100,0],"9":[3,97],"10":[206,570],"11":[70,27]},"f":{"1":118,"2":102,"3":100},"fnMap":{"1":{"name":"getMerkleRoot","line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":108,"column":4}}},"2":{"name":"verify","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":172,"column":4}}},"3":{"name":"_ceilLog2","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":219,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":1067}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1197}},"3":{"start":{"line":38,"column":12},"end":{"line":38,"column":31}},"4":{"start":{"line":41,"column":8},"end":{"line":41,"column":1279}},"5":{"start":{"line":61,"column":8},"end":{"line":61,"column":40}},"6":{"start":{"line":64,"column":8},"end":{"line":64,"column":27}},"7":{"start":{"line":65,"column":8},"end":{"line":65,"column":28}},"8":{"start":{"line":68,"column":8},"end":{"line":68,"column":42}},"9":{"start":{"line":71,"column":8},"end":{"line":71,"column":25}},"10":{"start":{"line":74,"column":8},"end":{"line":74,"column":27}},"11":{"start":{"line":75,"column":8},"end":{"line":75,"column":25}},"12":{"start":{"line":77,"column":8},"end":{"line":77,"column":3156}},"13":{"start":{"line":78,"column":12},"end":{"line":78,"column":36}},"14":{"start":{"line":79,"column":12},"end":{"line":79,"column":42}},"15":{"start":{"line":81,"column":12},"end":{"line":81,"column":3279}},"16":{"start":{"line":82,"column":16},"end":{"line":82,"column":52}},"17":{"start":{"line":83,"column":16},"end":{"line":83,"column":52}},"18":{"start":{"line":89,"column":16},"end":{"line":89,"column":44}},"19":{"start":{"line":92,"column":12},"end":{"line":92,"column":3663}},"20":{"start":{"line":93,"column":16},"end":{"line":93,"column":52}},"21":{"start":{"line":94,"column":16},"end":{"line":94,"column":54}},"22":{"start":{"line":100,"column":16},"end":{"line":100,"column":54}},"23":{"start":{"line":103,"column":12},"end":{"line":103,"column":57}},"24":{"start":{"line":107,"column":8},"end":{"line":107,"column":27}},"25":{"start":{"line":134,"column":8},"end":{"line":134,"column":5110}},"26":{"start":{"line":139,"column":8},"end":{"line":139,"column":5239}},"27":{"start":{"line":144,"column":8},"end":{"line":144,"column":5354}},"28":{"start":{"line":149,"column":8},"end":{"line":149,"column":36}},"29":{"start":{"line":151,"column":8},"end":{"line":151,"column":5571}},"30":{"start":{"line":152,"column":12},"end":{"line":152,"column":5636}},"31":{"start":{"line":153,"column":16},"end":{"line":153,"column":5681}},"32":{"start":{"line":160,"column":16},"end":{"line":160,"column":5898}},"33":{"start":{"line":168,"column":12},"end":{"line":168,"column":23}},"34":{"start":{"line":171,"column":8},"end":{"line":171,"column":36}},"35":{"start":{"line":193,"column":8},"end":{"line":193,"column":6569}},"36":{"start":{"line":198,"column":8},"end":{"line":198,"column":6682}},"37":{"start":{"line":199,"column":12},"end":{"line":199,"column":20}},"38":{"start":{"line":204,"column":8},"end":{"line":204,"column":25}},"39":{"start":{"line":205,"column":8},"end":{"line":205,"column":27}},"40":{"start":{"line":206,"column":8},"end":{"line":206,"column":6934}},"41":{"start":{"line":207,"column":12},"end":{"line":207,"column":6989}},"42":{"start":{"line":208,"column":16},"end":{"line":208,"column":27}},"43":{"start":{"line":209,"column":16},"end":{"line":209,"column":24}},"44":{"start":{"line":214,"column":8},"end":{"line":214,"column":7181}},"45":{"start":{"line":215,"column":12},"end":{"line":215,"column":23}},"46":{"start":{"line":218,"column":8},"end":{"line":218,"column":22}}},"branchMap":{"1":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":8},"end":{"line":32,"column":8}},{"start":{"line":32,"column":8},"end":{"line":32,"column":8}}]},"2":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"3":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":12},"end":{"line":92,"column":12}},{"start":{"line":92,"column":12},"end":{"line":92,"column":12}}]},"4":{"line":134,"type":"if","locations":[{"start":{"line":134,"column":8},"end":{"line":134,"column":8}},{"start":{"line":134,"column":8},"end":{"line":134,"column":8}}]},"5":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"6":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"7":{"line":152,"type":"if","locations":[{"start":{"line":152,"column":12},"end":{"line":152,"column":12}},{"start":{"line":152,"column":12},"end":{"line":152,"column":12}}]},"8":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"9":{"line":198,"type":"if","locations":[{"start":{"line":198,"column":8},"end":{"line":198,"column":8}},{"start":{"line":198,"column":8},"end":{"line":198,"column":8}}]},"10":{"line":207,"type":"if","locations":[{"start":{"line":207,"column":12},"end":{"line":207,"column":12}},{"start":{"line":207,"column":12},"end":{"line":207,"column":12}}]},"11":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol":{"l":{"38":54,"50":14,"53":14,"55":14,"59":6},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol","s":{"1":54,"2":14,"3":14,"4":6},"b":{"1":[14,0]},"f":{"1":54,"2":14},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":39,"column":4}}},"2":{"name":"nonReentrant","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":60,"column":4}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":29}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":70}},"3":{"start":{"line":53,"column":8},"end":{"line":53,"column":25}},"4":{"start":{"line":59,"column":8},"end":{"line":59,"column":29}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol":{"l":{"60":572,"61":572,"64":572,"65":134,"69":572,"70":11,"73":0,"74":0,"75":0,"78":0,"81":11,"86":572,"87":572,"90":572,"91":572,"92":572,"106":470,"108":470,"130":538,"132":538,"137":535,"138":535,"140":535,"143":535,"146":535,"151":535,"155":0,"158":0,"164":0,"169":0,"186":1,"188":1,"193":1,"197":0,"198":0,"202":1,"203":1,"204":1,"218":0,"219":0,"239":441,"240":441,"254":0,"255":0,"256":0,"273":550,"274":550,"288":573,"289":573,"291":573,"292":573,"293":573,"298":573,"299":573,"300":573,"301":573,"307":573,"308":573,"311":573,"312":0,"330":2572,"331":2572,"333":2572,"334":2572,"335":2572,"340":2572,"341":2572,"342":2572,"343":2572,"349":2572,"374":1642},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol","s":{"1":572,"2":572,"3":572,"4":134,"5":572,"6":11,"7":0,"8":0,"9":0,"10":11,"11":572,"12":572,"13":572,"14":572,"15":470,"16":470,"17":538,"18":538,"19":535,"20":535,"21":535,"22":535,"23":535,"24":535,"25":0,"26":0,"27":0,"28":0,"29":1,"30":1,"31":1,"32":0,"33":1,"34":1,"35":1,"36":0,"37":0,"38":441,"39":441,"40":0,"41":0,"42":0,"43":550,"44":550,"45":573,"46":573,"47":573,"48":573,"49":573,"50":573,"51":573,"52":573,"53":573,"54":573,"55":0,"56":2572,"57":2572,"58":2572,"59":2572,"60":2572,"61":2572,"62":2572,"63":2572,"64":1642},"b":{"1":[134,438],"2":[11,561],"3":[0,11],"4":[535,3],"5":[535,0],"6":[535,0],"7":[0,0],"8":[0,0],"9":[1,0],"10":[0,1],"11":[573,0],"12":[0,573]},"f":{"1":572,"2":470,"3":538,"4":1,"5":0,"6":441,"7":0,"8":550,"9":573,"10":2572,"11":1642},"fnMap":{"1":{"name":"push","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":93,"column":4}}},"2":{"name":"push","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":112,"column":4}}},"3":{"name":"get","line":120,"loc":{"start":{"line":120,"column":4},"end":{"line":171,"column":4}}},"4":{"name":"deleteElementsAfterInclusive","line":179,"loc":{"start":{"line":179,"column":4},"end":{"line":205,"column":4}}},"5":{"name":"deleteElementsAfterInclusive","line":212,"loc":{"start":{"line":212,"column":4},"end":{"line":223,"column":4}}},"6":{"name":"getLength","line":230,"loc":{"start":{"line":230,"column":4},"end":{"line":241,"column":4}}},"7":{"name":"setExtraData","line":248,"loc":{"start":{"line":248,"column":4},"end":{"line":257,"column":4}}},"8":{"name":"getExtraData","line":264,"loc":{"start":{"line":264,"column":4},"end":{"line":275,"column":4}}},"9":{"name":"setContext","line":282,"loc":{"start":{"line":282,"column":4},"end":{"line":314,"column":4}}},"10":{"name":"getContext","line":321,"loc":{"start":{"line":321,"column":4},"end":{"line":356,"column":4}}},"11":{"name":"getBuffer","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":375,"column":4}}}},"statementMap":{"1":{"start":{"line":60,"column":8},"end":{"line":60,"column":57}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":72}},"3":{"start":{"line":64,"column":8},"end":{"line":64,"column":1385}},"4":{"start":{"line":65,"column":12},"end":{"line":65,"column":43}},"5":{"start":{"line":69,"column":8},"end":{"line":69,"column":1530}},"6":{"start":{"line":70,"column":12},"end":{"line":70,"column":1611}},"7":{"start":{"line":74,"column":16},"end":{"line":74,"column":54}},"8":{"start":{"line":75,"column":16},"end":{"line":75,"column":51}},"9":{"start":{"line":78,"column":16},"end":{"line":78,"column":64}},"10":{"start":{"line":81,"column":16},"end":{"line":81,"column":37}},"11":{"start":{"line":86,"column":8},"end":{"line":86,"column":64}},"12":{"start":{"line":87,"column":8},"end":{"line":87,"column":41}},"13":{"start":{"line":91,"column":8},"end":{"line":91,"column":33}},"14":{"start":{"line":92,"column":8},"end":{"line":92,"column":28}},"15":{"start":{"line":106,"column":8},"end":{"line":106,"column":57}},"16":{"start":{"line":108,"column":8},"end":{"line":108,"column":2968}},"17":{"start":{"line":130,"column":8},"end":{"line":130,"column":57}},"18":{"start":{"line":132,"column":8},"end":{"line":132,"column":3484}},"19":{"start":{"line":137,"column":8},"end":{"line":137,"column":72}},"20":{"start":{"line":138,"column":8},"end":{"line":138,"column":76}},"21":{"start":{"line":140,"column":8},"end":{"line":140,"column":3739}},"22":{"start":{"line":143,"column":12},"end":{"line":143,"column":63}},"23":{"start":{"line":146,"column":12},"end":{"line":146,"column":4055}},"24":{"start":{"line":151,"column":12},"end":{"line":151,"column":48}},"25":{"start":{"line":155,"column":12},"end":{"line":155,"column":63}},"26":{"start":{"line":158,"column":12},"end":{"line":158,"column":4566}},"27":{"start":{"line":164,"column":12},"end":{"line":164,"column":4767}},"28":{"start":{"line":169,"column":12},"end":{"line":169,"column":68}},"29":{"start":{"line":186,"column":8},"end":{"line":186,"column":57}},"30":{"start":{"line":188,"column":8},"end":{"line":188,"column":5432}},"31":{"start":{"line":193,"column":8},"end":{"line":193,"column":5566}},"32":{"start":{"line":198,"column":12},"end":{"line":198,"column":50}},"33":{"start":{"line":202,"column":8},"end":{"line":202,"column":31}},"34":{"start":{"line":203,"column":8},"end":{"line":203,"column":33}},"35":{"start":{"line":204,"column":8},"end":{"line":204,"column":28}},"36":{"start":{"line":218,"column":8},"end":{"line":218,"column":57}},"37":{"start":{"line":219,"column":8},"end":{"line":219,"column":6512}},"38":{"start":{"line":239,"column":8},"end":{"line":239,"column":57}},"39":{"start":{"line":240,"column":8},"end":{"line":240,"column":30}},"40":{"start":{"line":254,"column":8},"end":{"line":254,"column":57}},"41":{"start":{"line":255,"column":8},"end":{"line":255,"column":33}},"42":{"start":{"line":256,"column":8},"end":{"line":256,"column":28}},"43":{"start":{"line":273,"column":8},"end":{"line":273,"column":57}},"44":{"start":{"line":274,"column":8},"end":{"line":274,"column":28}},"45":{"start":{"line":288,"column":8},"end":{"line":288,"column":24}},"46":{"start":{"line":289,"column":8},"end":{"line":289,"column":24}},"47":{"start":{"line":291,"column":8},"end":{"line":291,"column":45}},"48":{"start":{"line":292,"column":8},"end":{"line":292,"column":42}},"49":{"start":{"line":298,"column":8},"end":{"line":298,"column":53}},"50":{"start":{"line":299,"column":8},"end":{"line":299,"column":51}},"51":{"start":{"line":300,"column":8},"end":{"line":300,"column":51}},"52":{"start":{"line":307,"column":8},"end":{"line":307,"column":8669}},"53":{"start":{"line":308,"column":12},"end":{"line":308,"column":36}},"54":{"start":{"line":311,"column":8},"end":{"line":311,"column":8761}},"55":{"start":{"line":312,"column":12},"end":{"line":312,"column":36}},"56":{"start":{"line":330,"column":8},"end":{"line":330,"column":41}},"57":{"start":{"line":331,"column":8},"end":{"line":331,"column":41}},"58":{"start":{"line":333,"column":8},"end":{"line":333,"column":26}},"59":{"start":{"line":334,"column":8},"end":{"line":334,"column":25}},"60":{"start":{"line":340,"column":8},"end":{"line":340,"column":30}},"61":{"start":{"line":341,"column":8},"end":{"line":341,"column":29}},"62":{"start":{"line":342,"column":8},"end":{"line":342,"column":29}},"63":{"start":{"line":349,"column":8},"end":{"line":349,"column":10056}},"64":{"start":{"line":374,"column":8},"end":{"line":374,"column":62}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"2":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":8}},{"start":{"line":69,"column":8},"end":{"line":69,"column":8}}]},"3":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":12},"end":{"line":70,"column":12}},{"start":{"line":70,"column":12},"end":{"line":70,"column":12}}]},"4":{"line":132,"type":"if","locations":[{"start":{"line":132,"column":8},"end":{"line":132,"column":8}},{"start":{"line":132,"column":8},"end":{"line":132,"column":8}}]},"5":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":8},"end":{"line":140,"column":8}},{"start":{"line":140,"column":8},"end":{"line":140,"column":8}}]},"6":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":12},"end":{"line":146,"column":12}},{"start":{"line":146,"column":12},"end":{"line":146,"column":12}}]},"7":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":12},"end":{"line":158,"column":12}},{"start":{"line":158,"column":12},"end":{"line":158,"column":12}}]},"8":{"line":164,"type":"if","locations":[{"start":{"line":164,"column":12},"end":{"line":164,"column":12}},{"start":{"line":164,"column":12},"end":{"line":164,"column":12}}]},"9":{"line":188,"type":"if","locations":[{"start":{"line":188,"column":8},"end":{"line":188,"column":8}},{"start":{"line":188,"column":8},"end":{"line":188,"column":8}}]},"10":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"11":{"line":307,"type":"if","locations":[{"start":{"line":307,"column":8},"end":{"line":307,"column":8}},{"start":{"line":307,"column":8},"end":{"line":307,"column":8}}]},"12":{"line":311,"type":"if","locations":[{"start":{"line":311,"column":8},"end":{"line":311,"column":8}},{"start":{"line":311,"column":8},"end":{"line":311,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol":{"l":{"41":18,"50":18,"72":2,"81":2,"100":1,"108":1,"124":5,"131":5,"144":12,"150":12,"163":11,"169":11,"182":9,"188":9,"201":7,"207":7,"219":6,"242":2,"262":9,"283":41,"284":7,"301":43,"308":43,"320":21,"348":146,"349":146,"354":146,"355":2,"359":0,"363":144,"375":145},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol","s":{"1":18,"2":18,"3":2,"4":2,"5":1,"6":1,"7":5,"8":5,"9":12,"10":12,"11":11,"12":11,"13":9,"14":9,"15":7,"16":7,"17":6,"18":2,"19":9,"20":41,"21":7,"22":43,"23":43,"24":21,"25":146,"26":146,"27":146,"28":144,"29":144,"30":145},"b":{"1":[7,34],"2":[2,144],"3":[0,144]},"f":{"1":18,"2":2,"3":1,"4":5,"5":12,"6":11,"7":9,"8":7,"9":6,"10":2,"11":9,"12":41,"13":43,"14":21,"15":146,"16":145},"fnMap":{"1":{"name":"safeCALL","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":51,"column":4}}},"2":{"name":"safeDELEGATECALL","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":82,"column":4}}},"3":{"name":"safeCREATE","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":109,"column":4}}},"4":{"name":"safeEXTCODESIZE","line":116,"loc":{"start":{"line":116,"column":4},"end":{"line":132,"column":4}}},"5":{"name":"safeCHAINID","line":138,"loc":{"start":{"line":138,"column":4},"end":{"line":151,"column":4}}},"6":{"name":"safeCALLER","line":157,"loc":{"start":{"line":157,"column":4},"end":{"line":170,"column":4}}},"7":{"name":"safeADDRESS","line":176,"loc":{"start":{"line":176,"column":4},"end":{"line":189,"column":4}}},"8":{"name":"safeGETNONCE","line":195,"loc":{"start":{"line":195,"column":4},"end":{"line":208,"column":4}}},"9":{"name":"safeSETNONCE","line":214,"loc":{"start":{"line":214,"column":4},"end":{"line":225,"column":4}}},"10":{"name":"safeCREATEEOA","line":234,"loc":{"start":{"line":234,"column":4},"end":{"line":251,"column":4}}},"11":{"name":"safeREVERT","line":257,"loc":{"start":{"line":257,"column":4},"end":{"line":270,"column":4}}},"12":{"name":"safeREQUIRE","line":277,"loc":{"start":{"line":277,"column":4},"end":{"line":288,"column":4}}},"13":{"name":"safeSLOAD","line":293,"loc":{"start":{"line":293,"column":4},"end":{"line":309,"column":4}}},"14":{"name":"safeSSTORE","line":314,"loc":{"start":{"line":314,"column":4},"end":{"line":327,"column":4}}},"15":{"name":"_safeExecutionManagerInteraction","line":339,"loc":{"start":{"line":339,"column":4},"end":{"line":365,"column":4}}},"16":{"name":"_safeExecutionManagerInteraction","line":367,"loc":{"start":{"line":367,"column":4},"end":{"line":379,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":1128}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":52}},"3":{"start":{"line":72,"column":8},"end":{"line":72,"column":1988}},"4":{"start":{"line":81,"column":8},"end":{"line":81,"column":52}},"5":{"start":{"line":100,"column":8},"end":{"line":100,"column":2718}},"6":{"start":{"line":108,"column":8},"end":{"line":108,"column":55}},"7":{"start":{"line":124,"column":8},"end":{"line":124,"column":3343}},"8":{"start":{"line":131,"column":8},"end":{"line":131,"column":48}},"9":{"start":{"line":144,"column":8},"end":{"line":144,"column":3817}},"10":{"start":{"line":150,"column":8},"end":{"line":150,"column":48}},"11":{"start":{"line":163,"column":8},"end":{"line":163,"column":4248}},"12":{"start":{"line":169,"column":8},"end":{"line":169,"column":48}},"13":{"start":{"line":182,"column":8},"end":{"line":182,"column":4683}},"14":{"start":{"line":188,"column":8},"end":{"line":188,"column":48}},"15":{"start":{"line":201,"column":8},"end":{"line":201,"column":5118}},"16":{"start":{"line":207,"column":8},"end":{"line":207,"column":48}},"17":{"start":{"line":219,"column":8},"end":{"line":219,"column":5513}},"18":{"start":{"line":242,"column":8},"end":{"line":242,"column":6076}},"19":{"start":{"line":262,"column":8},"end":{"line":262,"column":6544}},"20":{"start":{"line":283,"column":8},"end":{"line":283,"column":7099}},"21":{"start":{"line":284,"column":12},"end":{"line":284,"column":7134}},"22":{"start":{"line":301,"column":8},"end":{"line":301,"column":7383}},"23":{"start":{"line":308,"column":8},"end":{"line":308,"column":48}},"24":{"start":{"line":320,"column":8},"end":{"line":320,"column":7782}},"25":{"start":{"line":348,"column":8},"end":{"line":348,"column":48}},"26":{"start":{"line":349,"column":8},"end":{"line":349,"column":8669}},"27":{"start":{"line":354,"column":8},"end":{"line":354,"column":8752}},"28":{"start":{"line":358,"column":15},"end":{"line":358,"column":8893}},"29":{"start":{"line":363,"column":12},"end":{"line":363,"column":29}},"30":{"start":{"line":375,"column":8},"end":{"line":375,"column":9234}}},"branchMap":{"1":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":8},"end":{"line":283,"column":8}},{"start":{"line":283,"column":8},"end":{"line":283,"column":8}}]},"2":{"line":354,"type":"if","locations":[{"start":{"line":354,"column":8},"end":{"line":354,"column":8}},{"start":{"line":354,"column":8},"end":{"line":354,"column":8}}]},"3":{"line":358,"type":"if","locations":[{"start":{"line":358,"column":15},"end":{"line":358,"column":15}},{"start":{"line":358,"column":15},"end":{"line":358,"column":15}}]}}},"contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol":{"l":{"39":0,"40":0,"42":0,"56":0,"70":0,"71":0,"73":0,"90":7,"91":0,"94":7,"95":7,"97":7,"113":0,"129":0,"130":0,"133":0,"149":0,"165":0,"166":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":7,"9":0,"10":7,"11":7,"12":7,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"b":{"1":[0,7]},"f":{"1":0,"2":0,"3":0,"4":7,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"add","line":38,"loc":{"start":{"line":38,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"sub","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":57,"column":4}}},"3":{"name":"sub","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":74,"column":4}}},"4":{"name":"mul","line":86,"loc":{"start":{"line":86,"column":4},"end":{"line":98,"column":4}}},"5":{"name":"div","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":114,"column":4}}},"6":{"name":"div","line":128,"loc":{"start":{"line":128,"column":4},"end":{"line":134,"column":4}}},"7":{"name":"mod","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":150,"column":4}}},"8":{"name":"mod","line":164,"loc":{"start":{"line":164,"column":4},"end":{"line":167,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":25}},"2":{"start":{"line":40,"column":8},"end":{"line":40,"column":100}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":16}},"4":{"start":{"line":56,"column":8},"end":{"line":56,"column":69}},"5":{"start":{"line":70,"column":8},"end":{"line":70,"column":72}},"6":{"start":{"line":71,"column":8},"end":{"line":71,"column":25}},"7":{"start":{"line":73,"column":8},"end":{"line":73,"column":16}},"8":{"start":{"line":90,"column":8},"end":{"line":90,"column":2816}},"9":{"start":{"line":91,"column":12},"end":{"line":91,"column":20}},"10":{"start":{"line":94,"column":8},"end":{"line":94,"column":25}},"11":{"start":{"line":95,"column":8},"end":{"line":95,"column":110}},"12":{"start":{"line":97,"column":8},"end":{"line":97,"column":16}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":65}},"14":{"start":{"line":129,"column":8},"end":{"line":129,"column":71}},"15":{"start":{"line":130,"column":8},"end":{"line":130,"column":25}},"16":{"start":{"line":133,"column":8},"end":{"line":133,"column":16}},"17":{"start":{"line":149,"column":8},"end":{"line":149,"column":63}},"18":{"start":{"line":165,"column":8},"end":{"line":165,"column":72}},"19":{"start":{"line":166,"column":8},"end":{"line":166,"column":20}}},"branchMap":{"1":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol":{"l":{"63":7,"69":7,"80":7,"83":7,"89":7,"102":7,"103":7,"104":7,"109":7,"115":7,"116":1,"122":1,"123":1,"125":0,"131":6,"133":6},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol","s":{"1":7,"2":7,"3":7,"4":7,"5":7,"6":7,"7":7,"8":7,"9":7,"10":7,"11":1,"12":1,"13":1,"14":0,"15":6,"16":6},"b":{"1":[1,6],"2":[1,0]},"f":{"1":7},"fnMap":{"1":{"name":"execute","line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":139,"column":4}}}},"statementMap":{"1":{"start":{"line":63,"column":8},"end":{"line":63,"column":91}},"2":{"start":{"line":69,"column":8},"end":{"line":69,"column":2653}},"3":{"start":{"line":80,"column":8},"end":{"line":80,"column":119}},"4":{"start":{"line":83,"column":8},"end":{"line":83,"column":3201}},"5":{"start":{"line":89,"column":8},"end":{"line":89,"column":3483}},"6":{"start":{"line":102,"column":8},"end":{"line":102,"column":70}},"7":{"start":{"line":103,"column":8},"end":{"line":103,"column":85}},"8":{"start":{"line":104,"column":8},"end":{"line":104,"column":4275}},"9":{"start":{"line":109,"column":8},"end":{"line":109,"column":4487}},"10":{"start":{"line":115,"column":8},"end":{"line":115,"column":4721}},"11":{"start":{"line":116,"column":12},"end":{"line":116,"column":4772}},"12":{"start":{"line":122,"column":12},"end":{"line":122,"column":5049}},"13":{"start":{"line":123,"column":16},"end":{"line":123,"column":50}},"14":{"start":{"line":125,"column":16},"end":{"line":125,"column":42}},"15":{"start":{"line":131,"column":12},"end":{"line":131,"column":76}},"16":{"start":{"line":133,"column":12},"end":{"line":133,"column":5602}}},"branchMap":{"1":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":8},"end":{"line":115,"column":8}},{"start":{"line":115,"column":8},"end":{"line":115,"column":8}}]},"2":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":12},"end":{"line":122,"column":12}},{"start":{"line":122,"column":12},"end":{"line":122,"column":12}}]}}},"contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol":{"l":{"39":13,"50":1,"56":1,"57":1,"61":0,"81":2,"86":2,"99":2,"116":15},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol","s":{"1":13,"2":1,"3":1,"4":0,"5":2,"6":2,"7":2,"8":15},"b":{"1":[1,0]},"f":{"1":13,"2":1,"3":2,"4":2,"5":15},"fnMap":{"1":{"name":"constructor","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":40,"column":4}}},"2":{"name":null,"line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":65,"column":4}}},"3":{"name":"upgrade","line":76,"loc":{"start":{"line":76,"column":4},"end":{"line":87,"column":4}}},"4":{"name":"getImplementation","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":104,"column":4}}},"5":{"name":"_setImplementation","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":120,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":42}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":1366}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":1554}},"4":{"start":{"line":61,"column":12},"end":{"line":61,"column":1704}},"5":{"start":{"line":81,"column":8},"end":{"line":81,"column":2100}},"6":{"start":{"line":86,"column":8},"end":{"line":86,"column":42}},"7":{"start":{"line":99,"column":8},"end":{"line":99,"column":2610}},"8":{"start":{"line":116,"column":8},"end":{"line":116,"column":2955}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol":{"l":{"47":4,"48":0,"65":7,"72":7,"73":7,"75":7,"76":7,"103":21,"124":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol","s":{"1":4,"2":0,"3":7,"4":7,"5":7,"6":7,"7":7,"8":21,"9":0},"b":{"1":[0,4]},"f":{"1":54,"2":4,"3":7,"4":21,"5":0},"fnMap":{"1":{"name":"constructor","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":41}}},"2":{"name":"xDomainMessageSender","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"sendMessage","line":57,"loc":{"start":{"line":57,"column":4},"end":{"line":77,"column":4}}},"4":{"name":"_getXDomainCalldata","line":91,"loc":{"start":{"line":91,"column":4},"end":{"line":110,"column":4}}},"5":{"name":"_sendXDomainMessage","line":117,"loc":{"start":{"line":117,"column":4},"end":{"line":125,"column":4}}}},"statementMap":{"1":{"start":{"line":47,"column":8},"end":{"line":47,"column":93}},"2":{"start":{"line":48,"column":8},"end":{"line":48,"column":31}},"3":{"start":{"line":65,"column":8},"end":{"line":65,"column":2352}},"4":{"start":{"line":72,"column":8},"end":{"line":72,"column":24}},"5":{"start":{"line":73,"column":8},"end":{"line":73,"column":54}},"6":{"start":{"line":75,"column":8},"end":{"line":75,"column":54}},"7":{"start":{"line":76,"column":8},"end":{"line":76,"column":41}},"8":{"start":{"line":103,"column":8},"end":{"line":103,"column":3373}},"9":{"start":{"line":124,"column":8},"end":{"line":124,"column":49}}},"branchMap":{"1":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":8}},{"start":{"line":47,"column":8},"end":{"line":47,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol":{"l":{"50":12,"51":12,"52":12,"64":9,"65":9,"66":1,"71":8,"95":8,"102":8,"110":4,"112":4,"117":3,"118":3,"119":3,"123":3,"124":3,"125":3,"130":3,"137":3,"154":2,"161":2,"166":1,"190":8,"210":8,"212":8,"238":6,"250":6,"259":5,"264":5,"268":5,"288":5},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol","s":{"1":12,"2":12,"3":12,"4":9,"5":9,"6":1,"7":8,"8":8,"9":4,"10":4,"11":3,"12":3,"13":3,"14":3,"15":3,"16":3,"17":3,"18":3,"19":2,"20":2,"21":1,"22":8,"23":8,"24":8,"25":6,"26":6,"27":5,"28":5,"29":5,"30":5},"b":{"1":[12,0],"2":[1,8],"3":[0,1],"4":[4,4],"5":[3,1],"6":[3,0],"7":[1,1],"8":[5,0]},"f":{"1":36,"2":12,"3":9,"4":8,"5":2,"6":8,"7":8,"8":6,"9":5},"fnMap":{"1":{"name":"constructor","line":39,"loc":{"start":{"line":38,"column":4},"end":{"line":40,"column":5}}},"2":{"name":"initialize","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":53,"column":4}}},"3":{"name":"onlyRelayer","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":72,"column":4}}},"4":{"name":"relayMessage","line":93,"loc":{"start":{"line":83,"column":4},"end":{"line":138,"column":4}}},"5":{"name":"replayMessage","line":144,"loc":{"start":{"line":144,"column":4},"end":{"line":167,"column":4}}},"6":{"name":"_verifyXDomainMessage","line":180,"loc":{"start":{"line":180,"column":4},"end":{"line":194,"column":4}}},"7":{"name":"_verifyStateRootProof","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":220,"column":4}}},"8":{"name":"_verifyStorageProof","line":228,"loc":{"start":{"line":228,"column":4},"end":{"line":274,"column":4}}},"9":{"name":"_sendXDomainMessage","line":281,"loc":{"start":{"line":281,"column":4},"end":{"line":293,"column":4}}}},"statementMap":{"1":{"start":{"line":50,"column":8},"end":{"line":50,"column":102}},"2":{"start":{"line":51,"column":8},"end":{"line":51,"column":65}},"3":{"start":{"line":52,"column":8},"end":{"line":52,"column":48}},"4":{"start":{"line":64,"column":8},"end":{"line":64,"column":57}},"5":{"start":{"line":65,"column":8},"end":{"line":65,"column":2460}},"6":{"start":{"line":66,"column":12},"end":{"line":66,"column":2505}},"7":{"start":{"line":95,"column":8},"end":{"line":95,"column":3142}},"8":{"start":{"line":102,"column":8},"end":{"line":102,"column":3303}},"9":{"start":{"line":110,"column":8},"end":{"line":110,"column":64}},"10":{"start":{"line":112,"column":8},"end":{"line":112,"column":3567}},"11":{"start":{"line":117,"column":8},"end":{"line":117,"column":33}},"12":{"start":{"line":118,"column":8},"end":{"line":118,"column":49}},"13":{"start":{"line":119,"column":8},"end":{"line":119,"column":48}},"14":{"start":{"line":123,"column":8},"end":{"line":123,"column":4023}},"15":{"start":{"line":124,"column":12},"end":{"line":124,"column":57}},"16":{"start":{"line":125,"column":12},"end":{"line":125,"column":52}},"17":{"start":{"line":130,"column":8},"end":{"line":130,"column":4350}},"18":{"start":{"line":137,"column":8},"end":{"line":137,"column":38}},"19":{"start":{"line":154,"column":8},"end":{"line":154,"column":4915}},"20":{"start":{"line":161,"column":8},"end":{"line":161,"column":5076}},"21":{"start":{"line":166,"column":8},"end":{"line":166,"column":54}},"22":{"start":{"line":190,"column":8},"end":{"line":190,"column":5816}},"23":{"start":{"line":210,"column":8},"end":{"line":210,"column":122}},"24":{"start":{"line":212,"column":8},"end":{"line":212,"column":6441}},"25":{"start":{"line":238,"column":8},"end":{"line":238,"column":7225}},"26":{"start":{"line":250,"column":8},"end":{"line":250,"column":7558}},"27":{"start":{"line":259,"column":8},"end":{"line":259,"column":7836}},"28":{"start":{"line":264,"column":8},"end":{"line":264,"column":7986}},"29":{"start":{"line":268,"column":8},"end":{"line":268,"column":8119}},"30":{"start":{"line":288,"column":8},"end":{"line":288,"column":8632}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]},"2":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]},"3":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":12},"end":{"line":66,"column":12}},{"start":{"line":66,"column":12},"end":{"line":66,"column":12}}]},"4":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"5":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":8},"end":{"line":112,"column":8}},{"start":{"line":112,"column":8},"end":{"line":112,"column":8}}]},"6":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"7":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":8}},{"start":{"line":161,"column":8},"end":{"line":161,"column":8}}]},"8":{"line":259,"type":"if","locations":[{"start":{"line":259,"column":8},"end":{"line":259,"column":8}},{"start":{"line":259,"column":8},"end":{"line":259,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol":{"l":{"38":2,"42":1,"58":1,"59":1,"60":3,"61":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol","s":{"1":2,"2":1,"3":1,"4":3,"5":3},"b":{"1":[1,1]},"f":{"1":6,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":30,"loc":{"start":{"line":27,"column":4},"end":{"line":31,"column":5}}},"2":{"name":"onlyBatchRelayer","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"batchRelayMessages","line":56,"loc":{"start":{"line":53,"column":4},"end":{"line":69,"column":4}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":1192}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":121}},"3":{"start":{"line":59,"column":8},"end":{"line":59,"column":1913}},"4":{"start":{"line":60,"column":12},"end":{"line":60,"column":55}},"5":{"start":{"line":61,"column":12},"end":{"line":61,"column":2035}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":8}},{"start":{"line":38,"column":8},"end":{"line":38,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol":{"l":{"59":5,"64":4,"71":4,"73":4,"78":3,"79":3,"80":3,"84":3,"85":3,"86":3,"91":3,"98":3,"117":5,"134":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol","s":{"1":5,"2":4,"3":4,"4":4,"5":3,"6":3,"7":3,"8":3,"9":3,"10":3,"11":3,"12":3,"13":5,"14":3},"b":{"1":[4,1],"2":[3,1],"3":[3,0]},"f":{"1":18,"2":5,"3":5,"4":3},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":34,"column":4},"end":{"line":38,"column":5}}},"2":{"name":"relayMessage","line":56,"loc":{"start":{"line":49,"column":4},"end":{"line":99,"column":4}}},"3":{"name":"_verifyXDomainMessage","line":110,"loc":{"start":{"line":110,"column":4},"end":{"line":120,"column":4}}},"4":{"name":"_sendXDomainMessage","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":135,"column":4}}}},"statementMap":{"1":{"start":{"line":59,"column":8},"end":{"line":59,"column":1793}},"2":{"start":{"line":64,"column":8},"end":{"line":64,"column":1922}},"3":{"start":{"line":71,"column":8},"end":{"line":71,"column":64}},"4":{"start":{"line":73,"column":8},"end":{"line":73,"column":2150}},"5":{"start":{"line":78,"column":8},"end":{"line":78,"column":33}},"6":{"start":{"line":79,"column":8},"end":{"line":79,"column":49}},"7":{"start":{"line":80,"column":8},"end":{"line":80,"column":48}},"8":{"start":{"line":84,"column":8},"end":{"line":84,"column":2606}},"9":{"start":{"line":85,"column":12},"end":{"line":85,"column":57}},"10":{"start":{"line":86,"column":12},"end":{"line":86,"column":52}},"11":{"start":{"line":91,"column":8},"end":{"line":91,"column":2933}},"12":{"start":{"line":98,"column":8},"end":{"line":98,"column":38}},"13":{"start":{"line":117,"column":8},"end":{"line":117,"column":3513}},"14":{"start":{"line":134,"column":8},"end":{"line":134,"column":93}}},"branchMap":{"1":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":8},"end":{"line":59,"column":8}},{"start":{"line":59,"column":8},"end":{"line":59,"column":8}}]},"2":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":8},"end":{"line":73,"column":8}},{"start":{"line":73,"column":8},"end":{"line":73,"column":8}}]},"3":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":8},"end":{"line":84,"column":8}},{"start":{"line":84,"column":8},"end":{"line":84,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol":{"l":{"48":24,"72":0,"91":0,"107":2,"124":1,"139":1,"158":2,"165":2,"172":2,"178":2,"202":1,"207":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol","s":{"1":24,"2":0,"3":0,"4":2,"5":1,"6":1,"7":2,"8":2,"9":2,"10":2,"11":1,"12":1},"b":{},"f":{"1":24,"2":0,"3":0,"4":2,"5":1,"6":1,"7":2,"8":1},"fnMap":{"1":{"name":"constructor","line":46,"loc":{"start":{"line":42,"column":4},"end":{"line":49,"column":4}}},"2":{"name":"_handleFinalizeWithdrawal","line":65,"loc":{"start":{"line":65,"column":4},"end":{"line":73,"column":4}}},"3":{"name":"_handleInitiateDeposit","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":92,"column":4}}},"4":{"name":"getFinalizeDepositL2Gas","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":108,"column":4}}},"5":{"name":"deposit","line":118,"loc":{"start":{"line":118,"column":4},"end":{"line":125,"column":4}}},"6":{"name":"depositTo","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"7":{"name":"_initiateDeposit","line":150,"loc":{"start":{"line":150,"column":4},"end":{"line":179,"column":4}}},"8":{"name":"finalizeWithdrawal","line":199,"loc":{"start":{"line":193,"column":4},"end":{"line":208,"column":4}}}},"statementMap":{"1":{"start":{"line":48,"column":8},"end":{"line":48,"column":43}},"2":{"start":{"line":72,"column":8},"end":{"line":72,"column":48}},"3":{"start":{"line":91,"column":8},"end":{"line":91,"column":48}},"4":{"start":{"line":107,"column":8},"end":{"line":107,"column":46}},"5":{"start":{"line":124,"column":8},"end":{"line":124,"column":56}},"6":{"start":{"line":139,"column":8},"end":{"line":139,"column":49}},"7":{"start":{"line":158,"column":8},"end":{"line":158,"column":4675}},"8":{"start":{"line":165,"column":8},"end":{"line":165,"column":4857}},"9":{"start":{"line":172,"column":8},"end":{"line":172,"column":5050}},"10":{"start":{"line":178,"column":8},"end":{"line":178,"column":50}},"11":{"start":{"line":202,"column":8},"end":{"line":202,"column":5940}},"12":{"start":{"line":207,"column":8},"end":{"line":207,"column":46}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol":{"l":{"64":8,"66":8,"68":8,"76":5,"77":5,"102":0,"119":0,"136":9,"155":1,"171":1,"187":2,"190":2,"197":2,"203":2,"227":1,"228":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol","s":{"1":8,"2":8,"3":8,"4":5,"5":0,"6":0,"7":9,"8":1,"9":1,"10":2,"11":2,"12":2,"13":2,"14":1,"15":1},"b":{"1":[8,0],"2":[5,0]},"f":{"1":30,"2":8,"3":5,"4":0,"5":0,"6":9,"7":1,"8":1,"9":2,"10":1},"fnMap":{"1":{"name":"constructor","line":48,"loc":{"start":{"line":45,"column":4},"end":{"line":49,"column":5}}},"2":{"name":"init","line":59,"loc":{"start":{"line":59,"column":4},"end":{"line":69,"column":4}}},"3":{"name":"onlyInitialized","line":75,"loc":{"start":{"line":75,"column":4},"end":{"line":78,"column":4}}},"4":{"name":"_handleInitiateWithdrawal","line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":103,"column":4}}},"5":{"name":"_handleFinalizeDeposit","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":120,"column":4}}},"6":{"name":"getFinalizeWithdrawalL1Gas","line":128,"loc":{"start":{"line":128,"column":4},"end":{"line":137,"column":4}}},"7":{"name":"withdraw","line":153,"loc":{"start":{"line":148,"column":4},"end":{"line":156,"column":4}}},"8":{"name":"withdrawTo","line":169,"loc":{"start":{"line":163,"column":4},"end":{"line":172,"column":4}}},"9":{"name":"_initiateWithdrawal","line":180,"loc":{"start":{"line":180,"column":4},"end":{"line":204,"column":4}}},"10":{"name":"finalizeDeposit","line":225,"loc":{"start":{"line":218,"column":4},"end":{"line":229,"column":4}}}},"statementMap":{"1":{"start":{"line":64,"column":8},"end":{"line":64,"column":94}},"2":{"start":{"line":66,"column":8},"end":{"line":66,"column":39}},"3":{"start":{"line":68,"column":8},"end":{"line":68,"column":40}},"4":{"start":{"line":76,"column":8},"end":{"line":76,"column":94}},"5":{"start":{"line":102,"column":8},"end":{"line":102,"column":66}},"6":{"start":{"line":119,"column":8},"end":{"line":119,"column":66}},"7":{"start":{"line":136,"column":8},"end":{"line":136,"column":49}},"8":{"start":{"line":155,"column":8},"end":{"line":155,"column":47}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":40}},"10":{"start":{"line":187,"column":8},"end":{"line":187,"column":46}},"11":{"start":{"line":190,"column":8},"end":{"line":190,"column":5686}},"12":{"start":{"line":197,"column":8},"end":{"line":197,"column":5888}},"13":{"start":{"line":203,"column":8},"end":{"line":203,"column":58}},"14":{"start":{"line":227,"column":8},"end":{"line":227,"column":43}},"15":{"start":{"line":228,"column":8},"end":{"line":228,"column":43}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"2":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol":{"l":{"51":24,"76":2,"98":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol","s":{"1":24,"2":2,"3":1},"b":{},"f":{"1":24,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":49,"loc":{"start":{"line":41,"column":4},"end":{"line":52,"column":4}}},"2":{"name":"_handleInitiateDeposit","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":81,"column":4}}},"3":{"name":"_handleFinalizeWithdrawal","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":99,"column":4}}}},"statementMap":{"1":{"start":{"line":51,"column":8},"end":{"line":51,"column":25}},"2":{"start":{"line":76,"column":8},"end":{"line":76,"column":2273}},"3":{"start":{"line":98,"column":8},"end":{"line":98,"column":37}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol":{"l":{"50":24,"51":24,"62":0,"73":2,"87":1,"103":3,"111":3,"117":3,"140":1,"142":1,"161":1,"162":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol","s":{"1":24,"2":24,"3":2,"4":1,"5":3,"6":3,"7":3,"8":1,"9":1,"10":1,"11":1},"b":{"1":[1,0]},"f":{"1":24,"2":2,"3":1,"4":3,"5":1,"6":1},"fnMap":{"1":{"name":"constructor","line":48,"loc":{"start":{"line":43,"column":4},"end":{"line":52,"column":4}}},"2":{"name":"deposit","line":68,"loc":{"start":{"line":68,"column":4},"end":{"line":74,"column":4}}},"3":{"name":"depositTo","line":80,"loc":{"start":{"line":80,"column":4},"end":{"line":88,"column":4}}},"4":{"name":"_initiateDeposit","line":96,"loc":{"start":{"line":96,"column":4},"end":{"line":118,"column":4}}},"5":{"name":"finalizeWithdrawal","line":138,"loc":{"start":{"line":132,"column":4},"end":{"line":143,"column":4}}},"6":{"name":"_safeTransferETH","line":155,"loc":{"start":{"line":155,"column":4},"end":{"line":163,"column":4}}}},"statementMap":{"1":{"start":{"line":50,"column":8},"end":{"line":50,"column":23}},"2":{"start":{"line":51,"column":8},"end":{"line":51,"column":63}},"3":{"start":{"line":73,"column":8},"end":{"line":73,"column":47}},"4":{"start":{"line":87,"column":8},"end":{"line":87,"column":40}},"5":{"start":{"line":103,"column":8},"end":{"line":103,"column":2878}},"6":{"start":{"line":111,"column":8},"end":{"line":111,"column":3097}},"7":{"start":{"line":117,"column":8},"end":{"line":117,"column":52}},"8":{"start":{"line":140,"column":8},"end":{"line":140,"column":37}},"9":{"start":{"line":142,"column":8},"end":{"line":142,"column":46}},"10":{"start":{"line":161,"column":8},"end":{"line":161,"column":64}},"11":{"start":{"line":162,"column":8},"end":{"line":162,"column":79}}},"branchMap":{"1":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol":{"l":{"54":2,"65":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol","s":{"1":2,"2":1},"b":{},"f":{"1":30,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":43,"loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":5}}},"2":{"name":"_handleInitiateWithdrawal","line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":55,"column":4}}},"3":{"name":"_handleFinalizeDeposit","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":66,"column":4}}}},"statementMap":{"1":{"start":{"line":54,"column":8},"end":{"line":54,"column":33}},"2":{"start":{"line":65,"column":8},"end":{"line":65,"column":26}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol":{"l":{"73":222,"74":222,"75":222,"95":559,"112":382,"129":291,"130":291,"145":0,"160":100,"161":100,"176":0,"177":0,"192":0,"193":0,"211":47,"229":0,"245":0,"264":239,"269":238,"274":237,"282":236,"283":236,"287":236,"294":235,"295":235,"296":37600,"299":235,"308":235,"309":235,"314":235,"316":235,"317":235,"322":235,"323":235,"345":1,"397":104,"398":104,"399":104,"400":104,"406":104,"411":103,"416":102,"421":101,"426":100,"428":100,"436":100,"437":100,"442":100,"445":100,"448":100,"451":100,"455":100,"457":100,"458":100,"459":232,"461":232,"463":100,"467":226,"475":221,"478":221,"479":439,"480":439,"484":439,"491":439,"492":439,"493":439,"497":221,"498":179,"503":178,"504":178,"505":178,"509":88,"516":82,"521":81,"527":81,"528":81,"529":81,"530":81,"532":39,"533":39,"539":42,"544":42,"545":42,"551":81,"559":81,"587":2,"588":1,"595":1,"623":232,"624":232,"625":232,"626":232,"627":232,"629":232,"636":232,"659":476,"661":476,"662":476,"663":476,"664":476,"665":476,"673":476,"701":81,"702":81,"710":81,"727":179,"756":267,"757":267,"758":265,"760":265,"761":265,"762":265,"767":265,"790":100,"813":439,"814":419,"817":439,"818":439,"820":439,"821":439,"838":439,"855":1,"856":1,"858":1,"859":1,"860":1,"862":1,"863":1,"880":1,"900":81,"901":81,"903":81,"911":81,"919":81,"920":81,"927":81,"942":100,"943":4,"945":4,"950":2,"957":96,"962":95,"982":178,"988":177,"995":176,"1000":174,"1023":226,"1028":225,"1034":224,"1035":175,"1060":88,"1061":3,"1068":85,"1069":83,"1086":179,"1117":1,"1118":1,"1119":1,"1121":1,"1130":1,"1141":1,"1164":1,"1166":1,"1175":1,"1184":1,"1185":1,"1192":1,"1212":2,"1217":2,"1228":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol","s":{"1":222,"2":222,"3":222,"4":559,"5":382,"6":291,"7":291,"8":0,"9":100,"10":100,"11":0,"12":0,"13":0,"14":0,"15":47,"16":0,"17":0,"18":239,"19":238,"20":237,"21":236,"22":236,"23":236,"24":235,"25":235,"26":235,"27":235,"28":235,"29":235,"30":235,"31":235,"32":235,"33":1,"34":104,"35":104,"36":104,"37":104,"38":103,"39":102,"40":101,"41":100,"42":100,"43":100,"44":100,"45":100,"46":100,"47":100,"48":100,"49":100,"50":100,"51":100,"52":232,"53":232,"54":100,"55":226,"56":221,"57":221,"58":439,"59":439,"60":439,"61":221,"62":179,"63":178,"64":88,"65":82,"66":81,"67":81,"68":81,"69":81,"70":81,"71":39,"72":39,"73":42,"74":42,"75":42,"76":81,"77":81,"78":2,"79":1,"80":1,"81":232,"82":232,"83":232,"84":232,"85":232,"86":232,"87":476,"88":476,"89":476,"90":476,"91":476,"92":476,"93":81,"94":81,"95":179,"96":267,"97":267,"98":265,"99":265,"100":265,"101":265,"102":100,"103":439,"104":419,"105":439,"106":439,"107":439,"108":439,"109":1,"110":1,"111":1,"112":1,"113":1,"114":1,"115":1,"116":81,"117":81,"118":81,"119":81,"120":81,"121":81,"122":81,"123":100,"124":4,"125":4,"126":2,"127":96,"128":95,"129":178,"130":177,"131":176,"132":174,"133":226,"134":225,"135":224,"136":175,"137":88,"138":3,"139":85,"140":83,"141":179,"142":1,"143":1,"144":1,"145":1,"146":1,"147":1,"148":1,"149":1,"150":1,"151":1,"152":1,"153":1,"154":2,"155":2,"156":2},"b":{"1":[238,1],"2":[237,1],"3":[236,1],"4":[235,1],"5":[103,1],"6":[102,1],"7":[101,1],"8":[100,1],"9":[100,0],"10":[100,132],"11":[178,1],"12":[81,1],"13":[81,0],"14":[39,42],"15":[1,1],"16":[419,20],"17":[4,96],"18":[2,2],"19":[0,2],"20":[95,1],"21":[94,1],"22":[176,1],"23":[174,2],"24":[172,2],"25":[225,1],"26":[224,1],"27":[175,49],"28":[3,85],"29":[83,2],"30":[82,1],"31":[1,0],"32":[1,0],"33":[1,0],"34":[1,0],"35":[2,0],"36":[2,0]},"f":{"1":222,"2":559,"3":382,"4":291,"5":0,"6":100,"7":0,"8":0,"9":47,"10":0,"11":0,"12":239,"13":1,"14":104,"15":2,"16":232,"17":476,"18":81,"19":179,"20":267,"21":100,"22":439,"23":1,"24":81,"25":100,"26":178,"27":226,"28":88,"29":179,"30":1,"31":1,"32":2},"fnMap":{"1":{"name":"constructor","line":71,"loc":{"start":{"line":65,"column":4},"end":{"line":76,"column":4}}},"2":{"name":"batches","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":98,"column":4}}},"3":{"name":"queue","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":115,"column":4}}},"4":{"name":"getTotalElements","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":131,"column":4}}},"5":{"name":"getTotalBatches","line":137,"loc":{"start":{"line":137,"column":4},"end":{"line":146,"column":4}}},"6":{"name":"getNextQueueIndex","line":152,"loc":{"start":{"line":152,"column":4},"end":{"line":162,"column":4}}},"7":{"name":"getLastTimestamp","line":168,"loc":{"start":{"line":168,"column":4},"end":{"line":178,"column":4}}},"8":{"name":"getLastBlockNumber","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":194,"column":4}}},"9":{"name":"getQueueElement","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":215,"column":4}}},"10":{"name":"getNumPendingQueueElements","line":221,"loc":{"start":{"line":221,"column":4},"end":{"line":230,"column":4}}},"11":{"name":"getQueueLength","line":237,"loc":{"start":{"line":237,"column":4},"end":{"line":248,"column":4}}},"12":{"name":"enqueue","line":256,"loc":{"start":{"line":256,"column":4},"end":{"line":331,"column":4}}},"13":{"name":"appendQueueBatch","line":337,"loc":{"start":{"line":337,"column":4},"end":{"line":383,"column":4}}},"14":{"name":"appendSequencerBatch","line":393,"loc":{"start":{"line":393,"column":4},"end":{"line":564,"column":4}}},"15":{"name":"verifyTransaction","line":574,"loc":{"start":{"line":574,"column":4},"end":{"line":602,"column":4}}},"16":{"name":"_getBatchContext","line":614,"loc":{"start":{"line":614,"column":4},"end":{"line":642,"column":4}}},"17":{"name":"_getBatchExtraData","line":649,"loc":{"start":{"line":649,"column":4},"end":{"line":679,"column":4}}},"18":{"name":"_makeBatchExtraData","line":689,"loc":{"start":{"line":689,"column":4},"end":{"line":711,"column":4}}},"19":{"name":"_getQueueLeafHash","line":718,"loc":{"start":{"line":718,"column":4},"end":{"line":736,"column":4}}},"20":{"name":"_getQueueElement","line":743,"loc":{"start":{"line":743,"column":4},"end":{"line":772,"column":4}}},"21":{"name":"_getQueueLength","line":778,"loc":{"start":{"line":778,"column":4},"end":{"line":791,"column":4}}},"22":{"name":"_getSequencerLeafHash","line":800,"loc":{"start":{"line":800,"column":4},"end":{"line":839,"column":4}}},"23":{"name":"_getSequencerLeafHash","line":846,"loc":{"start":{"line":846,"column":4},"end":{"line":881,"column":4}}},"24":{"name":"_appendBatch","line":891,"loc":{"start":{"line":891,"column":4},"end":{"line":928,"column":4}}},"25":{"name":"_validateFirstBatchContext","line":934,"loc":{"start":{"line":934,"column":4},"end":{"line":966,"column":4}}},"26":{"name":"_validateContextBeforeEnqueue","line":974,"loc":{"start":{"line":974,"column":4},"end":{"line":1004,"column":4}}},"27":{"name":"_validateNextBatchContext","line":1013,"loc":{"start":{"line":1013,"column":4},"end":{"line":1041,"column":4}}},"28":{"name":"_validateFinalBatchContext","line":1050,"loc":{"start":{"line":1050,"column":4},"end":{"line":1070,"column":4}}},"29":{"name":"_hashTransactionChainElement","line":1077,"loc":{"start":{"line":1077,"column":4},"end":{"line":1095,"column":4}}},"30":{"name":"_verifySequencerTransaction","line":1105,"loc":{"start":{"line":1105,"column":4},"end":{"line":1142,"column":4}}},"31":{"name":"_verifyQueueTransaction","line":1152,"loc":{"start":{"line":1152,"column":4},"end":{"line":1193,"column":4}}},"32":{"name":"_verifyElement","line":1201,"loc":{"start":{"line":1201,"column":4},"end":{"line":1229,"column":4}}}},"statementMap":{"1":{"start":{"line":73,"column":8},"end":{"line":73,"column":65}},"2":{"start":{"line":74,"column":8},"end":{"line":74,"column":63}},"3":{"start":{"line":75,"column":8},"end":{"line":75,"column":55}},"4":{"start":{"line":95,"column":8},"end":{"line":95,"column":3203}},"5":{"start":{"line":112,"column":8},"end":{"line":112,"column":3582}},"6":{"start":{"line":129,"column":8},"end":{"line":129,"column":56}},"7":{"start":{"line":130,"column":8},"end":{"line":130,"column":37}},"8":{"start":{"line":145,"column":8},"end":{"line":145,"column":33}},"9":{"start":{"line":160,"column":8},"end":{"line":160,"column":57}},"10":{"start":{"line":161,"column":8},"end":{"line":161,"column":29}},"11":{"start":{"line":176,"column":8},"end":{"line":176,"column":56}},"12":{"start":{"line":177,"column":8},"end":{"line":177,"column":28}},"13":{"start":{"line":192,"column":8},"end":{"line":192,"column":58}},"14":{"start":{"line":193,"column":8},"end":{"line":193,"column":30}},"15":{"start":{"line":211,"column":8},"end":{"line":211,"column":5827}},"16":{"start":{"line":229,"column":8},"end":{"line":229,"column":53}},"17":{"start":{"line":245,"column":8},"end":{"line":245,"column":6538}},"18":{"start":{"line":264,"column":8},"end":{"line":264,"column":6982}},"19":{"start":{"line":269,"column":8},"end":{"line":269,"column":7135}},"20":{"start":{"line":274,"column":8},"end":{"line":274,"column":7289}},"21":{"start":{"line":282,"column":8},"end":{"line":282,"column":64}},"22":{"start":{"line":283,"column":8},"end":{"line":283,"column":39}},"23":{"start":{"line":287,"column":8},"end":{"line":287,"column":7932}},"24":{"start":{"line":294,"column":8},"end":{"line":294,"column":17}},"25":{"start":{"line":295,"column":8},"end":{"line":295,"column":8239}},"26":{"start":{"line":299,"column":8},"end":{"line":299,"column":8324}},"27":{"start":{"line":308,"column":8},"end":{"line":308,"column":39}},"28":{"start":{"line":314,"column":8},"end":{"line":314,"column":53}},"29":{"start":{"line":316,"column":8},"end":{"line":316,"column":37}},"30":{"start":{"line":317,"column":8},"end":{"line":317,"column":45}},"31":{"start":{"line":322,"column":8},"end":{"line":322,"column":54}},"32":{"start":{"line":323,"column":8},"end":{"line":323,"column":9103}},"33":{"start":{"line":345,"column":8},"end":{"line":345,"column":56}},"34":{"start":{"line":397,"column":8},"end":{"line":397,"column":35}},"35":{"start":{"line":398,"column":8},"end":{"line":398,"column":36}},"36":{"start":{"line":399,"column":8},"end":{"line":399,"column":26}},"37":{"start":{"line":406,"column":8},"end":{"line":406,"column":12031}},"38":{"start":{"line":411,"column":8},"end":{"line":411,"column":12192}},"39":{"start":{"line":416,"column":8},"end":{"line":416,"column":12333}},"40":{"start":{"line":421,"column":8},"end":{"line":421,"column":12446}},"41":{"start":{"line":426,"column":8},"end":{"line":426,"column":102}},"42":{"start":{"line":428,"column":8},"end":{"line":428,"column":12667}},"43":{"start":{"line":436,"column":8},"end":{"line":436,"column":53}},"44":{"start":{"line":437,"column":8},"end":{"line":437,"column":54}},"45":{"start":{"line":442,"column":8},"end":{"line":442,"column":90}},"46":{"start":{"line":445,"column":8},"end":{"line":445,"column":70}},"47":{"start":{"line":448,"column":8},"end":{"line":448,"column":28}},"48":{"start":{"line":451,"column":8},"end":{"line":451,"column":43}},"49":{"start":{"line":455,"column":8},"end":{"line":455,"column":51}},"50":{"start":{"line":457,"column":8},"end":{"line":457,"column":38}},"51":{"start":{"line":458,"column":8},"end":{"line":458,"column":14097}},"52":{"start":{"line":459,"column":12},"end":{"line":459,"column":65}},"53":{"start":{"line":461,"column":12},"end":{"line":461,"column":14224}},"54":{"start":{"line":463,"column":16},"end":{"line":463,"column":54}},"55":{"start":{"line":467,"column":12},"end":{"line":467,"column":14468}},"56":{"start":{"line":475,"column":12},"end":{"line":475,"column":35}},"57":{"start":{"line":478,"column":12},"end":{"line":478,"column":14783}},"58":{"start":{"line":479,"column":16},"end":{"line":479,"column":36}},"59":{"start":{"line":484,"column":16},"end":{"line":484,"column":15033}},"60":{"start":{"line":491,"column":16},"end":{"line":491,"column":79}},"61":{"start":{"line":497,"column":12},"end":{"line":497,"column":15473}},"62":{"start":{"line":498,"column":16},"end":{"line":498,"column":15566}},"63":{"start":{"line":503,"column":16},"end":{"line":503,"column":68}},"64":{"start":{"line":509,"column":8},"end":{"line":509,"column":15868}},"65":{"start":{"line":516,"column":8},"end":{"line":516,"column":16014}},"66":{"start":{"line":521,"column":8},"end":{"line":521,"column":16155}},"67":{"start":{"line":527,"column":8},"end":{"line":527,"column":87}},"68":{"start":{"line":528,"column":8},"end":{"line":528,"column":29}},"69":{"start":{"line":529,"column":8},"end":{"line":529,"column":26}},"70":{"start":{"line":530,"column":8},"end":{"line":530,"column":16545}},"71":{"start":{"line":532,"column":12},"end":{"line":532,"column":56}},"72":{"start":{"line":533,"column":12},"end":{"line":533,"column":55}},"73":{"start":{"line":539,"column":12},"end":{"line":539,"column":17265}},"74":{"start":{"line":544,"column":12},"end":{"line":544,"column":49}},"75":{"start":{"line":545,"column":12},"end":{"line":545,"column":48}},"76":{"start":{"line":551,"column":8},"end":{"line":551,"column":17737}},"77":{"start":{"line":559,"column":8},"end":{"line":559,"column":17944}},"78":{"start":{"line":587,"column":8},"end":{"line":587,"column":18958}},"79":{"start":{"line":588,"column":12},"end":{"line":588,"column":19018}},"80":{"start":{"line":595,"column":12},"end":{"line":595,"column":19223}},"81":{"start":{"line":623,"column":8},"end":{"line":623,"column":61}},"82":{"start":{"line":624,"column":8},"end":{"line":624,"column":40}},"83":{"start":{"line":625,"column":8},"end":{"line":625,"column":46}},"84":{"start":{"line":626,"column":8},"end":{"line":626,"column":28}},"85":{"start":{"line":627,"column":8},"end":{"line":627,"column":30}},"86":{"start":{"line":636,"column":8},"end":{"line":636,"column":20452}},"87":{"start":{"line":659,"column":8},"end":{"line":659,"column":57}},"88":{"start":{"line":661,"column":8},"end":{"line":661,"column":28}},"89":{"start":{"line":662,"column":8},"end":{"line":662,"column":29}},"90":{"start":{"line":663,"column":8},"end":{"line":663,"column":28}},"91":{"start":{"line":664,"column":8},"end":{"line":664,"column":30}},"92":{"start":{"line":673,"column":8},"end":{"line":673,"column":21814}},"93":{"start":{"line":701,"column":8},"end":{"line":701,"column":25}},"94":{"start":{"line":710,"column":8},"end":{"line":710,"column":24}},"95":{"start":{"line":727,"column":8},"end":{"line":727,"column":23233}},"96":{"start":{"line":756,"column":8},"end":{"line":756,"column":45}},"97":{"start":{"line":757,"column":8},"end":{"line":757,"column":58}},"98":{"start":{"line":758,"column":8},"end":{"line":758,"column":70}},"99":{"start":{"line":760,"column":8},"end":{"line":760,"column":31}},"100":{"start":{"line":761,"column":8},"end":{"line":761,"column":33}},"101":{"start":{"line":767,"column":8},"end":{"line":767,"column":24663}},"102":{"start":{"line":790,"column":8},"end":{"line":790,"column":45}},"103":{"start":{"line":813,"column":8},"end":{"line":813,"column":25984}},"104":{"start":{"line":814,"column":12},"end":{"line":814,"column":70}},"105":{"start":{"line":817,"column":8},"end":{"line":817,"column":49}},"106":{"start":{"line":818,"column":8},"end":{"line":818,"column":53}},"107":{"start":{"line":820,"column":8},"end":{"line":820,"column":24}},"108":{"start":{"line":838,"column":8},"end":{"line":838,"column":23}},"109":{"start":{"line":855,"column":8},"end":{"line":855,"column":52}},"110":{"start":{"line":856,"column":8},"end":{"line":856,"column":60}},"111":{"start":{"line":858,"column":8},"end":{"line":858,"column":80}},"112":{"start":{"line":859,"column":8},"end":{"line":859,"column":56}},"113":{"start":{"line":860,"column":8},"end":{"line":860,"column":60}},"114":{"start":{"line":862,"column":8},"end":{"line":862,"column":24}},"115":{"start":{"line":880,"column":8},"end":{"line":880,"column":23}},"116":{"start":{"line":900,"column":8},"end":{"line":900,"column":57}},"117":{"start":{"line":901,"column":8},"end":{"line":901,"column":78}},"118":{"start":{"line":903,"column":8},"end":{"line":903,"column":29394}},"119":{"start":{"line":911,"column":8},"end":{"line":911,"column":29688}},"120":{"start":{"line":919,"column":8},"end":{"line":919,"column":70}},"121":{"start":{"line":920,"column":8},"end":{"line":920,"column":29969}},"122":{"start":{"line":927,"column":8},"end":{"line":927,"column":59}},"123":{"start":{"line":942,"column":8},"end":{"line":942,"column":30681}},"124":{"start":{"line":943,"column":12},"end":{"line":943,"column":84}},"125":{"start":{"line":945,"column":12},"end":{"line":945,"column":30814}},"126":{"start":{"line":950,"column":12},"end":{"line":950,"column":30982}},"127":{"start":{"line":957,"column":8},"end":{"line":957,"column":31241}},"128":{"start":{"line":962,"column":8},"end":{"line":962,"column":31409}},"129":{"start":{"line":982,"column":12},"end":{"line":982,"column":32133}},"130":{"start":{"line":988,"column":12},"end":{"line":988,"column":32405}},"131":{"start":{"line":995,"column":12},"end":{"line":995,"column":32840}},"132":{"start":{"line":1000,"column":12},"end":{"line":1000,"column":33029}},"133":{"start":{"line":1023,"column":8},"end":{"line":1023,"column":34010}},"134":{"start":{"line":1028,"column":8},"end":{"line":1028,"column":34169}},"135":{"start":{"line":1034,"column":8},"end":{"line":1034,"column":34414}},"136":{"start":{"line":1035,"column":12},"end":{"line":1035,"column":34485}},"137":{"start":{"line":1060,"column":8},"end":{"line":1060,"column":35385}},"138":{"start":{"line":1061,"column":12},"end":{"line":1061,"column":35496}},"139":{"start":{"line":1068,"column":8},"end":{"line":1068,"column":99}},"140":{"start":{"line":1069,"column":8},"end":{"line":1069,"column":101}},"141":{"start":{"line":1086,"column":8},"end":{"line":1086,"column":36314}},"142":{"start":{"line":1117,"column":8},"end":{"line":1117,"column":104}},"143":{"start":{"line":1118,"column":8},"end":{"line":1118,"column":74}},"144":{"start":{"line":1119,"column":8},"end":{"line":1119,"column":65}},"145":{"start":{"line":1121,"column":8},"end":{"line":1121,"column":37737}},"146":{"start":{"line":1130,"column":8},"end":{"line":1130,"column":37958}},"147":{"start":{"line":1141,"column":8},"end":{"line":1141,"column":19}},"148":{"start":{"line":1164,"column":8},"end":{"line":1164,"column":57}},"149":{"start":{"line":1166,"column":8},"end":{"line":1166,"column":39506}},"150":{"start":{"line":1175,"column":8},"end":{"line":1175,"column":39724}},"151":{"start":{"line":1184,"column":8},"end":{"line":1184,"column":74}},"152":{"start":{"line":1185,"column":8},"end":{"line":1185,"column":40049}},"153":{"start":{"line":1192,"column":8},"end":{"line":1192,"column":19}},"154":{"start":{"line":1212,"column":8},"end":{"line":1212,"column":40839}},"155":{"start":{"line":1217,"column":8},"end":{"line":1217,"column":41010}},"156":{"start":{"line":1228,"column":8},"end":{"line":1228,"column":19}}},"branchMap":{"1":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":8},"end":{"line":264,"column":8}},{"start":{"line":264,"column":8},"end":{"line":264,"column":8}}]},"2":{"line":269,"type":"if","locations":[{"start":{"line":269,"column":8},"end":{"line":269,"column":8}},{"start":{"line":269,"column":8},"end":{"line":269,"column":8}}]},"3":{"line":274,"type":"if","locations":[{"start":{"line":274,"column":8},"end":{"line":274,"column":8}},{"start":{"line":274,"column":8},"end":{"line":274,"column":8}}]},"4":{"line":287,"type":"if","locations":[{"start":{"line":287,"column":8},"end":{"line":287,"column":8}},{"start":{"line":287,"column":8},"end":{"line":287,"column":8}}]},"5":{"line":406,"type":"if","locations":[{"start":{"line":406,"column":8},"end":{"line":406,"column":8}},{"start":{"line":406,"column":8},"end":{"line":406,"column":8}}]},"6":{"line":411,"type":"if","locations":[{"start":{"line":411,"column":8},"end":{"line":411,"column":8}},{"start":{"line":411,"column":8},"end":{"line":411,"column":8}}]},"7":{"line":416,"type":"if","locations":[{"start":{"line":416,"column":8},"end":{"line":416,"column":8}},{"start":{"line":416,"column":8},"end":{"line":416,"column":8}}]},"8":{"line":421,"type":"if","locations":[{"start":{"line":421,"column":8},"end":{"line":421,"column":8}},{"start":{"line":421,"column":8},"end":{"line":421,"column":8}}]},"9":{"line":428,"type":"if","locations":[{"start":{"line":428,"column":8},"end":{"line":428,"column":8}},{"start":{"line":428,"column":8},"end":{"line":428,"column":8}}]},"10":{"line":461,"type":"if","locations":[{"start":{"line":461,"column":12},"end":{"line":461,"column":12}},{"start":{"line":461,"column":12},"end":{"line":461,"column":12}}]},"11":{"line":498,"type":"if","locations":[{"start":{"line":498,"column":16},"end":{"line":498,"column":16}},{"start":{"line":498,"column":16},"end":{"line":498,"column":16}}]},"12":{"line":516,"type":"if","locations":[{"start":{"line":516,"column":8},"end":{"line":516,"column":8}},{"start":{"line":516,"column":8},"end":{"line":516,"column":8}}]},"13":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":8},"end":{"line":521,"column":8}},{"start":{"line":521,"column":8},"end":{"line":521,"column":8}}]},"14":{"line":530,"type":"if","locations":[{"start":{"line":530,"column":8},"end":{"line":530,"column":8}},{"start":{"line":530,"column":8},"end":{"line":530,"column":8}}]},"15":{"line":587,"type":"if","locations":[{"start":{"line":587,"column":8},"end":{"line":587,"column":8}},{"start":{"line":587,"column":8},"end":{"line":587,"column":8}}]},"16":{"line":813,"type":"if","locations":[{"start":{"line":813,"column":8},"end":{"line":813,"column":8}},{"start":{"line":813,"column":8},"end":{"line":813,"column":8}}]},"17":{"line":942,"type":"if","locations":[{"start":{"line":942,"column":8},"end":{"line":942,"column":8}},{"start":{"line":942,"column":8},"end":{"line":942,"column":8}}]},"18":{"line":945,"type":"if","locations":[{"start":{"line":945,"column":12},"end":{"line":945,"column":12}},{"start":{"line":945,"column":12},"end":{"line":945,"column":12}}]},"19":{"line":950,"type":"if","locations":[{"start":{"line":950,"column":12},"end":{"line":950,"column":12}},{"start":{"line":950,"column":12},"end":{"line":950,"column":12}}]},"20":{"line":957,"type":"if","locations":[{"start":{"line":957,"column":8},"end":{"line":957,"column":8}},{"start":{"line":957,"column":8},"end":{"line":957,"column":8}}]},"21":{"line":962,"type":"if","locations":[{"start":{"line":962,"column":8},"end":{"line":962,"column":8}},{"start":{"line":962,"column":8},"end":{"line":962,"column":8}}]},"22":{"line":988,"type":"if","locations":[{"start":{"line":988,"column":12},"end":{"line":988,"column":12}},{"start":{"line":988,"column":12},"end":{"line":988,"column":12}}]},"23":{"line":995,"type":"if","locations":[{"start":{"line":995,"column":12},"end":{"line":995,"column":12}},{"start":{"line":995,"column":12},"end":{"line":995,"column":12}}]},"24":{"line":1000,"type":"if","locations":[{"start":{"line":1000,"column":12},"end":{"line":1000,"column":12}},{"start":{"line":1000,"column":12},"end":{"line":1000,"column":12}}]},"25":{"line":1023,"type":"if","locations":[{"start":{"line":1023,"column":8},"end":{"line":1023,"column":8}},{"start":{"line":1023,"column":8},"end":{"line":1023,"column":8}}]},"26":{"line":1028,"type":"if","locations":[{"start":{"line":1028,"column":8},"end":{"line":1028,"column":8}},{"start":{"line":1028,"column":8},"end":{"line":1028,"column":8}}]},"27":{"line":1034,"type":"if","locations":[{"start":{"line":1034,"column":8},"end":{"line":1034,"column":8}},{"start":{"line":1034,"column":8},"end":{"line":1034,"column":8}}]},"28":{"line":1060,"type":"if","locations":[{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}},{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}}]},"29":{"line":1068,"type":"if","locations":[{"start":{"line":1068,"column":8},"end":{"line":1068,"column":8}},{"start":{"line":1068,"column":8},"end":{"line":1068,"column":8}}]},"30":{"line":1069,"type":"if","locations":[{"start":{"line":1069,"column":8},"end":{"line":1069,"column":8}},{"start":{"line":1069,"column":8},"end":{"line":1069,"column":8}}]},"31":{"line":1121,"type":"if","locations":[{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}},{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}}]},"32":{"line":1130,"type":"if","locations":[{"start":{"line":1130,"column":8},"end":{"line":1130,"column":8}},{"start":{"line":1130,"column":8},"end":{"line":1130,"column":8}}]},"33":{"line":1166,"type":"if","locations":[{"start":{"line":1166,"column":8},"end":{"line":1166,"column":8}},{"start":{"line":1166,"column":8},"end":{"line":1166,"column":8}}]},"34":{"line":1185,"type":"if","locations":[{"start":{"line":1185,"column":8},"end":{"line":1185,"column":8}},{"start":{"line":1185,"column":8},"end":{"line":1185,"column":8}}]},"35":{"line":1212,"type":"if","locations":[{"start":{"line":1212,"column":8},"end":{"line":1212,"column":8}},{"start":{"line":1212,"column":8},"end":{"line":1212,"column":8}}]},"36":{"line":1217,"type":"if","locations":[{"start":{"line":1217,"column":8},"end":{"line":1217,"column":8}},{"start":{"line":1217,"column":8},"end":{"line":1217,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol":{"l":{"56":504,"65":573,"69":573,"87":0,"101":550,"115":441,"128":470,"142":102,"158":538,"171":0,"187":1,"203":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol","s":{"1":504,"2":573,"3":0,"4":550,"5":441,"6":470,"7":102,"8":538,"9":0,"10":1,"11":0},"b":{"1":[573,0]},"f":{"1":504,"2":573,"3":0,"4":550,"5":441,"6":470,"7":102,"8":538,"9":0,"10":1,"11":0},"fnMap":{"1":{"name":"constructor","line":54,"loc":{"start":{"line":50,"column":4},"end":{"line":57,"column":4}}},"2":{"name":"onlyOwner","line":64,"loc":{"start":{"line":64,"column":4},"end":{"line":70,"column":4}}},"3":{"name":"setGlobalMetadata","line":85,"loc":{"start":{"line":80,"column":4},"end":{"line":88,"column":4}}},"4":{"name":"getGlobalMetadata","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":102,"column":4}}},"5":{"name":"length","line":107,"loc":{"start":{"line":107,"column":4},"end":{"line":116,"column":4}}},"6":{"name":"push","line":126,"loc":{"start":{"line":121,"column":4},"end":{"line":129,"column":4}}},"7":{"name":"push","line":140,"loc":{"start":{"line":134,"column":4},"end":{"line":143,"column":4}}},"8":{"name":"get","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":159,"column":4}}},"9":{"name":"deleteElementsAfterInclusive","line":169,"loc":{"start":{"line":164,"column":4},"end":{"line":174,"column":4}}},"10":{"name":"deleteElementsAfterInclusive","line":185,"loc":{"start":{"line":179,"column":4},"end":{"line":191,"column":4}}},"11":{"name":"setNextOverwritableIndex","line":201,"loc":{"start":{"line":196,"column":4},"end":{"line":204,"column":4}}}},"statementMap":{"1":{"start":{"line":56,"column":8},"end":{"line":56,"column":21}},"2":{"start":{"line":65,"column":8},"end":{"line":65,"column":1959}},"3":{"start":{"line":87,"column":8},"end":{"line":87,"column":51}},"4":{"start":{"line":101,"column":8},"end":{"line":101,"column":36}},"5":{"start":{"line":115,"column":8},"end":{"line":115,"column":42}},"6":{"start":{"line":128,"column":8},"end":{"line":128,"column":27}},"7":{"start":{"line":142,"column":8},"end":{"line":142,"column":44}},"8":{"start":{"line":158,"column":8},"end":{"line":158,"column":41}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":3842}},"10":{"start":{"line":187,"column":8},"end":{"line":187,"column":4155}},"11":{"start":{"line":203,"column":8},"end":{"line":203,"column":44}}},"branchMap":{"1":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol":{"l":{"54":60,"55":60,"74":125,"90":52,"91":52,"105":24,"119":0,"120":0,"135":25,"141":24,"146":24,"151":23,"158":22,"173":4,"178":3,"183":1,"188":1,"206":0,"211":0,"222":0,"238":1,"243":1,"247":1,"268":74,"270":74,"271":74,"272":74,"278":74,"300":22,"301":22,"307":22,"321":22,"322":22,"324":22,"325":20,"331":2,"340":21,"348":21,"356":21,"374":1,"379":1,"384":1,"392":1,"412":4},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol","s":{"1":60,"2":60,"3":125,"4":52,"5":52,"6":24,"7":0,"8":0,"9":25,"10":24,"11":24,"12":23,"13":22,"14":4,"15":3,"16":1,"17":1,"18":0,"19":0,"20":0,"21":1,"22":1,"23":1,"24":74,"25":74,"26":74,"27":74,"28":22,"29":22,"30":22,"31":22,"32":22,"33":20,"34":2,"35":21,"36":21,"37":21,"38":1,"39":1,"40":1,"41":1,"42":4},"b":{"1":[24,1],"2":[24,0],"3":[23,1],"4":[22,1],"5":[3,1],"6":[1,2],"7":[1,0],"8":[0,0],"9":[0,0],"10":[1,0],"11":[20,2],"12":[1,1],"13":[1,0],"14":[1,0]},"f":{"1":60,"2":125,"3":52,"4":24,"5":0,"6":25,"7":4,"8":0,"9":1,"10":74,"11":22,"12":22,"13":1,"14":4},"fnMap":{"1":{"name":"constructor","line":52,"loc":{"start":{"line":47,"column":4},"end":{"line":56,"column":4}}},"2":{"name":"batches","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":77,"column":4}}},"3":{"name":"getTotalElements","line":82,"loc":{"start":{"line":82,"column":4},"end":{"line":92,"column":4}}},"4":{"name":"getTotalBatches","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":106,"column":4}}},"5":{"name":"getLastSequencerTimestamp","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":121,"column":4}}},"6":{"name":"appendStateBatch","line":126,"loc":{"start":{"line":126,"column":4},"end":{"line":162,"column":4}}},"7":{"name":"deleteStateBatch","line":167,"loc":{"start":{"line":167,"column":4},"end":{"line":189,"column":4}}},"8":{"name":"verifyStateCommitment","line":194,"loc":{"start":{"line":194,"column":4},"end":{"line":223,"column":4}}},"9":{"name":"insideFraudProofWindow","line":228,"loc":{"start":{"line":228,"column":4},"end":{"line":248,"column":4}}},"10":{"name":"_getBatchExtraData","line":260,"loc":{"start":{"line":260,"column":4},"end":{"line":282,"column":4}}},"11":{"name":"_makeBatchExtraData","line":290,"loc":{"start":{"line":290,"column":4},"end":{"line":308,"column":4}}},"12":{"name":"_appendBatch","line":315,"loc":{"start":{"line":315,"column":4},"end":{"line":363,"column":4}}},"13":{"name":"_deleteBatch","line":369,"loc":{"start":{"line":369,"column":4},"end":{"line":396,"column":4}}},"14":{"name":"_isValidBatchHeader","line":403,"loc":{"start":{"line":403,"column":4},"end":{"line":413,"column":4}}}},"statementMap":{"1":{"start":{"line":54,"column":8},"end":{"line":54,"column":45}},"2":{"start":{"line":55,"column":8},"end":{"line":55,"column":57}},"3":{"start":{"line":74,"column":8},"end":{"line":74,"column":2401}},"4":{"start":{"line":90,"column":8},"end":{"line":90,"column":55}},"5":{"start":{"line":91,"column":8},"end":{"line":91,"column":37}},"6":{"start":{"line":105,"column":8},"end":{"line":105,"column":33}},"7":{"start":{"line":119,"column":8},"end":{"line":119,"column":64}},"8":{"start":{"line":120,"column":8},"end":{"line":120,"column":46}},"9":{"start":{"line":135,"column":8},"end":{"line":135,"column":3782}},"10":{"start":{"line":141,"column":8},"end":{"line":141,"column":4012}},"11":{"start":{"line":146,"column":8},"end":{"line":146,"column":4190}},"12":{"start":{"line":151,"column":8},"end":{"line":151,"column":4300}},"13":{"start":{"line":158,"column":8},"end":{"line":158,"column":4670}},"14":{"start":{"line":173,"column":8},"end":{"line":173,"column":4976}},"15":{"start":{"line":178,"column":8},"end":{"line":178,"column":5135}},"16":{"start":{"line":183,"column":8},"end":{"line":183,"column":5247}},"17":{"start":{"line":188,"column":8},"end":{"line":188,"column":33}},"18":{"start":{"line":206,"column":8},"end":{"line":206,"column":5787}},"19":{"start":{"line":211,"column":8},"end":{"line":211,"column":5899}},"20":{"start":{"line":222,"column":8},"end":{"line":222,"column":19}},"21":{"start":{"line":238,"column":8},"end":{"line":238,"column":6480}},"22":{"start":{"line":243,"column":8},"end":{"line":243,"column":6601}},"23":{"start":{"line":247,"column":8},"end":{"line":247,"column":76}},"24":{"start":{"line":268,"column":8},"end":{"line":268,"column":57}},"25":{"start":{"line":270,"column":8},"end":{"line":270,"column":28}},"26":{"start":{"line":271,"column":8},"end":{"line":271,"column":37}},"27":{"start":{"line":278,"column":8},"end":{"line":278,"column":7685}},"28":{"start":{"line":300,"column":8},"end":{"line":300,"column":25}},"29":{"start":{"line":307,"column":8},"end":{"line":307,"column":24}},"30":{"start":{"line":321,"column":8},"end":{"line":321,"column":51}},"31":{"start":{"line":322,"column":8},"end":{"line":322,"column":84}},"32":{"start":{"line":324,"column":8},"end":{"line":324,"column":8914}},"33":{"start":{"line":325,"column":12},"end":{"line":325,"column":59}},"34":{"start":{"line":331,"column":12},"end":{"line":331,"column":9429}},"35":{"start":{"line":340,"column":8},"end":{"line":340,"column":9854}},"36":{"start":{"line":348,"column":8},"end":{"line":348,"column":10179}},"37":{"start":{"line":356,"column":8},"end":{"line":356,"column":10406}},"38":{"start":{"line":374,"column":8},"end":{"line":374,"column":10922}},"39":{"start":{"line":379,"column":8},"end":{"line":379,"column":11044}},"40":{"start":{"line":384,"column":8},"end":{"line":384,"column":11156}},"41":{"start":{"line":392,"column":8},"end":{"line":392,"column":11375}},"42":{"start":{"line":412,"column":8},"end":{"line":412,"column":99}}},"branchMap":{"1":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]},"2":{"line":141,"type":"if","locations":[{"start":{"line":141,"column":8},"end":{"line":141,"column":8}},{"start":{"line":141,"column":8},"end":{"line":141,"column":8}}]},"3":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"4":{"line":151,"type":"if","locations":[{"start":{"line":151,"column":8},"end":{"line":151,"column":8}},{"start":{"line":151,"column":8},"end":{"line":151,"column":8}}]},"5":{"line":173,"type":"if","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":8}},{"start":{"line":173,"column":8},"end":{"line":173,"column":8}}]},"6":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":8},"end":{"line":178,"column":8}},{"start":{"line":178,"column":8},"end":{"line":178,"column":8}}]},"7":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":8},"end":{"line":183,"column":8}},{"start":{"line":183,"column":8},"end":{"line":183,"column":8}}]},"8":{"line":206,"type":"if","locations":[{"start":{"line":206,"column":8},"end":{"line":206,"column":8}},{"start":{"line":206,"column":8},"end":{"line":206,"column":8}}]},"9":{"line":211,"type":"if","locations":[{"start":{"line":211,"column":8},"end":{"line":211,"column":8}},{"start":{"line":211,"column":8},"end":{"line":211,"column":8}}]},"10":{"line":243,"type":"if","locations":[{"start":{"line":243,"column":8},"end":{"line":243,"column":8}},{"start":{"line":243,"column":8},"end":{"line":243,"column":8}}]},"11":{"line":324,"type":"if","locations":[{"start":{"line":324,"column":8},"end":{"line":324,"column":8}},{"start":{"line":324,"column":8},"end":{"line":324,"column":8}}]},"12":{"line":331,"type":"if","locations":[{"start":{"line":331,"column":12},"end":{"line":331,"column":12}},{"start":{"line":331,"column":12},"end":{"line":331,"column":12}}]},"13":{"line":374,"type":"if","locations":[{"start":{"line":374,"column":8},"end":{"line":374,"column":8}},{"start":{"line":374,"column":8},"end":{"line":374,"column":8}}]},"14":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol":{"l":{"85":27,"86":27,"87":27,"88":27,"104":55,"105":55,"106":55,"109":55,"110":46,"122":201,"123":201,"124":192,"127":192,"128":165,"131":27,"139":42,"140":4,"142":38,"162":0,"165":0,"170":0,"178":0,"186":0,"187":0,"188":0,"196":0,"208":0,"211":0,"231":4,"246":150,"261":1,"276":1,"291":1,"306":1,"325":1,"340":1,"357":6,"384":28,"388":28,"391":27,"396":27,"423":1,"427":1,"430":0,"436":0,"458":3,"472":1,"501":1,"510":1,"511":0,"515":1,"516":0,"520":1,"523":1,"524":1,"528":1,"531":1,"534":1,"540":1,"570":154,"571":154,"572":154,"574":154,"604":8,"605":8,"606":8,"607":8,"609":8,"639":10,"641":10,"670":48,"672":48,"693":7,"695":7,"730":2,"732":2,"753":3,"772":2,"789":0,"807":29,"812":29,"814":29,"815":2,"841":27,"845":27,"846":27,"847":27,"851":27,"860":24,"889":172,"894":1,"898":171,"903":169,"938":196,"939":196,"945":196,"946":196,"947":196,"955":196,"961":196,"965":196,"969":196,"970":23,"980":23,"981":5,"987":18,"993":14,"998":18,"1002":10,"1004":8,"1012":18,"1016":191,"1018":191,"1047":27,"1050":0,"1060":27,"1061":0,"1071":27,"1074":27,"1076":27,"1079":10,"1080":10,"1081":10,"1082":10,"1090":10,"1095":17,"1096":17,"1097":1,"1108":16,"1115":16,"1135":0,"1136":0,"1152":28,"1153":28,"1167":29,"1168":29,"1184":57,"1185":57,"1201":369,"1202":367,"1217":28,"1218":28,"1236":17,"1237":17,"1259":55,"1260":55,"1281":7,"1282":0,"1285":7,"1286":7,"1300":535,"1301":0,"1305":535,"1306":2,"1311":533,"1317":533,"1318":144,"1336":53,"1340":53,"1346":53,"1347":47,"1348":47,"1372":62,"1373":0,"1379":62,"1380":0,"1385":62,"1391":62,"1392":46,"1410":7,"1414":7,"1420":7,"1423":7,"1425":7,"1426":7,"1452":20,"1455":0,"1459":20,"1460":7,"1469":13,"1498":23,"1499":3,"1508":20,"1523":19,"1528":19,"1542":13,"1567":196,"1581":244,"1582":0,"1585":244,"1602":0,"1608":0,"1613":0,"1620":0,"1646":0,"1647":0,"1651":0,"1652":0,"1656":0,"1687":0,"1688":0,"1689":0,"1691":0,"1694":0,"1718":0,"1735":0,"1759":392,"1760":202,"1764":392,"1765":308,"1769":392,"1770":16,"1783":0,"1784":0,"1785":0,"1786":0,"1787":0,"1788":0,"1790":0,"1799":27,"1800":27,"1801":27,"1802":27,"1803":27,"1804":27,"1806":27,"1808":27,"1809":27,"1810":27,"1812":27,"1837":0,"1839":0,"1840":0,"1841":0,"1843":0,"1845":0,"1846":0,"1847":0,"1848":0,"1849":0,"1853":0,"1856":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol","s":{"1":27,"2":27,"3":27,"4":27,"5":55,"6":55,"7":55,"8":46,"9":201,"10":192,"11":192,"12":165,"13":27,"14":42,"15":4,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":4,"27":150,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":6,"35":28,"36":28,"37":27,"38":27,"39":1,"40":1,"41":0,"42":0,"43":3,"44":1,"45":1,"46":1,"47":0,"48":1,"49":0,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":154,"58":154,"59":154,"60":154,"61":8,"62":8,"63":8,"64":8,"65":8,"66":10,"67":10,"68":48,"69":48,"70":7,"71":7,"72":2,"73":2,"74":3,"75":2,"76":0,"77":29,"78":29,"79":29,"80":2,"81":27,"82":27,"83":27,"84":27,"85":27,"86":24,"87":172,"88":1,"89":171,"90":169,"91":196,"92":196,"93":196,"94":196,"95":196,"96":196,"97":196,"98":196,"99":196,"100":23,"101":23,"102":5,"103":18,"104":14,"105":18,"106":10,"107":8,"108":18,"109":191,"110":191,"111":27,"112":0,"113":27,"114":0,"115":27,"116":27,"117":27,"118":10,"119":10,"120":10,"121":17,"122":17,"123":1,"124":16,"125":16,"126":0,"127":0,"128":28,"129":28,"130":29,"131":29,"132":57,"133":57,"134":369,"135":367,"136":28,"137":28,"138":17,"139":17,"140":55,"141":55,"142":7,"143":0,"144":7,"145":7,"146":535,"147":0,"148":535,"149":2,"150":533,"151":533,"152":144,"153":53,"154":53,"155":53,"156":47,"157":47,"158":62,"159":0,"160":62,"161":0,"162":62,"163":62,"164":46,"165":7,"166":7,"167":7,"168":7,"169":7,"170":7,"171":20,"172":0,"173":20,"174":7,"175":13,"176":23,"177":3,"178":20,"179":19,"180":13,"181":196,"182":244,"183":0,"184":244,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":392,"202":202,"203":392,"204":308,"205":392,"206":16,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":27,"215":27,"216":27,"217":27,"218":27,"219":27,"220":27,"221":27,"222":27,"223":27,"224":27,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0},"b":{"1":[46,9],"2":[165,27],"3":[4,38],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,1],"8":[0,1],"9":[2,27],"10":[1,171],"11":[23,173],"12":[5,18],"13":[14,4],"14":[10,8],"15":[0,27],"16":[0,27],"17":[10,17],"18":[1,16],"19":[0,7],"20":[0,535],"21":[2,533],"22":[144,389],"23":[47,6],"24":[0,62],"25":[0,62],"26":[46,16],"27":[7,0],"28":[0,20],"29":[7,13],"30":[3,20],"31":[0,244],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[202,190],"37":[308,84],"38":[16,376],"39":[0,0],"40":[0,0],"41":[0,0]},"f":{"1":27,"2":55,"3":201,"4":42,"5":0,"6":4,"7":150,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":6,"15":28,"16":1,"17":3,"18":1,"19":1,"20":154,"21":8,"22":10,"23":48,"24":7,"25":2,"26":3,"27":2,"28":0,"29":29,"30":27,"31":172,"32":196,"33":27,"34":0,"35":28,"36":29,"37":57,"38":369,"39":28,"40":17,"41":55,"42":7,"43":535,"44":53,"45":62,"46":7,"47":20,"48":23,"49":19,"50":13,"51":196,"52":244,"53":0,"54":0,"55":0,"56":0,"57":0,"58":392,"59":0,"60":27,"61":0},"fnMap":{"1":{"name":"constructor","line":83,"loc":{"start":{"line":78,"column":4},"end":{"line":89,"column":4}}},"2":{"name":"netGasCost","line":101,"loc":{"start":{"line":101,"column":4},"end":{"line":112,"column":4}}},"3":{"name":"fixedGasDiscount","line":119,"loc":{"start":{"line":119,"column":4},"end":{"line":133,"column":4}}},"4":{"name":"notStatic","line":138,"loc":{"start":{"line":138,"column":4},"end":{"line":143,"column":4}}},"5":{"name":"run","line":155,"loc":{"start":{"line":155,"column":4},"end":{"line":212,"column":4}}},"6":{"name":"ovmCALLER","line":223,"loc":{"start":{"line":223,"column":4},"end":{"line":232,"column":4}}},"7":{"name":"ovmADDRESS","line":238,"loc":{"start":{"line":238,"column":4},"end":{"line":247,"column":4}}},"8":{"name":"ovmTIMESTAMP","line":253,"loc":{"start":{"line":253,"column":4},"end":{"line":262,"column":4}}},"9":{"name":"ovmNUMBER","line":268,"loc":{"start":{"line":268,"column":4},"end":{"line":277,"column":4}}},"10":{"name":"ovmGASLIMIT","line":283,"loc":{"start":{"line":283,"column":4},"end":{"line":292,"column":4}}},"11":{"name":"ovmCHAINID","line":298,"loc":{"start":{"line":298,"column":4},"end":{"line":307,"column":4}}},"12":{"name":"ovmL1QUEUEORIGIN","line":317,"loc":{"start":{"line":317,"column":4},"end":{"line":326,"column":4}}},"13":{"name":"ovmL1TXORIGIN","line":332,"loc":{"start":{"line":332,"column":4},"end":{"line":341,"column":4}}},"14":{"name":"ovmREVERT","line":351,"loc":{"start":{"line":351,"column":4},"end":{"line":358,"column":4}}},"15":{"name":"ovmCREATE","line":377,"loc":{"start":{"line":371,"column":4},"end":{"line":400,"column":4}}},"16":{"name":"ovmCREATE2","line":416,"loc":{"start":{"line":409,"column":4},"end":{"line":440,"column":4}}},"17":{"name":"ovmGETNONCE","line":451,"loc":{"start":{"line":451,"column":4},"end":{"line":459,"column":4}}},"18":{"name":"ovmSETNONCE","line":470,"loc":{"start":{"line":465,"column":4},"end":{"line":473,"column":4}}},"19":{"name":"ovmCREATEEOA","line":494,"loc":{"start":{"line":486,"column":4},"end":{"line":541,"column":4}}},"20":{"name":"ovmCALL","line":563,"loc":{"start":{"line":556,"column":4},"end":{"line":580,"column":4}}},"21":{"name":"ovmSTATICCALL","line":597,"loc":{"start":{"line":590,"column":4},"end":{"line":615,"column":4}}},"22":{"name":"ovmDELEGATECALL","line":632,"loc":{"start":{"line":625,"column":4},"end":{"line":647,"column":4}}},"23":{"name":"ovmSLOAD","line":664,"loc":{"start":{"line":659,"column":4},"end":{"line":676,"column":4}}},"24":{"name":"ovmSSTORE","line":690,"loc":{"start":{"line":683,"column":4},"end":{"line":700,"column":4}}},"25":{"name":"ovmEXTCODECOPY","line":714,"loc":{"start":{"line":714,"column":4},"end":{"line":737,"column":4}}},"26":{"name":"ovmEXTCODESIZE","line":744,"loc":{"start":{"line":744,"column":4},"end":{"line":756,"column":4}}},"27":{"name":"ovmEXTCODEHASH","line":763,"loc":{"start":{"line":763,"column":4},"end":{"line":775,"column":4}}},"28":{"name":"getMaxTransactionGasLimit","line":781,"loc":{"start":{"line":781,"column":4},"end":{"line":790,"column":4}}},"29":{"name":"_checkDeployerAllowed","line":800,"loc":{"start":{"line":800,"column":4},"end":{"line":817,"column":4}}},"30":{"name":"_createContract","line":830,"loc":{"start":{"line":830,"column":4},"end":{"line":864,"column":4}}},"31":{"name":"_callContract","line":875,"loc":{"start":{"line":875,"column":4},"end":{"line":910,"column":4}}},"32":{"name":"_handleExternalMessage","line":924,"loc":{"start":{"line":924,"column":4},"end":{"line":1022,"column":4}}},"33":{"name":"_handleContractCreation","line":1035,"loc":{"start":{"line":1035,"column":4},"end":{"line":1116,"column":4}}},"34":{"name":"_hasAccount","line":1127,"loc":{"start":{"line":1127,"column":4},"end":{"line":1137,"column":4}}},"35":{"name":"_hasEmptyAccount","line":1144,"loc":{"start":{"line":1144,"column":4},"end":{"line":1154,"column":4}}},"36":{"name":"_setAccountNonce","line":1161,"loc":{"start":{"line":1161,"column":4},"end":{"line":1169,"column":4}}},"37":{"name":"_getAccountNonce","line":1176,"loc":{"start":{"line":1176,"column":4},"end":{"line":1186,"column":4}}},"38":{"name":"_getAccountEthAddress","line":1193,"loc":{"start":{"line":1193,"column":4},"end":{"line":1203,"column":4}}},"39":{"name":"_initPendingAccount","line":1209,"loc":{"start":{"line":1209,"column":4},"end":{"line":1219,"column":4}}},"40":{"name":"_commitPendingAccount","line":1229,"loc":{"start":{"line":1229,"column":4},"end":{"line":1242,"column":4}}},"41":{"name":"_getContractStorage","line":1250,"loc":{"start":{"line":1250,"column":4},"end":{"line":1261,"column":4}}},"42":{"name":"_putContractStorage","line":1269,"loc":{"start":{"line":1269,"column":4},"end":{"line":1287,"column":4}}},"43":{"name":"_checkAccountLoad","line":1294,"loc":{"start":{"line":1294,"column":4},"end":{"line":1322,"column":4}}},"44":{"name":"_checkAccountChange","line":1329,"loc":{"start":{"line":1329,"column":4},"end":{"line":1352,"column":4}}},"45":{"name":"_checkContractStorageLoad","line":1360,"loc":{"start":{"line":1360,"column":4},"end":{"line":1394,"column":4}}},"46":{"name":"_checkContractStorageChange","line":1402,"loc":{"start":{"line":1402,"column":4},"end":{"line":1428,"column":4}}},"47":{"name":"_encodeRevertData","line":1441,"loc":{"start":{"line":1441,"column":4},"end":{"line":1475,"column":4}}},"48":{"name":"_decodeRevertData","line":1485,"loc":{"start":{"line":1485,"column":4},"end":{"line":1509,"column":4}}},"49":{"name":"_revertWithFlag","line":1516,"loc":{"start":{"line":1516,"column":4},"end":{"line":1531,"column":4}}},"50":{"name":"_revertWithFlag","line":1537,"loc":{"start":{"line":1537,"column":4},"end":{"line":1543,"column":4}}},"51":{"name":"_getNuisanceGasLimit","line":1558,"loc":{"start":{"line":1558,"column":4},"end":{"line":1568,"column":4}}},"52":{"name":"_useNuisanceGas","line":1574,"loc":{"start":{"line":1574,"column":4},"end":{"line":1586,"column":4}}},"53":{"name":"_checkNeedsNewEpoch","line":1597,"loc":{"start":{"line":1597,"column":4},"end":{"line":1627,"column":4}}},"54":{"name":"_isValidGasLimit","line":1635,"loc":{"start":{"line":1635,"column":4},"end":{"line":1674,"column":4}}},"55":{"name":"_updateCumulativeGas","line":1681,"loc":{"start":{"line":1681,"column":4},"end":{"line":1703,"column":4}}},"56":{"name":"_getGasMetadata","line":1710,"loc":{"start":{"line":1710,"column":4},"end":{"line":1722,"column":4}}},"57":{"name":"_putGasMetadata","line":1729,"loc":{"start":{"line":1729,"column":4},"end":{"line":1740,"column":4}}},"58":{"name":"_switchMessageContext","line":1752,"loc":{"start":{"line":1752,"column":4},"end":{"line":1772,"column":4}}},"59":{"name":"_initContext","line":1778,"loc":{"start":{"line":1778,"column":4},"end":{"line":1791,"column":4}}},"60":{"name":"_resetContext","line":1796,"loc":{"start":{"line":1796,"column":4},"end":{"line":1813,"column":4}}},"61":{"name":"simulateMessage","line":1825,"loc":{"start":{"line":1825,"column":4},"end":{"line":1862,"column":4}}}},"statementMap":{"1":{"start":{"line":85,"column":8},"end":{"line":85,"column":74}},"2":{"start":{"line":86,"column":8},"end":{"line":86,"column":39}},"3":{"start":{"line":87,"column":8},"end":{"line":87,"column":37}},"4":{"start":{"line":88,"column":8},"end":{"line":88,"column":22}},"5":{"start":{"line":104,"column":8},"end":{"line":104,"column":39}},"6":{"start":{"line":106,"column":8},"end":{"line":106,"column":49}},"7":{"start":{"line":109,"column":8},"end":{"line":109,"column":3969}},"8":{"start":{"line":110,"column":12},"end":{"line":110,"column":60}},"9":{"start":{"line":122,"column":8},"end":{"line":122,"column":39}},"10":{"start":{"line":124,"column":8},"end":{"line":124,"column":49}},"11":{"start":{"line":127,"column":8},"end":{"line":127,"column":4602}},"12":{"start":{"line":128,"column":12},"end":{"line":128,"column":54}},"13":{"start":{"line":131,"column":12},"end":{"line":131,"column":52}},"14":{"start":{"line":139,"column":8},"end":{"line":139,"column":4939}},"15":{"start":{"line":140,"column":12},"end":{"line":140,"column":55}},"16":{"start":{"line":162,"column":8},"end":{"line":162,"column":99}},"17":{"start":{"line":165,"column":8},"end":{"line":165,"column":60}},"18":{"start":{"line":170,"column":8},"end":{"line":170,"column":6129}},"19":{"start":{"line":178,"column":8},"end":{"line":178,"column":33}},"20":{"start":{"line":186,"column":8},"end":{"line":186,"column":6951}},"21":{"start":{"line":187,"column":12},"end":{"line":187,"column":26}},"22":{"start":{"line":188,"column":12},"end":{"line":188,"column":18}},"23":{"start":{"line":196,"column":8},"end":{"line":196,"column":7365}},"24":{"start":{"line":208,"column":8},"end":{"line":208,"column":22}},"25":{"start":{"line":211,"column":8},"end":{"line":211,"column":54}},"26":{"start":{"line":231,"column":8},"end":{"line":231,"column":39}},"27":{"start":{"line":246,"column":8},"end":{"line":246,"column":40}},"28":{"start":{"line":261,"column":8},"end":{"line":261,"column":46}},"29":{"start":{"line":276,"column":8},"end":{"line":276,"column":43}},"30":{"start":{"line":291,"column":8},"end":{"line":291,"column":45}},"31":{"start":{"line":306,"column":8},"end":{"line":306,"column":39}},"32":{"start":{"line":325,"column":8},"end":{"line":325,"column":50}},"33":{"start":{"line":340,"column":8},"end":{"line":340,"column":47}},"34":{"start":{"line":357,"column":8},"end":{"line":357,"column":60}},"35":{"start":{"line":384,"column":8},"end":{"line":384,"column":38}},"36":{"start":{"line":388,"column":8},"end":{"line":388,"column":37}},"37":{"start":{"line":391,"column":8},"end":{"line":391,"column":12120}},"38":{"start":{"line":396,"column":8},"end":{"line":396,"column":12259}},"39":{"start":{"line":423,"column":8},"end":{"line":423,"column":38}},"40":{"start":{"line":427,"column":8},"end":{"line":427,"column":37}},"41":{"start":{"line":430,"column":8},"end":{"line":430,"column":13215}},"42":{"start":{"line":436,"column":8},"end":{"line":436,"column":13358}},"43":{"start":{"line":458,"column":8},"end":{"line":458,"column":45}},"44":{"start":{"line":472,"column":8},"end":{"line":472,"column":45}},"45":{"start":{"line":501,"column":8},"end":{"line":501,"column":15412}},"46":{"start":{"line":510,"column":8},"end":{"line":510,"column":15716}},"47":{"start":{"line":511,"column":12},"end":{"line":511,"column":87}},"48":{"start":{"line":515,"column":8},"end":{"line":515,"column":15949}},"49":{"start":{"line":516,"column":12},"end":{"line":516,"column":18}},"50":{"start":{"line":520,"column":8},"end":{"line":520,"column":31}},"51":{"start":{"line":523,"column":8},"end":{"line":523,"column":55}},"52":{"start":{"line":524,"column":8},"end":{"line":524,"column":38}},"53":{"start":{"line":528,"column":8},"end":{"line":528,"column":92}},"54":{"start":{"line":531,"column":8},"end":{"line":531,"column":46}},"55":{"start":{"line":534,"column":8},"end":{"line":534,"column":16780}},"56":{"start":{"line":540,"column":8},"end":{"line":540,"column":31}},"57":{"start":{"line":570,"column":8},"end":{"line":570,"column":65}},"58":{"start":{"line":571,"column":8},"end":{"line":571,"column":67}},"59":{"start":{"line":572,"column":8},"end":{"line":572,"column":47}},"60":{"start":{"line":574,"column":8},"end":{"line":574,"column":17970}},"61":{"start":{"line":604,"column":8},"end":{"line":604,"column":65}},"62":{"start":{"line":605,"column":8},"end":{"line":605,"column":67}},"63":{"start":{"line":606,"column":8},"end":{"line":606,"column":47}},"64":{"start":{"line":607,"column":8},"end":{"line":607,"column":41}},"65":{"start":{"line":609,"column":8},"end":{"line":609,"column":19091}},"66":{"start":{"line":639,"column":8},"end":{"line":639,"column":65}},"67":{"start":{"line":641,"column":8},"end":{"line":641,"column":20043}},"68":{"start":{"line":670,"column":8},"end":{"line":670,"column":46}},"69":{"start":{"line":672,"column":8},"end":{"line":672,"column":20768}},"70":{"start":{"line":693,"column":8},"end":{"line":693,"column":46}},"71":{"start":{"line":695,"column":8},"end":{"line":695,"column":21293}},"72":{"start":{"line":730,"column":8},"end":{"line":730,"column":51}},"73":{"start":{"line":732,"column":8},"end":{"line":732,"column":22625}},"74":{"start":{"line":753,"column":8},"end":{"line":753,"column":23119}},"75":{"start":{"line":772,"column":8},"end":{"line":772,"column":23567}},"76":{"start":{"line":789,"column":8},"end":{"line":789,"column":52}},"77":{"start":{"line":807,"column":8},"end":{"line":807,"column":24656}},"78":{"start":{"line":812,"column":8},"end":{"line":812,"column":49}},"79":{"start":{"line":814,"column":8},"end":{"line":814,"column":24934}},"80":{"start":{"line":815,"column":12},"end":{"line":815,"column":58}},"81":{"start":{"line":841,"column":8},"end":{"line":841,"column":73}},"82":{"start":{"line":845,"column":8},"end":{"line":845,"column":65}},"83":{"start":{"line":846,"column":8},"end":{"line":846,"column":63}},"84":{"start":{"line":847,"column":8},"end":{"line":847,"column":55}},"85":{"start":{"line":851,"column":8},"end":{"line":851,"column":26479}},"86":{"start":{"line":860,"column":8},"end":{"line":860,"column":26781}},"87":{"start":{"line":889,"column":8},"end":{"line":889,"column":27852}},"88":{"start":{"line":894,"column":12},"end":{"line":894,"column":32}},"89":{"start":{"line":898,"column":8},"end":{"line":898,"column":28436}},"90":{"start":{"line":903,"column":8},"end":{"line":903,"column":28544}},"91":{"start":{"line":938,"column":8},"end":{"line":938,"column":65}},"92":{"start":{"line":939,"column":8},"end":{"line":939,"column":69}},"93":{"start":{"line":945,"column":8},"end":{"line":945,"column":67}},"94":{"start":{"line":946,"column":8},"end":{"line":946,"column":66}},"95":{"start":{"line":947,"column":8},"end":{"line":947,"column":55}},"96":{"start":{"line":955,"column":8},"end":{"line":955,"column":30971}},"97":{"start":{"line":961,"column":8},"end":{"line":961,"column":69}},"98":{"start":{"line":965,"column":8},"end":{"line":965,"column":63}},"99":{"start":{"line":969,"column":8},"end":{"line":969,"column":31643}},"100":{"start":{"line":970,"column":12},"end":{"line":970,"column":31716}},"101":{"start":{"line":980,"column":12},"end":{"line":980,"column":32198}},"102":{"start":{"line":981,"column":16},"end":{"line":981,"column":36}},"103":{"start":{"line":987,"column":12},"end":{"line":987,"column":32623}},"104":{"start":{"line":993,"column":16},"end":{"line":993,"column":60}},"105":{"start":{"line":998,"column":12},"end":{"line":998,"column":33142}},"106":{"start":{"line":1002,"column":16},"end":{"line":1002,"column":46}},"107":{"start":{"line":1004,"column":16},"end":{"line":1004,"column":33}},"108":{"start":{"line":1012,"column":12},"end":{"line":1012,"column":54}},"109":{"start":{"line":1016,"column":8},"end":{"line":1016,"column":97}},"110":{"start":{"line":1018,"column":8},"end":{"line":1018,"column":34093}},"111":{"start":{"line":1047,"column":8},"end":{"line":1047,"column":35080}},"112":{"start":{"line":1050,"column":12},"end":{"line":1050,"column":35291}},"113":{"start":{"line":1060,"column":8},"end":{"line":1060,"column":35634}},"114":{"start":{"line":1061,"column":12},"end":{"line":1061,"column":35714}},"115":{"start":{"line":1071,"column":8},"end":{"line":1071,"column":36}},"116":{"start":{"line":1074,"column":8},"end":{"line":1074,"column":71}},"117":{"start":{"line":1076,"column":8},"end":{"line":1076,"column":36312}},"118":{"start":{"line":1079,"column":12},"end":{"line":1079,"column":34}},"119":{"start":{"line":1081,"column":12},"end":{"line":1081,"column":63}},"120":{"start":{"line":1090,"column":12},"end":{"line":1090,"column":38}},"121":{"start":{"line":1095,"column":8},"end":{"line":1095,"column":68}},"122":{"start":{"line":1096,"column":8},"end":{"line":1096,"column":37248}},"123":{"start":{"line":1097,"column":12},"end":{"line":1097,"column":37327}},"124":{"start":{"line":1108,"column":8},"end":{"line":1108,"column":37793}},"125":{"start":{"line":1115,"column":8},"end":{"line":1115,"column":28}},"126":{"start":{"line":1135,"column":8},"end":{"line":1135,"column":34}},"127":{"start":{"line":1136,"column":8},"end":{"line":1136,"column":51}},"128":{"start":{"line":1152,"column":8},"end":{"line":1152,"column":34}},"129":{"start":{"line":1153,"column":8},"end":{"line":1153,"column":56}},"130":{"start":{"line":1167,"column":8},"end":{"line":1167,"column":36}},"131":{"start":{"line":1168,"column":8},"end":{"line":1168,"column":56}},"132":{"start":{"line":1184,"column":8},"end":{"line":1184,"column":34}},"133":{"start":{"line":1185,"column":8},"end":{"line":1185,"column":56}},"134":{"start":{"line":1201,"column":8},"end":{"line":1201,"column":34}},"135":{"start":{"line":1202,"column":8},"end":{"line":1202,"column":61}},"136":{"start":{"line":1217,"column":8},"end":{"line":1217,"column":34}},"137":{"start":{"line":1218,"column":8},"end":{"line":1218,"column":51}},"138":{"start":{"line":1236,"column":8},"end":{"line":1236,"column":36}},"139":{"start":{"line":1237,"column":8},"end":{"line":1237,"column":41463}},"140":{"start":{"line":1259,"column":8},"end":{"line":1259,"column":49}},"141":{"start":{"line":1260,"column":8},"end":{"line":1260,"column":66}},"142":{"start":{"line":1281,"column":8},"end":{"line":1281,"column":42888}},"143":{"start":{"line":1282,"column":12},"end":{"line":1282,"column":18}},"144":{"start":{"line":1285,"column":8},"end":{"line":1285,"column":51}},"145":{"start":{"line":1286,"column":8},"end":{"line":1286,"column":66}},"146":{"start":{"line":1300,"column":8},"end":{"line":1300,"column":43493}},"147":{"start":{"line":1301,"column":12},"end":{"line":1301,"column":49}},"148":{"start":{"line":1305,"column":8},"end":{"line":1305,"column":43681}},"149":{"start":{"line":1306,"column":12},"end":{"line":1306,"column":59}},"150":{"start":{"line":1311,"column":8},"end":{"line":1311,"column":44063}},"151":{"start":{"line":1317,"column":8},"end":{"line":1317,"column":44270}},"152":{"start":{"line":1318,"column":12},"end":{"line":1318,"column":44327}},"153":{"start":{"line":1336,"column":8},"end":{"line":1336,"column":34}},"154":{"start":{"line":1340,"column":8},"end":{"line":1340,"column":45260}},"155":{"start":{"line":1346,"column":8},"end":{"line":1346,"column":45468}},"156":{"start":{"line":1347,"column":12},"end":{"line":1347,"column":62}},"157":{"start":{"line":1348,"column":12},"end":{"line":1348,"column":45591}},"158":{"start":{"line":1372,"column":8},"end":{"line":1372,"column":46695}},"159":{"start":{"line":1373,"column":12},"end":{"line":1373,"column":49}},"160":{"start":{"line":1379,"column":8},"end":{"line":1379,"column":47096}},"161":{"start":{"line":1380,"column":12},"end":{"line":1380,"column":59}},"162":{"start":{"line":1385,"column":8},"end":{"line":1385,"column":47501}},"163":{"start":{"line":1391,"column":8},"end":{"line":1391,"column":47698}},"164":{"start":{"line":1392,"column":12},"end":{"line":1392,"column":46}},"165":{"start":{"line":1410,"column":8},"end":{"line":1410,"column":49}},"166":{"start":{"line":1414,"column":8},"end":{"line":1414,"column":48692}},"167":{"start":{"line":1420,"column":8},"end":{"line":1420,"column":48891}},"168":{"start":{"line":1423,"column":12},"end":{"line":1423,"column":41}},"169":{"start":{"line":1425,"column":12},"end":{"line":1425,"column":69}},"170":{"start":{"line":1426,"column":12},"end":{"line":1426,"column":47}},"171":{"start":{"line":1452,"column":8},"end":{"line":1452,"column":49929}},"172":{"start":{"line":1455,"column":12},"end":{"line":1455,"column":28}},"173":{"start":{"line":1459,"column":8},"end":{"line":1459,"column":50123}},"174":{"start":{"line":1460,"column":12},"end":{"line":1460,"column":50188}},"175":{"start":{"line":1469,"column":8},"end":{"line":1469,"column":50379}},"176":{"start":{"line":1498,"column":8},"end":{"line":1498,"column":51255}},"177":{"start":{"line":1499,"column":12},"end":{"line":1499,"column":51303}},"178":{"start":{"line":1508,"column":8},"end":{"line":1508,"column":77}},"179":{"start":{"line":1523,"column":8},"end":{"line":1523,"column":51849}},"180":{"start":{"line":1542,"column":8},"end":{"line":1542,"column":40}},"181":{"start":{"line":1567,"column":8},"end":{"line":1567,"column":60}},"182":{"start":{"line":1581,"column":8},"end":{"line":1581,"column":53501}},"183":{"start":{"line":1582,"column":12},"end":{"line":1582,"column":59}},"184":{"start":{"line":1585,"column":8},"end":{"line":1585,"column":47}},"185":{"start":{"line":1602,"column":8},"end":{"line":1602,"column":54058}},"186":{"start":{"line":1608,"column":12},"end":{"line":1608,"column":54260}},"187":{"start":{"line":1613,"column":12},"end":{"line":1613,"column":54394}},"188":{"start":{"line":1620,"column":12},"end":{"line":1620,"column":54619}},"189":{"start":{"line":1646,"column":8},"end":{"line":1646,"column":55372}},"190":{"start":{"line":1647,"column":12},"end":{"line":1647,"column":24}},"191":{"start":{"line":1651,"column":8},"end":{"line":1651,"column":55532}},"192":{"start":{"line":1652,"column":12},"end":{"line":1652,"column":24}},"193":{"start":{"line":1656,"column":8},"end":{"line":1656,"column":19}},"194":{"start":{"line":1687,"column":8},"end":{"line":1687,"column":39}},"195":{"start":{"line":1688,"column":8},"end":{"line":1688,"column":56851}},"196":{"start":{"line":1689,"column":12},"end":{"line":1689,"column":75}},"197":{"start":{"line":1691,"column":12},"end":{"line":1691,"column":72}},"198":{"start":{"line":1694,"column":8},"end":{"line":1694,"column":57104}},"199":{"start":{"line":1718,"column":8},"end":{"line":1718,"column":57699}},"200":{"start":{"line":1735,"column":8},"end":{"line":1735,"column":58099}},"201":{"start":{"line":1759,"column":8},"end":{"line":1759,"column":58790}},"202":{"start":{"line":1760,"column":12},"end":{"line":1760,"column":67}},"203":{"start":{"line":1764,"column":8},"end":{"line":1764,"column":58990}},"204":{"start":{"line":1765,"column":12},"end":{"line":1765,"column":69}},"205":{"start":{"line":1769,"column":8},"end":{"line":1769,"column":59194}},"206":{"start":{"line":1770,"column":12},"end":{"line":1770,"column":65}},"207":{"start":{"line":1783,"column":8},"end":{"line":1783,"column":63}},"208":{"start":{"line":1784,"column":8},"end":{"line":1784,"column":62}},"209":{"start":{"line":1785,"column":8},"end":{"line":1785,"column":63}},"210":{"start":{"line":1786,"column":8},"end":{"line":1786,"column":71}},"211":{"start":{"line":1787,"column":8},"end":{"line":1787,"column":65}},"212":{"start":{"line":1788,"column":8},"end":{"line":1788,"column":77}},"213":{"start":{"line":1790,"column":8},"end":{"line":1790,"column":82}},"214":{"start":{"line":1799,"column":8},"end":{"line":1799,"column":52}},"215":{"start":{"line":1800,"column":8},"end":{"line":1800,"column":42}},"216":{"start":{"line":1801,"column":8},"end":{"line":1801,"column":39}},"217":{"start":{"line":1802,"column":8},"end":{"line":1802,"column":41}},"218":{"start":{"line":1803,"column":8},"end":{"line":1803,"column":43}},"219":{"start":{"line":1804,"column":8},"end":{"line":1804,"column":85}},"220":{"start":{"line":1806,"column":8},"end":{"line":1806,"column":41}},"221":{"start":{"line":1808,"column":8},"end":{"line":1808,"column":44}},"222":{"start":{"line":1809,"column":8},"end":{"line":1809,"column":45}},"223":{"start":{"line":1810,"column":8},"end":{"line":1810,"column":38}},"224":{"start":{"line":1812,"column":8},"end":{"line":1812,"column":40}},"225":{"start":{"line":1837,"column":8},"end":{"line":1837,"column":40}},"226":{"start":{"line":1839,"column":8},"end":{"line":1839,"column":41}},"227":{"start":{"line":1840,"column":8},"end":{"line":1840,"column":33}},"228":{"start":{"line":1841,"column":8},"end":{"line":1841,"column":47}},"229":{"start":{"line":1843,"column":8},"end":{"line":1843,"column":40}},"230":{"start":{"line":1845,"column":8},"end":{"line":1845,"column":61}},"231":{"start":{"line":1846,"column":8},"end":{"line":1846,"column":61862}},"232":{"start":{"line":1847,"column":12},"end":{"line":1847,"column":85}},"233":{"start":{"line":1848,"column":12},"end":{"line":1848,"column":61981}},"234":{"start":{"line":1849,"column":16},"end":{"line":1849,"column":42}},"235":{"start":{"line":1853,"column":16},"end":{"line":1853,"column":60}},"236":{"start":{"line":1856,"column":12},"end":{"line":1856,"column":62361}}},"branchMap":{"1":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":8},"end":{"line":109,"column":8}},{"start":{"line":109,"column":8},"end":{"line":109,"column":8}}]},"2":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":8},"end":{"line":127,"column":8}},{"start":{"line":127,"column":8},"end":{"line":127,"column":8}}]},"3":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"4":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]},"5":{"line":170,"type":"if","locations":[{"start":{"line":170,"column":8},"end":{"line":170,"column":8}},{"start":{"line":170,"column":8},"end":{"line":170,"column":8}}]},"6":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"7":{"line":510,"type":"if","locations":[{"start":{"line":510,"column":8},"end":{"line":510,"column":8}},{"start":{"line":510,"column":8},"end":{"line":510,"column":8}}]},"8":{"line":515,"type":"if","locations":[{"start":{"line":515,"column":8},"end":{"line":515,"column":8}},{"start":{"line":515,"column":8},"end":{"line":515,"column":8}}]},"9":{"line":814,"type":"if","locations":[{"start":{"line":814,"column":8},"end":{"line":814,"column":8}},{"start":{"line":814,"column":8},"end":{"line":814,"column":8}}]},"10":{"line":889,"type":"if","locations":[{"start":{"line":889,"column":8},"end":{"line":889,"column":8}},{"start":{"line":889,"column":8},"end":{"line":889,"column":8}}]},"11":{"line":969,"type":"if","locations":[{"start":{"line":969,"column":8},"end":{"line":969,"column":8}},{"start":{"line":969,"column":8},"end":{"line":969,"column":8}}]},"12":{"line":980,"type":"if","locations":[{"start":{"line":980,"column":12},"end":{"line":980,"column":12}},{"start":{"line":980,"column":12},"end":{"line":980,"column":12}}]},"13":{"line":987,"type":"if","locations":[{"start":{"line":987,"column":12},"end":{"line":987,"column":12}},{"start":{"line":987,"column":12},"end":{"line":987,"column":12}}]},"14":{"line":998,"type":"if","locations":[{"start":{"line":998,"column":12},"end":{"line":998,"column":12}},{"start":{"line":998,"column":12},"end":{"line":998,"column":12}}]},"15":{"line":1047,"type":"if","locations":[{"start":{"line":1047,"column":8},"end":{"line":1047,"column":8}},{"start":{"line":1047,"column":8},"end":{"line":1047,"column":8}}]},"16":{"line":1060,"type":"if","locations":[{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}},{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}}]},"17":{"line":1076,"type":"if","locations":[{"start":{"line":1076,"column":8},"end":{"line":1076,"column":8}},{"start":{"line":1076,"column":8},"end":{"line":1076,"column":8}}]},"18":{"line":1096,"type":"if","locations":[{"start":{"line":1096,"column":8},"end":{"line":1096,"column":8}},{"start":{"line":1096,"column":8},"end":{"line":1096,"column":8}}]},"19":{"line":1281,"type":"if","locations":[{"start":{"line":1281,"column":8},"end":{"line":1281,"column":8}},{"start":{"line":1281,"column":8},"end":{"line":1281,"column":8}}]},"20":{"line":1300,"type":"if","locations":[{"start":{"line":1300,"column":8},"end":{"line":1300,"column":8}},{"start":{"line":1300,"column":8},"end":{"line":1300,"column":8}}]},"21":{"line":1305,"type":"if","locations":[{"start":{"line":1305,"column":8},"end":{"line":1305,"column":8}},{"start":{"line":1305,"column":8},"end":{"line":1305,"column":8}}]},"22":{"line":1317,"type":"if","locations":[{"start":{"line":1317,"column":8},"end":{"line":1317,"column":8}},{"start":{"line":1317,"column":8},"end":{"line":1317,"column":8}}]},"23":{"line":1346,"type":"if","locations":[{"start":{"line":1346,"column":8},"end":{"line":1346,"column":8}},{"start":{"line":1346,"column":8},"end":{"line":1346,"column":8}}]},"24":{"line":1372,"type":"if","locations":[{"start":{"line":1372,"column":8},"end":{"line":1372,"column":8}},{"start":{"line":1372,"column":8},"end":{"line":1372,"column":8}}]},"25":{"line":1379,"type":"if","locations":[{"start":{"line":1379,"column":8},"end":{"line":1379,"column":8}},{"start":{"line":1379,"column":8},"end":{"line":1379,"column":8}}]},"26":{"line":1391,"type":"if","locations":[{"start":{"line":1391,"column":8},"end":{"line":1391,"column":8}},{"start":{"line":1391,"column":8},"end":{"line":1391,"column":8}}]},"27":{"line":1420,"type":"if","locations":[{"start":{"line":1420,"column":8},"end":{"line":1420,"column":8}},{"start":{"line":1420,"column":8},"end":{"line":1420,"column":8}}]},"28":{"line":1452,"type":"if","locations":[{"start":{"line":1452,"column":8},"end":{"line":1452,"column":8}},{"start":{"line":1452,"column":8},"end":{"line":1452,"column":8}}]},"29":{"line":1459,"type":"if","locations":[{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}},{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}}]},"30":{"line":1498,"type":"if","locations":[{"start":{"line":1498,"column":8},"end":{"line":1498,"column":8}},{"start":{"line":1498,"column":8},"end":{"line":1498,"column":8}}]},"31":{"line":1581,"type":"if","locations":[{"start":{"line":1581,"column":8},"end":{"line":1581,"column":8}},{"start":{"line":1581,"column":8},"end":{"line":1581,"column":8}}]},"32":{"line":1602,"type":"if","locations":[{"start":{"line":1602,"column":8},"end":{"line":1602,"column":8}},{"start":{"line":1602,"column":8},"end":{"line":1602,"column":8}}]},"33":{"line":1646,"type":"if","locations":[{"start":{"line":1646,"column":8},"end":{"line":1646,"column":8}},{"start":{"line":1646,"column":8},"end":{"line":1646,"column":8}}]},"34":{"line":1651,"type":"if","locations":[{"start":{"line":1651,"column":8},"end":{"line":1651,"column":8}},{"start":{"line":1651,"column":8},"end":{"line":1651,"column":8}}]},"35":{"line":1688,"type":"if","locations":[{"start":{"line":1688,"column":8},"end":{"line":1688,"column":8}},{"start":{"line":1688,"column":8},"end":{"line":1688,"column":8}}]},"36":{"line":1759,"type":"if","locations":[{"start":{"line":1759,"column":8},"end":{"line":1759,"column":8}},{"start":{"line":1759,"column":8},"end":{"line":1759,"column":8}}]},"37":{"line":1764,"type":"if","locations":[{"start":{"line":1764,"column":8},"end":{"line":1764,"column":8}},{"start":{"line":1764,"column":8},"end":{"line":1764,"column":8}}]},"38":{"line":1769,"type":"if","locations":[{"start":{"line":1769,"column":8},"end":{"line":1769,"column":8}},{"start":{"line":1769,"column":8},"end":{"line":1769,"column":8}}]},"39":{"line":1837,"type":"if","locations":[{"start":{"line":1837,"column":8},"end":{"line":1837,"column":8}},{"start":{"line":1837,"column":8},"end":{"line":1837,"column":8}}]},"40":{"line":1846,"type":"if","locations":[{"start":{"line":1846,"column":8},"end":{"line":1846,"column":8}},{"start":{"line":1846,"column":8},"end":{"line":1846,"column":8}}]},"41":{"line":1848,"type":"if","locations":[{"start":{"line":1848,"column":12},"end":{"line":1848,"column":12}},{"start":{"line":1848,"column":12},"end":{"line":1848,"column":12}}]}}},"contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol":{"l":{"43":277,"54":277,"56":277,"58":277,"60":277,"61":277,"62":277,"65":277,"66":277,"146":152},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol","s":{"1":277,"2":277,"3":277,"4":277,"5":277,"6":277,"7":277,"8":152},"b":{},"f":{"1":277},"fnMap":{"1":{"name":"isBytecodeSafe","line":31,"loc":{"start":{"line":31,"column":4},"end":{"line":147,"column":4}}}},"statementMap":{"1":{"start":{"line":43,"column":8},"end":{"line":43,"column":1492}},"2":{"start":{"line":54,"column":8},"end":{"line":54,"column":109}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":112}},"4":{"start":{"line":58,"column":8},"end":{"line":58,"column":77}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":26}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":19}},"7":{"start":{"line":65,"column":8},"end":{"line":65,"column":42}},"8":{"start":{"line":146,"column":8},"end":{"line":146,"column":19}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol":{"l":{"57":207,"71":921,"75":920,"97":0,"111":12,"127":12,"141":0,"142":0,"143":0,"161":4,"179":537,"197":31,"216":31,"234":60,"252":369,"270":0,"284":30,"285":30,"286":30,"287":30,"288":30,"306":18,"307":18,"308":18,"326":538,"347":61,"368":7,"369":7,"370":3,"373":4,"374":4,"376":4,"387":70,"402":5,"420":0,"421":0,"439":0,"440":0,"466":14,"473":14,"474":8,"497":57,"501":6,"505":51,"525":74,"545":69,"568":19,"591":9,"592":9,"593":3,"596":6,"597":6,"599":6,"610":30,"625":5,"645":0,"646":0,"666":0,"667":0,"689":606,"708":97,"730":687,"732":687,"733":268,"736":687},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol","s":{"1":207,"2":921,"3":0,"4":12,"5":12,"6":0,"7":0,"8":0,"9":4,"10":537,"11":31,"12":31,"13":60,"14":369,"15":0,"16":30,"17":30,"18":30,"19":30,"20":30,"21":18,"22":18,"23":18,"24":538,"25":61,"26":7,"27":7,"28":3,"29":4,"30":4,"31":4,"32":70,"33":5,"34":0,"35":0,"36":0,"37":0,"38":14,"39":14,"40":8,"41":57,"42":6,"43":51,"44":74,"45":69,"46":19,"47":9,"48":9,"49":3,"50":6,"51":6,"52":6,"53":30,"54":5,"55":0,"56":0,"57":0,"58":0,"59":606,"60":97,"61":687,"62":687,"63":268,"64":687},"b":{"1":[920,1],"2":[3,4],"3":[8,6],"4":[6,51],"5":[3,6],"6":[268,419]},"f":{"1":207,"2":921,"3":0,"4":12,"5":12,"6":0,"7":4,"8":537,"9":31,"10":31,"11":60,"12":369,"13":0,"14":30,"15":18,"16":538,"17":61,"18":7,"19":70,"20":5,"21":0,"22":0,"23":14,"24":57,"25":74,"26":69,"27":19,"28":9,"29":30,"30":5,"31":0,"32":0,"33":606,"34":97,"35":687},"fnMap":{"1":{"name":"constructor","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":58,"column":4}}},"2":{"name":"authenticated","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":76,"column":4}}},"3":{"name":"isAuthenticated","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":98,"column":4}}},"4":{"name":"setExecutionManager","line":109,"loc":{"start":{"line":104,"column":4},"end":{"line":112,"column":4}}},"5":{"name":"putAccount","line":125,"loc":{"start":{"line":119,"column":4},"end":{"line":128,"column":4}}},"6":{"name":"putEmptyAccount","line":139,"loc":{"start":{"line":134,"column":4},"end":{"line":144,"column":4}}},"7":{"name":"getAccount","line":151,"loc":{"start":{"line":151,"column":4},"end":{"line":162,"column":4}}},"8":{"name":"hasAccount","line":169,"loc":{"start":{"line":169,"column":4},"end":{"line":180,"column":4}}},"9":{"name":"hasEmptyAccount","line":187,"loc":{"start":{"line":187,"column":4},"end":{"line":201,"column":4}}},"10":{"name":"setAccountNonce","line":214,"loc":{"start":{"line":208,"column":4},"end":{"line":217,"column":4}}},"11":{"name":"getAccountNonce","line":224,"loc":{"start":{"line":224,"column":4},"end":{"line":235,"column":4}}},"12":{"name":"getAccountEthAddress","line":242,"loc":{"start":{"line":242,"column":4},"end":{"line":253,"column":4}}},"13":{"name":"getAccountStorageRoot","line":260,"loc":{"start":{"line":260,"column":4},"end":{"line":271,"column":4}}},"14":{"name":"initPendingAccount","line":282,"loc":{"start":{"line":277,"column":4},"end":{"line":289,"column":4}}},"15":{"name":"commitPendingAccount","line":304,"loc":{"start":{"line":297,"column":4},"end":{"line":309,"column":4}}},"16":{"name":"testAndSetAccountLoaded","line":321,"loc":{"start":{"line":316,"column":4},"end":{"line":330,"column":4}}},"17":{"name":"testAndSetAccountChanged","line":342,"loc":{"start":{"line":337,"column":4},"end":{"line":351,"column":4}}},"18":{"name":"commitAccount","line":363,"loc":{"start":{"line":358,"column":4},"end":{"line":377,"column":4}}},"19":{"name":"incrementTotalUncommittedAccounts","line":385,"loc":{"start":{"line":382,"column":4},"end":{"line":388,"column":4}}},"20":{"name":"getTotalUncommittedAccounts","line":394,"loc":{"start":{"line":394,"column":4},"end":{"line":403,"column":4}}},"21":{"name":"wasAccountChanged","line":410,"loc":{"start":{"line":410,"column":4},"end":{"line":422,"column":4}}},"22":{"name":"wasAccountCommitted","line":429,"loc":{"start":{"line":429,"column":4},"end":{"line":441,"column":4}}},"23":{"name":"putContractStorage","line":461,"loc":{"start":{"line":454,"column":4},"end":{"line":476,"column":4}}},"24":{"name":"getContractStorage","line":484,"loc":{"start":{"line":484,"column":4},"end":{"line":506,"column":4}}},"25":{"name":"hasContractStorage","line":514,"loc":{"start":{"line":514,"column":4},"end":{"line":526,"column":4}}},"26":{"name":"testAndSetContractStorageLoaded","line":540,"loc":{"start":{"line":534,"column":4},"end":{"line":549,"column":4}}},"27":{"name":"testAndSetContractStorageChanged","line":563,"loc":{"start":{"line":557,"column":4},"end":{"line":572,"column":4}}},"28":{"name":"commitContractStorage","line":586,"loc":{"start":{"line":580,"column":4},"end":{"line":600,"column":4}}},"29":{"name":"incrementTotalUncommittedContractStorage","line":608,"loc":{"start":{"line":605,"column":4},"end":{"line":611,"column":4}}},"30":{"name":"getTotalUncommittedContractStorage","line":617,"loc":{"start":{"line":617,"column":4},"end":{"line":626,"column":4}}},"31":{"name":"wasContractStorageChanged","line":634,"loc":{"start":{"line":634,"column":4},"end":{"line":647,"column":4}}},"32":{"name":"wasContractStorageCommitted","line":655,"loc":{"start":{"line":655,"column":4},"end":{"line":668,"column":4}}},"33":{"name":"_getItemHash","line":680,"loc":{"start":{"line":680,"column":4},"end":{"line":690,"column":4}}},"34":{"name":"_getItemHash","line":698,"loc":{"start":{"line":698,"column":4},"end":{"line":712,"column":4}}},"35":{"name":"_testAndSetItemState","line":721,"loc":{"start":{"line":721,"column":4},"end":{"line":737,"column":4}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":21}},"2":{"start":{"line":71,"column":8},"end":{"line":71,"column":2475}},"3":{"start":{"line":97,"column":8},"end":{"line":97,"column":69}},"4":{"start":{"line":111,"column":8},"end":{"line":111,"column":49}},"5":{"start":{"line":127,"column":8},"end":{"line":127,"column":36}},"6":{"start":{"line":141,"column":8},"end":{"line":141,"column":65}},"7":{"start":{"line":142,"column":8},"end":{"line":142,"column":55}},"8":{"start":{"line":143,"column":8},"end":{"line":143,"column":49}},"9":{"start":{"line":161,"column":8},"end":{"line":161,"column":33}},"10":{"start":{"line":179,"column":8},"end":{"line":179,"column":56}},"11":{"start":{"line":197,"column":8},"end":{"line":197,"column":5447}},"12":{"start":{"line":216,"column":8},"end":{"line":216,"column":40}},"13":{"start":{"line":234,"column":8},"end":{"line":234,"column":39}},"14":{"start":{"line":252,"column":8},"end":{"line":252,"column":44}},"15":{"start":{"line":270,"column":8},"end":{"line":270,"column":45}},"16":{"start":{"line":284,"column":8},"end":{"line":284,"column":65}},"17":{"start":{"line":285,"column":8},"end":{"line":285,"column":24}},"18":{"start":{"line":286,"column":8},"end":{"line":286,"column":55}},"19":{"start":{"line":287,"column":8},"end":{"line":287,"column":49}},"20":{"start":{"line":288,"column":8},"end":{"line":288,"column":29}},"21":{"start":{"line":306,"column":8},"end":{"line":306,"column":65}},"22":{"start":{"line":307,"column":8},"end":{"line":307,"column":39}},"23":{"start":{"line":308,"column":8},"end":{"line":308,"column":35}},"24":{"start":{"line":326,"column":8},"end":{"line":326,"column":8632}},"25":{"start":{"line":347,"column":8},"end":{"line":347,"column":9161}},"26":{"start":{"line":368,"column":8},"end":{"line":368,"column":45}},"27":{"start":{"line":369,"column":8},"end":{"line":369,"column":9676}},"28":{"start":{"line":370,"column":12},"end":{"line":370,"column":24}},"29":{"start":{"line":373,"column":8},"end":{"line":373,"column":50}},"30":{"start":{"line":374,"column":8},"end":{"line":374,"column":36}},"31":{"start":{"line":376,"column":8},"end":{"line":376,"column":19}},"32":{"start":{"line":387,"column":8},"end":{"line":387,"column":36}},"33":{"start":{"line":402,"column":8},"end":{"line":402,"column":39}},"34":{"start":{"line":420,"column":8},"end":{"line":420,"column":45}},"35":{"start":{"line":421,"column":8},"end":{"line":421,"column":57}},"36":{"start":{"line":439,"column":8},"end":{"line":439,"column":45}},"37":{"start":{"line":440,"column":8},"end":{"line":440,"column":59}},"38":{"start":{"line":466,"column":8},"end":{"line":466,"column":68}},"39":{"start":{"line":473,"column":8},"end":{"line":473,"column":12609}},"40":{"start":{"line":474,"column":12},"end":{"line":474,"column":58}},"41":{"start":{"line":497,"column":8},"end":{"line":497,"column":13277}},"42":{"start":{"line":501,"column":12},"end":{"line":501,"column":29}},"43":{"start":{"line":505,"column":8},"end":{"line":505,"column":67}},"44":{"start":{"line":525,"column":8},"end":{"line":525,"column":86}},"45":{"start":{"line":545,"column":8},"end":{"line":545,"column":14610}},"46":{"start":{"line":568,"column":8},"end":{"line":568,"column":15225}},"47":{"start":{"line":591,"column":8},"end":{"line":591,"column":52}},"48":{"start":{"line":592,"column":8},"end":{"line":592,"column":15834}},"49":{"start":{"line":593,"column":12},"end":{"line":593,"column":24}},"50":{"start":{"line":596,"column":8},"end":{"line":596,"column":50}},"51":{"start":{"line":597,"column":8},"end":{"line":597,"column":43}},"52":{"start":{"line":599,"column":8},"end":{"line":599,"column":19}},"53":{"start":{"line":610,"column":8},"end":{"line":610,"column":43}},"54":{"start":{"line":625,"column":8},"end":{"line":625,"column":46}},"55":{"start":{"line":645,"column":8},"end":{"line":645,"column":52}},"56":{"start":{"line":646,"column":8},"end":{"line":646,"column":57}},"57":{"start":{"line":666,"column":8},"end":{"line":666,"column":52}},"58":{"start":{"line":667,"column":8},"end":{"line":667,"column":59}},"59":{"start":{"line":689,"column":8},"end":{"line":689,"column":52}},"60":{"start":{"line":708,"column":8},"end":{"line":708,"column":18596}},"61":{"start":{"line":730,"column":8},"end":{"line":730,"column":62}},"62":{"start":{"line":732,"column":8},"end":{"line":732,"column":19270}},"63":{"start":{"line":733,"column":12},"end":{"line":733,"column":44}},"64":{"start":{"line":736,"column":8},"end":{"line":736,"column":27}}},"branchMap":{"1":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":8}},{"start":{"line":71,"column":8},"end":{"line":71,"column":8}}]},"2":{"line":369,"type":"if","locations":[{"start":{"line":369,"column":8},"end":{"line":369,"column":8}},{"start":{"line":369,"column":8},"end":{"line":369,"column":8}}]},"3":{"line":473,"type":"if","locations":[{"start":{"line":473,"column":8},"end":{"line":473,"column":8}},{"start":{"line":473,"column":8},"end":{"line":473,"column":8}}]},"4":{"line":497,"type":"if","locations":[{"start":{"line":497,"column":8},"end":{"line":497,"column":8}},{"start":{"line":497,"column":8},"end":{"line":497,"column":8}}]},"5":{"line":592,"type":"if","locations":[{"start":{"line":592,"column":8},"end":{"line":592,"column":8}},{"start":{"line":592,"column":8},"end":{"line":592,"column":8}}]},"6":{"line":732,"type":"if","locations":[{"start":{"line":732,"column":8},"end":{"line":732,"column":8}},{"start":{"line":732,"column":8},"end":{"line":732,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol":{"l":{"39":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol","s":{"1":0},"b":{},"f":{"1":0},"fnMap":{"1":{"name":"create","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":40,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":43}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol":{"l":{"57":0,"58":0,"59":0,"60":0,"62":0,"74":0,"75":0,"77":0,"78":0,"79":0,"85":0,"86":0,"94":0,"95":0,"96":0,"104":0,"105":0,"107":0,"115":0,"125":0,"127":0,"138":0,"139":0,"141":0,"149":0,"150":0,"152":0,"153":0,"154":0,"157":0,"158":0,"159":0,"162":0,"163":0,"164":0,"166":0,"173":0,"180":0,"182":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0},"fnMap":{"1":{"name":"getInterfaceImplementer","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":63,"column":4}}},"2":{"name":"setInterfaceImplementer","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":87,"column":4}}},"3":{"name":"setManager","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":97,"column":4}}},"4":{"name":"getManager","line":102,"loc":{"start":{"line":102,"column":4},"end":{"line":109,"column":4}}},"5":{"name":"interfaceHash","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":116,"column":4}}},"6":{"name":"updateERC165Cache","line":124,"loc":{"start":{"line":124,"column":4},"end":{"line":128,"column":4}}},"7":{"name":"implementsERC165Interface","line":137,"loc":{"start":{"line":137,"column":4},"end":{"line":142,"column":4}}},"8":{"name":"implementsERC165InterfaceNoCache","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":167,"column":4}}},"9":{"name":"isERC165Interface","line":172,"loc":{"start":{"line":172,"column":4},"end":{"line":174,"column":4}}},"10":{"name":"noThrowCall","line":177,"loc":{"start":{"line":177,"column":4},"end":{"line":198,"column":4}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":63}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":3386}},"3":{"start":{"line":59,"column":12},"end":{"line":59,"column":63}},"4":{"start":{"line":60,"column":12},"end":{"line":60,"column":91}},"5":{"start":{"line":62,"column":8},"end":{"line":62,"column":47}},"6":{"start":{"line":74,"column":8},"end":{"line":74,"column":63}},"7":{"start":{"line":75,"column":8},"end":{"line":75,"column":65}},"8":{"start":{"line":77,"column":8},"end":{"line":77,"column":80}},"9":{"start":{"line":78,"column":8},"end":{"line":78,"column":4625}},"10":{"start":{"line":79,"column":12},"end":{"line":79,"column":4705}},"11":{"start":{"line":85,"column":8},"end":{"line":85,"column":54}},"12":{"start":{"line":86,"column":8},"end":{"line":86,"column":72}},"13":{"start":{"line":94,"column":8},"end":{"line":94,"column":66}},"14":{"start":{"line":95,"column":8},"end":{"line":95,"column":72}},"15":{"start":{"line":96,"column":8},"end":{"line":96,"column":47}},"16":{"start":{"line":104,"column":8},"end":{"line":104,"column":5986}},"17":{"start":{"line":105,"column":12},"end":{"line":105,"column":24}},"18":{"start":{"line":107,"column":12},"end":{"line":107,"column":34}},"19":{"start":{"line":115,"column":8},"end":{"line":115,"column":58}},"20":{"start":{"line":125,"column":8},"end":{"line":125,"column":6972}},"21":{"start":{"line":127,"column":8},"end":{"line":127,"column":51}},"22":{"start":{"line":138,"column":8},"end":{"line":138,"column":7770}},"23":{"start":{"line":139,"column":12},"end":{"line":139,"column":76}},"24":{"start":{"line":141,"column":8},"end":{"line":141,"column":63}},"25":{"start":{"line":149,"column":8},"end":{"line":149,"column":23}},"26":{"start":{"line":150,"column":8},"end":{"line":150,"column":22}},"27":{"start":{"line":152,"column":8},"end":{"line":152,"column":59}},"28":{"start":{"line":153,"column":8},"end":{"line":153,"column":8523}},"29":{"start":{"line":154,"column":12},"end":{"line":154,"column":24}},"30":{"start":{"line":157,"column":8},"end":{"line":157,"column":61}},"31":{"start":{"line":158,"column":8},"end":{"line":158,"column":8667}},"32":{"start":{"line":159,"column":12},"end":{"line":159,"column":24}},"33":{"start":{"line":162,"column":8},"end":{"line":162,"column":63}},"34":{"start":{"line":163,"column":8},"end":{"line":163,"column":8813}},"35":{"start":{"line":164,"column":12},"end":{"line":164,"column":23}},"36":{"start":{"line":166,"column":8},"end":{"line":166,"column":20}},"37":{"start":{"line":173,"column":8},"end":{"line":173,"column":103}},"38":{"start":{"line":180,"column":8},"end":{"line":180,"column":34}}},"branchMap":{"1":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":8},"end":{"line":58,"column":8}},{"start":{"line":58,"column":8},"end":{"line":58,"column":8}}]},"2":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":8},"end":{"line":75,"column":8}},{"start":{"line":75,"column":8},"end":{"line":75,"column":8}}]},"3":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":77,"column":8}},{"start":{"line":77,"column":8},"end":{"line":77,"column":8}}]},"4":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]},"5":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":12},"end":{"line":79,"column":12}},{"start":{"line":79,"column":12},"end":{"line":79,"column":12}}]},"6":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":8},"end":{"line":94,"column":8}},{"start":{"line":94,"column":8},"end":{"line":94,"column":8}}]},"7":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":8},"end":{"line":104,"column":8}},{"start":{"line":104,"column":8},"end":{"line":104,"column":8}}]},"8":{"line":138,"type":"if","locations":[{"start":{"line":138,"column":8},"end":{"line":138,"column":8}},{"start":{"line":138,"column":8},"end":{"line":138,"column":8}}]},"9":{"line":153,"type":"if","locations":[{"start":{"line":153,"column":8},"end":{"line":153,"column":8}},{"start":{"line":153,"column":8},"end":{"line":153,"column":8}}]},"10":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":8},"end":{"line":158,"column":8}},{"start":{"line":158,"column":8},"end":{"line":158,"column":8}}]},"11":{"line":163,"type":"if","locations":[{"start":{"line":163,"column":8},"end":{"line":163,"column":8}},{"start":{"line":163,"column":8},"end":{"line":163,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol":{"l":{"40":0,"46":0,"50":0,"70":0,"74":0,"75":0,"78":0,"82":0,"86":0,"102":0,"122":0,"139":0,"156":0,"170":0,"171":0,"188":29,"192":29,"193":25,"196":4,"200":4,"201":1,"204":3,"210":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":29,"16":29,"17":25,"18":4,"19":4,"20":1,"21":3,"22":3},"b":{"1":[0,0],"2":[25,4],"3":[1,3]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":29},"fnMap":{"1":{"name":"onlyOwner","line":39,"loc":{"start":{"line":39,"column":4},"end":{"line":51,"column":4}}},"2":{"name":"initialize","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":90,"column":4}}},"3":{"name":"getOwner","line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":107,"column":4}}},"4":{"name":"setWhitelistedDeployer","line":120,"loc":{"start":{"line":114,"column":4},"end":{"line":126,"column":4}}},"5":{"name":"setOwner","line":137,"loc":{"start":{"line":132,"column":4},"end":{"line":143,"column":4}}},"6":{"name":"setAllowArbitraryDeployment","line":154,"loc":{"start":{"line":149,"column":4},"end":{"line":160,"column":4}}},"7":{"name":"enableArbitraryContractDeployment","line":168,"loc":{"start":{"line":165,"column":4},"end":{"line":172,"column":4}}},"8":{"name":"isDeployerAllowed","line":179,"loc":{"start":{"line":179,"column":4},"end":{"line":211,"column":4}}}},"statementMap":{"1":{"start":{"line":40,"column":8},"end":{"line":40,"column":1617}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":1775}},"3":{"start":{"line":70,"column":8},"end":{"line":70,"column":2421}},"4":{"start":{"line":74,"column":8},"end":{"line":74,"column":2555}},"5":{"start":{"line":75,"column":12},"end":{"line":75,"column":18}},"6":{"start":{"line":78,"column":8},"end":{"line":78,"column":2621}},"7":{"start":{"line":82,"column":8},"end":{"line":82,"column":2757}},"8":{"start":{"line":86,"column":8},"end":{"line":86,"column":2892}},"9":{"start":{"line":102,"column":8},"end":{"line":102,"column":3237}},"10":{"start":{"line":122,"column":8},"end":{"line":122,"column":3758}},"11":{"start":{"line":139,"column":8},"end":{"line":139,"column":4149}},"12":{"start":{"line":156,"column":8},"end":{"line":156,"column":4591}},"13":{"start":{"line":170,"column":8},"end":{"line":170,"column":40}},"14":{"start":{"line":171,"column":8},"end":{"line":171,"column":27}},"15":{"start":{"line":188,"column":8},"end":{"line":188,"column":5404}},"16":{"start":{"line":192,"column":8},"end":{"line":192,"column":5538}},"17":{"start":{"line":193,"column":12},"end":{"line":193,"column":23}},"18":{"start":{"line":196,"column":8},"end":{"line":196,"column":5611}},"19":{"start":{"line":200,"column":8},"end":{"line":200,"column":5773}},"20":{"start":{"line":201,"column":12},"end":{"line":201,"column":23}},"21":{"start":{"line":204,"column":8},"end":{"line":204,"column":5858}},"22":{"start":{"line":210,"column":8},"end":{"line":210,"column":28}}},"branchMap":{"1":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":8},"end":{"line":74,"column":8}},{"start":{"line":74,"column":8},"end":{"line":74,"column":8}}]},"2":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":8},"end":{"line":192,"column":8}},{"start":{"line":192,"column":8},"end":{"line":192,"column":8}}]},"3":{"line":200,"type":"if","locations":[{"start":{"line":200,"column":8},"end":{"line":200,"column":8}},{"start":{"line":200,"column":8},"end":{"line":200,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol":{"l":{"32":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol","s":{"1":0},"b":{},"f":{"1":0},"fnMap":{"1":{"name":"constructor","line":30,"loc":{"start":{"line":22,"column":4},"end":{"line":33,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":47}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol":{"l":{"41":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol","s":{"1":1},"b":{},"f":{"1":1},"fnMap":{"1":{"name":"getL1MessageSender","line":32,"loc":{"start":{"line":32,"column":4},"end":{"line":42,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":64}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol":{"l":{"43":31},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol","s":{"1":31},"b":{},"f":{"1":31},"fnMap":{"1":{"name":"passMessageToL1","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":49,"column":4}}}},"statementMap":{"1":{"start":{"line":43,"column":8},"end":{"line":43,"column":1351}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol":{"l":{"25":1,"43":2,"47":2,"48":2,"56":2,"61":2,"74":4,"86":1,"98":2,"110":4},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol","s":{"1":1,"2":2,"3":2,"4":2,"5":2,"6":2,"7":4,"8":1,"9":2,"10":4},"b":{},"f":{"1":1,"2":2,"3":2,"4":4,"5":1,"6":2,"7":4},"fnMap":{"1":{"name":null,"line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":30,"column":4}}},"2":{"name":"init","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"upgrade","line":51,"loc":{"start":{"line":51,"column":4},"end":{"line":62,"column":4}}},"4":{"name":"_setImplementation","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":78,"column":4}}},"5":{"name":"_getImplementation","line":80,"loc":{"start":{"line":80,"column":4},"end":{"line":91,"column":4}}},"6":{"name":"_setOwner","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":102,"column":4}}},"7":{"name":"_getOwner","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":115,"column":4}}}},"statementMap":{"1":{"start":{"line":25,"column":8},"end":{"line":25,"column":678}},"2":{"start":{"line":43,"column":8},"end":{"line":43,"column":1017}},"3":{"start":{"line":47,"column":8},"end":{"line":47,"column":24}},"4":{"start":{"line":48,"column":8},"end":{"line":48,"column":42}},"5":{"start":{"line":56,"column":8},"end":{"line":56,"column":1345}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":42}},"7":{"start":{"line":74,"column":8},"end":{"line":74,"column":1768}},"8":{"start":{"line":86,"column":8},"end":{"line":86,"column":2050}},"9":{"start":{"line":98,"column":8},"end":{"line":98,"column":2288}},"10":{"start":{"line":110,"column":8},"end":{"line":110,"column":2543}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol":{"l":{"52":7,"54":5,"55":5,"56":5,"59":5,"60":5,"63":5,"68":5,"76":5,"78":2,"79":2,"83":5,"92":5,"117":7,"118":3,"120":2,"122":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol","s":{"1":7,"2":5,"3":5,"4":5,"5":5,"6":5,"7":5,"8":5,"9":5,"10":2,"11":2,"12":5,"13":5,"14":7,"15":3,"16":4,"17":2,"18":2},"b":{"1":[2,3],"2":[3,4],"3":[2,2]},"f":{"1":7,"2":7},"fnMap":{"1":{"name":null,"line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":97,"column":4}}},"2":{"name":"_getTransactionType","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":126,"column":4}}}},"statementMap":{"1":{"start":{"line":52,"column":8},"end":{"line":52,"column":98}},"2":{"start":{"line":54,"column":8},"end":{"line":54,"column":83}},"3":{"start":{"line":55,"column":8},"end":{"line":55,"column":84}},"4":{"start":{"line":56,"column":8},"end":{"line":56,"column":54}},"5":{"start":{"line":59,"column":8},"end":{"line":59,"column":70}},"6":{"start":{"line":60,"column":8},"end":{"line":60,"column":87}},"7":{"start":{"line":63,"column":8},"end":{"line":63,"column":2436}},"8":{"start":{"line":68,"column":8},"end":{"line":68,"column":2618}},"9":{"start":{"line":76,"column":8},"end":{"line":76,"column":2784}},"10":{"start":{"line":78,"column":12},"end":{"line":78,"column":94}},"11":{"start":{"line":79,"column":12},"end":{"line":79,"column":85}},"12":{"start":{"line":83,"column":8},"end":{"line":83,"column":3190}},"13":{"start":{"line":92,"column":8},"end":{"line":92,"column":3423}},"14":{"start":{"line":117,"column":8},"end":{"line":117,"column":3983}},"15":{"start":{"line":118,"column":12},"end":{"line":118,"column":57}},"16":{"start":{"line":119,"column":10},"end":{"line":119,"column":4081}},"17":{"start":{"line":120,"column":12},"end":{"line":120,"column":53}},"18":{"start":{"line":122,"column":12},"end":{"line":122,"column":4198}}},"branchMap":{"1":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"2":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":8},"end":{"line":117,"column":8}},{"start":{"line":117,"column":8},"end":{"line":117,"column":8}}]},"3":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":10},"end":{"line":119,"column":10}},{"start":{"line":119,"column":10},"end":{"line":119,"column":10}}]}}},"contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol":{"l":{"13":28,"14":28,"15":14,"16":14},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol","s":{"1":28,"2":14,"3":14},"b":{},"f":{"1":28},"fnMap":{"1":{"name":"contributesToFraudProof","line":12,"loc":{"start":{"line":12,"column":4},"end":{"line":17,"column":4}}}},"statementMap":{"1":{"start":{"line":13,"column":8},"end":{"line":13,"column":36}},"2":{"start":{"line":15,"column":8},"end":{"line":15,"column":47}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":110}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol":{"l":{"69":63,"80":46,"81":46,"83":45,"84":45,"90":13,"91":12,"95":11,"97":11,"98":11,"99":8,"100":8,"101":8,"108":1,"109":1,"118":11,"123":1,"127":10,"133":18,"139":18,"144":7,"145":7,"146":7,"148":6,"149":6,"154":5,"156":5,"160":4,"163":3,"164":3,"166":3,"175":6,"176":6,"182":5,"183":5,"186":5,"190":4,"193":4,"196":4,"201":3,"206":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol","s":{"1":63,"2":46,"3":46,"4":45,"5":45,"6":13,"7":12,"8":11,"9":11,"10":11,"11":8,"12":8,"13":8,"14":3,"15":1,"16":1,"17":11,"18":1,"19":10,"20":18,"21":18,"22":7,"23":7,"24":7,"25":6,"26":6,"27":5,"28":5,"29":4,"30":3,"31":3,"32":3,"33":6,"34":6,"35":5,"36":5,"37":5,"38":4,"39":4,"40":4,"41":3,"42":2},"b":{"1":[45,1],"2":[12,1],"3":[11,1],"4":[8,3],"5":[1,2],"6":[1,10],"7":[18,0],"8":[7,0],"9":[6,1],"10":[4,1],"11":[3,1],"12":[3,0],"13":[5,1],"14":[4,1],"15":[4,0]},"f":{"1":63,"2":46,"3":13,"4":18,"5":7,"6":5,"7":6,"8":3,"9":2},"fnMap":{"1":{"name":"constructor","line":67,"loc":{"start":{"line":63,"column":4},"end":{"line":70,"column":4}}},"2":{"name":"recordGasSpent","line":78,"loc":{"start":{"line":78,"column":4},"end":{"line":85,"column":4}}},"3":{"name":"finalize","line":89,"loc":{"start":{"line":89,"column":4},"end":{"line":128,"column":4}}},"4":{"name":"deposit","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"5":{"name":"startWithdrawal","line":143,"loc":{"start":{"line":143,"column":4},"end":{"line":150,"column":4}}},"6":{"name":"finalizeWithdrawal","line":153,"loc":{"start":{"line":153,"column":4},"end":{"line":170,"column":4}}},"7":{"name":"claim","line":174,"loc":{"start":{"line":174,"column":4},"end":{"line":197,"column":4}}},"8":{"name":"isCollateralized","line":200,"loc":{"start":{"line":200,"column":4},"end":{"line":202,"column":4}}},"9":{"name":"getGasSpent","line":205,"loc":{"start":{"line":205,"column":4},"end":{"line":207,"column":4}}}},"statementMap":{"1":{"start":{"line":69,"column":8},"end":{"line":69,"column":21}},"2":{"start":{"line":80,"column":8},"end":{"line":80,"column":133}},"3":{"start":{"line":81,"column":8},"end":{"line":81,"column":68}},"4":{"start":{"line":83,"column":8},"end":{"line":83,"column":56}},"5":{"start":{"line":84,"column":8},"end":{"line":84,"column":64}},"6":{"start":{"line":90,"column":8},"end":{"line":90,"column":86}},"7":{"start":{"line":91,"column":8},"end":{"line":91,"column":91}},"8":{"start":{"line":95,"column":8},"end":{"line":95,"column":54}},"9":{"start":{"line":97,"column":8},"end":{"line":97,"column":44}},"10":{"start":{"line":98,"column":8},"end":{"line":98,"column":3657}},"11":{"start":{"line":99,"column":12},"end":{"line":99,"column":48}},"12":{"start":{"line":100,"column":12},"end":{"line":100,"column":57}},"13":{"start":{"line":101,"column":12},"end":{"line":101,"column":45}},"14":{"start":{"line":102,"column":15},"end":{"line":102,"column":3863}},"15":{"start":{"line":108,"column":12},"end":{"line":108,"column":57}},"16":{"start":{"line":109,"column":12},"end":{"line":109,"column":45}},"17":{"start":{"line":118,"column":8},"end":{"line":118,"column":4758}},"18":{"start":{"line":123,"column":12},"end":{"line":123,"column":18}},"19":{"start":{"line":127,"column":8},"end":{"line":127,"column":44}},"20":{"start":{"line":133,"column":8},"end":{"line":133,"column":5212}},"21":{"start":{"line":139,"column":8},"end":{"line":139,"column":53}},"22":{"start":{"line":144,"column":8},"end":{"line":144,"column":45}},"23":{"start":{"line":145,"column":8},"end":{"line":145,"column":72}},"24":{"start":{"line":146,"column":8},"end":{"line":146,"column":70}},"25":{"start":{"line":148,"column":8},"end":{"line":148,"column":37}},"26":{"start":{"line":149,"column":8},"end":{"line":149,"column":57}},"27":{"start":{"line":154,"column":8},"end":{"line":154,"column":45}},"28":{"start":{"line":156,"column":8},"end":{"line":156,"column":5998}},"29":{"start":{"line":160,"column":8},"end":{"line":160,"column":63}},"30":{"start":{"line":163,"column":8},"end":{"line":163,"column":44}},"31":{"start":{"line":164,"column":8},"end":{"line":164,"column":35}},"32":{"start":{"line":166,"column":8},"end":{"line":166,"column":6334}},"33":{"start":{"line":175,"column":8},"end":{"line":175,"column":38}},"34":{"start":{"line":176,"column":8},"end":{"line":176,"column":6686}},"35":{"start":{"line":182,"column":8},"end":{"line":182,"column":62}},"36":{"start":{"line":183,"column":8},"end":{"line":183,"column":65}},"37":{"start":{"line":186,"column":8},"end":{"line":186,"column":53}},"38":{"start":{"line":190,"column":8},"end":{"line":190,"column":98}},"39":{"start":{"line":193,"column":8},"end":{"line":193,"column":39}},"40":{"start":{"line":196,"column":8},"end":{"line":196,"column":68}},"41":{"start":{"line":201,"column":8},"end":{"line":201,"column":55}},"42":{"start":{"line":206,"column":8},"end":{"line":206,"column":59}}},"branchMap":{"1":{"line":81,"type":"if","locations":[{"start":{"line":81,"column":8},"end":{"line":81,"column":8}},{"start":{"line":81,"column":8},"end":{"line":81,"column":8}}]},"2":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]},"3":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"4":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"5":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":15},"end":{"line":102,"column":15}},{"start":{"line":102,"column":15},"end":{"line":102,"column":15}}]},"6":{"line":118,"type":"if","locations":[{"start":{"line":118,"column":8},"end":{"line":118,"column":8}},{"start":{"line":118,"column":8},"end":{"line":118,"column":8}}]},"7":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":8}},{"start":{"line":133,"column":8},"end":{"line":133,"column":8}}]},"8":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":145,"column":8}},{"start":{"line":145,"column":8},"end":{"line":145,"column":8}}]},"9":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"10":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"11":{"line":160,"type":"if","locations":[{"start":{"line":160,"column":8},"end":{"line":160,"column":8}},{"start":{"line":160,"column":8},"end":{"line":160,"column":8}}]},"12":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":8},"end":{"line":166,"column":8}},{"start":{"line":166,"column":8},"end":{"line":166,"column":8}}]},"13":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":8},"end":{"line":176,"column":8}},{"start":{"line":176,"column":8},"end":{"line":176,"column":8}}]},"14":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"15":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol":{"l":{"74":21,"105":12,"107":12,"108":0,"111":12,"112":12,"114":12,"123":11,"133":10,"138":9,"140":9,"171":6,"172":6,"174":6,"179":5,"184":4,"193":3,"203":2,"208":1,"211":1,"213":1,"241":12,"257":9,"278":1,"279":1,"282":1,"287":1,"290":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol","s":{"1":21,"2":12,"3":12,"4":0,"5":12,"6":12,"7":12,"8":11,"9":10,"10":9,"11":9,"12":6,"13":6,"14":6,"15":5,"16":4,"17":3,"18":2,"19":1,"20":1,"21":1,"22":12,"23":9,"24":1,"25":1,"26":1,"27":1,"28":1},"b":{"1":[0,12],"2":[11,1],"3":[10,1],"4":[9,1],"5":[5,1],"6":[4,1],"7":[3,1],"8":[2,1],"9":[1,1]},"f":{"1":33,"2":21,"3":12,"4":6,"5":12,"6":9,"7":1},"fnMap":{"1":{"name":"constructor","line":50,"loc":{"start":{"line":47,"column":4},"end":{"line":51,"column":5}}},"2":{"name":"getStateTransitioner","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":75,"column":4}}},"3":{"name":"initializeFraudVerification","line":103,"loc":{"start":{"line":92,"column":4},"end":{"line":146,"column":4}}},"4":{"name":"finalizeFraudVerification","line":169,"loc":{"start":{"line":158,"column":4},"end":{"line":219,"column":4}}},"5":{"name":"_hasStateTransitioner","line":231,"loc":{"start":{"line":231,"column":4},"end":{"line":242,"column":4}}},"6":{"name":"_deployTransitioner","line":250,"loc":{"start":{"line":250,"column":4},"end":{"line":265,"column":4}}},"7":{"name":"_cancelStateTransition","line":272,"loc":{"start":{"line":272,"column":4},"end":{"line":295,"column":4}}}},"statementMap":{"1":{"start":{"line":74,"column":8},"end":{"line":74,"column":81}},"2":{"start":{"line":105,"column":8},"end":{"line":105,"column":68}},"3":{"start":{"line":107,"column":8},"end":{"line":107,"column":3959}},"4":{"start":{"line":108,"column":12},"end":{"line":108,"column":18}},"5":{"start":{"line":111,"column":8},"end":{"line":111,"column":122}},"6":{"start":{"line":112,"column":8},"end":{"line":112,"column":142}},"7":{"start":{"line":114,"column":8},"end":{"line":114,"column":4320}},"8":{"start":{"line":123,"column":8},"end":{"line":123,"column":4585}},"9":{"start":{"line":133,"column":8},"end":{"line":133,"column":4878}},"10":{"start":{"line":138,"column":8},"end":{"line":138,"column":76}},"11":{"start":{"line":140,"column":8},"end":{"line":140,"column":5238}},"12":{"start":{"line":171,"column":8},"end":{"line":171,"column":90}},"13":{"start":{"line":172,"column":8},"end":{"line":172,"column":122}},"14":{"start":{"line":174,"column":8},"end":{"line":174,"column":6732}},"15":{"start":{"line":179,"column":8},"end":{"line":179,"column":6888}},"16":{"start":{"line":184,"column":8},"end":{"line":184,"column":7179}},"17":{"start":{"line":193,"column":8},"end":{"line":193,"column":7444}},"18":{"start":{"line":203,"column":8},"end":{"line":203,"column":7814}},"19":{"start":{"line":208,"column":8},"end":{"line":208,"column":71}},"20":{"start":{"line":211,"column":8},"end":{"line":211,"column":142}},"21":{"start":{"line":213,"column":8},"end":{"line":213,"column":8258}},"22":{"start":{"line":241,"column":8},"end":{"line":241,"column":82}},"23":{"start":{"line":257,"column":8},"end":{"line":257,"column":9503}},"24":{"start":{"line":278,"column":8},"end":{"line":278,"column":122}},"25":{"start":{"line":279,"column":8},"end":{"line":279,"column":86}},"26":{"start":{"line":282,"column":8},"end":{"line":282,"column":10441}},"27":{"start":{"line":287,"column":8},"end":{"line":287,"column":116}},"28":{"start":{"line":290,"column":8},"end":{"line":290,"column":10767}}},"branchMap":{"1":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"2":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":8},"end":{"line":114,"column":8}},{"start":{"line":114,"column":8},"end":{"line":114,"column":8}}]},"3":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"4":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":8}},{"start":{"line":133,"column":8},"end":{"line":133,"column":8}}]},"5":{"line":174,"type":"if","locations":[{"start":{"line":174,"column":8},"end":{"line":174,"column":8}},{"start":{"line":174,"column":8},"end":{"line":174,"column":8}}]},"6":{"line":179,"type":"if","locations":[{"start":{"line":179,"column":8},"end":{"line":179,"column":8}},{"start":{"line":179,"column":8},"end":{"line":179,"column":8}}]},"7":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":8},"end":{"line":184,"column":8}},{"start":{"line":184,"column":8},"end":{"line":184,"column":8}}]},"8":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"9":{"line":203,"type":"if","locations":[{"start":{"line":203,"column":8},"end":{"line":203,"column":8}},{"start":{"line":203,"column":8},"end":{"line":203,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol":{"l":{"97":42,"98":42,"99":42,"100":42,"102":42,"117":13,"121":13,"141":0,"156":1,"171":1,"196":2,"205":2,"214":1,"216":1,"220":1,"221":1,"224":0,"228":1,"234":1,"247":0,"268":3,"273":3,"278":2,"279":2,"281":2,"283":0,"286":2,"295":1,"298":1,"303":0,"307":1,"331":1,"340":0,"345":0,"350":0,"355":0,"357":0,"379":2,"384":2,"389":1,"391":1,"401":1,"422":2,"427":1,"428":1,"430":1,"439":1,"442":1,"461":3,"466":2,"471":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol","s":{"1":42,"2":42,"3":42,"4":42,"5":42,"6":13,"7":0,"8":1,"9":1,"10":2,"11":2,"12":1,"13":1,"14":1,"15":1,"16":0,"17":1,"18":1,"19":0,"20":3,"21":3,"22":2,"23":2,"24":2,"25":0,"26":2,"27":1,"28":1,"29":0,"30":1,"31":1,"32":0,"33":0,"34":0,"35":0,"36":0,"37":2,"38":2,"39":1,"40":1,"41":1,"42":2,"43":1,"44":1,"45":1,"46":1,"47":1,"48":3,"49":2,"50":1},"b":{"1":[13,0],"2":[2,0],"3":[1,0],"4":[0,1],"5":[1,0],"6":[3,0],"7":[2,1],"8":[0,2],"9":[1,0],"10":[0,1],"11":[0,0],"12":[2,0],"13":[1,1],"14":[1,1],"15":[2,1],"16":[1,1]},"f":{"1":42,"2":13,"3":0,"4":1,"5":1,"6":2,"7":3,"8":1,"9":2,"10":2,"11":3},"fnMap":{"1":{"name":"constructor","line":95,"loc":{"start":{"line":89,"column":4},"end":{"line":103,"column":4}}},"2":{"name":"onlyDuringPhase","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":122,"column":4}}},"3":{"name":"getPreStateRoot","line":133,"loc":{"start":{"line":133,"column":4},"end":{"line":142,"column":4}}},"4":{"name":"getPostStateRoot","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":157,"column":4}}},"5":{"name":"isComplete","line":163,"loc":{"start":{"line":163,"column":4},"end":{"line":172,"column":4}}},"6":{"name":"proveContractState","line":193,"loc":{"start":{"line":185,"column":4},"end":{"line":249,"column":4}}},"7":{"name":"proveStorageSlot","line":265,"loc":{"start":{"line":257,"column":4},"end":{"line":312,"column":4}}},"8":{"name":"applyTransaction","line":329,"loc":{"start":{"line":323,"column":4},"end":{"line":358,"column":4}}},"9":{"name":"commitContractState","line":377,"loc":{"start":{"line":370,"column":4},"end":{"line":404,"column":4}}},"10":{"name":"commitStorageSlot","line":420,"loc":{"start":{"line":412,"column":4},"end":{"line":446,"column":4}}},"11":{"name":"completeTransition","line":459,"loc":{"start":{"line":456,"column":4},"end":{"line":472,"column":4}}}},"statementMap":{"1":{"start":{"line":97,"column":8},"end":{"line":97,"column":51}},"2":{"start":{"line":98,"column":8},"end":{"line":98,"column":35}},"3":{"start":{"line":99,"column":8},"end":{"line":99,"column":36}},"4":{"start":{"line":100,"column":8},"end":{"line":100,"column":41}},"5":{"start":{"line":102,"column":8},"end":{"line":102,"column":107}},"6":{"start":{"line":117,"column":8},"end":{"line":117,"column":4442}},"7":{"start":{"line":141,"column":8},"end":{"line":141,"column":27}},"8":{"start":{"line":156,"column":8},"end":{"line":156,"column":28}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":48}},"10":{"start":{"line":196,"column":8},"end":{"line":196,"column":6424}},"11":{"start":{"line":205,"column":8},"end":{"line":205,"column":6778}},"12":{"start":{"line":214,"column":8},"end":{"line":214,"column":7009}},"13":{"start":{"line":216,"column":12},"end":{"line":216,"column":7108}},"14":{"start":{"line":220,"column":12},"end":{"line":220,"column":60}},"15":{"start":{"line":221,"column":12},"end":{"line":221,"column":7300}},"16":{"start":{"line":224,"column":16},"end":{"line":224,"column":78}},"17":{"start":{"line":228,"column":16},"end":{"line":228,"column":7787}},"18":{"start":{"line":234,"column":12},"end":{"line":234,"column":8038}},"19":{"start":{"line":247,"column":12},"end":{"line":247,"column":63}},"20":{"start":{"line":268,"column":8},"end":{"line":268,"column":9237}},"21":{"start":{"line":273,"column":8},"end":{"line":273,"column":9402}},"22":{"start":{"line":278,"column":8},"end":{"line":278,"column":88}},"23":{"start":{"line":279,"column":8},"end":{"line":279,"column":21}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":9685}},"25":{"start":{"line":283,"column":12},"end":{"line":283,"column":29}},"26":{"start":{"line":286,"column":12},"end":{"line":286,"column":9989}},"27":{"start":{"line":295,"column":12},"end":{"line":295,"column":10236}},"28":{"start":{"line":298,"column":16},"end":{"line":298,"column":10392}},"29":{"start":{"line":303,"column":16},"end":{"line":303,"column":33}},"30":{"start":{"line":307,"column":8},"end":{"line":307,"column":10652}},"31":{"start":{"line":331,"column":8},"end":{"line":331,"column":11252}},"32":{"start":{"line":340,"column":8},"end":{"line":340,"column":11732}},"33":{"start":{"line":345,"column":8},"end":{"line":345,"column":106}},"34":{"start":{"line":350,"column":8},"end":{"line":350,"column":72}},"35":{"start":{"line":355,"column":8},"end":{"line":355,"column":70}},"36":{"start":{"line":357,"column":8},"end":{"line":357,"column":45}},"37":{"start":{"line":379,"column":8},"end":{"line":379,"column":13348}},"38":{"start":{"line":384,"column":8},"end":{"line":384,"column":13526}},"39":{"start":{"line":389,"column":8},"end":{"line":389,"column":93}},"40":{"start":{"line":391,"column":8},"end":{"line":391,"column":13798}},"41":{"start":{"line":401,"column":8},"end":{"line":401,"column":14153}},"42":{"start":{"line":422,"column":8},"end":{"line":422,"column":14795}},"43":{"start":{"line":427,"column":8},"end":{"line":427,"column":93}},"44":{"start":{"line":428,"column":8},"end":{"line":428,"column":85}},"45":{"start":{"line":430,"column":8},"end":{"line":430,"column":15172}},"46":{"start":{"line":439,"column":8},"end":{"line":439,"column":63}},"47":{"start":{"line":442,"column":8},"end":{"line":442,"column":15596}},"48":{"start":{"line":461,"column":8},"end":{"line":461,"column":16010}},"49":{"start":{"line":466,"column":8},"end":{"line":466,"column":16180}},"50":{"start":{"line":471,"column":8},"end":{"line":471,"column":39}}},"branchMap":{"1":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":8},"end":{"line":117,"column":8}},{"start":{"line":117,"column":8},"end":{"line":117,"column":8}}]},"2":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]},"3":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]},"4":{"line":221,"type":"if","locations":[{"start":{"line":221,"column":12},"end":{"line":221,"column":12}},{"start":{"line":221,"column":12},"end":{"line":221,"column":12}}]},"5":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":16},"end":{"line":228,"column":16}},{"start":{"line":228,"column":16},"end":{"line":228,"column":16}}]},"6":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":8},"end":{"line":268,"column":8}},{"start":{"line":268,"column":8},"end":{"line":268,"column":8}}]},"7":{"line":273,"type":"if","locations":[{"start":{"line":273,"column":8},"end":{"line":273,"column":8}},{"start":{"line":273,"column":8},"end":{"line":273,"column":8}}]},"8":{"line":281,"type":"if","locations":[{"start":{"line":281,"column":8},"end":{"line":281,"column":8}},{"start":{"line":281,"column":8},"end":{"line":281,"column":8}}]},"9":{"line":295,"type":"if","locations":[{"start":{"line":295,"column":12},"end":{"line":295,"column":12}},{"start":{"line":295,"column":12},"end":{"line":295,"column":12}}]},"10":{"line":331,"type":"if","locations":[{"start":{"line":331,"column":8},"end":{"line":331,"column":8}},{"start":{"line":331,"column":8},"end":{"line":331,"column":8}}]},"11":{"line":340,"type":"if","locations":[{"start":{"line":340,"column":8},"end":{"line":340,"column":8}},{"start":{"line":340,"column":8},"end":{"line":340,"column":8}}]},"12":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"13":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":8},"end":{"line":384,"column":8}},{"start":{"line":384,"column":8},"end":{"line":384,"column":8}}]},"14":{"line":422,"type":"if","locations":[{"start":{"line":422,"column":8},"end":{"line":422,"column":8}},{"start":{"line":422,"column":8},"end":{"line":422,"column":8}}]},"15":{"line":461,"type":"if","locations":[{"start":{"line":461,"column":8},"end":{"line":461,"column":8}},{"start":{"line":461,"column":8},"end":{"line":461,"column":8}}]},"16":{"line":466,"type":"if","locations":[{"start":{"line":466,"column":8},"end":{"line":466,"column":8}},{"start":{"line":466,"column":8},"end":{"line":466,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol":{"l":{"56":1,"60":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol","s":{"1":1,"2":0},"b":{"1":[0,1]},"f":{"1":3,"2":1},"fnMap":{"1":{"name":"constructor","line":29,"loc":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}}},"2":{"name":"create","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":66,"column":4}}}},"statementMap":{"1":{"start":{"line":56,"column":8},"end":{"line":56,"column":1919}},"2":{"start":{"line":60,"column":8},"end":{"line":60,"column":2068}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]}}}} \ No newline at end of file diff --git a/coverage/OVM/accounts/OVM_ECDSAContractAccount.sol.html b/coverage/OVM/accounts/OVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..f86195d44 --- /dev/null +++ b/coverage/OVM/accounts/OVM_ECDSAContractAccount.sol.html @@ -0,0 +1,485 @@ + + + + Code coverage report for OVM/accounts/OVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / OVM/accounts/ OVM_ECDSAContractAccount.sol +

+
+
+ 93.75% + Statements + 15/16 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 1/1 +
+
+ 93.75% + Lines + 15/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + +  +  +  +  +  + + +  +  +  +  +  + + +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+import { Lib_SafeMathWrapper } from "../../libraries/wrappers/Lib_SafeMathWrapper.sol";
+ 
+/**
+ * @title OVM_ECDSAContractAccount
+ * @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the
+ * ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by 
+ * providing eth_sign and EIP155 formatted transaction encodings.
+ *
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    // TODO: should be the amount sufficient to cover the gas costs of all of the transactions up
+    // to and including the CALL/CREATE which forms the entrypoint of the transaction.
+    uint256 constant EXECUTION_VALIDATION_GAS_OVERHEAD = 25000;
+    address constant ETH_ERC20_ADDRESS = 0x4200000000000000000000000000000000000006;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Executes a signed transaction.
+     * @param _transaction Signed EOA transaction.
+     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     * @return Whether or not the call returned (rather than reverted).
+     * @return Data returned by the call.
+     */
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        override
+        public
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
+ 
+        // Address of this contract within the ovm (ovmADDRESS) should be the same as the
+        // recovered address of the user who signed this message. This is how we manage to shim
+        // account abstraction even though the user isn't a contract.
+        // Need to make sure that the transaction nonce is right and bump it if so.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_ECDSAUtils.recover(
+                _transaction,
+                isEthSign,
+                _v,
+                _r,
+                _s
+            ) == Lib_SafeExecutionManagerWrapper.safeADDRESS(),
+            "Signature provided for EOA transaction execution is invalid."
+        );
+ 
+        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
+ 
+        // Need to make sure that the transaction chainId is correct.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.chainId == Lib_SafeExecutionManagerWrapper.safeCHAINID(),
+            "Transaction chainId does not match expected OVM chainId."
+        );
+ 
+        // Need to make sure that the transaction nonce is right.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
+            "Transaction nonce does not match the expected nonce."
+        );
+ 
+        // TEMPORARY: Disable gas checks for mainnet.
+        // // Need to make sure that the gas is sufficient to execute the transaction.
+        // Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+        //    gasleft() >= Lib_SafeMathWrapper.add(decodedTx.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD),
+        //    "Gas is not sufficient to execute the transaction."
+        // );
+ 
+        // Transfer fee to relayer.
+        address relayer = Lib_SafeExecutionManagerWrapper.safeCALLER();
+        uint256 fee = Lib_SafeMathWrapper.mul(decodedTx.gasLimit, decodedTx.gasPrice);
+        (bool success, ) = Lib_SafeExecutionManagerWrapper.safeCALL(
+            gasleft(),
+            ETH_ERC20_ADDRESS,
+            abi.encodeWithSignature("transfer(address,uint256)", relayer, fee)
+        );
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            success == true,
+            "Fee was not transferred to relayer."
+        );
+ 
+        // Contract creations are signalled by sending a transaction to the zero address.
+        if (decodedTx.to == address(0)) {
+            (address created, bytes memory revertData) = Lib_SafeExecutionManagerWrapper.safeCREATE(
+                decodedTx.gasLimit,
+                decodedTx.data
+            );
+ 
+            // Return true if the contract creation succeeded, false w/ revertData otherwise.
+            Eif (created != address(0)) {
+                return (true, abi.encode(created));
+            } else {
+                return (false, revertData);
+            }
+        } else {
+            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
+            // the nonce of the calling account. Normally an EOA would bump the nonce for both
+            // cases, but since this is a contract we'd end up bumping the nonce twice.
+            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
+ 
+            return Lib_SafeExecutionManagerWrapper.safeCALL(
+                decodedTx.gasLimit,
+                decodedTx.to,
+                decodedTx.data
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/accounts/OVM_ProxyEOA.sol.html b/coverage/OVM/accounts/OVM_ProxyEOA.sol.html new file mode 100644 index 000000000..d8de28f6d --- /dev/null +++ b/coverage/OVM/accounts/OVM_ProxyEOA.sol.html @@ -0,0 +1,428 @@ + + + + Code coverage report for OVM/accounts/OVM_ProxyEOA.sol + + + + + + + +
+
+

+ all files / OVM/accounts/ OVM_ProxyEOA.sol +

+
+
+ 87.5% + Statements + 7/8 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 5/5 +
+
+ 88.89% + Lines + 8/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_ProxyEOA
+ * @dev The Proxy EOA contract uses a delegate call to execute the logic in an implementation contract.
+ * In combination with the logic implemented in the ECDSA Contract Account, this enables a form of upgradable 
+ * 'account abstraction' on layer 2. 
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ProxyEOA {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _implementation Address of the initial implementation contract.
+     */
+    constructor(
+        address _implementation
+    )
+    {
+        _setImplementation(_implementation);
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        (bool success, bytes memory returndata) = Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
+            gasleft(),
+            getImplementation(),
+            msg.data
+        );
+ 
+        Eif (success) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            Lib_SafeExecutionManagerWrapper.safeREVERT(
+                string(returndata)
+            );
+        }
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Changes the implementation address.
+     * @param _implementation New implementation address.
+     */
+    function upgrade(
+        address _implementation
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_SafeExecutionManagerWrapper.safeADDRESS() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
+            "EOAs can only upgrade their own EOA implementation"
+        );
+ 
+        _setImplementation(_implementation);
+    }
+ 
+    /**
+     * Gets the address of the current implementation.
+     * @return Current implementation address.
+     */
+    function getImplementation()
+        public
+        returns (
+            address
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                IMPLEMENTATION_KEY
+            )
+        );
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _setImplementation(
+        address _implementation
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            IMPLEMENTATION_KEY,
+            Lib_Bytes32Utils.fromAddress(_implementation)
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/accounts/index.html b/coverage/OVM/accounts/index.html new file mode 100644 index 000000000..a286f49e4 --- /dev/null +++ b/coverage/OVM/accounts/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for OVM/accounts/ + + + + + + + +
+
+

+ all files OVM/accounts/ +

+
+
+ 91.67% + Statements + 22/24 +
+
+ 66.67% + Branches + 4/6 +
+
+ 100% + Functions + 6/6 +
+
+ 92% + Lines + 23/25 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_ECDSAContractAccount.sol
93.75%15/1675%3/4100%1/193.75%15/16
OVM_ProxyEOA.sol
87.5%7/850%1/2100%5/588.89%8/9
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html b/coverage/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html new file mode 100644 index 000000000..6457a4c5d --- /dev/null +++ b/coverage/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html @@ -0,0 +1,443 @@ + + + + Code coverage report for OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / OVM/bridge/messaging/ Abs_BaseCrossDomainMessenger.sol +

+
+
+ 77.78% + Statements + 7/9 +
+
+ 50% + Branches + 1/2 +
+
+ 80% + Functions + 4/5 +
+
+ 77.78% + Lines + 7/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/* Library Imports */
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/**
+ * @title Abs_BaseCrossDomainMessenger
+ * @dev The Base Cross Domain Messenger is an abstract contract providing the interface and common functionality used in the
+ * L1 and L2 Cross Domain Messengers. It can also serve as a template for developers wishing to implement a custom bridge 
+ * contract to suit their needs.
+ *
+ * Compiler used: defined by child contract
+ * Runtime target: defined by child contract
+ */
+abstract contract Abs_BaseCrossDomainMessenger is iAbs_BaseCrossDomainMessenger, Lib_ReentrancyGuard {
+    /**************
+     *  Constants *
+     **************/
+ 
+    // The default x-domain message sender being set to a non-zero value makes
+    // deployment a bit more expensive, but in exchange the refund on every call to
+    // `relayMessage` by the L1 and L2 messengers will be higher.
+    address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    mapping (bytes32 => bool) public relayedMessages;
+    mapping (bytes32 => bool) public successfulMessages;
+    mapping (bytes32 => bool) public sentMessages;
+    uint256 public messageNonce;
+    address internal xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    constructor() Lib_ReentrancyGuard() {}
+ 
+    function xDomainMessageSender() public override view returns (address) {
+        Irequire(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set");
+        return xDomainMsgSender;
+    }
+ 
+    /**
+     * Sends a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _message Message to send to the target.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function sendMessage(
+        address _target,
+        bytes memory _message,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            msg.sender,
+            _message,
+            messageNonce
+        );
+ 
+        messageNonce += 1;
+        sentMessages[keccak256(xDomainCalldata)] = true;
+ 
+        _sendXDomainMessage(xDomainCalldata, _gasLimit);
+        emit SentMessage(xDomainCalldata);
+    }
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Generates the correct cross domain calldata for a message.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @return ABI encoded cross domain calldata.
+     */
+    function _getXDomainCalldata(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodeWithSignature(
+            "relayMessage(address,address,bytes,uint256)",
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * param // Message to send.
+     * param // Gas limit for the provided message.
+     */
+    function _sendXDomainMessage(
+        bytes memory, // _message,
+        uint256 // _gasLimit
+    )
+        virtual
+        internal
+    {
+        revert("Implement me in child contracts!");
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html b/coverage/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html new file mode 100644 index 000000000..07a375b6a --- /dev/null +++ b/coverage/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html @@ -0,0 +1,947 @@ + + + + Code coverage report for OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / OVM/bridge/messaging/ OVM_L1CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 30/30 +
+
+ 75% + Branches + 12/16 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 31/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  + +  +  +  +  + + + +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_AddressManager } from "../../../libraries/resolver/Lib_AddressManager.sol";
+import { Lib_SecureMerkleTrie } from "../../../libraries/trie/Lib_SecureMerkleTrie.sol";
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+import { iOVM_CanonicalTransactionChain } from "../../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_StateCommitmentChain } from "../../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+ 
+/* Contract Imports */
+import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_L1CrossDomainMessenger
+ * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. 
+ * In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted 
+ * via this contract's replay function. 
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * Pass a default zero address to the address resolver. This will be updated when initialized.
+     */
+    constructor()
+        Lib_AddressResolver(address(0))
+    {}
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    function initialize(
+        address _libAddressManager
+    )
+        public
+    {
+        Erequire(address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized.");
+        libAddressManager = Lib_AddressManager(_libAddressManager);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may successfully call a method.
+     */
+    modifier onlyRelayer() {
+        address relayer = resolve("OVM_L2MessageRelayer");
+        if (relayer != address(0)) {
+            Irequire(
+                msg.sender == relayer,
+                "Only OVM_L2MessageRelayer can relay L2-to-L1 messages."
+            );
+        }
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @inheritdoc iOVM_L1CrossDomainMessenger
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        L2MessageInclusionProof memory _proof
+    )
+        override
+        public
+        nonReentrant
+        onlyRelayer()
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        require(
+            _verifyXDomainMessage(
+                xDomainCalldata,
+                _proof
+            ) == true,
+            "Provided message could not be verified."
+        );
+ 
+        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
+ 
+        require(
+            successfulMessages[xDomainCalldataHash] == false,
+            "Provided message has already been received."
+        );
+ 
+        xDomainMsgSender = _sender;
+        (bool success, ) = _target.call(_message);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+        // Mark the message as received if the call was successful. Ensures that a message can be
+        // relayed multiple times in the case that the call reverted.
+        Eif (success == true) {
+            successfulMessages[xDomainCalldataHash] = true;
+            emit RelayedMessage(xDomainCalldataHash);
+        }
+ 
+        // Store an identifier that can be used to prove that the given message was relayed by some
+        // user. Gives us an easy way to pay relayers for their work.
+        bytes32 relayId = keccak256(
+            abi.encodePacked(
+                xDomainCalldata,
+                msg.sender,
+                block.number
+            )
+        );
+        relayedMessages[relayId] = true;
+    }
+ 
+    /**
+     * Replays a cross domain message to the target messenger.
+     * @inheritdoc iOVM_L1CrossDomainMessenger
+     */
+    function replayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        require(
+            sentMessages[keccak256(xDomainCalldata)] == true,
+            "Provided message has not already been sent."
+        );
+ 
+        _sendXDomainMessage(xDomainCalldata, _gasLimit);
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Verifies that the given message is valid.
+     * @param _xDomainCalldata Calldata to verify.
+     * @param _proof Inclusion proof for the message.
+     * @return Whether or not the provided message is valid.
+     */
+    function _verifyXDomainMessage(
+        bytes memory _xDomainCalldata,
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        return (
+            _verifyStateRootProof(_proof)
+            && _verifyStorageProof(_xDomainCalldata, _proof)
+        );
+    }
+ 
+    /**
+     * Verifies that the state root within an inclusion proof is valid.
+     * @param _proof Message inclusion proof.
+     * @return Whether or not the provided proof is valid.
+     */
+    function _verifyStateRootProof(
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+ 
+        return (
+            ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) == false
+            && ovmStateCommitmentChain.verifyStateCommitment(
+                _proof.stateRoot,
+                _proof.stateRootBatchHeader,
+                _proof.stateRootProof
+            )
+        );
+    }
+ 
+    /**
+     * Verifies that the storage proof within an inclusion proof is valid.
+     * @param _xDomainCalldata Encoded message calldata.
+     * @param _proof Message inclusion proof.
+     * @return Whether or not the provided proof is valid.
+     */
+    function _verifyStorageProof(
+        bytes memory _xDomainCalldata,
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 storageKey = keccak256(
+            abi.encodePacked(
+                keccak256(
+                    abi.encodePacked(
+                        _xDomainCalldata,
+                        resolve("OVM_L2CrossDomainMessenger")
+                    )
+                ),
+                uint256(0)
+            )
+        );
+ 
+        (
+            bool exists,
+            bytes memory encodedMessagePassingAccount
+        ) = Lib_SecureMerkleTrie.get(
+            abi.encodePacked(0x4200000000000000000000000000000000000000),
+            _proof.stateTrieWitness,
+            _proof.stateRoot
+        );
+ 
+        Erequire(
+            exists == true,
+            "Message passing predeploy has not been initialized or invalid proof provided."
+        );
+ 
+        Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
+            encodedMessagePassingAccount
+        );
+ 
+        return Lib_SecureMerkleTrie.verifyInclusionProof(
+            abi.encodePacked(storageKey),
+            abi.encodePacked(uint8(1)),
+            _proof.storageTrieWitness,
+            account.storageRoot
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * @param _message Message to send.
+     * @param _gasLimit OVM gas limit for the message.
+     */
+    function _sendXDomainMessage(
+        bytes memory _message,
+        uint256 _gasLimit
+    )
+        override
+        internal
+    {
+        iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).enqueue(
+            resolve("OVM_L2CrossDomainMessenger"),
+            _gasLimit,
+            _message
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html b/coverage/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html new file mode 100644 index 000000000..421554d4f --- /dev/null +++ b/coverage/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html @@ -0,0 +1,275 @@ + + + + Code coverage report for OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol + + + + + + + +
+
+

+ all files / OVM/bridge/messaging/ OVM_L1MultiMessageRelayer.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+import { iOVM_L1MultiMessageRelayer } from "../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol";
+ 
+/* Contract Imports */
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+ 
+/**
+ * @title OVM_L1MultiMessageRelayer
+ * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the 
+ * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain
+ * Message Sender.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+    constructor(
+        address _libAddressManager
+    ) 
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyBatchRelayer() {
+        require(
+            msg.sender == resolve("OVM_L2BatchMessageRelayer"),
+            "OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer"
+        );
+        _;
+    }
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying
+     * @param _messages An array of L2 to L1 messages
+     */
+    function batchRelayMessages(L2ToL1Message[] calldata _messages) 
+        override
+        external
+        onlyBatchRelayer 
+    {
+        iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(resolve("Proxy__OVM_L1CrossDomainMessenger"));
+        for (uint256 i = 0; i < _messages.length; i++) {
+            L2ToL1Message memory message = _messages[i];
+            messenger.relayMessage(
+                message.target,
+                message.sender,
+                message.message,
+                message.messageNonce,
+                message.proof
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html b/coverage/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html new file mode 100644 index 000000000..16a8bd88d --- /dev/null +++ b/coverage/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html @@ -0,0 +1,473 @@ + + + + Code coverage report for OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / OVM/bridge/messaging/ OVM_L2CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  + +  + +  +  +  +  + + + +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/* Interface Imports */
+import { iOVM_L2CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol";
+import { iOVM_L1MessageSender } from "../../../iOVM/predeploys/iOVM_L1MessageSender.sol";
+import { iOVM_L2ToL1MessagePasser } from "../../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
+ 
+/* Contract Imports */
+import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_L2CrossDomainMessenger
+ * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point
+ * for L2 messages sent via the L1 Cross Domain Messenger.
+ * 
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+  */
+contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @inheritdoc iOVM_L2CrossDomainMessenger
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    )
+        override
+        nonReentrant
+        public
+    {
+        require(
+            _verifyXDomainMessage() == true,
+            "Provided message could not be verified."
+        );
+ 
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
+ 
+        require(
+            successfulMessages[xDomainCalldataHash] == false,
+            "Provided message has already been received."
+        );
+ 
+        xDomainMsgSender = _sender;
+        (bool success, ) = _target.call(_message);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+        // Mark the message as received if the call was successful. Ensures that a message can be
+        // relayed multiple times in the case that the call reverted.
+        Eif (success == true) {
+            successfulMessages[xDomainCalldataHash] = true;
+            emit RelayedMessage(xDomainCalldataHash);
+        }
+ 
+        // Store an identifier that can be used to prove that the given message was relayed by some
+        // user. Gives us an easy way to pay relayers for their work.
+        bytes32 relayId = keccak256(
+            abi.encodePacked(
+                xDomainCalldata,
+                msg.sender,
+                block.number
+            )
+        );
+        relayedMessages[relayId] = true;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Verifies that a received cross domain message is valid.
+     * @return _valid Whether or not the message is valid.
+     */
+    function _verifyXDomainMessage()
+        view
+        internal
+        returns (
+            bool _valid
+        )
+    {
+        return (
+            iOVM_L1MessageSender(resolve("OVM_L1MessageSender")).getL1MessageSender() == resolve("OVM_L1CrossDomainMessenger")
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * @param _message Message to send.
+     * param _gasLimit Gas limit for the provided message.
+     */
+    function _sendXDomainMessage(
+        bytes memory _message,
+        uint256 // _gasLimit
+    )
+        override
+        internal
+    {
+        iOVM_L2ToL1MessagePasser(resolve("OVM_L2ToL1MessagePasser")).passMessageToL1(_message);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/messaging/index.html b/coverage/OVM/bridge/messaging/index.html new file mode 100644 index 000000000..d1b88f421 --- /dev/null +++ b/coverage/OVM/bridge/messaging/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for OVM/bridge/messaging/ + + + + + + + +
+
+

+ all files OVM/bridge/messaging/ +

+
+
+ 96.55% + Statements + 56/58 +
+
+ 76.92% + Branches + 20/26 +
+
+ 95.24% + Functions + 20/21 +
+
+ 96.67% + Lines + 58/60 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_BaseCrossDomainMessenger.sol
77.78%7/950%1/280%4/577.78%7/9
OVM_L1CrossDomainMessenger.sol
100%30/3075%12/16100%9/9100%31/31
OVM_L1MultiMessageRelayer.sol
100%5/5100%2/2100%3/3100%6/6
OVM_L2CrossDomainMessenger.sol
100%14/1483.33%5/6100%4/4100%14/14
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html b/coverage/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html new file mode 100644 index 000000000..d4b0621e5 --- /dev/null +++ b/coverage/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html @@ -0,0 +1,692 @@ + + + + Code coverage report for OVM/bridge/tokens/Abs_L1TokenGateway.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ Abs_L1TokenGateway.sol +

+
+
+ 83.33% + Statements + 10/12 +
+
+ 100% + Branches + 0/0 +
+
+ 75% + Functions + 6/8 +
+
+ 83.33% + Lines + 10/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm 
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+ 
+/**
+ * @title Abs_L1TokenGateway
+ * @dev An L1 Token Gateway is a contract which stores deposited L1 funds that are in use on L2.
+ * It synchronizes a corresponding L2 representation of the "deposited token", informing it
+ * of new deposits and releasing L1 funds when there are newly finalized withdrawals.
+ *
+ * NOTE: This abstract contract gives all the core functionality of an L1 token gateway, 
+ * but provides easy hooks in case developers need extensions in child contracts.
+ * In many cases, the default OVM_L1ERC20Gateway will suffice.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+abstract contract Abs_L1TokenGateway is iOVM_L1TokenGateway, OVM_CrossDomainEnabled {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    address public l2DepositedToken;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l2DepositedToken iOVM_L2DepositedToken-compatible address on the chain being deposited into.
+     * @param _l1messenger L1 Messenger address being used for cross-chain communications.
+     */
+    constructor(
+        address _l2DepositedToken,
+        address _l1messenger 
+    )
+        OVM_CrossDomainEnabled(_l1messenger)
+    {
+        l2DepositedToken = _l2DepositedToken;
+    }
+ 
+    /********************************
+     * Overridable Accounting logic *
+     ********************************/
+ 
+    // Default gas value which can be overridden if more complex logic runs on L2.
+    uint32 public DEFAULT_FINALIZE_DEPOSIT_L2_GAS = 1200000;
+ 
+    /**
+     * @dev Core logic to be performed when a withdrawal is finalized on L1.
+     * In most cases, this will simply send locked funds to the withdrawer.
+     *
+     * param _to Address being withdrawn to.
+     * param _amount Amount being withdrawn.
+     */
+    function _handleFinalizeWithdrawal(
+        address, // _to,
+        uint256 // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Implement me in child contracts");
+    }
+ 
+    /**
+     * @dev Core logic to be performed when a deposit is initiated on L1.
+     * In most cases, this will simply send locked funds to the withdrawer.
+     *
+     * param _from Address being deposited from on L1.
+     * param _to Address being deposited into on L2.
+     * param _amount Amount being deposited.
+     */
+    function _handleInitiateDeposit(
+        address, // _from,
+        address, // _to,
+        uint256 // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Implement me in child contracts");
+    }
+ 
+    /**
+     * @dev Overridable getter for the L2 gas limit, in the case it may be
+     * dynamic, and the above public constant does not suffice.
+     *
+     */
+ 
+    function getFinalizeDepositL2Gas()
+        public
+        view
+        returns(
+            uint32
+        )
+    {
+        return DEFAULT_FINALIZE_DEPOSIT_L2_GAS;
+    }
+ 
+    /**************
+     * Depositing *
+     **************/
+ 
+    /**
+     * @dev deposit an amount of the ERC20 to the caller's balance on L2
+     * @param _amount Amount of the ERC20 to deposit
+     */
+    function deposit(
+        uint _amount
+    )
+        public
+        override
+    {
+        _initiateDeposit(msg.sender, msg.sender, _amount);
+    }
+ 
+    /**
+     * @dev deposit an amount of ERC20 to a recipients's balance on L2
+     * @param _to L2 address to credit the withdrawal to
+     * @param _amount Amount of the ERC20 to deposit
+     */
+    function depositTo(
+        address _to,
+        uint _amount
+    )
+        public
+        override
+    {
+        _initiateDeposit(msg.sender, _to, _amount);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by informing the L2 Deposited Token
+     * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)
+     *
+     * @param _from Account to pull the deposit from on L1
+     * @param _to Account to give the deposit to on L2
+     * @param _amount Amount of the ERC20 to deposit.
+     */
+    function _initiateDeposit(
+        address _from,
+        address _to,
+        uint _amount
+    )
+        internal
+    {
+        // Call our deposit accounting handler implemented by child contracts.
+        _handleInitiateDeposit(
+            _from,
+            _to,
+            _amount
+        );
+ 
+        // Construct calldata for l2DepositedToken.finalizeDeposit(_to, _amount)
+        bytes memory data = abi.encodeWithSelector(
+            iOVM_L2DepositedToken.finalizeDeposit.selector,
+            _to,
+            _amount
+        );
+ 
+        // Send calldata into L2
+        sendCrossDomainMessage(
+            l2DepositedToken,
+            data,
+            getFinalizeDepositL2Gas()
+        );
+ 
+        emit DepositInitiated(_from, _to, _amount);
+    }
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    /**
+     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the 
+     * L1 ERC20 token. 
+     * This call will fail if the initialized withdrawal from L2 has not been finalized. 
+     *
+     * @param _to L1 address to credit the withdrawal to
+     * @param _amount Amount of the ERC20 to withdraw
+     */
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external
+        override 
+        onlyFromCrossDomainAccount(l2DepositedToken)
+    {
+        // Call our withdrawal accounting handler implemented by child contracts.
+        _handleFinalizeWithdrawal(
+            _to,
+            _amount
+        );
+ 
+        emit WithdrawalFinalized(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html b/coverage/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html new file mode 100644 index 000000000..ba6d6780c --- /dev/null +++ b/coverage/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html @@ -0,0 +1,755 @@ + + + + Code coverage report for OVM/bridge/tokens/Abs_L2DepositedToken.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ Abs_L2DepositedToken.sol +

+
+
+ 86.67% + Statements + 13/15 +
+
+ 50% + Branches + 2/4 +
+
+ 80% + Functions + 8/10 +
+
+ 87.5% + Lines + 14/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  + +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+ 
+/**
+ * @title Abs_L2DepositedToken
+ * @dev An L2 Deposited Token is an L2 representation of funds which were deposited from L1.
+ * Usually contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
+ * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
+ *
+ * NOTE: This abstract contract gives all the core functionality of a deposited token implementation except for the
+ * token's internal accounting itself.  This gives developers an easy way to implement children with their own token code.
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+abstract contract Abs_L2DepositedToken is iOVM_L2DepositedToken, OVM_CrossDomainEnabled {
+ 
+    /*******************
+     * Contract Events *
+     *******************/
+ 
+    event Initialized(iOVM_L1TokenGateway _l1TokenGateway);
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    iOVM_L1TokenGateway public l1TokenGateway;
+ 
+    /********************************
+     * Constructor & Initialization *
+     ********************************/
+ 
+    /**
+     * @param _l2CrossDomainMessenger L1 Messenger address being used for cross-chain communications.
+     */
+    constructor(
+        address _l2CrossDomainMessenger
+    )
+        OVM_CrossDomainEnabled(_l2CrossDomainMessenger)
+    {}
+ 
+    /**
+     * @dev Initialize this contract with the L1 token gateway address.
+     * The flow: 1) this contract gets deployed on L2, 2) the L1
+     * gateway is deployed with addr from (1), 3) L1 gateway address passed here.
+     *
+     * @param _l1TokenGateway Address of the corresponding L1 gateway deployed to the main chain
+     */
+ 
+    function init(
+        iOVM_L1TokenGateway _l1TokenGateway
+    )
+        public
+    {
+        Erequire(address(l1TokenGateway) == address(0), "Contract has already been initialized");
+ 
+        l1TokenGateway = _l1TokenGateway;
+        
+        emit Initialized(l1TokenGateway);
+    }
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyInitialized() {
+        Erequire(address(l1TokenGateway) != address(0), "Contract has not yet been initialized");
+        _;
+    }
+ 
+    /********************************
+     * Overridable Accounting logic *
+     ********************************/
+ 
+    // Default gas value which can be overridden if more complex logic runs on L2.
+    uint32 constant DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS = 100000;
+ 
+    /**
+     * @dev Core logic to be performed when a withdrawal from L2 is initialized.
+     * In most cases, this will simply burn the withdrawn L2 funds.
+     *
+     * param _to Address being withdrawn to
+     * param _amount Amount being withdrawn
+     */
+ 
+    function _handleInitiateWithdrawal(
+        address, // _to,
+        uint // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Accounting must be implemented by child contract.");
+    }
+ 
+    /**
+     * @dev Core logic to be performed when a deposit from L2 is finalized on L2.
+     * In most cases, this will simply _mint() to credit L2 funds to the recipient.
+     *
+     * param _to Address being deposited to on L2
+     * param _amount Amount which was deposited on L1
+     */
+    function _handleFinalizeDeposit(
+        address, // _to
+        uint // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Accounting must be implemented by child contract.");
+    }
+ 
+    /**
+     * @dev Overridable getter for the *L1* gas limit of settling the withdrawal, in the case it may be
+     * dynamic, and the above public constant does not suffice.
+     *
+     */
+ 
+    function getFinalizeWithdrawalL1Gas()
+        public
+        view
+        virtual
+        returns(
+            uint32
+        )
+    {
+        return DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS;
+    }
+ 
+ 
+    /***************
+     * Withdrawing *
+     ***************/
+ 
+    /**
+     * @dev initiate a withdraw of some tokens to the caller's account on L1
+     * @param _amount Amount of the token to withdraw
+     */
+    function withdraw(
+        uint _amount
+    )
+        external
+        override
+        onlyInitialized()
+    {
+        _initiateWithdrawal(msg.sender, _amount);
+    }
+ 
+    /**
+     * @dev initiate a withdraw of some token to a recipient's account on L1
+     * @param _to L1 adress to credit the withdrawal to
+     * @param _amount Amount of the token to withdraw
+     */
+    function withdrawTo(
+        address _to,
+        uint _amount
+    )
+        external
+        override
+        onlyInitialized()
+    {
+        _initiateWithdrawal(_to, _amount);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by storing the token and informing the L2 token Gateway of the deposit.
+     *
+     * @param _to Account to give the withdrawal to on L1
+     * @param _amount Amount of the token to withdraw
+     */
+    function _initiateWithdrawal(
+        address _to,
+        uint _amount
+    )
+        internal
+    {
+        // Call our withdrawal accounting handler implemented by child contracts (usually a _burn)
+        _handleInitiateWithdrawal(_to, _amount);
+ 
+        // Construct calldata for l1TokenGateway.finalizeWithdrawal(_to, _amount)
+        bytes memory data = abi.encodeWithSelector(
+            iOVM_L1TokenGateway.finalizeWithdrawal.selector,
+            _to,
+            _amount
+        );
+ 
+        // Send message up to L1 gateway
+        sendCrossDomainMessage(
+            address(l1TokenGateway),
+            data,
+            getFinalizeWithdrawalL1Gas()
+        );
+ 
+        emit WithdrawalInitiated(msg.sender, _to, _amount);
+    }
+ 
+    /************************************
+     * Cross-chain Function: Depositing *
+     ************************************/
+ 
+    /**
+     * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this 
+     * L2 token. 
+     * This call will fail if it did not originate from a corresponding deposit in OVM_l1TokenGateway. 
+     *
+     * @param _to Address to receive the withdrawal at
+     * @param _amount Amount of the token to withdraw
+     */
+    function finalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        external
+        override 
+        onlyInitialized()
+        onlyFromCrossDomainAccount(address(l1TokenGateway))
+    {
+        _handleFinalizeDeposit(_to, _amount);
+        emit DepositFinalized(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html b/coverage/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html new file mode 100644 index 000000000..ca0c061f1 --- /dev/null +++ b/coverage/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html @@ -0,0 +1,365 @@ + + + + Code coverage report for OVM/bridge/tokens/OVM_L1ERC20Gateway.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ OVM_L1ERC20Gateway.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 3/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm 
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+import { Abs_L1TokenGateway } from "./Abs_L1TokenGateway.sol";
+import { iOVM_ERC20 } from "../../../iOVM/predeploys/iOVM_ERC20.sol";
+ 
+/**
+ * @title OVM_L1ERC20Gateway
+ * @dev The L1 ERC20 Gateway is a contract which stores deposited L1 funds that are in use on L2.
+ * It synchronizes a corresponding L2 ERC20 Gateway, informing it of deposits, and listening to it
+ * for newly finalized withdrawals.
+ *
+ * NOTE: This contract extends Abs_L1TokenGateway, which is where we
+ * takes care of most of the initialization and the cross-chain logic.
+ * If you are looking to implement your own deposit/withdrawal contracts, you
+ * may also want to extend the abstract contract in a similar manner.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1ERC20Gateway is Abs_L1TokenGateway {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+    
+    iOVM_ERC20 public l1ERC20;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l1ERC20 L1 ERC20 address this contract stores deposits for
+     * @param _l2DepositedERC20 L2 Gateway address on the chain being deposited into
+     */
+    constructor(
+        iOVM_ERC20 _l1ERC20,
+        address _l2DepositedERC20,
+        address _l1messenger 
+    )
+        Abs_L1TokenGateway(
+            _l2DepositedERC20,
+            _l1messenger
+        )
+    {
+        l1ERC20 = _l1ERC20;
+    }
+ 
+ 
+    /**************
+     * Accounting *
+     **************/
+ 
+    /**
+     * @dev When a deposit is initiated on L1, the L1 Gateway
+     * transfers the funds to itself for future withdrawals
+     *
+     * @param _from L1 address ETH is being deposited from
+     * param _to L2 address that the ETH is being deposited to
+     * @param _amount Amount of ERC20 to send
+     */
+    function _handleInitiateDeposit(
+        address _from,
+        address, // _to,
+        uint256 _amount
+    )
+        internal
+        override
+    {
+         // Hold on to the newly deposited funds
+        l1ERC20.transferFrom(
+            _from,
+            address(this),
+            _amount
+        );
+    }
+ 
+    /**
+     * @dev When a withdrawal is finalized on L1, the L1 Gateway
+     * transfers the funds to the withdrawer
+     *
+     * @param _to L1 address that the ERC20 is being withdrawn to
+     * @param _amount Amount of ERC20 to send
+     */
+    function _handleFinalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        // Transfer withdrawn funds out to withdrawer
+        l1ERC20.transfer(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html b/coverage/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html new file mode 100644 index 000000000..af1be607b --- /dev/null +++ b/coverage/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html @@ -0,0 +1,557 @@ + + + + Code coverage report for OVM/bridge/tokens/OVM_L1ETHGateway.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ OVM_L1ETHGateway.sol +

+
+
+ 100% + Statements + 11/11 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 6/6 +
+
+ 91.67% + Lines + 11/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1ETHGateway } from "../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol";
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/**
+ * @title OVM_L1ETHGateway
+ * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {
+ 
+    /********************
+     * Public Constants *
+     ********************/
+ 
+    uint32 public constant override getFinalizeDepositL2Gas = 1200000;
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    address public ovmEth;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address manager for this OE deployment
+     * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken
+     */
+    constructor(
+        address _libAddressManager,
+        address _ovmEth
+    )
+        OVM_CrossDomainEnabled(address(0)) // overridden in constructor code
+        Lib_AddressResolver(_libAddressManager)
+    {
+        ovmEth = _ovmEth;
+        messenger = resolve("Proxy__OVM_L1CrossDomainMessenger"); // overrides OVM_CrossDomainEnabled constructor setting because resolve() is not yet accessible
+    }
+ 
+    /**************
+     * Depositing *
+     **************/
+ 
+    receive()
+        external
+        payable
+    {
+        _initiateDeposit(msg.sender, msg.sender);
+    }
+ 
+    /**
+     * @dev deposit an amount of the ETH to the caller's balance on L2
+     */
+    function deposit() 
+        external
+        override
+        payable
+    {
+        _initiateDeposit(msg.sender, msg.sender);
+    }
+ 
+    /**
+     * @dev deposit an amount of ETH to a recipients's balance on L2
+     * @param _to L2 address to credit the withdrawal to
+     */
+    function depositTo(
+        address _to
+    )
+        external
+        override
+        payable
+    {
+        _initiateDeposit(msg.sender, _to);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.
+     *
+     * @param _from Account to pull the deposit from on L1
+     * @param _to Account to give the deposit to on L2
+     */
+    function _initiateDeposit(
+        address _from,
+        address _to
+    )
+        internal
+    {
+        // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)
+        bytes memory data =
+            abi.encodeWithSelector(
+                iOVM_L2DepositedToken.finalizeDeposit.selector,
+                _to,
+                msg.value
+            );
+ 
+        // Send calldata into L2
+        sendCrossDomainMessage(
+            ovmEth,
+            data,
+            getFinalizeDepositL2Gas
+        );
+ 
+        emit DepositInitiated(_from, _to, msg.value);
+    }
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    /**
+     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the
+     * L1 ETH token.
+     * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized. 
+     *
+     * @param _to L1 address to credit the withdrawal to
+     * @param _amount Amount of the ETH to withdraw
+     */
+    function finalizeWithdrawal(
+        address _to,
+        uint256 _amount
+    )
+        external
+        override
+        onlyFromCrossDomainAccount(ovmEth)
+    {
+        _safeTransferETH(_to, _amount);
+ 
+        emit WithdrawalFinalized(_to, _amount);
+    }
+ 
+    /**********************************
+     * Internal Functions: Accounting *
+     **********************************/
+ 
+    /**
+     * @dev Internal accounting function for moving around L1 ETH.
+     *
+     * @param _to L1 address to transfer ETH to
+     * @param _value Amount of ETH to send to
+     */
+    function _safeTransferETH(
+        address _to,
+        uint256 _value
+    )
+        internal
+    {
+        (bool success, ) = _to.call{value: _value}(new bytes(0));
+        Erequire(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html b/coverage/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html new file mode 100644 index 000000000..74ff02ea8 --- /dev/null +++ b/coverage/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html @@ -0,0 +1,266 @@ + + + + Code coverage report for OVM/bridge/tokens/OVM_L2DepositedERC20.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ OVM_L2DepositedERC20.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Contract Imports */
+import { UniswapV2ERC20 } from "../../../libraries/standards/UniswapV2ERC20.sol";
+ 
+/* Library Imports */
+import { Abs_L2DepositedToken } from "./Abs_L2DepositedToken.sol";
+ 
+/**
+ * @title OVM_L2DepositedERC20
+ * @dev The L2 Deposited ERC20 is an ERC20 implementation which represents L1 assets deposited into L2.
+ * This contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
+ * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
+ *
+ * NOTE: This contract implements the Abs_L2DepositedToken contract using Uniswap's ERC20 as the implementation.
+ * Alternative implementations can be used in this similar manner.
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract OVM_L2DepositedERC20 is Abs_L2DepositedToken, UniswapV2ERC20 {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.
+     * @param _name ERC20 name
+     * @param _symbol ERC20 symbol
+     */
+    constructor(
+        address _l2CrossDomainMessenger,
+        string memory _name,
+        string memory _symbol
+    )
+        Abs_L2DepositedToken(_l2CrossDomainMessenger)
+        UniswapV2ERC20(_name, _symbol)
+    {}
+ 
+    // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2 usage.
+    function _handleInitiateWithdrawal(
+        address, // _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        _burn(msg.sender, _amount);
+    }
+ 
+    // When a deposit is finalized, we credit the account on L2 with the same amount of tokens.
+    function _handleFinalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        _mint(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/bridge/tokens/index.html b/coverage/OVM/bridge/tokens/index.html new file mode 100644 index 000000000..81e37f18b --- /dev/null +++ b/coverage/OVM/bridge/tokens/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for OVM/bridge/tokens/ + + + + + + + +
+
+

+ all files OVM/bridge/tokens/ +

+
+
+ 90.7% + Statements + 39/43 +
+
+ 50% + Branches + 3/6 +
+
+ 86.67% + Functions + 26/30 +
+
+ 88.89% + Lines + 40/45 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_L1TokenGateway.sol
83.33%10/12100%0/075%6/883.33%10/12
Abs_L2DepositedToken.sol
86.67%13/1550%2/480%8/1087.5%14/16
OVM_L1ERC20Gateway.sol
100%3/3100%0/0100%3/3100%3/3
OVM_L1ETHGateway.sol
100%11/1150%1/2100%6/691.67%11/12
OVM_L2DepositedERC20.sol
100%2/2100%0/0100%3/3100%2/2
+
+
+ + + + + + + diff --git a/coverage/OVM/chain/OVM_CanonicalTransactionChain.sol.html b/coverage/OVM/chain/OVM_CanonicalTransactionChain.sol.html new file mode 100644 index 000000000..c0026a36e --- /dev/null +++ b/coverage/OVM/chain/OVM_CanonicalTransactionChain.sol.html @@ -0,0 +1,3755 @@ + + + + Code coverage report for OVM/chain/OVM_CanonicalTransactionChain.sol + + + + + + + +
+
+

+ all files / OVM/chain/ OVM_CanonicalTransactionChain.sol +

+
+
+ 95.51% + Statements + 149/156 +
+
+ 87.5% + Branches + 63/72 +
+
+ 84.38% + Functions + 27/32 +
+
+ 95.88% + Lines + 163/170 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +222× +222× +222× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +559× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +382× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +291× +291× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +100× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +47× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +239× +  +  +  +  +238× +  +  +  +  +237× +  +  +  +  +  +  +  +236× +236× +  +  +  +236× +  +  +  +  +  +  +235× +235× +37600× +  +  +235× +  +  +  +  +  +  +  +  +235× +235× +  +  +  +  +235× +  +235× +235× +  +  +  +  +235× +235× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +104× +104× +104× +104× +  +  +  +  +  +104× +  +  +  +  +103× +  +  +  +  +102× +  +  +  +  +101× +  +  +  +  +100× +  +100× +  +  +  +  +  +  +  +100× +100× +  +  +  +  +100× +  +  +100× +  +  +100× +  +  +100× +  +  +  +100× +  +100× +100× +232× +  +232× +  +100× +  +  +  +226× +  +  +  +  +  +  +  +221× +  +  +221× +439× +439× +  +  +  +439× +  +  +  +  +  +  +439× +439× +439× +  +  +  +221× +179× +  +  +  +  +178× +178× +178× +  +  +  +88× +  +  +  +  +  +  +82× +  +  +  +  +81× +  +  +  +  +  +81× +81× +81× +81× +  +39× +39× +  +  +  +  +  +42× +  +  +  +  +42× +42× +  +  +  +  +  +81× +  +  +  +  +  +  +  +81× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +232× +232× +232× +232× +232× +  +232× +  +  +  +  +  +  +232× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +476× +  +476× +476× +476× +476× +476× +  +  +  +  +  +  +  +476× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +81× +81× +  +  +  +  +  +  +  +81× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +179× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +267× +267× +265× +  +265× +265× +265× +  +  +  +  +265× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +439× +419× +  +  +439× +439× +  +439× +439× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +439× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +81× +81× +  +81× +  +  +  +  +  +  +  +81× +  +  +  +  +  +  +  +81× +81× +  +  +  +  +  +  +81× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× + +  + +  +  +  +  + +  +  +  +  +  +  +96× +  +  +  +  +95× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +178× +  +  +  +  +  +177× +  +  +  +  +  +  +176× +  +  +  +  +174× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +226× +  +  +  +  +225× +  +  +  +  +  +224× +175× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +88× + +  +  +  +  +  +  +85× +83× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +179× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
+import { Lib_Math } from "../../libraries/utils/Lib_Math.sol";
+ 
+/* Interface Imports */
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/* Contract Imports */
+import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
+ 
+ 
+/**
+ * @title OVM_CanonicalTransactionChain
+ * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions
+ * which must be applied to the rollup state. It defines the ordering of rollup transactions by
+ * writing them to the 'CTC:batches' instance of the Chain Storage Container.
+ * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer
+ * will eventually append it to the rollup state.
+ * If the Sequencer does not include an enqueued transaction within the 'force inclusion period',
+ * then any account may force it to be included by calling appendQueueBatch().
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_AddressResolver {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    // L2 tx gas-related
+    uint256 constant public MIN_ROLLUP_TX_GAS = 100000;
+    uint256 constant public MAX_ROLLUP_TX_SIZE = 10000;
+    uint256 constant public L2_GAS_DISCOUNT_DIVISOR = 32;
+ 
+    // Encoding-related (all in bytes)
+    uint256 constant internal BATCH_CONTEXT_SIZE = 16;
+    uint256 constant internal BATCH_CONTEXT_LENGTH_POS = 12;
+    uint256 constant internal BATCH_CONTEXT_START_POS = 15;
+    uint256 constant internal TX_DATA_HEADER_SIZE = 3;
+    uint256 constant internal BYTES_TILL_TX_DATA = 65;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    uint256 public forceInclusionPeriodSeconds;
+    uint256 public forceInclusionPeriodBlocks;
+    uint256 public maxTransactionGasLimit;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    constructor(
+        address _libAddressManager,
+        uint256 _forceInclusionPeriodSeconds,
+        uint256 _forceInclusionPeriodBlocks,
+        uint256 _maxTransactionGasLimit
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        forceInclusionPeriodSeconds = _forceInclusionPeriodSeconds;
+        forceInclusionPeriodBlocks = _forceInclusionPeriodBlocks;
+        maxTransactionGasLimit = _maxTransactionGasLimit;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        override
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:CTC:batches")
+        );
+    }
+ 
+    /**
+     * Accesses the queue storage container.
+     * @return Reference to the queue storage container.
+     */
+    function queue()
+        override
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:CTC:queue")
+        );
+    }
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        override
+        public
+        view
+        returns (
+            uint256 _totalElements
+        )
+    {
+        (uint40 totalElements,,,) = _getBatchExtraData();
+        return uint256(totalElements);
+    }
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        override
+        public
+        view
+        returns (
+            uint256 _totalBatches
+        )
+    {
+        return batches().length();
+    }
+ 
+    /**
+     * Returns the index of the next element to be enqueued.
+     * @return Index for the next queue element.
+     */
+    function getNextQueueIndex()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,uint40 nextQueueIndex,,) = _getBatchExtraData();
+        return nextQueueIndex;
+    }
+ 
+    /**
+     * Returns the timestamp of the last transaction.
+     * @return Timestamp for the last transaction.
+     */
+    function getLastTimestamp()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,,uint40 lastTimestamp,) = _getBatchExtraData();
+        return lastTimestamp;
+    }
+ 
+    /**
+     * Returns the blocknumber of the last transaction.
+     * @return Blocknumber for the last transaction.
+     */
+    function getLastBlockNumber()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,,,uint40 lastBlockNumber) = _getBatchExtraData();
+        return lastBlockNumber;
+    }
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function getQueueElement(
+        uint256 _index
+    )
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        )
+    {
+        return _getQueueElement(
+            _index,
+            queue()
+        );
+    }
+ 
+    /**
+     * Get the number of queue elements which have not yet been included.
+     * @return Number of pending queue elements.
+     */
+    function getNumPendingQueueElements()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        return getQueueLength() - getNextQueueIndex();
+    }
+ 
+   /**
+     * Retrieves the length of the queue, including
+     * both pending and canonical transactions.
+     * @return Length of the queue.
+     */
+    function getQueueLength()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        return _getQueueLength(
+            queue()
+        );
+    }
+ 
+    /**
+     * Adds a transaction to the queue.
+     * @param _target Target L2 contract to send the transaction to.
+     * @param _gasLimit Gas limit for the enqueued L2 transaction.
+     * @param _data Transaction data.
+     */
+    function enqueue(
+        address _target,
+        uint256 _gasLimit,
+        bytes memory _data
+    )
+        override
+        public
+    {
+        require(
+            _data.length <= MAX_ROLLUP_TX_SIZE,
+            "Transaction data size exceeds maximum for rollup transaction."
+        );
+ 
+        require(
+            _gasLimit <= maxTransactionGasLimit,
+            "Transaction gas limit exceeds maximum for rollup transaction."
+        );
+ 
+        require(
+            _gasLimit >= MIN_ROLLUP_TX_GAS,
+            "Transaction gas limit too low to enqueue."
+        );
+ 
+        // We need to consume some amount of L1 gas in order to rate limit transactions going into
+        // L2. However, L2 is cheaper than L1 so we only need to burn some small proportion of the
+        // provided L1 gas.
+        uint256 gasToConsume = _gasLimit/L2_GAS_DISCOUNT_DIVISOR;
+        uint256 startingGas = gasleft();
+ 
+        // Although this check is not necessary (burn below will run out of gas if not true), it
+        // gives the user an explicit reason as to why the enqueue attempt failed.
+        require(
+            startingGas > gasToConsume,
+            "Insufficient gas for L2 rate limiting burn."
+        );
+ 
+        // Here we do some "dumb" work in order to burn gas, although we should probably replace
+        // this with something like minting gas token later on.
+        uint256 i;
+        while(startingGas - gasleft() < gasToConsume) {
+            i++;
+        }
+ 
+        bytes32 transactionHash = keccak256(
+            abi.encode(
+                msg.sender,
+                _target,
+                _gasLimit,
+                _data
+            )
+        );
+ 
+        bytes32 timestampAndBlockNumber;
+        assembly {
+            timestampAndBlockNumber := timestamp()
+            timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
+        }
+ 
+        iOVM_ChainStorageContainer queueRef = queue();
+ 
+        queueRef.push(transactionHash);
+        queueRef.push(timestampAndBlockNumber);
+ 
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the real queue length we need
+        // to divide by 2 and subtract 1.
+        uint256 queueIndex = queueRef.length() / 2 - 1;
+        emit TransactionEnqueued(
+            msg.sender,
+            _target,
+            _gasLimit,
+            _data,
+            queueIndex,
+            block.timestamp
+        );
+    }
+ 
+    /**
+     * Appends a given number of queued transactions as a single batch.
+     * param _numQueuedTransactions Number of transactions to append.
+     */
+    function appendQueueBatch(
+        uint256 // _numQueuedTransactions
+    )
+        override
+        public
+        pure
+    {
+        // TEMPORARY: Disable `appendQueueBatch` for minnet
+        revert("appendQueueBatch is currently disabled.");
+ 
+        // _numQueuedTransactions = Lib_Math.min(_numQueuedTransactions, getNumPendingQueueElements());
+        // require(
+        //     _numQueuedTransactions > 0,
+        //     "Must append more than zero transactions."
+        // );
+ 
+        // bytes32[] memory leaves = new bytes32[](_numQueuedTransactions);
+        // uint40 nextQueueIndex = getNextQueueIndex();
+ 
+        // for (uint256 i = 0; i < _numQueuedTransactions; i++) {
+        //     if (msg.sender != resolve("OVM_Sequencer")) {
+        //         Lib_OVMCodec.QueueElement memory el = getQueueElement(nextQueueIndex);
+        //         require(
+        //             el.timestamp + forceInclusionPeriodSeconds < block.timestamp,
+        //             "Queue transactions cannot be submitted during the sequencer inclusion period."
+        //         );
+        //     }
+        //     leaves[i] = _getQueueLeafHash(nextQueueIndex);
+        //     nextQueueIndex++;
+        // }
+ 
+        // Lib_OVMCodec.QueueElement memory lastElement = getQueueElement(nextQueueIndex - 1);
+ 
+        // _appendBatch(
+        //     Lib_MerkleTree.getMerkleRoot(leaves),
+        //     _numQueuedTransactions,
+        //     _numQueuedTransactions,
+        //     lastElement.timestamp,
+        //     lastElement.blockNumber
+        // );
+ 
+        // emit QueueBatchAppended(
+        //     nextQueueIndex - _numQueuedTransactions,
+        //     _numQueuedTransactions,
+        //     getTotalElements()
+        // );
+    }
+ 
+    /**
+     * Allows the sequencer to append a batch of transactions.
+     * @dev This function uses a custom encoding scheme for efficiency reasons.
+     * .param _shouldStartAtElement Specific batch we expect to start appending to.
+     * .param _totalElementsToAppend Total number of batch elements we expect to append.
+     * .param _contexts Array of batch contexts.
+     * .param _transactionDataFields Array of raw transaction data.
+     */
+    function appendSequencerBatch()
+        override
+        public
+    {
+        uint40 shouldStartAtElement;
+        uint24 totalElementsToAppend;
+        uint24 numContexts;
+        assembly {
+            shouldStartAtElement  := shr(216, calldataload(4))
+            totalElementsToAppend := shr(232, calldataload(9))
+            numContexts           := shr(232, calldataload(12))
+        }
+ 
+        require(
+            shouldStartAtElement == getTotalElements(),
+            "Actual batch start index does not match expected start index."
+        );
+ 
+        require(
+            msg.sender == resolve("OVM_Sequencer"),
+            "Function can only be called by the Sequencer."
+        );
+ 
+        require(
+            numContexts > 0,
+            "Must provide at least one batch context."
+        );
+ 
+        require(
+            totalElementsToAppend > 0,
+            "Must append at least one element."
+        );
+ 
+        uint40 nextTransactionPtr = uint40(BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts);
+ 
+        Erequire(
+            msg.data.length >= nextTransactionPtr,
+            "Not enough BatchContexts provided."
+        );
+ 
+        // Take a reference to the queue and its length so we don't have to keep resolving it.
+        // Length isn't going to change during the course of execution, so it's fine to simply
+        // resolve this once at the start. Saves gas.
+        iOVM_ChainStorageContainer queueRef = queue();
+        uint40 queueLength = _getQueueLength(queueRef);
+ 
+        // Reserve some memory to save gas on hashing later on. This is a relatively safe estimate
+        // for the average transaction size that will prevent having to resize this chunk of memory
+        // later on. Saves gas.
+        bytes memory hashMemory = new bytes((msg.data.length / totalElementsToAppend) * 2);
+ 
+        // Initialize the array of canonical chain leaves that we will append.
+        bytes32[] memory leaves = new bytes32[](totalElementsToAppend);
+ 
+        // Each leaf index corresponds to a tx, either sequenced or enqueued.
+        uint32 leafIndex = 0;
+ 
+        // Counter for number of sequencer transactions appended so far.
+        uint32 numSequencerTransactions = 0;
+ 
+        // We will sequentially append leaves which are pointers to the queue.
+        // The initial queue index is what is currently in storage.
+        uint40 nextQueueIndex = getNextQueueIndex();
+ 
+        BatchContext memory curContext;
+        for (uint32 i = 0; i < numContexts; i++) {
+            BatchContext memory nextContext = _getBatchContext(i);
+ 
+            if (i == 0) {
+                // Execute a special check for the first batch.
+                _validateFirstBatchContext(nextContext);
+            }
+ 
+            // Execute this check on every single batch, including the first one.
+            _validateNextBatchContext(
+                curContext,
+                nextContext,
+                nextQueueIndex,
+                queueRef
+            );
+ 
+            // Now we can update our current context.
+            curContext = nextContext;
+ 
+            // Process sequencer transactions first.
+            for (uint32 j = 0; j < curContext.numSequencedTransactions; j++) {
+                uint256 txDataLength;
+                assembly {
+                    txDataLength := shr(232, calldataload(nextTransactionPtr))
+                }
+ 
+                leaves[leafIndex] = _getSequencerLeafHash(
+                    curContext,
+                    nextTransactionPtr,
+                    txDataLength,
+                    hashMemory
+                );
+ 
+                nextTransactionPtr += uint40(TX_DATA_HEADER_SIZE + txDataLength);
+                numSequencerTransactions++;
+                leafIndex++;
+            }
+ 
+            // Now process any subsequent queue transactions.
+            for (uint32 j = 0; j < curContext.numSubsequentQueueTransactions; j++) {
+                require(
+                    nextQueueIndex < queueLength,
+                    "Not enough queued transactions to append."
+                );
+ 
+                leaves[leafIndex] = _getQueueLeafHash(nextQueueIndex);
+                nextQueueIndex++;
+                leafIndex++;
+            }
+        }
+ 
+        _validateFinalBatchContext(
+            curContext,
+            nextQueueIndex,
+            queueLength,
+            queueRef
+        );
+ 
+        require(
+            msg.data.length == nextTransactionPtr,
+            "Not all sequencer transactions were processed."
+        );
+ 
+        Erequire(
+            leafIndex == totalElementsToAppend,
+            "Actual transaction index does not match expected total elements to append."
+        );
+ 
+        // Generate the required metadata that we need to append this batch
+        uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
+        uint40 blockTimestamp;
+        uint40 blockNumber;
+        if (curContext.numSubsequentQueueTransactions == 0) {
+            // The last element is a sequencer tx, therefore pull timestamp and block number from the last context.
+            blockTimestamp = uint40(curContext.timestamp);
+            blockNumber = uint40(curContext.blockNumber);
+        } else {
+            // The last element is a queue tx, therefore pull timestamp and block number from the queue element.
+            // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at least one queue element.
+            // We increment nextQueueIndex after processing each queue element,
+            // so the index of the last element we processed is nextQueueIndex - 1.
+            Lib_OVMCodec.QueueElement memory lastElement = _getQueueElement(
+                nextQueueIndex - 1,
+                queueRef
+            );
+ 
+            blockTimestamp = lastElement.timestamp;
+            blockNumber = lastElement.blockNumber;
+        }
+ 
+        // For efficiency reasons getMerkleRoot modifies the `leaves` argument in place
+        // while calculating the root hash therefore any arguments passed to it must not
+        // be used again afterwards
+        _appendBatch(
+            Lib_MerkleTree.getMerkleRoot(leaves),
+            totalElementsToAppend,
+            numQueuedTransactions,
+            blockTimestamp,
+            blockNumber
+        );
+ 
+        emit SequencerBatchAppended(
+            nextQueueIndex - numQueuedTransactions,
+            numQueuedTransactions,
+            getTotalElements()
+        );
+    }
+ 
+    /**
+     * Verifies whether a transaction is included in the chain.
+     * @param _transaction Transaction to verify.
+     * @param _txChainElement Transaction chain element corresponding to the transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
+     * @return True if the transaction exists in the CTC, false if not.
+     */
+    function verifyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        if (_txChainElement.isSequenced == true) {
+            return _verifySequencerTransaction(
+                _transaction,
+                _txChainElement,
+                _batchHeader,
+                _inclusionProof
+            );
+        } else {
+            return _verifyQueueTransaction(
+                _transaction,
+                _txChainElement.queueIndex,
+                _batchHeader,
+                _inclusionProof
+            );
+        }
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Returns the BatchContext located at a particular index.
+     * @param _index The index of the BatchContext
+     * @return The BatchContext at the specified index.
+     */
+    function _getBatchContext(
+        uint256 _index
+    )
+        internal
+        pure
+        returns (
+            BatchContext memory
+        )
+    {
+        uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;
+        uint256 numSequencedTransactions;
+        uint256 numSubsequentQueueTransactions;
+        uint256 ctxTimestamp;
+        uint256 ctxBlockNumber;
+ 
+        assembly {
+            numSequencedTransactions       := shr(232, calldataload(contextPtr))
+            numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))
+            ctxTimestamp                   := shr(216, calldataload(add(contextPtr, 6)))
+            ctxBlockNumber                 := shr(216, calldataload(add(contextPtr, 11)))
+        }
+ 
+        return BatchContext({
+            numSequencedTransactions: numSequencedTransactions,
+            numSubsequentQueueTransactions: numSubsequentQueueTransactions,
+            timestamp: ctxTimestamp,
+            blockNumber: ctxBlockNumber
+        });
+    }
+ 
+    /**
+     * Parses the batch context from the extra data.
+     * @return Total number of elements submitted.
+     * @return Index of the next queue element.
+     */
+    function _getBatchExtraData()
+        internal
+        view
+        returns (
+            uint40,
+            uint40,
+            uint40,
+            uint40
+        )
+    {
+        bytes27 extraData = batches().getGlobalMetadata();
+ 
+        uint40 totalElements;
+        uint40 nextQueueIndex;
+        uint40 lastTimestamp;
+        uint40 lastBlockNumber;
+        assembly {
+            extraData       :=  shr(40, extraData)
+            totalElements   :=  and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            nextQueueIndex  :=  shr(40, and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000))
+            lastTimestamp   :=  shr(80, and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000))
+            lastBlockNumber :=  shr(120, and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000))
+        }
+ 
+        return (
+            totalElements,
+            nextQueueIndex,
+            lastTimestamp,
+            lastBlockNumber
+        );
+    }
+ 
+    /**
+     * Encodes the batch context for the extra data.
+     * @param _totalElements Total number of elements submitted.
+     * @param _nextQueueIndex Index of the next queue element.
+     * @param _timestamp Timestamp for the last batch.
+     * @param _blockNumber Block number of the last batch.
+     * @return Encoded batch context.
+     */
+    function _makeBatchExtraData(
+        uint40 _totalElements,
+        uint40 _nextQueueIndex,
+        uint40 _timestamp,
+        uint40 _blockNumber
+    )
+        internal
+        pure
+        returns (
+            bytes27
+        )
+    {
+        bytes27 extraData;
+        assembly {
+            extraData := _totalElements
+            extraData := or(extraData, shl(40, _nextQueueIndex))
+            extraData := or(extraData, shl(80, _timestamp))
+            extraData := or(extraData, shl(120, _blockNumber))
+            extraData := shl(40, extraData)
+        }
+ 
+        return extraData;
+    }
+ 
+    /**
+     * Retrieves the hash of a queue element.
+     * @param _index Index of the queue element to retrieve a hash for.
+     * @return Hash of the queue element.
+     */
+    function _getQueueLeafHash(
+        uint256 _index
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return _hashTransactionChainElement(
+            Lib_OVMCodec.TransactionChainElement({
+                isSequenced: false,
+                queueIndex: _index,
+                timestamp: 0,
+                blockNumber: 0,
+                txData: hex""
+            })
+        );
+    }
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function _getQueueElement(
+        uint256 _index,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        )
+    {
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the actual desired queue index
+        // we need to multiply by 2.
+        uint40 trueIndex = uint40(_index * 2);
+        bytes32 transactionHash = _queueRef.get(trueIndex);
+        bytes32 timestampAndBlockNumber = _queueRef.get(trueIndex + 1);
+ 
+        uint40 elementTimestamp;
+        uint40 elementBlockNumber;
+        assembly {
+            elementTimestamp   :=         and(timestampAndBlockNumber, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            elementBlockNumber := shr(40, and(timestampAndBlockNumber, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
+        }
+ 
+        return Lib_OVMCodec.QueueElement({
+            transactionHash: transactionHash,
+            timestamp: elementTimestamp,
+            blockNumber: elementBlockNumber
+        });
+    }
+ 
+    /**
+     * Retrieves the length of the queue.
+     * @return Length of the queue.
+     */
+    function _getQueueLength(
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the real queue length we need
+        // to divide by 2.
+        return uint40(_queueRef.length() / 2);
+    }
+ 
+    /**
+     * Retrieves the hash of a sequencer element.
+     * @param _context Batch context for the given element.
+     * @param _nextTransactionPtr Pointer to the next transaction in the calldata.
+     * @param _txDataLength Length of the transaction item.
+     * @return Hash of the sequencer element.
+     */
+    function _getSequencerLeafHash(
+        BatchContext memory _context,
+        uint256 _nextTransactionPtr,
+        uint256 _txDataLength,
+        bytes memory _hashMemory
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        // Only allocate more memory if we didn't reserve enough to begin with.
+        if (BYTES_TILL_TX_DATA + _txDataLength > _hashMemory.length) {
+            _hashMemory = new bytes(BYTES_TILL_TX_DATA + _txDataLength);
+        }
+ 
+        uint256 ctxTimestamp = _context.timestamp;
+        uint256 ctxBlockNumber = _context.blockNumber;
+ 
+        bytes32 leafHash;
+        assembly {
+            let chainElementStart := add(_hashMemory, 0x20)
+ 
+            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
+            // This distinguishes sequencer ChainElements from queue ChainElements because
+            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
+            // elements is always zero
+            mstore8(chainElementStart, 1)
+ 
+            mstore(add(chainElementStart, 1), ctxTimestamp)
+            mstore(add(chainElementStart, 33), ctxBlockNumber)
+ 
+            calldatacopy(add(chainElementStart, BYTES_TILL_TX_DATA), add(_nextTransactionPtr, 3), _txDataLength)
+ 
+            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, _txDataLength))
+        }
+ 
+        return leafHash;
+    }
+ 
+    /**
+     * Retrieves the hash of a sequencer element.
+     * @param _txChainElement The chain element which is hashed to calculate the leaf.
+     * @return Hash of the sequencer element.
+     */
+    function _getSequencerLeafHash(
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement
+    )
+        internal
+        view
+        returns(
+            bytes32
+        )
+    {
+        bytes memory txData = _txChainElement.txData;
+        uint256 txDataLength = _txChainElement.txData.length;
+ 
+        bytes memory chainElement = new bytes(BYTES_TILL_TX_DATA + txDataLength);
+        uint256 ctxTimestamp = _txChainElement.timestamp;
+        uint256 ctxBlockNumber = _txChainElement.blockNumber;
+ 
+        bytes32 leafHash;
+        assembly {
+            let chainElementStart := add(chainElement, 0x20)
+ 
+            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
+            // This distinguishes sequencer ChainElements from queue ChainElements because
+            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
+            // elements is always zero
+            mstore8(chainElementStart, 1)
+ 
+            mstore(add(chainElementStart, 1), ctxTimestamp)
+            mstore(add(chainElementStart, 33), ctxBlockNumber)
+ 
+            pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart, BYTES_TILL_TX_DATA), txDataLength))
+ 
+            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, txDataLength))
+        }
+ 
+        return leafHash;
+    }
+ 
+    /**
+     * Inserts a batch into the chain of batches.
+     * @param _transactionRoot Root of the transaction tree for this batch.
+     * @param _batchSize Number of elements in the batch.
+     * @param _numQueuedTransactions Number of queue transactions in the batch.
+     * @param _timestamp The latest batch timestamp.
+     * @param _blockNumber The latest batch blockNumber.
+     */
+    function _appendBatch(
+        bytes32 _transactionRoot,
+        uint256 _batchSize,
+        uint256 _numQueuedTransactions,
+        uint40 _timestamp,
+        uint40 _blockNumber
+    )
+        internal
+    {
+        iOVM_ChainStorageContainer batchesRef = batches();
+        (uint40 totalElements, uint40 nextQueueIndex,,) = _getBatchExtraData();
+ 
+        Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({
+            batchIndex: batchesRef.length(),
+            batchRoot: _transactionRoot,
+            batchSize: _batchSize,
+            prevTotalElements: totalElements,
+            extraData: hex""
+        });
+ 
+        emit TransactionBatchAppended(
+            header.batchIndex,
+            header.batchRoot,
+            header.batchSize,
+            header.prevTotalElements,
+            header.extraData
+        );
+ 
+        bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);
+        bytes27 latestBatchContext = _makeBatchExtraData(
+            totalElements + uint40(header.batchSize),
+            nextQueueIndex + uint40(_numQueuedTransactions),
+            _timestamp,
+            _blockNumber
+        );
+ 
+        batchesRef.push(batchHeaderHash, latestBatchContext);
+    }
+ 
+    /**
+     * Checks that the first batch context in a sequencer submission is valid
+     * @param _firstContext The batch context to validate.
+     */
+    function _validateFirstBatchContext(
+        BatchContext memory _firstContext
+    )
+        internal
+        view
+    {
+        // If there are existing elements, this batch must have the same context 
+        // or a later timestamp and block number.
+        if (getTotalElements() > 0) {
+            (,, uint40 lastTimestamp, uint40 lastBlockNumber) = _getBatchExtraData();
+ 
+            require(
+                _firstContext.blockNumber >= lastBlockNumber,
+                "Context block number is lower than last submitted."
+            );
+ 
+            Irequire(
+                _firstContext.timestamp >= lastTimestamp,
+                "Context timestamp is lower than last submitted."
+            );
+        }
+ 
+        // Sequencer cannot submit contexts which are more than the force inclusion period old.
+        require(
+            _firstContext.timestamp + forceInclusionPeriodSeconds >= block.timestamp,
+            "Context timestamp too far in the past."
+        );
+ 
+        require(
+            _firstContext.blockNumber + forceInclusionPeriodBlocks >= block.number,
+            "Context block number too far in the past."
+        );
+    }
+ 
+    /**
+     * Checks that a given batch context has a time context which is below a given que element
+     * @param _context The batch context to validate has values lower.
+     * @param _queueIndex Index of the queue element we are validating came later than the context.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateContextBeforeEnqueue(
+        BatchContext memory _context,
+        uint40 _queueIndex,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+            Lib_OVMCodec.QueueElement memory nextQueueElement = _getQueueElement(
+                _queueIndex,
+                _queueRef
+            );
+ 
+            // If the force inclusion period has passed for an enqueued transaction, it MUST be the next chain element.
+            require(
+                block.timestamp < nextQueueElement.timestamp + forceInclusionPeriodSeconds,
+                "Previously enqueued batches have expired and must be appended before a new sequencer batch."
+            );
+ 
+            // Just like sequencer transaction times must be increasing relative to each other,
+            // We also require that they be increasing relative to any interspersed queue elements.
+            require(
+                _context.timestamp <= nextQueueElement.timestamp,
+                "Sequencer transaction timestamp exceeds that of next queue element."
+            );
+ 
+            require(
+                _context.blockNumber <= nextQueueElement.blockNumber,
+                "Sequencer transaction blockNumber exceeds that of next queue element."
+            );
+    }
+ 
+    /**
+     * Checks that a given batch context is valid based on its previous context, and the next queue elemtent.
+     * @param _prevContext The previously validated batch context.
+     * @param _nextContext The batch context to validate with this call.
+     * @param _nextQueueIndex Index of the next queue element to process for the _nextContext's subsequentQueueElements.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateNextBatchContext(
+        BatchContext memory _prevContext,
+        BatchContext memory _nextContext,
+        uint40 _nextQueueIndex,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+        // All sequencer transactions' times must be greater than or equal to the previous ones.
+        require(
+            _nextContext.timestamp >= _prevContext.timestamp,
+            "Context timestamp values must monotonically increase."
+        );
+ 
+        require(
+            _nextContext.blockNumber >= _prevContext.blockNumber,
+            "Context blockNumber values must monotonically increase."
+        );
+ 
+        // If there is going to be a queue element pulled in from this context:
+        if (_nextContext.numSubsequentQueueTransactions > 0) {
+            _validateContextBeforeEnqueue(
+                _nextContext,
+                _nextQueueIndex,
+                _queueRef
+            );
+        }
+    }
+ 
+    /**
+     * Checks that the final batch context in a sequencer submission is valid.
+     * @param _finalContext The batch context to validate.
+     * @param _queueLength The length of the queue at the start of the batchAppend call.
+     * @param _nextQueueIndex The next element in the queue that will be pulled into the CTC.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateFinalBatchContext(
+        BatchContext memory _finalContext,
+        uint40 _nextQueueIndex,
+        uint40 _queueLength,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+        // If the queue is not now empty, check the mononoticity of whatever the next batch that will come in is.
+        if (_queueLength - _nextQueueIndex > 0 && _finalContext.numSubsequentQueueTransactions == 0) {
+            _validateContextBeforeEnqueue(
+                _finalContext,
+                _nextQueueIndex,
+                _queueRef
+            );
+        }
+        // Batches cannot be added from the future, or subsequent enqueue() contexts would violate monotonicity.
+        require(_finalContext.timestamp <= block.timestamp, "Context timestamp is from the future.");
+        require(_finalContext.blockNumber <= block.number, "Context block number is from the future.");
+    }
+ 
+    /**
+     * Hashes a transaction chain element.
+     * @param _element Chain element to hash.
+     * @return Hash of the chain element.
+     */
+    function _hashTransactionChainElement(
+        Lib_OVMCodec.TransactionChainElement memory _element
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(
+            abi.encode(
+                _element.isSequenced,
+                _element.queueIndex,
+                _element.timestamp,
+                _element.blockNumber,
+                _element.txData
+            )
+        );
+    }
+ 
+    /**
+     * Verifies a sequencer transaction, returning true if it was indeed included in the CTC
+     * @param _transaction The transaction we are verifying inclusion of.
+     * @param _txChainElement The chain element that the transaction is claimed to be a part of.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof An inclusion proof into the CTC at a particular index.
+     * @return True if the transaction was included in the specified location, else false.
+     */
+    function _verifySequencerTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        OVM_ExecutionManager ovmExecutionManager = OVM_ExecutionManager(resolve("OVM_ExecutionManager"));
+        uint256 gasLimit = ovmExecutionManager.getMaxTransactionGasLimit();
+        bytes32 leafHash = _getSequencerLeafHash(_txChainElement);
+ 
+        Erequire(
+            _verifyElement(
+                leafHash,
+                _batchHeader,
+                _inclusionProof
+            ),
+            "Invalid Sequencer transaction inclusion proof."
+        );
+ 
+        Erequire(
+            _transaction.blockNumber        == _txChainElement.blockNumber
+            && _transaction.timestamp       == _txChainElement.timestamp
+            && _transaction.entrypoint      == resolve("OVM_DecompressionPrecompileAddress")
+            && _transaction.gasLimit        == gasLimit
+            && _transaction.l1TxOrigin      == address(0)
+            && _transaction.l1QueueOrigin   == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
+            && keccak256(_transaction.data) == keccak256(_txChainElement.txData),
+            "Invalid Sequencer transaction."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * Verifies a queue transaction, returning true if it was indeed included in the CTC
+     * @param _transaction The transaction we are verifying inclusion of.
+     * @param _queueIndex The queueIndex of the queued transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof An inclusion proof into the CTC at a particular index (should point to queue tx).
+     * @return True if the transaction was included in the specified location, else false.
+     */
+    function _verifyQueueTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        uint256 _queueIndex,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 leafHash = _getQueueLeafHash(_queueIndex);
+ 
+        Erequire(
+            _verifyElement(
+                leafHash,
+                _batchHeader,
+                _inclusionProof
+            ),
+            "Invalid Queue transaction inclusion proof."
+        );
+ 
+        bytes32 transactionHash = keccak256(
+            abi.encode(
+                _transaction.l1TxOrigin,
+                _transaction.entrypoint,
+                _transaction.gasLimit,
+                _transaction.data
+            )
+        );
+ 
+        Lib_OVMCodec.QueueElement memory el = getQueueElement(_queueIndex);
+        Erequire(
+            el.transactionHash      == transactionHash
+            && el.timestamp   == _transaction.timestamp
+            && el.blockNumber == _transaction.blockNumber,
+            "Invalid Queue transaction."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * Verifies a batch inclusion proof.
+     * @param _element Hash of the element to verify a proof for.
+     * @param _batchHeader Header of the batch in which the element was included.
+     * @param _proof Merkle inclusion proof for the element.
+     */
+    function _verifyElement(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        Erequire(
+            Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(uint32(_batchHeader.batchIndex)),
+            "Invalid batch header."
+        );
+ 
+        Erequire(
+            Lib_MerkleTree.verify(
+                _batchHeader.batchRoot,
+                _element,
+                _proof.index,
+                _proof.siblings,
+                _batchHeader.batchSize
+            ),
+            "Invalid inclusion proof."
+        );
+ 
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/chain/OVM_ChainStorageContainer.sol.html b/coverage/OVM/chain/OVM_ChainStorageContainer.sol.html new file mode 100644 index 000000000..537ad24b1 --- /dev/null +++ b/coverage/OVM/chain/OVM_ChainStorageContainer.sol.html @@ -0,0 +1,680 @@ + + + + Code coverage report for OVM/chain/OVM_ChainStorageContainer.sol + + + + + + + +
+
+

+ all files / OVM/chain/ OVM_ChainStorageContainer.sol +

+
+
+ 72.73% + Statements + 8/11 +
+
+ 50% + Branches + 1/2 +
+
+ 72.73% + Functions + 8/11 +
+
+ 75% + Lines + 9/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +504× +  +  +  +  +  +  +  +  +573× +  +  +  +573× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +550× +  +  +  +  +  +  +  +  +  +  +  +  +  +441× +  +  +  +  +  +  +  +  +  +  +  +  +470× +  +  +  +  +  +  +  +  +  +  +  +  +  +102× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_RingBuffer } from "../../libraries/utils/Lib_RingBuffer.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/**
+ * @title OVM_ChainStorageContainer
+ * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.
+ * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used
+ * in a fraud proof due to the fraud window having passed, and the associated chain state or
+ * transactions being finalized.
+ * Three distinct Chain Storage Containers will be deployed on Layer 1:
+ * 1. Stores transaction batches for the Canonical Transaction Chain
+ * 2. Stores queued transactions for the Canonical Transaction Chain
+ * 3. Stores chain state batches for the State Commitment Chain
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {
+ 
+    /*************
+     * Libraries *
+     *************/
+ 
+    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    string public owner;
+    Lib_RingBuffer.RingBuffer internal buffer;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _owner Name of the contract that owns this container (will be resolved later).
+     */
+    constructor(
+        address _libAddressManager,
+        string memory _owner
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        owner = _owner;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyOwner() {
+        Erequire(
+            msg.sender == resolve(owner),
+            "OVM_ChainStorageContainer: Function can only be called by the owner."
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function setGlobalMetadata(
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        return buffer.setExtraData(_globalMetadata);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function getGlobalMetadata()
+        override
+        public
+        view
+        returns (
+            bytes27
+        )
+    {
+        return buffer.getExtraData();
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function length()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return uint256(buffer.getLength());
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function push(
+        bytes32 _object
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.push(_object);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function push(
+        bytes32 _object,
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.push(_object, _globalMetadata);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function get(
+        uint256 _index
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        return buffer.get(uint40(_index));
+    }
+    
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.deleteElementsAfterInclusive(
+            uint40(_index)
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index,
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.deleteElementsAfterInclusive(
+            uint40(_index),
+            _globalMetadata
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function setNextOverwritableIndex(
+        uint256 _index
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.nextOverwritableIndex = _index;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/chain/OVM_StateCommitmentChain.sol.html b/coverage/OVM/chain/OVM_StateCommitmentChain.sol.html new file mode 100644 index 000000000..059e03525 --- /dev/null +++ b/coverage/OVM/chain/OVM_StateCommitmentChain.sol.html @@ -0,0 +1,1307 @@ + + + + Code coverage report for OVM/chain/OVM_StateCommitmentChain.sol + + + + + + + +
+
+

+ all files / OVM/chain/ OVM_StateCommitmentChain.sol +

+
+
+ 88.1% + Statements + 37/42 +
+
+ 67.86% + Branches + 19/28 +
+
+ 85.71% + Functions + 12/14 +
+
+ 88.64% + Lines + 39/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +60× +60× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +125× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +24× +  +  +  +  +24× +  +  +  +  +23× +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +74× +  +74× +74× +74× +  +  +  +  +  +74× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +22× +20× +  +  +  +  +  + +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
+ 
+/* Interface Imports */
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/* External Imports */
+import '@openzeppelin/contracts/math/SafeMath.sol';
+ 
+/**
+ * @title OVM_StateCommitmentChain
+ * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which
+ * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).
+ * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique
+ * state root calculated off-chain by applying the canonical transactions one by one.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 public FRAUD_PROOF_WINDOW;
+    uint256 public SEQUENCER_PUBLISH_WINDOW;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager,
+        uint256 _fraudProofWindow,
+        uint256 _sequencerPublishWindow
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        FRAUD_PROOF_WINDOW = _fraudProofWindow;
+        SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:SCC:batches")
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getTotalElements()
+        override
+        public
+        view
+        returns (
+            uint256 _totalElements
+        )
+    {
+        (uint40 totalElements, ) = _getBatchExtraData();
+        return uint256(totalElements);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getTotalBatches()
+        override
+        public
+        view
+        returns (
+            uint256 _totalBatches
+        )
+    {
+        return batches().length();
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getLastSequencerTimestamp()
+        override
+        public
+        view
+        returns (
+            uint256 _lastSequencerTimestamp
+        )
+    {
+        (, uint40 lastSequencerTimestamp) = _getBatchExtraData();
+        return uint256(lastSequencerTimestamp);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function appendStateBatch(
+        bytes32[] memory _batch,
+        uint256 _shouldStartAtElement
+    )
+        override
+        public
+    {
+        // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the
+        // publication of batches by some other user.
+        require(
+            _shouldStartAtElement == getTotalElements(),
+            "Actual batch start index does not match expected start index."
+        );
+ 
+        // Proposers must have previously staked at the BondManager
+        Erequire(
+            iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender),
+            "Proposer does not have enough collateral posted"
+        );
+ 
+        require(
+            _batch.length > 0,
+            "Cannot submit an empty state batch."
+        );
+ 
+        require(
+            getTotalElements() + _batch.length <= iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(),
+            "Number of state roots cannot exceed the number of canonical transactions."
+        );
+ 
+        // Pass the block's timestamp and the publisher of the data
+        // to be used in the fraud proofs
+        _appendBatch(
+            _batch,
+            abi.encode(block.timestamp, msg.sender)
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function deleteStateBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        override
+        public
+    {
+        require(
+            msg.sender == resolve("OVM_FraudVerifier"),
+            "State batches can only be deleted by the OVM_FraudVerifier."
+        );
+ 
+        require(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        Erequire(
+            insideFraudProofWindow(_batchHeader),
+            "State batches can only be deleted within the fraud proof window."
+        );
+ 
+        _deleteBatch(_batchHeader);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function verifyStateCommitment(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        require(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        require(
+            Lib_MerkleTree.verify(
+                _batchHeader.batchRoot,
+                _element,
+                _proof.index,
+                _proof.siblings,
+                _batchHeader.batchSize
+            ),
+            "Invalid inclusion proof."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function insideFraudProofWindow(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        override
+        public
+        view
+        returns (
+            bool _inside
+        )
+    {
+        (uint256 timestamp,) = abi.decode(
+            _batchHeader.extraData,
+            (uint256, address)
+        );
+ 
+        Erequire(
+            timestamp != 0,
+            "Batch header timestamp cannot be zero"
+        );
+        return SafeMath.add(timestamp, FRAUD_PROOF_WINDOW) > block.timestamp;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Parses the batch context from the extra data.
+     * @return Total number of elements submitted.
+     * @return Timestamp of the last batch submitted by the sequencer.
+     */
+    function _getBatchExtraData()
+        internal
+        view
+        returns (
+            uint40,
+            uint40
+        )
+    {
+        bytes27 extraData = batches().getGlobalMetadata();
+ 
+        uint40 totalElements;
+        uint40 lastSequencerTimestamp;
+        assembly {
+            extraData              := shr(40, extraData)
+            totalElements          :=         and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            lastSequencerTimestamp := shr(40, and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
+        }
+ 
+        return (
+            totalElements,
+            lastSequencerTimestamp
+        );
+    }
+ 
+    /**
+     * Encodes the batch context for the extra data.
+     * @param _totalElements Total number of elements submitted.
+     * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.
+     * @return Encoded batch context.
+     */
+    function _makeBatchExtraData(
+        uint40 _totalElements,
+        uint40 _lastSequencerTimestamp
+    )
+        internal
+        pure
+        returns (
+            bytes27
+        )
+    {
+        bytes27 extraData;
+        assembly {
+            extraData := _totalElements
+            extraData := or(extraData, shl(40, _lastSequencerTimestamp))
+            extraData := shl(40, extraData)
+        }
+ 
+        return extraData;
+    }
+ 
+    /**
+     * Appends a batch to the chain.
+     * @param _batch Elements within the batch.
+     * @param _extraData Any extra data to append to the batch.
+     */
+    function _appendBatch(
+        bytes32[] memory _batch,
+        bytes memory _extraData
+    )
+        internal
+    {
+        address sequencer = resolve("OVM_Proposer");
+        (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();
+ 
+        if (msg.sender == sequencer) {
+            lastSequencerTimestamp = uint40(block.timestamp);
+        } else {
+            // We keep track of the last batch submitted by the sequencer so there's a window in
+            // which only the sequencer can publish state roots. A window like this just reduces
+            // the chance of "system breaking" state roots being published while we're still in
+            // testing mode. This window should be removed or significantly reduced in the future.
+            require(
+                lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,
+                "Cannot publish state roots within the sequencer publication window."
+            );
+        }
+ 
+        // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place
+        // while calculating the root hash therefore any arguments passed to it must not
+        // be used again afterwards
+        Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({
+            batchIndex: getTotalBatches(),
+            batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),
+            batchSize: _batch.length,
+            prevTotalElements: totalElements,
+            extraData: _extraData
+        });
+ 
+        emit StateBatchAppended(
+            batchHeader.batchIndex,
+            batchHeader.batchRoot,
+            batchHeader.batchSize,
+            batchHeader.prevTotalElements,
+            batchHeader.extraData
+        );
+ 
+        batches().push(
+            Lib_OVMCodec.hashBatchHeader(batchHeader),
+            _makeBatchExtraData(
+                uint40(batchHeader.prevTotalElements + batchHeader.batchSize),
+                lastSequencerTimestamp
+            )
+        );
+    }
+ 
+    /**
+     * Removes a batch and all subsequent batches from the chain.
+     * @param _batchHeader Header of the batch to remove.
+     */
+    function _deleteBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+    {
+        Erequire(
+            _batchHeader.batchIndex < batches().length(),
+            "Invalid batch index."
+        );
+ 
+        Erequire(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        batches().deleteElementsAfterInclusive(
+            _batchHeader.batchIndex,
+            _makeBatchExtraData(
+                uint40(_batchHeader.prevTotalElements),
+                0
+            )
+        );
+ 
+        emit StateBatchDeleted(
+            _batchHeader.batchIndex,
+            _batchHeader.batchRoot
+        );
+    }
+ 
+    /**
+     * Checks that a batch header matches the stored hash for the given index.
+     * @param _batchHeader Batch header to validate.
+     * @return Whether or not the header matches the stored one.
+     */
+    function _isValidBatchHeader(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/chain/index.html b/coverage/OVM/chain/index.html new file mode 100644 index 000000000..3b8188133 --- /dev/null +++ b/coverage/OVM/chain/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for OVM/chain/ + + + + + + + +
+
+

+ all files OVM/chain/ +

+
+
+ 92.82% + Statements + 194/209 +
+
+ 81.37% + Branches + 83/102 +
+
+ 82.46% + Functions + 47/57 +
+
+ 93.36% + Lines + 211/226 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_CanonicalTransactionChain.sol
95.51%149/15687.5%63/7284.38%27/3295.88%163/170
OVM_ChainStorageContainer.sol
72.73%8/1150%1/272.73%8/1175%9/12
OVM_StateCommitmentChain.sol
88.1%37/4267.86%19/2885.71%12/1488.64%39/44
+
+
+ + + + + + + diff --git a/coverage/OVM/execution/OVM_ExecutionManager.sol.html b/coverage/OVM/execution/OVM_ExecutionManager.sol.html new file mode 100644 index 000000000..774beb5aa --- /dev/null +++ b/coverage/OVM/execution/OVM_ExecutionManager.sol.html @@ -0,0 +1,5654 @@ + + + + Code coverage report for OVM/execution/OVM_ExecutionManager.sol + + + + + + + +
+
+

+ all files / OVM/execution/ OVM_ExecutionManager.sol +

+
+
+ 74.58% + Statements + 176/236 +
+
+ 62.2% + Branches + 51/82 +
+
+ 83.61% + Functions + 51/61 +
+
+ 75.21% + Lines + 182/242 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244 +1245 +1246 +1247 +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1310 +1311 +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319 +1320 +1321 +1322 +1323 +1324 +1325 +1326 +1327 +1328 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1348 +1349 +1350 +1351 +1352 +1353 +1354 +1355 +1356 +1357 +1358 +1359 +1360 +1361 +1362 +1363 +1364 +1365 +1366 +1367 +1368 +1369 +1370 +1371 +1372 +1373 +1374 +1375 +1376 +1377 +1378 +1379 +1380 +1381 +1382 +1383 +1384 +1385 +1386 +1387 +1388 +1389 +1390 +1391 +1392 +1393 +1394 +1395 +1396 +1397 +1398 +1399 +1400 +1401 +1402 +1403 +1404 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1424 +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432 +1433 +1434 +1435 +1436 +1437 +1438 +1439 +1440 +1441 +1442 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +1458 +1459 +1460 +1461 +1462 +1463 +1464 +1465 +1466 +1467 +1468 +1469 +1470 +1471 +1472 +1473 +1474 +1475 +1476 +1477 +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489 +1490 +1491 +1492 +1493 +1494 +1495 +1496 +1497 +1498 +1499 +1500 +1501 +1502 +1503 +1504 +1505 +1506 +1507 +1508 +1509 +1510 +1511 +1512 +1513 +1514 +1515 +1516 +1517 +1518 +1519 +1520 +1521 +1522 +1523 +1524 +1525 +1526 +1527 +1528 +1529 +1530 +1531 +1532 +1533 +1534 +1535 +1536 +1537 +1538 +1539 +1540 +1541 +1542 +1543 +1544 +1545 +1546 +1547 +1548 +1549 +1550 +1551 +1552 +1553 +1554 +1555 +1556 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1576 +1577 +1578 +1579 +1580 +1581 +1582 +1583 +1584 +1585 +1586 +1587 +1588 +1589 +1590 +1591 +1592 +1593 +1594 +1595 +1596 +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609 +1610 +1611 +1612 +1613 +1614 +1615 +1616 +1617 +1618 +1619 +1620 +1621 +1622 +1623 +1624 +1625 +1626 +1627 +1628 +1629 +1630 +1631 +1632 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1652 +1653 +1654 +1655 +1656 +1657 +1658 +1659 +1660 +1661 +1662 +1663 +1664 +1665 +1666 +1667 +1668 +1669 +1670 +1671 +1672 +1673 +1674 +1675 +1676 +1677 +1678 +1679 +1680 +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688 +1689 +1690 +1691 +1692 +1693 +1694 +1695 +1696 +1697 +1698 +1699 +1700 +1701 +1702 +1703 +1704 +1705 +1706 +1707 +1708 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +1720 +1721 +1722 +1723 +1724 +1725 +1726 +1727 +1728 +1729 +1730 +1731 +1732 +1733 +1734 +1735 +1736 +1737 +1738 +1739 +1740 +1741 +1742 +1743 +1744 +1745 +1746 +1747 +1748 +1749 +1750 +1751 +1752 +1753 +1754 +1755 +1756 +1757 +1758 +1759 +1760 +1761 +1762 +1763 +1764 +1765 +1766 +1767 +1768 +1769 +1770 +1771 +1772 +1773 +1774 +1775 +1776 +1777 +1778 +1779 +1780 +1781 +1782 +1783 +1784 +1785 +1786 +1787 +1788 +1789 +1790 +1791 +1792 +1793 +1794 +1795 +1796 +1797 +1798 +1799 +1800 +1801 +1802 +1803 +1804 +1805 +1806 +1807 +1808 +1809 +1810 +1811 +1812 +1813 +1814 +1815 +1816 +1817 +1818 +1819 +1820 +1821 +1822 +1823 +1824 +1825 +1826 +1827 +1828 +1829 +1830 +1831 +1832 +1833 +1834 +1835 +1836 +1837 +1838 +1839 +1840 +1841 +1842 +1843 +1844 +1845 +1846 +1847 +1848 +1849 +1850 +1851 +1852 +1853 +1854 +1855 +1856 +1857 +1858 +1859 +1860 +1861 +1862 +1863 +1864  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +55× +55× +55× +  +  +55× +46× +  +  +  +  +  +  +  +  +  +  +  +201× +201× +192× +  +  +192× +165× +  +  +27× +  +  +  +  +  +  +  +42× + +  +38× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +150× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +  +  +  +28× +  +  +27× +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  + + +  +  +  + +  +  + +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +154× +154× +154× +  +154× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +48× +  +48× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +  +29× +  +29× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +27× +27× +27× +  +  +  +27× +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +172× +  +  +  +  + +  +  +  +171× +  +  +  +  +169× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +196× +196× +  +  +  +  +  +196× +196× +196× +  +  +  +  +  +  +  +196× +  +  +  +  +  +196× +  +  +  +196× +  +  +  +196× +23× +  +  +  +  +  +  +  +  +  +23× + +  +  +  +  +  +18× +  +  +  +  +  +14× +  +  +  +  +18× +  +  +  +10× +  + +  +  +  +  +  +  +  +18× +  +  +  +191× +  +191× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +27× +  +  +27× +  +27× +  +  +10× +10× +10× +10× +  +  +  +  +  +  +  +10× +  +  +  +  +17× +17× + +  +  +  +  +  +  +  +  +  +  +16× +  +  +  +  +  +  +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +29× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +57× +57× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +369× +367× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +17× +17× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +55× +55× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +535× +  +  +  +  +535× + +  +  +  +  +533× +  +  +  +  +  +533× +144× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +53× +  +  +  +53× +  +  +  +  +  +53× +47× +47× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +62× +  +  +  +  +  +  +62× +  +  +  +  +  +62× +  +  +  +  +  +62× +46× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  + +  +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +20× + +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× + +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +196× +  +  +  +  +  +  +  +  +  +  +  +  +  +244× +  +  +  +244× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +392× +202× +  +  +  +392× +308× +  +  +  +392× +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +27× +27× +27× +  +27× +  +27× +27× +27× +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
+import { Lib_ErrorUtils } from "../../libraries/utils/Lib_ErrorUtils.sol";
+ 
+/* Interface Imports */
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
+ 
+/* Contract Imports */
+import { OVM_ECDSAContractAccount } from "../accounts/OVM_ECDSAContractAccount.sol";
+import { OVM_ProxyEOA } from "../accounts/OVM_ProxyEOA.sol";
+import { OVM_DeployerWhitelist } from "../predeploys/OVM_DeployerWhitelist.sol";
+ 
+/**
+ * @title OVM_ExecutionManager
+ * @dev The Execution Manager (EM) is the core of our OVM implementation, and provides a sandboxed
+ * environment allowing us to execute OVM transactions deterministically on either Layer 1 or
+ * Layer 2.
+ * The EM's run() function is the first function called during the execution of any
+ * transaction on L2.
+ * For each context-dependent EVM operation the EM has a function which implements a corresponding
+ * OVM operation, which will read state from the State Manager contract.
+ * The EM relies on the Safety Checker to verify that code deployed to Layer 2 does not contain any
+ * context-dependent operations.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    iOVM_SafetyChecker internal ovmSafetyChecker;
+    iOVM_StateManager internal ovmStateManager;
+ 
+ 
+    /*******************************
+     * Execution Context Variables *
+     *******************************/
+ 
+    GasMeterConfig internal gasMeterConfig;
+    GlobalContext internal globalContext;
+    TransactionContext internal transactionContext;
+    MessageContext internal messageContext;
+    TransactionRecord internal transactionRecord;
+    MessageRecord internal messageRecord;
+ 
+ 
+    /**************************
+     * Gas Metering Constants *
+     **************************/
+ 
+    address constant GAS_METADATA_ADDRESS = 0x06a506A506a506A506a506a506A506A506A506A5;
+    uint256 constant NUISANCE_GAS_SLOAD = 20000;
+    uint256 constant NUISANCE_GAS_SSTORE = 20000;
+    uint256 constant MIN_NUISANCE_GAS_PER_CONTRACT = 30000;
+    uint256 constant NUISANCE_GAS_PER_CONTRACT_BYTE = 100;
+    uint256 constant MIN_GAS_FOR_INVALID_STATE_ACCESS = 30000;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager,
+        GasMeterConfig memory _gasMeterConfig,
+        GlobalContext memory _globalContext
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        ovmSafetyChecker = iOVM_SafetyChecker(resolve("OVM_SafetyChecker"));
+        gasMeterConfig = _gasMeterConfig;
+        globalContext = _globalContext;
+        _resetContext();
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Applies dynamically-sized refund to a transaction to account for the difference in execution
+     * between L1 and L2, so that the overall cost of the ovmOPCODE is fixed.
+     * @param _cost Desired gas cost for the function after the refund.
+     */
+    modifier netGasCost(
+        uint256 _cost
+    ) {
+        uint256 gasProvided = gasleft();
+        _;
+        uint256 gasUsed = gasProvided - gasleft();
+ 
+        // We want to refund everything *except* the specified cost.
+        if (_cost < gasUsed) {
+            transactionRecord.ovmGasRefund += gasUsed - _cost;
+        }
+    }
+ 
+    /**
+     * Applies a fixed-size gas refund to a transaction to account for the difference in execution
+     * between L1 and L2, so that the overall cost of an ovmOPCODE can be lowered.
+     * @param _discount Amount of gas cost to refund for the ovmOPCODE.
+     */
+    modifier fixedGasDiscount(
+        uint256 _discount
+    ) {
+        uint256 gasProvided = gasleft();
+        _;
+        uint256 gasUsed = gasProvided - gasleft();
+ 
+        // We want to refund the specified _discount, unless this risks underflow.
+        if (_discount < gasUsed) {
+            transactionRecord.ovmGasRefund += _discount;
+        } else {
+            // refund all we can without risking underflow.
+            transactionRecord.ovmGasRefund += gasUsed;
+        }
+    }
+ 
+    /**
+     * Makes sure we're not inside a static context.
+     */
+    modifier notStatic() {
+        if (messageContext.isStatic == true) {
+            _revertWithFlag(RevertFlag.STATIC_VIOLATION);
+        }
+        _;
+    }
+ 
+ 
+    /************************************
+     * Transaction Execution Entrypoint *
+     ************************************/
+ 
+    /**
+     * Starts the execution of a transaction via the OVM_ExecutionManager.
+     * @param _transaction Transaction data to be executed.
+     * @param _ovmStateManager iOVM_StateManager implementation providing account state.
+     */
+    function run(
+        Lib_OVMCodec.Transaction memory _transaction,
+        address _ovmStateManager
+    )
+        override
+        public
+    {
+        require(transactionContext.ovmNUMBER == 0, "Only be callable at the start of a transaction");
+        // Store our OVM_StateManager instance (significantly easier than attempting to pass the
+        // address around in calldata).
+        ovmStateManager = iOVM_StateManager(_ovmStateManager);
+ 
+        // Make sure this function can't be called by anyone except the owner of the
+        // OVM_StateManager (expected to be an OVM_StateTransitioner). We can revert here because
+        // this would make the `run` itself invalid.
+        require(
+            // This method may return false during fraud proofs, but always returns true in L2 nodes' State Manager precompile.
+            ovmStateManager.isAuthenticated(msg.sender),
+            "Only authenticated addresses in ovmStateManager can call this function"
+        );
+ 
+        // Initialize the execution context, must be initialized before we perform any gas metering
+        // or we'll throw a nuisance gas error.
+        _initContext(_transaction);
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Check whether we need to start a new epoch, do so if necessary.
+        // _checkNeedsNewEpoch(_transaction.timestamp);
+ 
+        // Make sure the transaction's gas limit is valid. We don't revert here because we reserve
+        // reverts for INVALID_STATE_ACCESS.
+        if (_isValidGasLimit(_transaction.gasLimit, _transaction.l1QueueOrigin) == false) {
+            _resetContext();
+            return;
+        }
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Check gas right before the call to get total gas consumed by OVM transaction.
+        // uint256 gasProvided = gasleft();
+ 
+        // Run the transaction, make sure to meter the gas usage.
+        ovmCALL(
+            _transaction.gasLimit - gasMeterConfig.minTransactionGasLimit,
+            _transaction.entrypoint,
+            _transaction.data
+        );
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Update the cumulative gas based on the amount of gas used.
+        // uint256 gasUsed = gasProvided - gasleft();
+        // _updateCumulativeGas(gasUsed, _transaction.l1QueueOrigin);
+ 
+        // Wipe the execution context.
+        _resetContext();
+ 
+        // Reset the ovmStateManager.
+        ovmStateManager = iOVM_StateManager(address(0));
+    }
+ 
+ 
+    /******************************
+     * Opcodes: Execution Context *
+     ******************************/
+ 
+    /**
+     * @notice Overrides CALLER.
+     * @return _CALLER Address of the CALLER within the current message context.
+     */
+    function ovmCALLER()
+        override
+        public
+        view
+        returns (
+            address _CALLER
+        )
+    {
+        return messageContext.ovmCALLER;
+    }
+ 
+    /**
+     * @notice Overrides ADDRESS.
+     * @return _ADDRESS Active ADDRESS within the current message context.
+     */
+    function ovmADDRESS()
+        override
+        public
+        view
+        returns (
+            address _ADDRESS
+        )
+    {
+        return messageContext.ovmADDRESS;
+    }
+ 
+    /**
+     * @notice Overrides TIMESTAMP.
+     * @return _TIMESTAMP Value of the TIMESTAMP within the transaction context.
+     */
+    function ovmTIMESTAMP()
+        override
+        public
+        view
+        returns (
+            uint256 _TIMESTAMP
+        )
+    {
+        return transactionContext.ovmTIMESTAMP;
+    }
+ 
+    /**
+     * @notice Overrides NUMBER.
+     * @return _NUMBER Value of the NUMBER within the transaction context.
+     */
+    function ovmNUMBER()
+        override
+        public
+        view
+        returns (
+            uint256 _NUMBER
+        )
+    {
+        return transactionContext.ovmNUMBER;
+    }
+ 
+    /**
+     * @notice Overrides GASLIMIT.
+     * @return _GASLIMIT Value of the block's GASLIMIT within the transaction context.
+     */
+    function ovmGASLIMIT()
+        override
+        public
+        view
+        returns (
+            uint256 _GASLIMIT
+        )
+    {
+        return transactionContext.ovmGASLIMIT;
+    }
+ 
+    /**
+     * @notice Overrides CHAINID.
+     * @return _CHAINID Value of the chain's CHAINID within the global context.
+     */
+    function ovmCHAINID()
+        override
+        public
+        view
+        returns (
+            uint256 _CHAINID
+        )
+    {
+        return globalContext.ovmCHAINID;
+    }
+ 
+    /*********************************
+     * Opcodes: L2 Execution Context *
+     *********************************/
+ 
+    /**
+     * @notice Specifies from which L1 rollup queue this transaction originated from.
+     * @return _queueOrigin Address of the ovmL1QUEUEORIGIN within the current message context.
+     */
+    function ovmL1QUEUEORIGIN()
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.QueueOrigin _queueOrigin
+        )
+    {
+        return transactionContext.ovmL1QUEUEORIGIN;
+    }
+ 
+    /**
+     * @notice Specifies which L1 account, if any, sent this transaction by calling enqueue().
+     * @return _l1TxOrigin Address of the account which sent the tx into L2 from L1.
+     */
+    function ovmL1TXORIGIN()
+        override
+        public
+        view
+        returns (
+            address _l1TxOrigin
+        )
+    {
+        return transactionContext.ovmL1TXORIGIN;
+    }
+ 
+    /********************
+     * Opcodes: Halting *
+     ********************/
+ 
+    /**
+     * @notice Overrides REVERT.
+     * @param _data Bytes data to pass along with the REVERT.
+     */
+    function ovmREVERT(
+        bytes memory _data
+    )
+        override
+        public
+    {
+        _revertWithFlag(RevertFlag.INTENTIONAL_REVERT, _data);
+    }
+ 
+ 
+    /******************************
+     * Opcodes: Contract Creation *
+     ******************************/
+ 
+    /**
+     * @notice Overrides CREATE.
+     * @param _bytecode Code to be used to CREATE a new contract.
+     * @return Address of the created contract.
+     * @return Revert data, if and only if the creation threw an exception.
+     */
+    function ovmCREATE(
+        bytes memory _bytecode
+    )
+        override
+        public
+        notStatic
+        fixedGasDiscount(40000)
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // Creator is always the current ADDRESS.
+        address creator = ovmADDRESS();
+ 
+        // Check that the deployer is whitelisted, or
+        // that arbitrary contract deployment has been enabled.
+        _checkDeployerAllowed(creator);
+ 
+        // Generate the correct CREATE address.
+        address contractAddress = Lib_EthUtils.getAddressForCREATE(
+            creator,
+            _getAccountNonce(creator)
+        );
+ 
+        return _createContract(
+            contractAddress,
+            _bytecode
+        );
+    }
+ 
+    /**
+     * @notice Overrides CREATE2.
+     * @param _bytecode Code to be used to CREATE2 a new contract.
+     * @param _salt Value used to determine the contract's address.
+     * @return Address of the created contract.
+     * @return Revert data, if and only if the creation threw an exception.
+     */
+    function ovmCREATE2(
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        override
+        public
+        notStatic
+        fixedGasDiscount(40000)
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // Creator is always the current ADDRESS.
+        address creator = ovmADDRESS();
+ 
+        // Check that the deployer is whitelisted, or
+        // that arbitrary contract deployment has been enabled.
+        _checkDeployerAllowed(creator);
+ 
+        // Generate the correct CREATE2 address.
+        address contractAddress = Lib_EthUtils.getAddressForCREATE2(
+            creator,
+            _bytecode,
+            _salt
+        );
+ 
+        return _createContract(
+            contractAddress,
+            _bytecode
+        );
+    }
+ 
+ 
+    /*******************************
+     * Account Abstraction Opcodes *
+     ******************************/
+ 
+    /**
+     * Retrieves the nonce of the current ovmADDRESS.
+     * @return _nonce Nonce of the current contract.
+     */
+    function ovmGETNONCE()
+        override
+        public
+        returns (
+            uint256 _nonce
+        )
+    {
+        return _getAccountNonce(ovmADDRESS());
+    }
+ 
+    /**
+     * Sets the nonce of the current ovmADDRESS.
+     * @param _nonce New nonce for the current contract.
+     */
+    function ovmSETNONCE(
+        uint256 _nonce
+    )
+        override
+        public
+        notStatic
+    {
+        _setAccountNonce(ovmADDRESS(), _nonce);
+    }
+ 
+    /**
+     * Creates a new EOA contract account, for account abstraction.
+     * @dev Essentially functions like ovmCREATE or ovmCREATE2, but we can bypass a lot of checks
+     *      because the contract we're creating is trusted (no need to do safety checking or to
+     *      handle unexpected reverts). Doesn't need to return an address because the address is
+     *      assumed to be the user's actual address.
+     * @param _messageHash Hash of a message signed by some user, for verification.
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     */
+    function ovmCREATEEOA(
+        bytes32 _messageHash,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        override
+        public
+        notStatic
+    {
+        // Recover the EOA address from the message hash and signature parameters. Since we do the
+        // hashing in advance, we don't have handle different message hashing schemes. Even if this
+        // function were to return the wrong address (rather than explicitly returning the zero
+        // address), the rest of the transaction would simply fail (since there's no EOA account to
+        // actually execute the transaction).
+        address eoa = ecrecover(
+            _messageHash,
+            _v + 27,
+            _r,
+            _s
+        );
+ 
+        // Invalid signature is a case we proactively handle with a revert. We could alternatively
+        // have this function return a `success` boolean, but this is just easier.
+        Iif (eoa == address(0)) {
+            ovmREVERT(bytes("Signature provided for EOA contract creation is invalid."));
+        }
+ 
+        // If the user already has an EOA account, then there's no need to perform this operation.
+        Iif (_hasEmptyAccount(eoa) == false) {
+            return;
+        }
+ 
+        // We always need to initialize the contract with the default account values.
+        _initPendingAccount(eoa);
+ 
+        // Temporarily set the current address so it's easier to access on L2.
+        address prevADDRESS = messageContext.ovmADDRESS;
+        messageContext.ovmADDRESS = eoa;
+ 
+        // Now actually create the account and get its bytecode. We're not worried about reverts
+        // (other than out of gas, which we can't capture anyway) because this contract is trusted.
+        OVM_ProxyEOA proxyEOA = new OVM_ProxyEOA(0x4200000000000000000000000000000000000003);
+ 
+        // Reset the address now that we're done deploying.
+        messageContext.ovmADDRESS = prevADDRESS;
+ 
+        // Commit the account with its final values.
+        _commitPendingAccount(
+            eoa,
+            address(proxyEOA),
+            keccak256(Lib_EthUtils.getCode(address(proxyEOA)))
+        );
+ 
+        _setAccountNonce(eoa, 0);
+    }
+ 
+ 
+    /*********************************
+     * Opcodes: Contract Interaction *
+     *********************************/
+ 
+    /**
+     * @notice Overrides CALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmCALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(100000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // CALL updates the CALLER and ADDRESS.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _address;
+ 
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+    /**
+     * @notice Overrides STATICCALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmSTATICCALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(80000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // STATICCALL updates the CALLER, updates the ADDRESS, and runs in a static context.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _address;
+        nextMessageContext.isStatic = true;
+ 
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+    /**
+     * @notice Overrides DELEGATECALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmDELEGATECALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(40000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // DELEGATECALL does not change anything about the message context.
+        MessageContext memory nextMessageContext = messageContext;
+        
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+ 
+    /************************************
+     * Opcodes: Contract Storage Access *
+     ************************************/
+ 
+    /**
+     * @notice Overrides SLOAD.
+     * @param _key 32 byte key of the storage slot to load.
+     * @return _value 32 byte value of the requested storage slot.
+     */
+    function ovmSLOAD(
+        bytes32 _key
+    )
+        override
+        public
+        netGasCost(40000)
+        returns (
+            bytes32 _value
+        )
+    {
+        // We always SLOAD from the storage of ADDRESS.
+        address contractAddress = ovmADDRESS();
+ 
+        return _getContractStorage(
+            contractAddress,
+            _key
+        );
+    }
+ 
+    /**
+     * @notice Overrides SSTORE.
+     * @param _key 32 byte key of the storage slot to set.
+     * @param _value 32 byte value for the storage slot.
+     */
+    function ovmSSTORE(
+        bytes32 _key,
+        bytes32 _value
+    )
+        override
+        public
+        notStatic
+        netGasCost(60000)
+    {
+        // We always SSTORE to the storage of ADDRESS.
+        address contractAddress = ovmADDRESS();
+ 
+        _putContractStorage(
+            contractAddress,
+            _key,
+            _value
+        );
+    }
+ 
+ 
+    /*********************************
+     * Opcodes: Contract Code Access *
+     *********************************/
+ 
+    /**
+     * @notice Overrides EXTCODECOPY.
+     * @param _contract Address of the contract to copy code from.
+     * @param _offset Offset in bytes from the start of contract code to copy beyond.
+     * @param _length Total number of bytes to copy from the contract's code.
+     * @return _code Bytes of code copied from the requested contract.
+     */
+    function ovmEXTCODECOPY(
+        address _contract,
+        uint256 _offset,
+        uint256 _length
+    )
+        override
+        public
+        returns (
+            bytes memory _code
+        )
+    {
+        // `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of
+        // return data. By blocking reads of one byte, we're able to use the condition that an
+        // OVM_ExecutionManager function return value having a length of exactly one byte indicates
+        // an error without an explicit revert. If users were able to read a single byte, they
+        // could forcibly trigger behavior that should only be available to this contract.
+        uint256 length = _length == 1 ? 2 : _length;
+ 
+        return Lib_EthUtils.getCode(
+            _getAccountEthAddress(_contract),
+            _offset,
+            length
+        );
+    }
+ 
+    /**
+     * @notice Overrides EXTCODESIZE.
+     * @param _contract Address of the contract to query the size of.
+     * @return _EXTCODESIZE Size of the requested contract in bytes.
+     */
+    function ovmEXTCODESIZE(
+        address _contract
+    )
+        override
+        public
+        returns (
+            uint256 _EXTCODESIZE
+        )
+    {
+        return Lib_EthUtils.getCodeSize(
+            _getAccountEthAddress(_contract)
+        );
+    }
+ 
+    /**
+     * @notice Overrides EXTCODEHASH.
+     * @param _contract Address of the contract to query the hash of.
+     * @return _EXTCODEHASH Hash of the requested contract.
+     */
+    function ovmEXTCODEHASH(
+        address _contract
+    )
+        override
+        public
+        returns (
+            bytes32 _EXTCODEHASH
+        )
+    {
+        return Lib_EthUtils.getCodeHash(
+            _getAccountEthAddress(_contract)
+        );
+    }
+ 
+    /***************************************
+     * Public Functions: Execution Context *
+     ***************************************/
+ 
+    function getMaxTransactionGasLimit()
+        external
+        view
+        override
+        returns (
+            uint256 _maxTransactionGasLimit
+        )
+    {
+        return gasMeterConfig.maxTransactionGasLimit;
+    }
+ 
+    /********************************************
+     * Public Functions: Deployment Whitelisting *
+     ********************************************/
+ 
+    /**
+     * Checks whether the given address is on the whitelist to ovmCREATE/ovmCREATE2, and reverts if not.
+     * @param _deployerAddress Address attempting to deploy a contract.
+     */
+    function _checkDeployerAllowed(
+        address _deployerAddress
+    )
+        internal
+    {
+        // From an OVM semantics perspective, this will appear identical to
+        // the deployer ovmCALLing the whitelist.  This is fine--in a sense, we are forcing them to.
+        (bool success, bytes memory data) = ovmCALL(
+            gasleft(),
+            0x4200000000000000000000000000000000000002,
+            abi.encodeWithSignature("isDeployerAllowed(address)", _deployerAddress)
+        );
+        bool isAllowed = abi.decode(data, (bool));
+ 
+        if (!isAllowed || !success) {
+            _revertWithFlag(RevertFlag.CREATOR_NOT_ALLOWED);
+        }
+    }
+ 
+    /********************************************
+     * Internal Functions: Contract Interaction *
+     ********************************************/
+ 
+    /**
+     * Creates a new contract and associates it with some contract address.
+     * @param _contractAddress Address to associate the created contract with.
+     * @param _bytecode Bytecode to be used to create the contract.
+     * @return Final OVM contract address.
+     * @return Revertdata, if and only if the creation threw an exception.
+     */
+    function _createContract(
+        address _contractAddress,
+        bytes memory _bytecode
+    )
+        internal
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // We always update the nonce of the creating account, even if the creation fails.
+        _setAccountNonce(ovmADDRESS(), _getAccountNonce(ovmADDRESS()) + 1);
+ 
+        // We're stepping into a CREATE or CREATE2, so we need to update ADDRESS to point
+        // to the contract's associated address and CALLER to point to the previous ADDRESS.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = messageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _contractAddress;
+ 
+        // Run the common logic which occurs between call-type and create-type messages,
+        // passing in the creation bytecode and `true` to trigger create-specific logic.
+        (bool success, bytes memory data) = _handleExternalMessage(
+            nextMessageContext,
+            gasleft(),
+            _contractAddress,
+            _bytecode,
+            true
+        );
+ 
+        // Yellow paper requires that address returned is zero if the contract deployment fails.
+        return (
+            success ? _contractAddress : address(0),
+            data
+        );
+    }
+ 
+    /**
+     * Calls the deployed contract associated with a given address.
+     * @param _nextMessageContext Message context to be used for the call.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _contract OVM address to be called.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function _callContract(
+        MessageContext memory _nextMessageContext,
+        uint256 _gasLimit,
+        address _contract,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // We reserve addresses of the form 0xdeaddeaddead...NNNN for the container contracts in L2 geth.
+        // So, we block calls to these addresses since they are not safe to run as an OVM contract itself.
+        if (
+            (uint256(_contract) & uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000))
+            == uint256(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000)
+        ) {
+            // EVM does not return data in the success case, see: https://github.com/ethereum/go-ethereum/blob/aae7660410f0ef90279e14afaaf2f429fdc2a186/core/vm/instructions.go#L600-L604
+            return (true, hex'');
+        }
+ 
+        // Both 0x0000... and the EVM precompiles have the same address on L1 and L2 --> no trie lookup needed.
+        address codeContractAddress =
+            uint(_contract) < 100
+            ? _contract
+            : _getAccountEthAddress(_contract);
+ 
+        return _handleExternalMessage(
+            _nextMessageContext,
+            _gasLimit,
+            codeContractAddress,
+            _calldata,
+            false
+        );
+    }
+ 
+    /**
+     * Handles all interactions which involve the execution manager calling out to untrusted code (both calls and creates).
+     * Ensures that OVM-related measures are enforced, including L2 gas refunds, nuisance gas, and flagged reversions.
+     * 
+     * @param _nextMessageContext Message context to be used for the external message.
+     * @param _gasLimit Amount of gas to be passed into this message.
+     * @param _contract OVM address being called or deployed to
+     * @param _data Data for the message (either calldata or creation code)
+     * @param _isCreate Whether this is a create-type message.
+     * @return Whether or not the message (either a call or deployment) succeeded.
+     * @return Data returned by the message.
+     */
+    function _handleExternalMessage(
+        MessageContext memory _nextMessageContext,
+        uint256 _gasLimit,
+        address _contract,
+        bytes memory _data,
+        bool _isCreate
+    )
+        internal
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        // We need to switch over to our next message context for the duration of this call.
+        MessageContext memory prevMessageContext = messageContext;
+        _switchMessageContext(prevMessageContext, _nextMessageContext);
+ 
+        // Nuisance gas is a system used to bound the ability for an attacker to make fraud proofs
+        // expensive by touching a lot of different accounts or storage slots. Since most contracts
+        // only use a few storage slots during any given transaction, this shouldn't be a limiting
+        // factor.
+        uint256 prevNuisanceGasLeft = messageRecord.nuisanceGasLeft;
+        uint256 nuisanceGasLimit = _getNuisanceGasLimit(_gasLimit);
+        messageRecord.nuisanceGasLeft = nuisanceGasLimit;
+ 
+        // Make the call and make sure to pass in the gas limit. Another instance of hidden
+        // complexity. `_contract` is guaranteed to be a safe contract, meaning its return/revert
+        // behavior can be controlled. In particular, we enforce that flags are passed through
+        // revert data as to retrieve execution metadata that would normally be reverted out of
+        // existence.
+ 
+        (bool success, bytes memory returndata) =
+            _isCreate
+            ? _handleContractCreation(_gasLimit, _data, _contract)
+            : _contract.call{gas: _gasLimit}(_data);
+ 
+        // Switch back to the original message context now that we're out of the call.
+        _switchMessageContext(_nextMessageContext, prevMessageContext);
+ 
+        // Assuming there were no reverts, the message record should be accurate here. We'll update
+        // this value in the case of a revert.
+        uint256 nuisanceGasLeft = messageRecord.nuisanceGasLeft;
+ 
+        // Reverts at this point are completely OK, but we need to make a few updates based on the
+        // information passed through the revert.
+        if (success == false) {
+            (
+                RevertFlag flag,
+                uint256 nuisanceGasLeftPostRevert,
+                uint256 ovmGasRefund,
+                bytes memory returndataFromFlag
+            ) = _decodeRevertData(returndata);
+ 
+            // INVALID_STATE_ACCESS is the only flag that triggers an immediate abort of the
+            // parent EVM message. This behavior is necessary because INVALID_STATE_ACCESS must
+            // halt any further transaction execution that could impact the execution result.
+            if (flag == RevertFlag.INVALID_STATE_ACCESS) {
+                _revertWithFlag(flag);
+            }
+ 
+            // INTENTIONAL_REVERT, UNSAFE_BYTECODE, STATIC_VIOLATION, and CREATOR_NOT_ALLOWED aren't
+            // dependent on the input state, so we can just handle them like standard reverts. Our only change here
+            // is to record the gas refund reported by the call (enforced by safety checking).
+            if (
+                flag == RevertFlag.INTENTIONAL_REVERT
+                || flag == RevertFlag.UNSAFE_BYTECODE
+                || flag == RevertFlag.STATIC_VIOLATION
+                || flag == RevertFlag.CREATOR_NOT_ALLOWED
+            ) {
+                transactionRecord.ovmGasRefund = ovmGasRefund;
+            }
+ 
+            // INTENTIONAL_REVERT needs to pass up the user-provided return data encoded into the
+            // flag, *not* the full encoded flag. All other revert types return no data.
+            if (
+                flag == RevertFlag.INTENTIONAL_REVERT
+                || _isCreate
+            ) {
+                returndata = returndataFromFlag;
+            } else {
+                returndata = hex'';
+            }
+ 
+            // Reverts mean we need to use up whatever "nuisance gas" was used by the call.
+            // EXCEEDS_NUISANCE_GAS explicitly reduces the remaining nuisance gas for this message
+            // to zero. OUT_OF_GAS is a "pseudo" flag given that messages return no data when they
+            // run out of gas, so we have to treat this like EXCEEDS_NUISANCE_GAS. All other flags
+            // will simply pass up the remaining nuisance gas.
+            nuisanceGasLeft = nuisanceGasLeftPostRevert;
+        }
+ 
+        // We need to reset the nuisance gas back to its original value minus the amount used here.
+        messageRecord.nuisanceGasLeft = prevNuisanceGasLeft - (nuisanceGasLimit - nuisanceGasLeft);
+ 
+        return (
+            success,
+            returndata
+        );
+    }
+ 
+    /**
+     * Handles the creation-specific safety measures required for OVM contract deployment.
+     * This function sanitizes the return types for creation messages to match calls (bool, bytes).
+     * This allows for consistent handling of both types of messages in _handleExternalMessage().
+     * 
+     * @param _gasLimit Amount of gas to be passed into this creation.
+     * @param _creationCode Code to pass into CREATE for deployment.
+     * @param _address OVM address being deployed to.
+     * @return Whether or not the call succeeded.
+     * @return If creation fails: revert data. Otherwise: empty.
+     */
+    function _handleContractCreation(
+        uint _gasLimit,
+        bytes memory _creationCode,
+        address _address
+    )
+        internal
+        returns(
+            bool,
+            bytes memory
+        )
+    {
+        // Check that there is not already code at this address.
+        Iif (_hasEmptyAccount(_address) == false) {
+            // Note: in the EVM, this case burns all allotted gas.  For improved
+            // developer experience, we do return the remaining ones.
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.CREATE_COLLISION,
+                    Lib_ErrorUtils.encodeRevertString("A contract has already been deployed to this address")
+                )
+            );
+        }
+ 
+        // Check the creation bytecode against the OVM_SafetyChecker.
+        Iif (ovmSafetyChecker.isBytecodeSafe(_creationCode) == false) {
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.UNSAFE_BYTECODE,
+                    Lib_ErrorUtils.encodeRevertString("Contract creation code contains unsafe opcodes. Did you use the right compiler or pass an unsafe constructor argument?")
+                )
+            );
+        }
+ 
+        // We always need to initialize the contract with the default account values.
+        _initPendingAccount(_address);
+ 
+        // Actually execute the EVM create message,
+        address ethAddress = Lib_EthUtils.createContract(_creationCode);
+        
+        if (ethAddress == address(0)) {
+            // If the creation fails, the EVM lets us grab its revert data. This may contain a revert flag
+            // to be used above in _handleExternalMessage.
+            uint256 revertDataSize;
+            assembly { revertDataSize := returndatasize() }
+            bytes memory revertdata = new bytes(revertDataSize);
+            assembly {
+                returndatacopy(
+                    add(revertdata, 0x20),
+                    0,
+                    revertDataSize
+                )
+            }
+            // Return that the creation failed, and the data it reverted with.
+            return (false, revertdata);
+        }
+ 
+        // Again simply checking that the deployed code is safe too. Contracts can generate
+        // arbitrary deployment code, so there's no easy way to analyze this beforehand.
+        bytes memory deployedCode = Lib_EthUtils.getCode(ethAddress);
+        if (ovmSafetyChecker.isBytecodeSafe(deployedCode) == false) {
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.UNSAFE_BYTECODE,
+                    Lib_ErrorUtils.encodeRevertString("Constructor attempted to deploy unsafe bytecode.")
+                )
+            );
+        }
+ 
+        // Contract creation didn't need to be reverted and the bytecode is safe. We finish up by
+        // associating the desired address with the newly created contract's code hash and address.
+        _commitPendingAccount(
+            _address,
+            ethAddress,
+            Lib_EthUtils.getCodeHash(ethAddress)
+        );
+ 
+        // Successful deployments will not give access to returndata, in both the EVM and the OVM.
+        return (true, hex'');
+    }
+ 
+    /******************************************
+     * Internal Functions: State Manipulation *
+     ******************************************/
+ 
+    /**
+     * Checks whether an account exists within the OVM_StateManager.
+     * @param _address Address of the account to check.
+     * @return _exists Whether or not the account exists.
+     */
+    function _hasAccount(
+        address _address
+    )
+        internal
+        returns (
+            bool _exists
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.hasAccount(_address);
+    }
+ 
+    /**
+     * Checks whether a known empty account exists within the OVM_StateManager.
+     * @param _address Address of the account to check.
+     * @return _exists Whether or not the account empty exists.
+     */
+    function _hasEmptyAccount(
+        address _address
+    )
+        internal
+        returns (
+            bool _exists
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.hasEmptyAccount(_address);
+    }
+ 
+    /**
+     * Sets the nonce of an account.
+     * @param _address Address of the account to modify.
+     * @param _nonce New account nonce.
+     */
+    function _setAccountNonce(
+        address _address,
+        uint256 _nonce
+    )
+        internal
+    {
+        _checkAccountChange(_address);
+        ovmStateManager.setAccountNonce(_address, _nonce);
+    }
+ 
+    /**
+     * Gets the nonce of an account.
+     * @param _address Address of the account to access.
+     * @return _nonce Nonce of the account.
+     */
+    function _getAccountNonce(
+        address _address
+    )
+        internal
+        returns (
+            uint256 _nonce
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.getAccountNonce(_address);
+    }
+ 
+    /**
+     * Retrieves the Ethereum address of an account.
+     * @param _address Address of the account to access.
+     * @return _ethAddress Corresponding Ethereum address.
+     */
+    function _getAccountEthAddress(
+        address _address
+    )
+        internal
+        returns (
+            address _ethAddress
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.getAccountEthAddress(_address);
+    }
+ 
+    /**
+     * Creates the default account object for the given address.
+     * @param _address Address of the account create.
+     */
+    function _initPendingAccount(
+        address _address
+    )
+        internal
+    {
+        // Although it seems like `_checkAccountChange` would be more appropriate here, we don't
+        // actually consider an account "changed" until it's inserted into the state (in this case
+        // by `_commitPendingAccount`).
+        _checkAccountLoad(_address);
+        ovmStateManager.initPendingAccount(_address);
+    }
+ 
+    /**
+     * Stores additional relevant data for a new account, thereby "committing" it to the state.
+     * This function is only called during `ovmCREATE` and `ovmCREATE2` after a successful contract
+     * creation.
+     * @param _address Address of the account to commit.
+     * @param _ethAddress Address of the associated deployed contract.
+     * @param _codeHash Hash of the code stored at the address.
+     */
+    function _commitPendingAccount(
+        address _address,
+        address _ethAddress,
+        bytes32 _codeHash
+    )
+        internal
+    {
+        _checkAccountChange(_address);
+        ovmStateManager.commitPendingAccount(
+            _address,
+            _ethAddress,
+            _codeHash
+        );
+    }
+ 
+    /**
+     * Retrieves the value of a storage slot.
+     * @param _contract Address of the contract to query.
+     * @param _key 32 byte key of the storage slot.
+     * @return _value 32 byte storage slot value.
+     */
+    function _getContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+        returns (
+            bytes32 _value
+        )
+    {
+        _checkContractStorageLoad(_contract, _key);
+        return ovmStateManager.getContractStorage(_contract, _key);
+    }
+ 
+    /**
+     * Sets the value of a storage slot.
+     * @param _contract Address of the contract to modify.
+     * @param _key 32 byte key of the storage slot.
+     * @param _value 32 byte storage slot value.
+     */
+    function _putContractStorage(
+        address _contract,
+        bytes32 _key,
+        bytes32 _value
+    )
+        internal
+    {
+        // We don't set storage if the value didn't change. Although this acts as a convenient
+        // optimization, it's also necessary to avoid the case in which a contract with no storage
+        // attempts to store the value "0" at any key. Putting this value (and therefore requiring
+        // that the value be committed into the storage trie after execution) would incorrectly
+        // modify the storage root.
+        Iif (_getContractStorage(_contract, _key) == _value) {
+            return;
+        }
+ 
+        _checkContractStorageChange(_contract, _key);
+        ovmStateManager.putContractStorage(_contract, _key, _value);
+    }
+ 
+    /**
+     * Validation whenever a contract needs to be loaded. Checks that the account exists, charges
+     * nuisance gas if the account hasn't been loaded before.
+     * @param _address Address of the account to load.
+     */
+    function _checkAccountLoad(
+        address _address
+    )
+        internal
+    {
+        // See `_checkContractStorageLoad` for more information.
+        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
+            _revertWithFlag(RevertFlag.OUT_OF_GAS);
+        }
+ 
+        // See `_checkContractStorageLoad` for more information.
+        if (ovmStateManager.hasAccount(_address) == false) {
+            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
+        }
+ 
+        // Check whether the account has been loaded before and mark it as loaded if not. We need
+        // this because "nuisance gas" only applies to the first time that an account is loaded.
+        (
+            bool _wasAccountAlreadyLoaded
+        ) = ovmStateManager.testAndSetAccountLoaded(_address);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
+        // on the size of the contract code.
+        if (_wasAccountAlreadyLoaded == false) {
+            _useNuisanceGas(
+                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
+            );
+        }
+    }
+ 
+    /**
+     * Validation whenever a contract needs to be changed. Checks that the account exists, charges
+     * nuisance gas if the account hasn't been changed before.
+     * @param _address Address of the account to change.
+     */
+    function _checkAccountChange(
+        address _address
+    )
+        internal
+    {
+        // Start by checking for a load as we only want to charge nuisance gas proportional to
+        // contract size once.
+        _checkAccountLoad(_address);
+ 
+        // Check whether the account has been changed before and mark it as changed if not. We need
+        // this because "nuisance gas" only applies to the first time that an account is changed.
+        (
+            bool _wasAccountAlreadyChanged
+        ) = ovmStateManager.testAndSetAccountChanged(_address);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
+        // on the size of the contract code.
+        if (_wasAccountAlreadyChanged == false) {
+            ovmStateManager.incrementTotalUncommittedAccounts();
+            _useNuisanceGas(
+                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
+            );
+        }
+    }
+ 
+    /**
+     * Validation whenever a slot needs to be loaded. Checks that the account exists, charges
+     * nuisance gas if the slot hasn't been loaded before.
+     * @param _contract Address of the account to load from.
+     * @param _key 32 byte key to load.
+     */
+    function _checkContractStorageLoad(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+    {
+        // Another case of hidden complexity. If we didn't enforce this requirement, then a
+        // contract could pass in just enough gas to cause the INVALID_STATE_ACCESS check to fail
+        // on L1 but not on L2. A contract could use this behavior to prevent the
+        // OVM_ExecutionManager from detecting an invalid state access. Reverting with OUT_OF_GAS
+        // allows us to also charge for the full message nuisance gas, because you deserve that for
+        // trying to break the contract in this way.
+        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
+            _revertWithFlag(RevertFlag.OUT_OF_GAS);
+        }
+ 
+        // We need to make sure that the transaction isn't trying to access storage that hasn't
+        // been provided to the OVM_StateManager. We'll immediately abort if this is the case.
+        // We know that we have enough gas to do this check because of the above test.
+        Iif (ovmStateManager.hasContractStorage(_contract, _key) == false) {
+            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
+        }
+ 
+        // Check whether the slot has been loaded before and mark it as loaded if not. We need
+        // this because "nuisance gas" only applies to the first time that a slot is loaded.
+        (
+            bool _wasContractStorageAlreadyLoaded
+        ) = ovmStateManager.testAndSetContractStorageLoaded(_contract, _key);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge some fixed amount of
+        // "nuisance gas".
+        if (_wasContractStorageAlreadyLoaded == false) {
+            _useNuisanceGas(NUISANCE_GAS_SLOAD);
+        }
+    }
+ 
+    /**
+     * Validation whenever a slot needs to be changed. Checks that the account exists, charges
+     * nuisance gas if the slot hasn't been changed before.
+     * @param _contract Address of the account to change.
+     * @param _key 32 byte key to change.
+     */
+    function _checkContractStorageChange(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+    {
+        // Start by checking for load to make sure we have the storage slot and that we charge the
+        // "nuisance gas" necessary to prove the storage slot state.
+        _checkContractStorageLoad(_contract, _key);
+ 
+        // Check whether the slot has been changed before and mark it as changed if not. We need
+        // this because "nuisance gas" only applies to the first time that a slot is changed.
+        (
+            bool _wasContractStorageAlreadyChanged
+        ) = ovmStateManager.testAndSetContractStorageChanged(_contract, _key);
+ 
+        // If we hadn't already changed the account, then we'll need to charge some fixed amount of
+        // "nuisance gas".
+        Eif (_wasContractStorageAlreadyChanged == false) {
+            // Changing a storage slot means that we're also going to have to change the
+            // corresponding account, so do an account change check.
+            _checkAccountChange(_contract);
+ 
+            ovmStateManager.incrementTotalUncommittedContractStorage();
+            _useNuisanceGas(NUISANCE_GAS_SSTORE);
+        }
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Revert Logic *
+     ************************************/
+ 
+    /**
+     * Simple encoding for revert data.
+     * @param _flag Flag to revert with.
+     * @param _data Additional user-provided revert data.
+     * @return _revertdata Encoded revert data.
+     */
+    function _encodeRevertData(
+        RevertFlag _flag,
+        bytes memory _data
+    )
+        internal
+        view
+        returns (
+            bytes memory _revertdata
+        )
+    {
+        // Out of gas and create exceptions will fundamentally return no data, so simulating it shouldn't either.
+        Iif (
+            _flag == RevertFlag.OUT_OF_GAS
+        ) {
+            return bytes('');
+        }
+ 
+        // INVALID_STATE_ACCESS doesn't need to return any data other than the flag.
+        if (_flag == RevertFlag.INVALID_STATE_ACCESS) {
+            return abi.encode(
+                _flag,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        // Just ABI encode the rest of the parameters.
+        return abi.encode(
+            _flag,
+            messageRecord.nuisanceGasLeft,
+            transactionRecord.ovmGasRefund,
+            _data
+        );
+    }
+ 
+    /**
+     * Simple decoding for revert data.
+     * @param _revertdata Revert data to decode.
+     * @return _flag Flag used to revert.
+     * @return _nuisanceGasLeft Amount of nuisance gas unused by the message.
+     * @return _ovmGasRefund Amount of gas refunded during the message.
+     * @return _data Additional user-provided revert data.
+     */
+    function _decodeRevertData(
+        bytes memory _revertdata
+    )
+        internal
+        pure
+        returns (
+            RevertFlag _flag,
+            uint256 _nuisanceGasLeft,
+            uint256 _ovmGasRefund,
+            bytes memory _data
+        )
+    {
+        // A length of zero means the call ran out of gas, just return empty data.
+        if (_revertdata.length == 0) {
+            return (
+                RevertFlag.OUT_OF_GAS,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        // ABI decode the incoming data.
+        return abi.decode(_revertdata, (RevertFlag, uint256, uint256, bytes));
+    }
+ 
+    /**
+     * Causes a message to revert or abort.
+     * @param _flag Flag to revert with.
+     * @param _data Additional user-provided data.
+     */
+    function _revertWithFlag(
+        RevertFlag _flag,
+        bytes memory _data
+    )
+        internal
+        view
+    {
+        bytes memory revertdata = _encodeRevertData(
+            _flag,
+            _data
+        );
+ 
+        assembly {
+            revert(add(revertdata, 0x20), mload(revertdata))
+        }
+    }
+ 
+    /**
+     * Causes a message to revert or abort.
+     * @param _flag Flag to revert with.
+     */
+    function _revertWithFlag(
+        RevertFlag _flag
+    )
+        internal
+    {
+        _revertWithFlag(_flag, bytes(''));
+    }
+ 
+ 
+    /******************************************
+     * Internal Functions: Nuisance Gas Logic *
+     ******************************************/
+ 
+    /**
+     * Computes the nuisance gas limit from the gas limit.
+     * @dev This function is currently using a naive implementation whereby the nuisance gas limit
+     *      is set to exactly equal the lesser of the gas limit or remaining gas. It's likely that
+     *      this implementation is perfectly fine, but we may change this formula later.
+     * @param _gasLimit Gas limit to compute from.
+     * @return _nuisanceGasLimit Computed nuisance gas limit.
+     */
+    function _getNuisanceGasLimit(
+        uint256 _gasLimit
+    )
+        internal
+        view
+        returns (
+            uint256 _nuisanceGasLimit
+        )
+    {
+        return _gasLimit < gasleft() ? _gasLimit : gasleft();
+    }
+ 
+    /**
+     * Uses a certain amount of nuisance gas.
+     * @param _amount Amount of nuisance gas to use.
+     */
+    function _useNuisanceGas(
+        uint256 _amount
+    )
+        internal
+    {
+        // Essentially the same as a standard OUT_OF_GAS, except we also retain a record of the gas
+        // refund to be given at the end of the transaction.
+        Iif (messageRecord.nuisanceGasLeft < _amount) {
+            _revertWithFlag(RevertFlag.EXCEEDS_NUISANCE_GAS);
+        }
+ 
+        messageRecord.nuisanceGasLeft -= _amount;
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Gas Metering *
+     ************************************/
+ 
+    /**
+     * Checks whether a transaction needs to start a new epoch and does so if necessary.
+     * @param _timestamp Transaction timestamp.
+     */
+    function _checkNeedsNewEpoch(
+        uint256 _timestamp
+    )
+        internal
+    {
+        if (
+            _timestamp >= (
+                _getGasMetadata(GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP)
+                + gasMeterConfig.secondsPerEpoch
+            )
+        ) {
+            _putGasMetadata(
+                GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP,
+                _timestamp
+            );
+ 
+            _putGasMetadata(
+                GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS,
+                _getGasMetadata(
+                    GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS
+                )
+            );
+ 
+            _putGasMetadata(
+                GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS,
+                _getGasMetadata(
+                    GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS
+                )
+            );
+        }
+    }
+ 
+    /**
+     * Validates the gas limit for a given transaction.
+     * @param _gasLimit Gas limit provided by the transaction.
+     * param _queueOrigin Queue from which the transaction originated.
+     * @return _valid Whether or not the gas limit is valid.
+     */
+    function _isValidGasLimit(
+        uint256 _gasLimit,
+        Lib_OVMCodec.QueueOrigin // _queueOrigin
+    )
+        view
+        internal
+        returns (
+            bool _valid
+        )
+    {
+        // Always have to be below the maximum gas limit.
+        if (_gasLimit > gasMeterConfig.maxTransactionGasLimit) {
+            return false;
+        }
+ 
+        // Always have to be above the minimum gas limit.
+        if (_gasLimit < gasMeterConfig.minTransactionGasLimit) {
+            return false;
+        }
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        return true;
+        // GasMetadataKey cumulativeGasKey;
+        // GasMetadataKey prevEpochGasKey;
+        // if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
+        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
+        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS;
+        // } else {
+        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
+        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS;
+        // }
+ 
+        // return (
+        //     (
+        //         _getGasMetadata(cumulativeGasKey)
+        //         - _getGasMetadata(prevEpochGasKey)
+        //         + _gasLimit
+        //     ) < gasMeterConfig.maxGasPerQueuePerEpoch
+        // );
+    }
+ 
+    /**
+     * Updates the cumulative gas after a transaction.
+     * @param _gasUsed Gas used by the transaction.
+     * @param _queueOrigin Queue from which the transaction originated.
+     */
+    function _updateCumulativeGas(
+        uint256 _gasUsed,
+        Lib_OVMCodec.QueueOrigin _queueOrigin
+    )
+        internal
+    {
+        GasMetadataKey cumulativeGasKey;
+        if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
+            cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
+        } else {
+            cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
+        }
+ 
+        _putGasMetadata(
+            cumulativeGasKey,
+            (
+                _getGasMetadata(cumulativeGasKey)
+                + gasMeterConfig.minTransactionGasLimit
+                + _gasUsed
+                - transactionRecord.ovmGasRefund
+            )
+        );
+    }
+ 
+    /**
+     * Retrieves the value of a gas metadata key.
+     * @param _key Gas metadata key to retrieve.
+     * @return _value Value stored at the given key.
+     */
+    function _getGasMetadata(
+        GasMetadataKey _key
+    )
+        internal
+        returns (
+            uint256 _value
+        )
+    {
+        return uint256(_getContractStorage(
+            GAS_METADATA_ADDRESS,
+            bytes32(uint256(_key))
+        ));
+    }
+ 
+    /**
+     * Sets the value of a gas metadata key.
+     * @param _key Gas metadata key to set.
+     * @param _value Value to store at the given key.
+     */
+    function _putGasMetadata(
+        GasMetadataKey _key,
+        uint256 _value
+    )
+        internal
+    {
+        _putContractStorage(
+            GAS_METADATA_ADDRESS,
+            bytes32(uint256(_key)),
+            bytes32(uint256(_value))
+        );
+    }
+ 
+ 
+    /*****************************************
+     * Internal Functions: Execution Context *
+     *****************************************/
+ 
+    /**
+     * Swaps over to a new message context.
+     * @param _prevMessageContext Context we're switching from.
+     * @param _nextMessageContext Context we're switching to.
+     */
+    function _switchMessageContext(
+        MessageContext memory _prevMessageContext,
+        MessageContext memory _nextMessageContext
+    )
+        internal
+    {
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.ovmCALLER != _nextMessageContext.ovmCALLER) {
+            messageContext.ovmCALLER = _nextMessageContext.ovmCALLER;
+        }
+ 
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.ovmADDRESS != _nextMessageContext.ovmADDRESS) {
+            messageContext.ovmADDRESS = _nextMessageContext.ovmADDRESS;
+        }
+ 
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.isStatic != _nextMessageContext.isStatic) {
+            messageContext.isStatic = _nextMessageContext.isStatic;
+        }
+    }
+ 
+    /**
+     * Initializes the execution context.
+     * @param _transaction OVM transaction being executed.
+     */
+    function _initContext(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        internal
+    {
+        transactionContext.ovmTIMESTAMP = _transaction.timestamp;
+        transactionContext.ovmNUMBER = _transaction.blockNumber;
+        transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
+        transactionContext.ovmL1QUEUEORIGIN = _transaction.l1QueueOrigin;
+        transactionContext.ovmL1TXORIGIN = _transaction.l1TxOrigin;
+        transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
+ 
+        messageRecord.nuisanceGasLeft = _getNuisanceGasLimit(_transaction.gasLimit);
+    }
+ 
+    /**
+     * Resets the transaction and message context.
+     */
+    function _resetContext()
+        internal
+    {
+        transactionContext.ovmL1TXORIGIN = address(0);
+        transactionContext.ovmTIMESTAMP = 0;
+        transactionContext.ovmNUMBER = 0;
+        transactionContext.ovmGASLIMIT = 0;
+        transactionContext.ovmTXGASLIMIT = 0;
+        transactionContext.ovmL1QUEUEORIGIN = Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE;
+ 
+        transactionRecord.ovmGasRefund = 0;
+ 
+        messageContext.ovmCALLER = address(0);
+        messageContext.ovmADDRESS = address(0);
+        messageContext.isStatic = false;
+ 
+        messageRecord.nuisanceGasLeft = 0;
+    }
+ 
+    /*****************************
+     * L2-only Helper Functions *
+     *****************************/
+ 
+    /**
+     * Unreachable helper function for simulating eth_calls with an OVM message context.
+     * This function will throw an exception in all cases other than when used as a custom entrypoint in L2 Geth to simulate eth_call.
+     * @param _transaction the message transaction to simulate.
+     * @param _from the OVM account the simulated call should be from.
+     */
+    function simulateMessage(
+        Lib_OVMCodec.Transaction memory _transaction,
+        address _from,
+        iOVM_StateManager _ovmStateManager
+    )
+        external
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        // Prevent this call from having any effect unless in a custom-set VM frame
+        require(msg.sender == address(0));
+ 
+        ovmStateManager = _ovmStateManager;
+        _initContext(_transaction);
+        messageRecord.nuisanceGasLeft = uint(-1);
+ 
+        messageContext.ovmADDRESS = _from;
+ 
+        bool isCreate = _transaction.entrypoint == address(0);
+        if (isCreate) {
+            (address created, bytes memory revertData) = ovmCREATE(_transaction.data);
+            if (created == address(0)) {
+                return (false, revertData);
+            } else {
+                // The eth_call RPC endpoint for to = undefined will return the deployed bytecode 
+                // in the success case, differing from standard create messages.
+                return (true, Lib_EthUtils.getCode(created));
+            }
+        } else {
+            return ovmCALL(
+                _transaction.gasLimit,
+                _transaction.entrypoint,
+                _transaction.data
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/execution/OVM_SafetyChecker.sol.html b/coverage/OVM/execution/OVM_SafetyChecker.sol.html new file mode 100644 index 000000000..7c3a8f6b4 --- /dev/null +++ b/coverage/OVM/execution/OVM_SafetyChecker.sol.html @@ -0,0 +1,509 @@ + + + + Code coverage report for OVM/execution/OVM_SafetyChecker.sol + + + + + + + +
+
+

+ all files / OVM/execution/ OVM_SafetyChecker.sol +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +277× +  +  +  +  +  +  +  +  +  +  +277× +  +277× +  +277× +  +277× +277× +277× +  +  +277× +277× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +152× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
+ 
+/**
+ * @title OVM_SafetyChecker
+ * @dev  The Safety Checker verifies that contracts deployed on L2 do not contain any
+ * "unsafe" operations. An operation is considered unsafe if it would access state variables which
+ * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used
+ * to "escape the sandbox" of the OVM, resulting in non-deterministic fraud proofs. 
+ * That is, an attacker would be able to "prove fraud" on an honestly applied transaction.
+ * Note that a "safe" contract requires opcodes to appear in a particular pattern;
+ * omission of "unsafe" opcodes is necessary, but not sufficient.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_SafetyChecker is iOVM_SafetyChecker {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Returns whether or not all of the provided bytecode is safe.
+     * @param _bytecode The bytecode to safety check.
+     * @return `true` if the bytecode is safe, `false` otherwise.
+     */
+    function isBytecodeSafe(
+        bytes memory _bytecode
+    )
+        override
+        external
+        pure
+        returns (
+            bool
+        )
+    {
+        // autogenerated by gen_safety_checker_constants.py
+        // number of bytes to skip for each opcode
+        uint256[8] memory opcodeSkippableBytes = [
+            uint256(0x0001010101010101010101010000000001010101010101010101010101010000),
+            uint256(0x0100000000000000000000000000000000000000010101010101000000010100),
+            uint256(0x0000000000000000000000000000000001010101000000010101010100000000),
+            uint256(0x0203040500000000000000000000000000000000000000000000000000000000),
+            uint256(0x0101010101010101010101010101010101010101010101010101010101010101),
+            uint256(0x0101010101000000000000000000000000000000000000000000000000000000),
+            uint256(0x0000000000000000000000000000000000000000000000000000000000000000),
+            uint256(0x0000000000000000000000000000000000000000000000000000000000000000)
+        ];
+        // Mask to gate opcode specific cases
+        uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);
+        // Halting opcodes
+        uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);
+        // PUSH opcodes
+        uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);
+ 
+        uint256 codeLength;
+        uint256 _pc;
+        assembly {
+            _pc := add(_bytecode, 0x20)
+        }
+        codeLength = _pc + _bytecode.length;
+        do {
+            // current opcode: 0x00...0xff
+            uint256 opNum;
+ 
+            // inline assembly removes the extra add + bounds check
+            assembly {
+                let word := mload(_pc) //load the next 32 bytes at pc into word
+ 
+                // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord
+                // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4
+                // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).
+                // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,
+                // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.
+                let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                _pc := add(_pc, indexInWord)
+ 
+                opNum := byte(indexInWord, word)
+            }
+ 
+            // + push opcodes
+            // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]
+            // + caller opcode CALLER(0x33)
+            // + blacklisted opcodes
+            uint256 opBit = 1 << opNum;
+            if (opBit & opcodeGateMask == 0) {
+                if (opBit & opcodePushMask == 0) {
+                    // all pushes are valid opcodes
+                    // subsequent bytes are not opcodes. Skip them.
+                    _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to
+                    // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)
+                    continue;
+                } else if (opBit & opcodeHaltingMask == 0) {
+                    // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)
+                    // We are now inside unreachable code until we hit a JUMPDEST!
+                    do {
+                        _pc++;
+                        assembly {
+                            opNum := byte(0, mload(_pc))
+                        }
+                        // encountered a JUMPDEST
+                        if (opNum == 0x5b) break;
+                        // skip PUSHed bytes
+                        if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)
+                    } while (_pc < codeLength);
+                    // opNum is 0x5b, so we don't continue here since the pc++ is fine
+                } else if (opNum == 0x33) { // Caller opcode
+                    uint256 firstOps; // next 32 bytes of bytecode
+                    uint256 secondOps; // following 32 bytes of bytecode
+ 
+                    assembly {
+                        firstOps := mload(_pc)
+                        // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits
+                        secondOps := shr(216, mload(add(_pc, 0x20)))
+                    }
+ 
+                    // Call identity precompile
+                    // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL
+                    // 32 - 8 bytes = 24 bytes = 192
+                    if ((firstOps >> 192) == 0x3350600060045af1) {
+                        _pc += 8;
+                    // Call EM and abort execution if instructed
+                    // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST 
+                    } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {
+                        _pc += 37;
+                    } else {
+                        return false;
+                    }
+                    continue;
+                } else {
+                    // encountered a non-whitelisted opcode!
+                    return false;
+                }
+            }
+            _pc++;
+        } while (_pc < codeLength);
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/execution/OVM_StateManager.sol.html b/coverage/OVM/execution/OVM_StateManager.sol.html new file mode 100644 index 000000000..43f0df6b4 --- /dev/null +++ b/coverage/OVM/execution/OVM_StateManager.sol.html @@ -0,0 +1,2279 @@ + + + + Code coverage report for OVM/execution/OVM_StateManager.sol + + + + + + + +
+
+

+ all files / OVM/execution/ OVM_StateManager.sol +

+
+
+ 79.69% + Statements + 51/64 +
+
+ 100% + Branches + 12/12 +
+
+ 80% + Functions + 28/35 +
+
+ 80% + Lines + 52/65 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +207× +  +  +  +  +  +  +  +  +  +  +  +  +  +921× +  +  +  +920× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +537× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +60× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +369× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +30× +30× +30× +30× +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +18× +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +61× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +70× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +  +  +  +  +14× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +57× +  +  +  + +  +  +  +51× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +74× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +69× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +606× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +97× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +687× +  +687× +268× +  +  +687× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+ 
+/**
+ * @title OVM_StateManager
+ * @dev The State Manager contract holds all storage values for contracts in the OVM. It can only be written to by the
+ * the Execution Manager and State Transitioner. It runs on L1 during the setup and execution of a fraud proof.
+ * The same logic runs on L2, but has been implemented as a precompile in the L2 go-ethereum client
+ * (see https://github.com/ethereum-optimism/go-ethereum/blob/master/core/vm/ovm_state_manager.go).
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateManager is iOVM_StateManager {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 constant internal EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
+    bytes32 constant internal EMPTY_ACCOUNT_CODE_HASH =    0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
+    bytes32 constant internal STORAGE_XOR_VALUE =          0xFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEF;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    address override public owner;
+    address override public ovmExecutionManager;
+    mapping (address => Lib_OVMCodec.Account) internal accounts;
+    mapping (address => mapping (bytes32 => bytes32)) internal contractStorage;
+    mapping (address => mapping (bytes32 => bool)) internal verifiedContractStorage;
+    mapping (bytes32 => ItemState) internal itemStates;
+    uint256 internal totalUncommittedAccounts;
+    uint256 internal totalUncommittedContractStorage;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _owner Address of the owner of this contract.
+     */
+    constructor(
+        address _owner
+    )
+    {
+        owner = _owner;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Simple authentication, this contract should only be accessible to the owner (which is expected to be the State Transitioner during `PRE_EXECUTION` 
+     * or the OVM_ExecutionManager during transaction execution.
+     */
+    modifier authenticated() {
+        // owner is the State Transitioner
+        require(
+            msg.sender == owner || msg.sender == ovmExecutionManager,
+            "Function can only be called by authenticated addresses"
+        );
+        _;
+    }
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Checks whether a given address is allowed to modify this contract.
+     * @param _address Address to check.
+     * @return Whether or not the address can modify this contract.
+     */
+    function isAuthenticated(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return (_address == owner || _address == ovmExecutionManager);
+    }
+ 
+    /**
+     * Sets the address of the OVM_ExecutionManager.
+     * @param _ovmExecutionManager Address of the OVM_ExecutionManager.
+     */
+    function setExecutionManager(
+        address _ovmExecutionManager
+    )
+        override
+        public
+        authenticated
+    {
+        ovmExecutionManager = _ovmExecutionManager;
+    }
+ 
+    /**
+     * Inserts an account into the state.
+     * @param _address Address of the account to insert.
+     * @param _account Account to insert for the given address.
+     */
+    function putAccount(
+        address _address,
+        Lib_OVMCodec.Account memory _account
+    )
+        override
+        public
+        authenticated
+    {
+        accounts[_address] = _account;
+    }
+ 
+    /**
+     * Marks an account as empty.
+     * @param _address Address of the account to mark.
+     */
+    function putEmptyAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
+        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
+    }
+ 
+    /**
+     * Retrieves an account from the state.
+     * @param _address Address of the account to retrieve.
+     * @return Account for the given address.
+     */
+    function getAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.Account memory
+        )
+    {
+        return accounts[_address];
+    }
+ 
+    /**
+     * Checks whether the state has a given account.
+     * @param _address Address of the account to check.
+     * @return Whether or not the state has the account.
+     */
+    function hasAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return accounts[_address].codeHash != bytes32(0);
+    }
+ 
+    /**
+     * Checks whether the state has a given known empty account.
+     * @param _address Address of the account to check.
+     * @return Whether or not the state has the empty account.
+     */
+    function hasEmptyAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return (
+            accounts[_address].codeHash == EMPTY_ACCOUNT_CODE_HASH
+            && accounts[_address].nonce == 0
+        );
+    }
+ 
+    /**
+     * Sets the nonce of an account.
+     * @param _address Address of the account to modify.
+     * @param _nonce New account nonce.
+     */
+    function setAccountNonce(
+        address _address,
+        uint256 _nonce
+    )
+        override
+        public
+        authenticated
+    {
+        accounts[_address].nonce = _nonce;
+    }
+ 
+    /**
+     * Gets the nonce of an account.
+     * @param _address Address of the account to access.
+     * @return Nonce of the account.
+     */
+    function getAccountNonce(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return accounts[_address].nonce;
+    }
+ 
+    /**
+     * Retrieves the Ethereum address of an account.
+     * @param _address Address of the account to access.
+     * @return Corresponding Ethereum address.
+     */
+    function getAccountEthAddress(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            address
+        )
+    {
+        return accounts[_address].ethAddress;
+    }
+ 
+    /**
+     * Retrieves the storage root of an account.
+     * @param _address Address of the account to access.
+     * @return Corresponding storage root.
+     */
+    function getAccountStorageRoot(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        return accounts[_address].storageRoot;
+    }
+ 
+    /**
+     * Initializes a pending account (during CREATE or CREATE2) with the default values.
+     * @param _address Address of the account to initialize.
+     */
+    function initPendingAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.nonce = 1;
+        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
+        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
+        account.isFresh = true;
+    }
+ 
+    /**
+     * Finalizes the creation of a pending account (during CREATE or CREATE2).
+     * @param _address Address of the account to finalize.
+     * @param _ethAddress Address of the account's associated contract on Ethereum.
+     * @param _codeHash Hash of the account's code.
+     */
+    function commitPendingAccount(
+        address _address,
+        address _ethAddress,
+        bytes32 _codeHash
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.ethAddress = _ethAddress;
+        account.codeHash = _codeHash;
+    }
+ 
+    /**
+     * Checks whether an account has already been retrieved, and marks it as retrieved if not.
+     * @param _address Address of the account to check.
+     * @return Whether or not the account was already loaded.
+     */
+    function testAndSetAccountLoaded(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_address),
+            ItemState.ITEM_LOADED
+        );
+    }
+ 
+    /**
+     * Checks whether an account has already been modified, and marks it as modified if not.
+     * @param _address Address of the account to check.
+     * @return Whether or not the account was already modified.
+     */
+    function testAndSetAccountChanged(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_address),
+            ItemState.ITEM_CHANGED
+        );
+    }
+ 
+    /**
+     * Attempts to mark an account as committed.
+     * @param _address Address of the account to commit.
+     * @return Whether or not the account was committed.
+     */
+    function commitAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        if (itemStates[item] != ItemState.ITEM_CHANGED) {
+            return false;
+        }
+ 
+        itemStates[item] = ItemState.ITEM_COMMITTED;
+        totalUncommittedAccounts -= 1;
+ 
+        return true;
+    }
+ 
+    /**
+     * Increments the total number of uncommitted accounts.
+     */
+    function incrementTotalUncommittedAccounts()
+        override
+        public
+        authenticated
+    {
+        totalUncommittedAccounts += 1;
+    }
+ 
+    /**
+     * Gets the total number of uncommitted accounts.
+     * @return Total uncommitted accounts.
+     */
+    function getTotalUncommittedAccounts()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return totalUncommittedAccounts;
+    }
+ 
+    /**
+     * Checks whether a given account was changed during execution.
+     * @param _address Address to check.
+     * @return Whether or not the account was changed.
+     */
+    function wasAccountChanged(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        return itemStates[item] >= ItemState.ITEM_CHANGED;
+    }
+ 
+    /**
+     * Checks whether a given account was committed after execution.
+     * @param _address Address to check.
+     * @return Whether or not the account was committed.
+     */
+    function wasAccountCommitted(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        return itemStates[item] >= ItemState.ITEM_COMMITTED;
+    }
+ 
+ 
+    /************************************
+     * Public Functions: Storage Access *
+     ************************************/
+ 
+    /**
+     * Changes a contract storage slot value.
+     * @param _contract Address of the contract to modify.
+     * @param _key 32 byte storage slot key.
+     * @param _value 32 byte storage slot value.
+     */
+    function putContractStorage(
+        address _contract,
+        bytes32 _key,
+        bytes32 _value
+    )
+        override
+        public
+        authenticated
+    {
+        // A hilarious optimization. `SSTORE`ing a value of `bytes32(0)` is common enough that it's
+        // worth populating this with a non-zero value in advance (during the fraud proof
+        // initialization phase) to cut the execution-time cost down to 5000 gas.
+        contractStorage[_contract][_key] = _value ^ STORAGE_XOR_VALUE;
+ 
+        // Only used when initially populating the contract storage. OVM_ExecutionManager will
+        // perform a `hasContractStorage` INVALID_STATE_ACCESS check before putting any contract
+        // storage because writing to zero when the actual value is nonzero causes a gas
+        // discrepancy. Could be moved into a new `putVerifiedContractStorage` function, or
+        // something along those lines.
+        if (verifiedContractStorage[_contract][_key] == false) {
+            verifiedContractStorage[_contract][_key] = true;
+        }
+    }
+ 
+    /**
+     * Retrieves a contract storage slot value.
+     * @param _contract Address of the contract to access.
+     * @param _key 32 byte storage slot key.
+     * @return 32 byte storage slot value.
+     */
+    function getContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        // Storage XOR system doesn't work for newly created contracts that haven't set this
+        // storage slot value yet.
+        if (
+            verifiedContractStorage[_contract][_key] == false
+            && accounts[_contract].isFresh
+        ) {
+            return bytes32(0);
+        }
+ 
+        // See `putContractStorage` for more information about the XOR here.
+        return contractStorage[_contract][_key] ^ STORAGE_XOR_VALUE;
+    }
+ 
+    /**
+     * Checks whether a contract storage slot exists in the state.
+     * @param _contract Address of the contract to access.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the key was set in the state.
+     */
+    function hasContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return verifiedContractStorage[_contract][_key] || accounts[_contract].isFresh;
+    }
+ 
+    /**
+     * Checks whether a storage slot has already been retrieved, and marks it as retrieved if not.
+     * @param _contract Address of the contract to check.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the slot was already loaded.
+     */
+    function testAndSetContractStorageLoaded(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_contract, _key),
+            ItemState.ITEM_LOADED
+        );
+    }
+ 
+    /**
+     * Checks whether a storage slot has already been modified, and marks it as modified if not.
+     * @param _contract Address of the contract to check.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the slot was already modified.
+     */
+    function testAndSetContractStorageChanged(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_contract, _key),
+            ItemState.ITEM_CHANGED
+        );
+    }
+ 
+    /**
+     * Attempts to mark a storage slot as committed.
+     * @param _contract Address of the account to commit.
+     * @param _key 32 byte slot key to commit.
+     * @return Whether or not the slot was committed.
+     */
+    function commitContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        if (itemStates[item] != ItemState.ITEM_CHANGED) {
+            return false;
+        }
+ 
+        itemStates[item] = ItemState.ITEM_COMMITTED;
+        totalUncommittedContractStorage -= 1;
+ 
+        return true;
+    }
+ 
+    /**
+     * Increments the total number of uncommitted storage slots.
+     */
+    function incrementTotalUncommittedContractStorage()
+        override
+        public
+        authenticated
+    {
+        totalUncommittedContractStorage += 1;
+    }
+ 
+    /**
+     * Gets the total number of uncommitted storage slots.
+     * @return Total uncommitted storage slots.
+     */
+    function getTotalUncommittedContractStorage()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return totalUncommittedContractStorage;
+    }
+ 
+    /**
+     * Checks whether a given storage slot was changed during execution.
+     * @param _contract Address to check.
+     * @param _key Key of the storage slot to check.
+     * @return Whether or not the storage slot was changed.
+     */
+    function wasContractStorageChanged(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        return itemStates[item] >= ItemState.ITEM_CHANGED;
+    }
+ 
+    /**
+     * Checks whether a given storage slot was committed after execution.
+     * @param _contract Address to check.
+     * @param _key Key of the storage slot to check.
+     * @return Whether or not the storage slot was committed.
+     */
+    function wasContractStorageCommitted(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        return itemStates[item] >= ItemState.ITEM_COMMITTED;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Generates a unique hash for an address.
+     * @param _address Address to generate a hash for.
+     * @return Unique hash for the given address.
+     */
+    function _getItemHash(
+        address _address
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(abi.encodePacked(_address));
+    }
+ 
+    /**
+     * Generates a unique hash for an address/key pair.
+     * @param _contract Address to generate a hash for.
+     * @param _key Key to generate a hash for.
+     * @return Unique hash for the given pair.
+     */
+    function _getItemHash(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(abi.encodePacked(
+            _contract,
+            _key
+        ));
+    }
+ 
+    /**
+     * Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets the
+     * item to the provided state if not.
+     * @param _item 32 byte item ID to check.
+     * @param _minItemState Minimum state that must be satisfied by the item.
+     * @return Whether or not the item was already in the state.
+     */
+    function _testAndSetItemState(
+        bytes32 _item,
+        ItemState _minItemState
+    )
+        internal
+        returns (
+            bool
+        )
+    {
+        bool wasItemState = itemStates[_item] >= _minItemState;
+ 
+        if (wasItemState == false) {
+            itemStates[_item] = _minItemState;
+        }
+ 
+        return wasItemState;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/execution/OVM_StateManagerFactory.sol.html b/coverage/OVM/execution/OVM_StateManagerFactory.sol.html new file mode 100644 index 000000000..571e900b2 --- /dev/null +++ b/coverage/OVM/execution/OVM_StateManagerFactory.sol.html @@ -0,0 +1,188 @@ + + + + Code coverage report for OVM/execution/OVM_StateManagerFactory.sol + + + + + + + +
+
+

+ all files / OVM/execution/ OVM_StateManagerFactory.sol +

+
+
+ 0% + Statements + 0/1 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
+ 
+/* Contract Imports */
+import { OVM_StateManager } from "./OVM_StateManager.sol";
+ 
+/**
+ * @title OVM_StateManagerFactory
+ * @dev The State Manager Factory is called by a State Transitioner's init code, to create a new
+ * State Manager for use in the Fraud Verification process.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateManagerFactory is iOVM_StateManagerFactory {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Creates a new OVM_StateManager
+     * @param _owner Owner of the created contract.
+     * @return New OVM_StateManager instance.
+     */
+    function create(
+        address _owner
+    )
+        override
+        public
+        returns (
+            iOVM_StateManager
+        )
+    {
+        return new OVM_StateManager(_owner);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/execution/index.html b/coverage/OVM/execution/index.html new file mode 100644 index 000000000..ede1cb77a --- /dev/null +++ b/coverage/OVM/execution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for OVM/execution/ + + + + + + + +
+
+

+ all files OVM/execution/ +

+
+
+ 76.05% + Statements + 235/309 +
+
+ 67.02% + Branches + 63/94 +
+
+ 81.63% + Functions + 80/98 +
+
+ 76.73% + Lines + 244/318 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_ExecutionManager.sol
74.58%176/23662.2%51/8283.61%51/6175.21%182/242
OVM_SafetyChecker.sol
100%8/8100%0/0100%1/1100%10/10
OVM_StateManager.sol
79.69%51/64100%12/1280%28/3580%52/65
OVM_StateManagerFactory.sol
0%0/1100%0/00%0/10%0/1
+
+
+ + + + + + + diff --git a/coverage/OVM/predeploys/ERC1820Registry.sol.html b/coverage/OVM/predeploys/ERC1820Registry.sol.html new file mode 100644 index 000000000..e49e79f7c --- /dev/null +++ b/coverage/OVM/predeploys/ERC1820Registry.sol.html @@ -0,0 +1,662 @@ + + + + Code coverage report for OVM/predeploys/ERC1820Registry.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ ERC1820Registry.sol +

+
+
+ 0% + Statements + 0/38 +
+
+ 0% + Branches + 0/22 +
+
+ 0% + Functions + 0/10 +
+
+ 0% + Lines + 0/39 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: CC0-1.0
+/* ERC1820 Pseudo-introspection Registry Contract
+ * This standard defines a universal registry smart contract where any address (contract or regular account) can
+ * register which interface it supports and which smart contract is responsible for its implementation.
+ *
+ * Written in 2019 by Jordi Baylina and Jacques Dafflon
+ *
+ * To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to
+ * this software to the public domain worldwide. This software is distributed without any warranty.
+ *
+ * You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
+ * <http://creativecommons.org/publicdomain/zero/1.0/>.
+ */
+pragma solidity >0.5.0 <0.8.0;
+ 
+/// @dev The interface a contract MUST implement if it is the implementer of
+/// some (other) interface for any address other than itself.
+interface ERC1820ImplementerInterface {
+    /// @notice Indicates whether the contract implements the interface 'interfaceHash' for the address 'addr' or not.
+    /// @param interfaceHash keccak256 hash of the name of the interface
+    /// @param addr Address for which the contract will implement the interface
+    /// @return ERC1820_ACCEPT_MAGIC only if the contract implements 'interfaceHash' for the address 'addr'.
+    function canImplementInterfaceForAddress(bytes32 interfaceHash, address addr) external view returns(bytes32);
+}
+ 
+/**
+ * @title ERC1820 Pseudo-introspection Registry Contract
+ * @author Jordi Baylina and Jacques Dafflon
+ * @dev This contract is the official implementation of the ERC1820 Registry 
+ * For more details, see https://eips.ethereum.org/EIPS/eip-1820
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract ERC1820Registry {
+    bytes4 constant internal INVALID_ID = 0xffffffff;
+    bytes4 constant internal ERC165ID = 0x01ffc9a7;
+    bytes32 constant internal ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
+ 
+    mapping(address => mapping(bytes32 => address)) internal interfaces;
+    mapping(address => address) internal managers;
+    mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
+ 
+    /// @notice Indicates a contract is the 'implementer' of 'interfaceHash' for 'addr'.
+    event InterfaceImplementerSet(address indexed addr, bytes32 indexed interfaceHash, address indexed implementer);
+    /// @notice Indicates 'newManager' is the address of the new manager for 'addr'.
+    event ManagerChanged(address indexed addr, address indexed newManager);
+ 
+    /// @notice Query if an address implements an interface and through which contract.
+    /// @param _addr Address being queried for the implementer of an interface.
+    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
+    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
+    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
+    /// @return The address of the contract which implements the interface '_interfaceHash' for '_addr'
+    /// or '0' if '_addr' did not register an implementer for this interface.
+    function getInterfaceImplementer(address _addr, bytes32 _interfaceHash) external view returns (address) {
+        address addr = _addr == address(0) ? msg.sender : _addr;
+        if (isERC165Interface(_interfaceHash)) {
+            bytes4 erc165InterfaceHash = bytes4(_interfaceHash);
+            return implementsERC165Interface(addr, erc165InterfaceHash) ? addr : address(0);
+        }
+        return interfaces[addr][_interfaceHash];
+    }
+ 
+    /// @notice Sets the contract which implements a specific interface for an address.
+    /// Only the manager defined for that address can set it.
+    /// (Each address is the manager for itself until it sets a new manager.)
+    /// @param _addr Address for which to set the interface.
+    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
+    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
+    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
+    /// @param _implementer Contract address implementing '_interfaceHash' for '_addr'.
+    function setInterfaceImplementer(address _addr, bytes32 _interfaceHash, address _implementer) external {
+        address addr = _addr == address(0) ? msg.sender : _addr;
+        require(getManager(addr) == msg.sender, "Not the manager");
+ 
+        require(!isERC165Interface(_interfaceHash), "Must not be an ERC165 hash");
+        if (_implementer != address(0) && _implementer != msg.sender) {
+            require(
+                ERC1820ImplementerInterface(_implementer)
+                    .canImplementInterfaceForAddress(_interfaceHash, addr) == ERC1820_ACCEPT_MAGIC,
+                "Does not implement the interface"
+            );
+        }
+        interfaces[addr][_interfaceHash] = _implementer;
+        emit InterfaceImplementerSet(addr, _interfaceHash, _implementer);
+    }
+ 
+    /// @notice Sets '_newManager' as manager for '_addr'.
+    /// The new manager will be able to call 'setInterfaceImplementer' for '_addr'.
+    /// @param _addr Address for which to set the new manager.
+    /// @param _newManager Address of the new manager for 'addr'. (Pass '0x0' to reset the manager to '_addr'.)
+    function setManager(address _addr, address _newManager) external {
+        require(getManager(_addr) == msg.sender, "Not the manager");
+        managers[_addr] = _newManager == _addr ? address(0) : _newManager;
+        emit ManagerChanged(_addr, _newManager);
+    }
+ 
+    /// @notice Get the manager of an address.
+    /// @param _addr Address for which to return the manager.
+    /// @return Address of the manager for a given address.
+    function getManager(address _addr) public view returns(address) {
+        // By default the manager of an address is the same address
+        if (managers[_addr] == address(0)) {
+            return _addr;
+        } else {
+            return managers[_addr];
+        }
+    }
+ 
+    /// @notice Compute the keccak256 hash of an interface given its name.
+    /// @param _interfaceName Name of the interface.
+    /// @return The keccak256 hash of an interface name.
+    function interfaceHash(string calldata _interfaceName) external pure returns(bytes32) {
+        return keccak256(abi.encodePacked(_interfaceName));
+    }
+ 
+    /* --- ERC165 Related Functions --- */
+    /* --- Developed in collaboration with William Entriken. --- */
+ 
+    /// @notice Updates the cache with whether the contract implements an ERC165 interface or not.
+    /// @param _contract Address of the contract for which to update the cache.
+    /// @param _interfaceId ERC165 interface for which to update the cache.
+    function updateERC165Cache(address _contract, bytes4 _interfaceId) external {
+        interfaces[_contract][_interfaceId] = implementsERC165InterfaceNoCache(
+            _contract, _interfaceId) ? _contract : address(0);
+        erc165Cached[_contract][_interfaceId] = true;
+    }
+ 
+    /// @notice Checks whether a contract implements an ERC165 interface or not.
+    //  If the result is not cached a direct lookup on the contract address is performed.
+    //  If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
+    //  'updateERC165Cache' with the contract address.
+    /// @param _contract Address of the contract to check.
+    /// @param _interfaceId ERC165 interface to check.
+    /// @return True if '_contract' implements '_interfaceId', false otherwise.
+    function implementsERC165Interface(address _contract, bytes4 _interfaceId) public view returns (bool) {
+        if (!erc165Cached[_contract][_interfaceId]) {
+            return implementsERC165InterfaceNoCache(_contract, _interfaceId);
+        }
+        return interfaces[_contract][_interfaceId] == _contract;
+    }
+ 
+    /// @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
+    /// @param _contract Address of the contract to check.
+    /// @param _interfaceId ERC165 interface to check.
+    /// @return True if '_contract' implements '_interfaceId', false otherwise.
+    function implementsERC165InterfaceNoCache(address _contract, bytes4 _interfaceId) public view returns (bool) {
+        uint256 success;
+        uint256 result;
+ 
+        (success, result) = noThrowCall(_contract, ERC165ID);
+        if (success == 0 || result == 0) {
+            return false;
+        }
+ 
+        (success, result) = noThrowCall(_contract, INVALID_ID);
+        if (success == 0 || result != 0) {
+            return false;
+        }
+ 
+        (success, result) = noThrowCall(_contract, _interfaceId);
+        if (success == 1 && result == 1) {
+            return true;
+        }
+        return false;
+    }
+ 
+    /// @notice Checks whether the hash is a ERC165 interface (ending with 28 zeroes) or not.
+    /// @param _interfaceHash The hash to check.
+    /// @return True if '_interfaceHash' is an ERC165 interface (ending with 28 zeroes), false otherwise.
+    function isERC165Interface(bytes32 _interfaceHash) internal pure returns (bool) {
+        return _interfaceHash & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0;
+    }
+ 
+    /// @dev Make a call on a contract without throwing if the function does not exist.
+    function noThrowCall(address _contract, bytes4 _interfaceId)
+        internal view returns (uint256 success, uint256 result)
+    {
+        bytes4 erc165ID = ERC165ID;
+ 
+        assembly {
+            let x := mload(0x40)               // Find empty storage location using "free memory pointer"
+            mstore(x, erc165ID)                // Place signature at beginning of empty storage
+            mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
+ 
+            success := staticcall(
+                30000,                         // 30k gas
+                _contract,                     // To addr
+                x,                             // Inputs are stored at location x
+                0x24,                          // Inputs are 36 (4 + 32) bytes long
+                x,                             // Store output over input (saves space)
+                0x20                           // Outputs are 32 bytes long
+            )
+ 
+            result := mload(x)                 // Load the result
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/predeploys/OVM_DeployerWhitelist.sol.html b/coverage/OVM/predeploys/OVM_DeployerWhitelist.sol.html new file mode 100644 index 000000000..fb432861c --- /dev/null +++ b/coverage/OVM/predeploys/OVM_DeployerWhitelist.sol.html @@ -0,0 +1,701 @@ + + + + Code coverage report for OVM/predeploys/OVM_DeployerWhitelist.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_DeployerWhitelist.sol +

+
+
+ 36.36% + Statements + 8/22 +
+
+ 66.67% + Branches + 4/6 +
+
+ 12.5% + Functions + 1/8 +
+
+ 34.78% + Lines + 8/23 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +29× +25× +  +  + +  +  +  + + +  +  + +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+ 
+/* Interface Imports */
+import { iOVM_DeployerWhitelist } from "../../iOVM/predeploys/iOVM_DeployerWhitelist.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_DeployerWhitelist
+ * @dev The Deployer Whitelist is a temporary predeploy used to provide additional safety during the
+ * initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts
+ * which are allowed to deploy contracts on Layer2. The Execution Manager will only allow an 
+ * ovmCREATE or ovmCREATE2 operation to proceed if the deployer's address whitelisted.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_DeployerWhitelist is iOVM_DeployerWhitelist {
+ 
+    /**********************
+     * Contract Constants *
+     **********************/
+ 
+    bytes32 internal constant KEY_INITIALIZED =                0x0000000000000000000000000000000000000000000000000000000000000010;
+    bytes32 internal constant KEY_OWNER =                      0x0000000000000000000000000000000000000000000000000000000000000011;
+    bytes32 internal constant KEY_ALLOW_ARBITRARY_DEPLOYMENT = 0x0000000000000000000000000000000000000000000000000000000000000012;
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+    
+    /**
+     * Blocks functions to anyone except the contract owner.
+     */
+    modifier onlyOwner() {
+        address owner = Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                KEY_OWNER
+            )
+        );
+ 
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_SafeExecutionManagerWrapper.safeCALLER() == owner,
+            "Function can only be called by the owner of this contract."
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+    
+    /**
+     * Initializes the whitelist.
+     * @param _owner Address of the owner for this contract.
+     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
+     */
+    function initialize(
+        address _owner,
+        bool _allowArbitraryDeployment
+    )
+        override
+        public
+    {
+        bool initialized = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
+        );
+ 
+        if (initialized == true) {
+            return;
+        }
+ 
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_INITIALIZED,
+            Lib_Bytes32Utils.fromBool(true)
+        );
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_OWNER,
+            Lib_Bytes32Utils.fromAddress(_owner)
+        );
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
+            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
+        );
+    }
+ 
+    /**
+     * Gets the owner of the whitelist.
+     */
+    function getOwner()
+        override
+        public
+        returns(
+            address
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                KEY_OWNER
+            )
+        );
+    }
+ 
+    /**
+     * Adds or removes an address from the deployment whitelist.
+     * @param _deployer Address to update permissions for.
+     * @param _isWhitelisted Whether or not the address is whitelisted.
+     */
+    function setWhitelistedDeployer(
+        address _deployer,
+        bool _isWhitelisted
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            Lib_Bytes32Utils.fromAddress(_deployer),
+            Lib_Bytes32Utils.fromBool(_isWhitelisted)
+        );
+    }
+ 
+    /**
+     * Updates the owner of this contract.
+     * @param _owner Address of the new owner.
+     */
+    function setOwner(
+        address _owner
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_OWNER,
+            Lib_Bytes32Utils.fromAddress(_owner)
+        );
+    }
+ 
+    /**
+     * Updates the arbitrary deployment flag.
+     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
+     */
+    function setAllowArbitraryDeployment(
+        bool _allowArbitraryDeployment
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
+            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
+        );
+    }
+ 
+    /**
+     * Permanently enables arbitrary contract deployment and deletes the owner.
+     */
+    function enableArbitraryContractDeployment()
+        override
+        public
+        onlyOwner
+    {
+        setAllowArbitraryDeployment(true);
+        setOwner(address(0));
+    }
+ 
+    /**
+     * Checks whether an address is allowed to deploy contracts.
+     * @param _deployer Address to check.
+     * @return _allowed Whether or not the address can deploy contracts.
+     */
+    function isDeployerAllowed(
+        address _deployer
+    )
+        override
+        public
+        returns (
+            bool _allowed
+        )
+    {
+        bool initialized = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
+        );
+ 
+        if (initialized == false) {
+            return true;
+        }
+ 
+        bool allowArbitraryDeployment = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_ALLOW_ARBITRARY_DEPLOYMENT)
+        );
+ 
+        if (allowArbitraryDeployment == true) {
+            return true;
+        }
+ 
+        bool isWhitelisted = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                Lib_Bytes32Utils.fromAddress(_deployer)
+            )
+        );
+ 
+        return isWhitelisted;        
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/predeploys/OVM_ETH.sol.html b/coverage/OVM/predeploys/OVM_ETH.sol.html new file mode 100644 index 000000000..c72919992 --- /dev/null +++ b/coverage/OVM/predeploys/OVM_ETH.sol.html @@ -0,0 +1,167 @@ + + + + Code coverage report for OVM/predeploys/OVM_ETH.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_ETH.sol +

+
+
+ 0% + Statements + 0/1 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Contract Imports */
+import { OVM_L2DepositedERC20 } from "../bridge/tokens/OVM_L2DepositedERC20.sol";
+ 
+/**
+ * @title OVM_ETH
+ * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that 
+ * unlike on Layer 1, Layer 2 accounts do not have a balance field.
+ * 
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract OVM_ETH is OVM_L2DepositedERC20 {
+    constructor(
+        address _l2CrossDomainMessenger,
+        address _l1ETHGateway
+    ) 
+        OVM_L2DepositedERC20(
+            _l2CrossDomainMessenger,
+            "Ether",
+            "ETH"
+        )
+    {
+        init(iOVM_L1TokenGateway(_l1ETHGateway));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/predeploys/OVM_L1MessageSender.sol.html b/coverage/OVM/predeploys/OVM_L1MessageSender.sol.html new file mode 100644 index 000000000..23974fcf0 --- /dev/null +++ b/coverage/OVM/predeploys/OVM_L1MessageSender.sol.html @@ -0,0 +1,194 @@ + + + + Code coverage report for OVM/predeploys/OVM_L1MessageSender.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_L1MessageSender.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_L1MessageSender } from "../../iOVM/predeploys/iOVM_L1MessageSender.sol";
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+ 
+/**
+ * @title OVM_L1MessageSender
+ * @dev The L1MessageSender is a predeploy contract running on L2. During the execution of cross 
+ * domain transaction from L1 to L2, it returns the address of the L1 account (either an EOA or
+ * contract) which sent the message to L2 via the Canonical Transaction Chain's `enqueue()` 
+ * function.
+ * 
+ * This contract exclusively serves as a getter for the ovmL1TXORIGIN operation. This is necessary 
+ * because there is no corresponding operation in the EVM which the the optimistic solidity compiler 
+ * can be replaced with a call to the ExecutionManager's ovmL1TXORIGIN() function.
+ *
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_L1MessageSender is iOVM_L1MessageSender {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @return _l1MessageSender L1 message sender address (msg.sender).
+     */
+    function getL1MessageSender()
+        override
+        public
+        view
+        returns (
+            address _l1MessageSender
+        )
+    {
+        // Note that on L2 msg.sender (ie. evmCALLER) will always be the Execution Manager 
+        return iOVM_ExecutionManager(msg.sender).ovmL1TXORIGIN();
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html b/coverage/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html new file mode 100644 index 000000000..78befb65e --- /dev/null +++ b/coverage/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html @@ -0,0 +1,215 @@ + + + + Code coverage report for OVM/predeploys/OVM_L2ToL1MessagePasser.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_L2ToL1MessagePasser.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_L2ToL1MessagePasser } from "../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
+ 
+/**
+ * @title OVM_L2ToL1MessagePasser
+ * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the 
+ * of a message on L2. The L1 Cross Domain Messenger performs this proof in its
+ * _verifyStorageProof function, which verifies the existence of the transaction hash in this 
+ * contract's `sentMessages` mapping.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    mapping (bytes32 => bool) public sentMessages;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Passes a message to L1.
+     * @param _message Message to pass to L1.
+     */
+    function passMessageToL1(
+        bytes memory _message
+    )
+        override
+        public
+    {
+        // Note: although this function is public, only messages sent from the OVM_L2CrossDomainMessenger 
+        // will be relayed by the OVM_L1CrossDomainMessenger. This is enforced by a check in 
+        // OVM_L1CrossDomainMessenger._verifyStorageProof().
+        sentMessages[keccak256(
+            abi.encodePacked(
+                _message,
+                msg.sender
+            )
+        )] = true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html b/coverage/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html new file mode 100644 index 000000000..26ebcbefe --- /dev/null +++ b/coverage/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html @@ -0,0 +1,413 @@ + + + + Code coverage report for OVM/predeploys/OVM_ProxySequencerEntrypoint.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_ProxySequencerEntrypoint.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 7/7 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_ProxySequencerEntrypoint 
+ * @dev The Proxy Sequencer Entrypoint is a predeployed proxy to the implementation of the 
+ * Sequencer Entrypoint. This will enable the Optimism team to upgrade the Sequencer Entrypoint 
+ * contract.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ProxySequencerEntrypoint {
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
+            gasleft(),
+            _getImplementation(),
+            msg.data
+        );
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function init(
+        address _implementation,
+        address _owner
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            _getOwner() == address(0),
+            "ProxySequencerEntrypoint has already been inited"
+        );
+        _setOwner(_owner);
+        _setImplementation(_implementation);
+    }
+ 
+    function upgrade(
+        address _implementation
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            _getOwner() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
+            "Only owner can upgrade the Entrypoint"
+        );
+ 
+        _setImplementation(_implementation);
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _setImplementation(
+        address _implementation
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            bytes32(uint256(0)),
+            bytes32(uint256(uint160(_implementation)))
+        );
+    }
+ 
+    function _getImplementation()
+        internal
+        returns (
+            address _implementation
+        )
+    {
+        return address(uint160(uint256(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                bytes32(uint256(0))
+            )
+        )));
+    }
+ 
+    function _setOwner(
+        address _owner
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            bytes32(uint256(1)),
+            bytes32(uint256(uint160(_owner)))
+        );
+    }
+ 
+    function _getOwner()
+        internal
+        returns (
+            address _owner
+        )
+    {
+        return address(uint160(uint256(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                bytes32(uint256(1))
+            )
+        )));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/predeploys/OVM_SequencerEntrypoint.sol.html b/coverage/OVM/predeploys/OVM_SequencerEntrypoint.sol.html new file mode 100644 index 000000000..b6e8b5067 --- /dev/null +++ b/coverage/OVM/predeploys/OVM_SequencerEntrypoint.sol.html @@ -0,0 +1,446 @@ + + + + Code coverage report for OVM/predeploys/OVM_SequencerEntrypoint.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_SequencerEntrypoint.sol +

+
+
+ 100% + Statements + 18/18 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 17/17 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + + +  +  + + +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  + + +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_SequencerEntrypoint
+ * @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by 
+ * any account. It accepts a more efficient compressed calldata format, which it decompresses and 
+ * encodes to the standard EIP155 transaction format.
+ * This contract is the implementation referenced by the Proxy Sequencer Entrypoint, thus enabling
+ * the Optimism team to upgrade the decompression of calldata from the Sequencer.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_SequencerEntrypoint {
+ 
+    /*********
+     * Enums *
+     *********/
+    
+    enum TransactionType {
+        NATIVE_ETH_TRANSACTION,
+        ETH_SIGNED_MESSAGE
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    /**
+     * Uses a custom "compressed" format to save on calldata gas:
+     * calldata[00:01]: transaction type (0 == EIP 155, 2 == Eth Sign Message)
+     * calldata[01:33]: signature "r" parameter
+     * calldata[33:65]: signature "s" parameter
+     * calldata[65:66]: signature "v" parameter
+     * calldata[66:69]: transaction gas limit
+     * calldata[69:72]: transaction gas price
+     * calldata[72:75]: transaction nonce
+     * calldata[75:95]: transaction target address
+     * calldata[95:XX]: transaction data
+     */
+    fallback()
+        external
+    {
+        TransactionType transactionType = _getTransactionType(Lib_BytesUtils.toUint8(msg.data, 0));
+ 
+        bytes32 r = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 1, 32));
+        bytes32 s = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 33, 32));
+        uint8 v = Lib_BytesUtils.toUint8(msg.data, 65);
+ 
+        // Remainder is the transaction to execute.
+        bytes memory compressedTx = Lib_BytesUtils.slice(msg.data, 66);
+        bool isEthSignedMessage = transactionType == TransactionType.ETH_SIGNED_MESSAGE;
+ 
+        // Need to decompress and then re-encode the transaction based on the original encoding.
+        bytes memory encodedTx = Lib_OVMCodec.encodeEIP155Transaction(
+            Lib_OVMCodec.decompressEIP155Transaction(compressedTx),
+            isEthSignedMessage
+        );
+ 
+        address target = Lib_ECDSAUtils.recover(
+            encodedTx,
+            isEthSignedMessage,
+            uint8(v),
+            r,
+            s
+        );
+ 
+        if (Lib_SafeExecutionManagerWrapper.safeEXTCODESIZE(target) == 0) {
+            // ProxyEOA has not yet been deployed for this EOA.
+            bytes32 messageHash = Lib_ECDSAUtils.getMessageHash(encodedTx, isEthSignedMessage);
+            Lib_SafeExecutionManagerWrapper.safeCREATEEOA(messageHash, uint8(v), r, s);
+        }
+ 
+        // ProxyEOA has been deployed for this EOA, continue to CALL.
+        bytes memory callbytes = abi.encodeWithSignature(
+            "execute(bytes,uint8,uint8,bytes32,bytes32)",
+            encodedTx,
+            isEthSignedMessage,
+            uint8(v),
+            r,
+            s
+        );
+ 
+        Lib_SafeExecutionManagerWrapper.safeCALL(
+            gasleft(),
+            target,
+            callbytes
+        );
+    }
+    
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Converts a uint256 into a TransactionType enum.
+     * @param _transactionType Transaction type index.
+     * @return _txType Transaction type enum value.
+     */
+    function _getTransactionType(
+        uint8 _transactionType
+    )
+        internal
+        returns (
+            TransactionType _txType
+        )
+    {
+        if (_transactionType == 0) {
+            return TransactionType.NATIVE_ETH_TRANSACTION;
+        } if (_transactionType == 2) {
+            return TransactionType.ETH_SIGNED_MESSAGE;
+        } else {
+            Lib_SafeExecutionManagerWrapper.safeREVERT(
+                "Transaction type must be 0 or 2"
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/predeploys/index.html b/coverage/OVM/predeploys/index.html new file mode 100644 index 000000000..fab910cad --- /dev/null +++ b/coverage/OVM/predeploys/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for OVM/predeploys/ + + + + + + + +
+
+

+ all files OVM/predeploys/ +

+
+
+ 41.76% + Statements + 38/91 +
+
+ 29.41% + Branches + 10/34 +
+
+ 40% + Functions + 12/30 +
+
+ 40.22% + Lines + 37/92 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ERC1820Registry.sol
0%0/380%0/220%0/100%0/39
OVM_DeployerWhitelist.sol
36.36%8/2266.67%4/612.5%1/834.78%8/23
OVM_ETH.sol
0%0/1100%0/00%0/10%0/1
OVM_L1MessageSender.sol
100%1/1100%0/0100%1/1100%1/1
OVM_L2ToL1MessagePasser.sol
100%1/1100%0/0100%1/1100%1/1
OVM_ProxySequencerEntrypoint.sol
100%10/10100%0/0100%7/7100%10/10
OVM_SequencerEntrypoint.sol
100%18/18100%6/6100%2/2100%17/17
+
+
+ + + + + + + diff --git a/coverage/OVM/verification/Abs_FraudContributor.sol.html b/coverage/OVM/verification/Abs_FraudContributor.sol.html new file mode 100644 index 000000000..cb75b1904 --- /dev/null +++ b/coverage/OVM/verification/Abs_FraudContributor.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for OVM/verification/Abs_FraudContributor.sol + + + + + + + +
+
+

+ all files / OVM/verification/ Abs_FraudContributor.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +14× +14× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/// Minimal contract to be inherited by contracts consumed by users that provide
+/// data for fraud proofs
+abstract contract Abs_FraudContributor is Lib_AddressResolver {
+    /// Decorate your functions with this modifier to store how much total gas was
+    /// consumed by the sender, to reward users fairly
+    modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
+        uint256 startGas = gasleft();
+        _;
+        uint256 gasSpent = startGas - gasleft();
+        iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/verification/OVM_BondManager.sol.html b/coverage/OVM/verification/OVM_BondManager.sol.html new file mode 100644 index 000000000..d90409cfe --- /dev/null +++ b/coverage/OVM/verification/OVM_BondManager.sol.html @@ -0,0 +1,689 @@ + + + + Code coverage report for OVM/verification/OVM_BondManager.sol + + + + + + + +
+
+

+ all files / OVM/verification/ OVM_BondManager.sol +

+
+
+ 100% + Statements + 42/42 +
+
+ 86.67% + Branches + 26/30 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 41/41 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +63× +  +  +  +  +  +  +  +  +  +  +46× +46× +  +45× +45× +  +  +  +  +  +13× +12× +  +  +  +11× +  +11× +11× + + + +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +11× +  +  +  +  + +  +  +  +10× +  +  +  +  +  +18× +  +  +  +  +  +18× +  +  +  +  + + + +  + + +  +  +  +  + +  + +  +  +  + +  +  + + +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  + + +  +  + +  +  +  + +  +  + +  +  + +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_BondManager, Errors, ERC20 } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+ 
+/**
+ * @title OVM_BondManager
+ * @dev The Bond Manager contract handles deposits in the form of an ERC20 token from bonded 
+ * Proposers. It also handles the accounting of gas costs spent by a Verifier during the course of a
+ * fraud proof. In the event of a successful fraud proof, the fraudulent Proposer's bond is slashed, 
+ * and the Verifier's gas costs are refunded.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
+ 
+    /****************************
+     * Constants and Parameters *
+     ****************************/
+ 
+    /// The period to find the earliest fraud proof for a publisher
+    uint256 public constant multiFraudProofPeriod = 7 days;
+ 
+    /// The dispute period
+    uint256 public constant disputePeriodSeconds = 7 days;
+ 
+    /// The minimum collateral a sequencer must post
+    uint256 public constant requiredCollateral = 1 ether;
+ 
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    /// The bond token
+    ERC20 immutable public token;
+ 
+ 
+    /********************************************
+     * Contract Variables: Internal Accounting  *
+     *******************************************/
+ 
+    /// The bonds posted by each proposer
+    mapping(address => Bond) public bonds;
+ 
+    /// For each pre-state root, there's an array of witnessProviders that must be rewarded
+    /// for posting witnesses
+    mapping(bytes32 => Rewards) public witnessProviders;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /// Initializes with a ERC20 token to be used for the fidelity bonds
+    /// and with the Address Manager
+    constructor(
+        ERC20 _token,
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        token = _token;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /// Adds `who` to the list of witnessProviders for the provided `preStateRoot`.
+    function recordGasSpent(bytes32 _preStateRoot, bytes32 _txHash, address who, uint256 gasSpent) override public {
+        // The sender must be the transitioner that corresponds to the claimed pre-state root
+        address transitioner = address(iOVM_FraudVerifier(resolve("OVM_FraudVerifier")).getStateTransitioner(_preStateRoot, _txHash));
+        require(transitioner == msg.sender, Errors.ONLY_TRANSITIONER);
+ 
+        witnessProviders[_preStateRoot].total += gasSpent;
+        witnessProviders[_preStateRoot].gasSpent[who] += gasSpent;
+    }
+ 
+    /// Slashes + distributes rewards or frees up the sequencer's bond, only called by
+    /// `FraudVerifier.finalizeFraudVerification`
+    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) override public {
+        require(msg.sender == resolve("OVM_FraudVerifier"), Errors.ONLY_FRAUD_VERIFIER);
+        require(witnessProviders[_preStateRoot].canClaim == false, Errors.ALREADY_FINALIZED);
+ 
+        // allow users to claim from that state root's
+        // pool of collateral (effectively slashing the sequencer)
+        witnessProviders[_preStateRoot].canClaim = true;
+ 
+        Bond storage bond = bonds[publisher];
+        if (bond.firstDisputeAt == 0) {
+            bond.firstDisputeAt = block.timestamp;
+            bond.earliestDisputedStateRoot = _preStateRoot;
+            bond.earliestTimestamp = timestamp;
+        } else if (
+            // only update the disputed state root for the publisher if it's within
+            // the dispute period _and_ if it's before the previous one
+            block.timestamp < bond.firstDisputeAt + multiFraudProofPeriod &&
+            timestamp < bond.earliestTimestamp
+        ) {
+            bond.earliestDisputedStateRoot = _preStateRoot;
+            bond.earliestTimestamp = timestamp;
+        }
+ 
+        // if the fraud proof's dispute period does not intersect with the 
+        // withdrawal's timestamp, then the user should not be slashed
+        // e.g if a user at day 10 submits a withdrawal, and a fraud proof
+        // from day 1 gets published, the user won't be slashed since day 8 (1d + 7d)
+        // is before the user started their withdrawal. on the contrary, if the user
+        // had started their withdrawal at, say, day 6, they would be slashed
+        if (
+            bond.withdrawalTimestamp != 0 && 
+            uint256(bond.withdrawalTimestamp) > timestamp + disputePeriodSeconds &&
+            bond.state == State.WITHDRAWING
+        ) {
+            return;
+        }
+ 
+        // slash!
+        bond.state = State.NOT_COLLATERALIZED;
+    }
+ 
+    /// Sequencers call this function to post collateral which will be used for
+    /// the `appendBatch` call
+    function deposit() override public {
+        Erequire(
+            token.transferFrom(msg.sender, address(this), requiredCollateral),
+            Errors.ERC20_ERR
+        );
+ 
+        // This cannot overflow
+        bonds[msg.sender].state = State.COLLATERALIZED;
+    }
+ 
+    /// Starts the withdrawal for a publisher
+    function startWithdrawal() override public {
+        Bond storage bond = bonds[msg.sender];
+        Erequire(bond.withdrawalTimestamp == 0, Errors.WITHDRAWAL_PENDING);
+        require(bond.state == State.COLLATERALIZED, Errors.WRONG_STATE);
+ 
+        bond.state = State.WITHDRAWING;
+        bond.withdrawalTimestamp = uint32(block.timestamp);
+    }
+ 
+    /// Finalizes a pending withdrawal from a publisher
+    function finalizeWithdrawal() override public {
+        Bond storage bond = bonds[msg.sender];
+ 
+        require(
+            block.timestamp >= uint256(bond.withdrawalTimestamp) + disputePeriodSeconds, 
+            Errors.TOO_EARLY
+        );
+        require(bond.state == State.WITHDRAWING, Errors.SLASHED);
+        
+        // refunds!
+        bond.state = State.NOT_COLLATERALIZED;
+        bond.withdrawalTimestamp = 0;
+        
+        Erequire(
+            token.transfer(msg.sender, requiredCollateral),
+            Errors.ERC20_ERR
+        );
+    }
+ 
+    /// Claims the user's reward for the witnesses they provided for the earliest
+    /// disputed state root of the designated publisher
+    function claim(address who) override public {
+        Bond storage bond = bonds[who];
+        require(
+            block.timestamp >= bond.firstDisputeAt + multiFraudProofPeriod,
+            Errors.WAIT_FOR_DISPUTES
+        );
+ 
+        // reward the earliest state root for this publisher
+        bytes32 _preStateRoot = bond.earliestDisputedStateRoot;
+        Rewards storage rewards = witnessProviders[_preStateRoot];
+ 
+        // only allow claiming if fraud was proven in `finalize`
+        require(rewards.canClaim, Errors.CANNOT_CLAIM);
+ 
+        // proportional allocation - only reward 50% (rest gets locked in the
+        // contract forever
+        uint256 amount = (requiredCollateral * rewards.gasSpent[msg.sender]) / (2 * rewards.total);
+ 
+        // reset the user's spent gas so they cannot double claim
+        rewards.gasSpent[msg.sender] = 0;
+ 
+        // transfer
+        Erequire(token.transfer(msg.sender, amount), Errors.ERC20_ERR);
+    }
+ 
+    /// Checks if the user is collateralized
+    function isCollateralized(address who) override public view returns (bool) {
+        return bonds[who].state == State.COLLATERALIZED;
+    }
+ 
+    /// Gets how many witnesses the user has provided for the state root
+    function getGasSpent(bytes32 preStateRoot, address who) override public view returns (uint256) {
+        return witnessProviders[preStateRoot].gasSpent[who];
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/verification/OVM_FraudVerifier.sol.html b/coverage/OVM/verification/OVM_FraudVerifier.sol.html new file mode 100644 index 000000000..23d1fbb73 --- /dev/null +++ b/coverage/OVM/verification/OVM_FraudVerifier.sol.html @@ -0,0 +1,953 @@ + + + + Code coverage report for OVM/verification/OVM_FraudVerifier.sol + + + + + + + +
+
+

+ all files / OVM/verification/ OVM_FraudVerifier.sol +

+
+
+ 96.43% + Statements + 27/28 +
+
+ 94.44% + Branches + 17/18 +
+
+ 100% + Functions + 7/7 +
+
+ 96.43% + Lines + 27/28 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +12× +  +  +  +12× +12× +  +12× +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +10× +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  +  + +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+ 
+/* Contract Imports */
+import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
+ 
+ 
+ 
+/**
+ * @title OVM_FraudVerifier
+ * @dev The Fraud Verifier contract coordinates the entire fraud proof verification process. 
+ * If the fraud proof was successful it prunes any state batches from State Commitment Chain
+ * which were published after the fraudulent state root.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_FraudVerifier is Lib_AddressResolver, Abs_FraudContributor, iOVM_FraudVerifier {
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    mapping (bytes32 => iOVM_StateTransitioner) internal transitioners;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+ 
+    /***************************************
+     * Public Functions: Transition Status *
+     ***************************************/
+ 
+    /**
+     * Retrieves the state transitioner for a given root.
+     * @param _preStateRoot State root to query a transitioner for.
+     * @return _transitioner Corresponding state transitioner contract.
+     */
+    function getStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        override
+        public
+        view
+        returns (
+            iOVM_StateTransitioner _transitioner
+        )
+    {
+        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
+    }
+ 
+ 
+    /****************************************
+     * Public Functions: Fraud Verification *
+     ****************************************/
+ 
+    /**
+     * Begins the fraud verification process.
+     * @param _preStateRoot State root before the fraudulent transaction.
+     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
+     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
+     * @param _transaction OVM transaction claimed to be fraudulent.
+     * @param _txChainElement OVM transaction chain element.
+     * @param _transactionBatchHeader Batch header for the provided transaction.
+     * @param _transactionProof Inclusion proof for the provided transaction.
+     */
+    function initializeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _transactionBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _transactionProof
+    )
+        override
+        public
+        contributesToFraudProof(_preStateRoot, Lib_OVMCodec.hashTransaction(_transaction))
+    {
+        bytes32 _txHash = Lib_OVMCodec.hashTransaction(_transaction);
+ 
+        Iif (_hasStateTransitioner(_preStateRoot, _txHash)) {
+            return;
+        }
+ 
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+        iOVM_CanonicalTransactionChain ovmCanonicalTransactionChain = iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain"));
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _preStateRoot,
+                _preStateRootBatchHeader,
+                _preStateRootProof
+            ),
+            "Invalid pre-state root inclusion proof."
+        );
+ 
+        require(
+            ovmCanonicalTransactionChain.verifyTransaction(
+                _transaction,
+                _txChainElement,
+                _transactionBatchHeader,
+                _transactionProof
+            ),
+            "Invalid transaction inclusion proof."
+        );
+ 
+        require (
+            _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1 == _transactionBatchHeader.prevTotalElements + _transactionProof.index,
+            "Pre-state root global index must equal to the transaction root global index."
+        );
+ 
+        _deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index);
+ 
+        emit FraudProofInitialized(
+            _preStateRoot,
+            _preStateRootProof.index,
+            _txHash,
+            msg.sender
+        );
+    }
+ 
+    /**
+     * Finalizes the fraud verification process.
+     * @param _preStateRoot State root before the fraudulent transaction.
+     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
+     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
+     * @param _txHash The transaction for the state root
+     * @param _postStateRoot State root after the fraudulent transaction.
+     * @param _postStateRootBatchHeader Batch header for the provided post-state root.
+     * @param _postStateRootProof Inclusion proof for the provided post-state root.
+     */
+    function finalizeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
+        bytes32 _txHash,
+        bytes32 _postStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _postStateRootProof
+    )
+        override
+        public
+        contributesToFraudProof(_preStateRoot, _txHash)
+    {
+        iOVM_StateTransitioner transitioner = getStateTransitioner(_preStateRoot, _txHash);
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+ 
+        require(
+            transitioner.isComplete() == true,
+            "State transition process must be completed prior to finalization."
+        );
+ 
+        require (
+            _postStateRootBatchHeader.prevTotalElements + _postStateRootProof.index == _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1,
+            "Post-state root global index must equal to the pre state root global index plus one."
+        );
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _preStateRoot,
+                _preStateRootBatchHeader,
+                _preStateRootProof
+            ),
+            "Invalid pre-state root inclusion proof."
+        );
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _postStateRoot,
+                _postStateRootBatchHeader,
+                _postStateRootProof
+            ),
+            "Invalid post-state root inclusion proof."
+        );
+ 
+        // If the post state root did not match, then there was fraud and we should delete the batch
+        require(
+            _postStateRoot != transitioner.getPostStateRoot(),
+            "State transition has not been proven fraudulent."
+        );
+        
+        _cancelStateTransition(_postStateRootBatchHeader, _preStateRoot);
+ 
+        // TEMPORARY: Remove the transitioner; for minnet.
+        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitioner(0x0000000000000000000000000000000000000000);
+ 
+        emit FraudProofFinalized(
+            _preStateRoot,
+            _preStateRootProof.index,
+            _txHash,
+            msg.sender
+        );
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Verification *
+     ************************************/
+ 
+    /**
+     * Checks whether a transitioner already exists for a given pre-state root.
+     * @param _preStateRoot Pre-state root to check.
+     * @return _exists Whether or not we already have a transitioner for the root.
+     */
+    function _hasStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        internal
+        view
+        returns (
+            bool _exists
+        )
+    {
+        return address(getStateTransitioner(_preStateRoot, _txHash)) != address(0);
+    }
+ 
+    /**
+     * Deploys a new state transitioner.
+     * @param _preStateRoot Pre-state root to initialize the transitioner with.
+     * @param _txHash Hash of the transaction this transitioner will execute.
+     * @param _stateTransitionIndex Index of the transaction in the chain.
+     */
+    function _deployTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        uint256 _stateTransitionIndex
+    )
+        internal
+    {
+        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitionerFactory(
+            resolve("OVM_StateTransitionerFactory")
+        ).create(
+            address(libAddressManager),
+            _stateTransitionIndex,
+            _preStateRoot,
+            _txHash
+        );
+    }
+ 
+    /**
+     * Removes a state transition from the state commitment chain.
+     * @param _postStateRootBatchHeader Header for the post-state root.
+     * @param _preStateRoot Pre-state root hash.
+     */
+    function _cancelStateTransition(
+        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
+        bytes32 _preStateRoot
+    )
+        internal
+    {
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+        iOVM_BondManager ovmBondManager = iOVM_BondManager(resolve("OVM_BondManager"));
+ 
+        // Delete the state batch.
+        ovmStateCommitmentChain.deleteStateBatch(
+            _postStateRootBatchHeader
+        );
+ 
+        // Get the timestamp and publisher for that block.
+        (uint256 timestamp, address publisher) = abi.decode(_postStateRootBatchHeader.extraData, (uint256, address));
+ 
+        // Slash the bonds at the bond manager.
+        ovmBondManager.finalize(
+            _preStateRoot,
+            publisher,
+            timestamp
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/verification/OVM_StateTransitioner.sol.html b/coverage/OVM/verification/OVM_StateTransitioner.sol.html new file mode 100644 index 000000000..e163ff151 --- /dev/null +++ b/coverage/OVM/verification/OVM_StateTransitioner.sol.html @@ -0,0 +1,1484 @@ + + + + Code coverage report for OVM/verification/OVM_StateTransitioner.sol + + + + + + + +
+
+

+ all files / OVM/verification/ OVM_StateTransitioner.sol +

+
+
+ 80% + Statements + 40/50 +
+
+ 62.5% + Branches + 20/32 +
+
+ 90.91% + Functions + 10/11 +
+
+ 80.39% + Lines + 41/51 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +42× +42× +  +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  + +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
+import { Lib_SecureMerkleTrie } from "../../libraries/trie/Lib_SecureMerkleTrie.sol";
+import { Lib_RLPWriter } from "../../libraries/rlp/Lib_RLPWriter.sol";
+import { Lib_RLPReader } from "../../libraries/rlp/Lib_RLPReader.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
+ 
+/* Contract Imports */
+import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
+ 
+/**
+ * @title OVM_StateTransitioner
+ * @dev The State Transitioner coordinates the execution of a state transition during the evaluation of a
+ * fraud proof. It feeds verified input to the Execution Manager's run(), and controls a State Manager (which is
+ * uniquely created for each fraud proof).
+ * Once a fraud proof has been initialized, this contract is provided with the pre-state root and verifies
+ * that the OVM storage slots committed to the State Mangager are contained in that state
+ * This contract controls the State Manager and Execution Manager, and uses them to calculate the
+ * post-state root by applying the transaction. The Fraud Verifier can then check for fraud by comparing
+ * the calculated post-state root with the proposed post-state root.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateTransitioner is Lib_AddressResolver, Abs_FraudContributor, iOVM_StateTransitioner {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum TransitionPhase {
+        PRE_EXECUTION,
+        POST_EXECUTION,
+        COMPLETE
+    }
+ 
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    iOVM_StateManager public ovmStateManager;
+ 
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    bytes32 internal preStateRoot;
+    bytes32 internal postStateRoot;
+    TransitionPhase public phase;
+    uint256 internal stateTransitionIndex;
+    bytes32 internal transactionHash;
+ 
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 internal constant EMPTY_ACCOUNT_CODE_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
+    bytes32 internal constant EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _stateTransitionIndex Index of the state transition being verified.
+     * @param _preStateRoot State root before the transition was executed.
+     * @param _transactionHash Hash of the executed transaction.
+     */
+    constructor(
+        address _libAddressManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        stateTransitionIndex = _stateTransitionIndex;
+        preStateRoot = _preStateRoot;
+        postStateRoot = _preStateRoot;
+        transactionHash = _transactionHash;
+ 
+        ovmStateManager = iOVM_StateManagerFactory(resolve("OVM_StateManagerFactory")).create(address(this));
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Checks that a function is only run during a specific phase.
+     * @param _phase Phase the function must run within.
+     */
+    modifier onlyDuringPhase(
+        TransitionPhase _phase
+    ) {
+        Erequire(
+            phase == _phase,
+            "Function must be called during the correct phase."
+        );
+        _;
+    }
+ 
+ 
+    /**********************************
+     * Public Functions: State Access *
+     **********************************/
+ 
+    /**
+     * Retrieves the state root before execution.
+     * @return _preStateRoot State root before execution.
+     */
+    function getPreStateRoot()
+        override
+        public
+        view
+        returns (
+            bytes32 _preStateRoot
+        )
+    {
+        return preStateRoot;
+    }
+ 
+    /**
+     * Retrieves the state root after execution.
+     * @return _postStateRoot State root after execution.
+     */
+    function getPostStateRoot()
+        override
+        public
+        view
+        returns (
+            bytes32 _postStateRoot
+        )
+    {
+        return postStateRoot;
+    }
+ 
+    /**
+     * Checks whether the transitioner is complete.
+     * @return _complete Whether or not the transition process is finished.
+     */
+    function isComplete()
+        override
+        public
+        view
+        returns (
+            bool _complete
+        )
+    {
+        return phase == TransitionPhase.COMPLETE;
+    }
+    
+ 
+    /***********************************
+     * Public Functions: Pre-Execution *
+     ***********************************/
+ 
+    /**
+     * Allows a user to prove the initial state of a contract.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _ethContractAddress Address of the corresponding contract on L1.
+     * @param _stateTrieWitness Proof of the account state.
+     */
+    function proveContractState(
+        address _ovmContractAddress,
+        address _ethContractAddress,
+        bytes memory _stateTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        // Exit quickly to avoid unnecessary work.
+        Erequire(
+            (
+                ovmStateManager.hasAccount(_ovmContractAddress) == false
+                && ovmStateManager.hasEmptyAccount(_ovmContractAddress) == false
+            ),
+            "Account state has already been proven."
+        );
+ 
+        // Function will fail if the proof is not a valid inclusion or exclusion proof.
+        (
+            bool exists,
+            bytes memory encodedAccount
+        ) = Lib_SecureMerkleTrie.get(
+            abi.encodePacked(_ovmContractAddress),
+            _stateTrieWitness,
+            preStateRoot
+        );
+ 
+        Eif (exists == true) {
+            // Account exists, this was an inclusion proof.
+            Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
+                encodedAccount
+            );
+ 
+            address ethContractAddress = _ethContractAddress;
+            Iif (account.codeHash == EMPTY_ACCOUNT_CODE_HASH) {
+                // Use a known empty contract to prevent an attack in which a user provides a
+                // contract address here and then later deploys code to it.
+                ethContractAddress = 0x0000000000000000000000000000000000000000;
+            } else {
+                // Otherwise, make sure that the code at the provided eth address matches the hash
+                // of the code stored on L2.
+                Erequire(
+                    Lib_EthUtils.getCodeHash(ethContractAddress) == account.codeHash,
+                    "OVM_StateTransitioner: Provided L1 contract code hash does not match L2 contract code hash."
+                );
+            }
+ 
+            ovmStateManager.putAccount(
+                _ovmContractAddress,
+                Lib_OVMCodec.Account({
+                    nonce: account.nonce,
+                    balance: account.balance,
+                    storageRoot: account.storageRoot,
+                    codeHash: account.codeHash,
+                    ethAddress: ethContractAddress,
+                    isFresh: false
+                })
+            );
+        } else {
+            // Account does not exist, this was an exclusion proof.
+            ovmStateManager.putEmptyAccount(_ovmContractAddress);
+        }
+    }
+ 
+    /**
+     * Allows a user to prove the initial state of a contract storage slot.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _key Claimed account slot key.
+     * @param _storageTrieWitness Proof of the storage slot.
+     */
+    function proveStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes memory _storageTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        // Exit quickly to avoid unnecessary work.
+        Erequire(
+            ovmStateManager.hasContractStorage(_ovmContractAddress, _key) == false,
+            "Storage slot has already been proven."
+        );
+ 
+        require(
+            ovmStateManager.hasAccount(_ovmContractAddress) == true,
+            "Contract must be verified before proving a storage slot."
+        );
+ 
+        bytes32 storageRoot = ovmStateManager.getAccountStorageRoot(_ovmContractAddress);
+        bytes32 value;
+ 
+        Iif (storageRoot == EMPTY_ACCOUNT_STORAGE_ROOT) {
+            // Storage trie was empty, so the user is always allowed to insert zero-byte values.
+            value = bytes32(0);
+        } else {
+            // Function will fail if the proof is not a valid inclusion or exclusion proof.
+            (
+                bool exists,
+                bytes memory encodedValue
+            ) = Lib_SecureMerkleTrie.get(
+                abi.encodePacked(_key),
+                _storageTrieWitness,
+                storageRoot
+            );
+ 
+            Eif (exists == true) {
+                // Inclusion proof.
+                // Stored values are RLP encoded, with leading zeros removed.
+                value = Lib_BytesUtils.toBytes32PadLeft(
+                    Lib_RLPReader.readBytes(encodedValue)
+                );
+            } else {
+                // Exclusion proof, can only be zero bytes.
+                value = bytes32(0);
+            }
+        }
+ 
+        ovmStateManager.putContractStorage(
+            _ovmContractAddress,
+            _key,
+            value
+        );
+    }
+ 
+ 
+    /*******************************
+     * Public Functions: Execution *
+     *******************************/
+ 
+    /**
+     * Executes the state transition.
+     * @param _transaction OVM transaction to execute.
+     */
+    function applyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        Irequire(
+            Lib_OVMCodec.hashTransaction(_transaction) == transactionHash,
+            "Invalid transaction provided."
+        );
+ 
+        // We require gas to complete the logic here in run() before/after execution,
+        // But must ensure the full _tx.gasLimit can be given to the ovmCALL (determinism)
+        // This includes 1/64 of the gas getting lost because of EIP-150 (lost twice--first 
+        // going into EM, then going into the code contract).
+        require(
+            gasleft() >= 100000 + _transaction.gasLimit * 1032 / 1000, // 1032/1000 = 1.032 = (64/63)^2 rounded up
+            "Not enough gas to execute transaction deterministically."
+        );
+ 
+        iOVM_ExecutionManager ovmExecutionManager = iOVM_ExecutionManager(resolve("OVM_ExecutionManager"));
+ 
+        // We call `setExecutionManager` right before `run` (and not earlier) just in case the
+        // OVM_ExecutionManager address was updated between the time when this contract was created
+        // and when `applyTransaction` was called.
+        ovmStateManager.setExecutionManager(address(ovmExecutionManager));
+ 
+        // `run` always succeeds *unless* the user hasn't provided enough gas to `applyTransaction`
+        // or an INVALID_STATE_ACCESS flag was triggered. Either way, we won't get beyond this line
+        // if that's the case.
+        ovmExecutionManager.run(_transaction, address(ovmStateManager));
+ 
+        phase = TransitionPhase.POST_EXECUTION;
+    }
+ 
+ 
+    /************************************
+     * Public Functions: Post-Execution *
+     ************************************/
+ 
+    /**
+     * Allows a user to commit the final state of a contract.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _stateTrieWitness Proof of the account state.
+     */
+    function commitContractState(
+        address _ovmContractAddress,
+        bytes memory _stateTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        Erequire(
+            ovmStateManager.getTotalUncommittedContractStorage() == 0,
+            "All storage must be committed before committing account states."
+        );
+ 
+        require (
+            ovmStateManager.commitAccount(_ovmContractAddress) == true,
+            "Account state wasn't changed or has already been committed."
+        );
+ 
+        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
+ 
+        postStateRoot = Lib_SecureMerkleTrie.update(
+            abi.encodePacked(_ovmContractAddress),
+            Lib_OVMCodec.encodeEVMAccount(
+                Lib_OVMCodec.toEVMAccount(account)
+            ),
+            _stateTrieWitness,
+            postStateRoot
+        );
+ 
+        // Emit an event to help clients figure out the proof ordering.
+        emit AccountCommitted(
+            _ovmContractAddress
+        );
+    }
+ 
+    /**
+     * Allows a user to commit the final state of a contract storage slot.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _key Claimed account slot key.
+     * @param _storageTrieWitness Proof of the storage slot.
+     */
+    function commitStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes memory _storageTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        require(
+            ovmStateManager.commitContractStorage(_ovmContractAddress, _key) == true,
+            "Storage slot value wasn't changed or has already been committed."
+        );
+ 
+        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
+        bytes32 value = ovmStateManager.getContractStorage(_ovmContractAddress, _key);
+ 
+        account.storageRoot = Lib_SecureMerkleTrie.update(
+            abi.encodePacked(_key),
+            Lib_RLPWriter.writeBytes(
+                Lib_Bytes32Utils.removeLeadingZeros(value)
+            ),
+            _storageTrieWitness,
+            account.storageRoot
+        );
+ 
+        ovmStateManager.putAccount(_ovmContractAddress, account);
+ 
+        // Emit an event to help clients figure out the proof ordering.
+        emit ContractStorageCommitted(
+            _ovmContractAddress,
+            _key
+        );
+    }
+ 
+ 
+    /**********************************
+     * Public Functions: Finalization *
+     **********************************/
+ 
+    /**
+     * Finalizes the transition process.
+     */
+    function completeTransition()
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+    {
+        require(
+            ovmStateManager.getTotalUncommittedAccounts() == 0,
+            "All accounts must be committed before completing a transition."
+        );
+ 
+        require(
+            ovmStateManager.getTotalUncommittedContractStorage() == 0,
+            "All storage must be committed before completing a transition."
+        );
+ 
+        phase = TransitionPhase.COMPLETE;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/verification/OVM_StateTransitionerFactory.sol.html b/coverage/OVM/verification/OVM_StateTransitionerFactory.sol.html new file mode 100644 index 000000000..d817cc23b --- /dev/null +++ b/coverage/OVM/verification/OVM_StateTransitionerFactory.sol.html @@ -0,0 +1,266 @@ + + + + Code coverage report for OVM/verification/OVM_StateTransitionerFactory.sol + + + + + + + +
+
+

+ all files / OVM/verification/ OVM_StateTransitionerFactory.sol +

+
+
+ 50% + Statements + 1/2 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 2/2 +
+
+ 50% + Lines + 1/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+ 
+/* Contract Imports */
+import { OVM_StateTransitioner } from "./OVM_StateTransitioner.sol";
+ 
+/**
+ * @title OVM_StateTransitionerFactory
+ * @dev The State Transitioner Factory is used by the Fraud Verifier to create a new State 
+ * Transitioner during the initialization of a fraud proof.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateTransitionerFactory is iOVM_StateTransitionerFactory, Lib_AddressResolver {
+ 
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    /**
+     * Creates a new OVM_StateTransitioner
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _stateTransitionIndex Index of the state transition being verified.
+     * @param _preStateRoot State root before the transition was executed.
+     * @param _transactionHash Hash of the executed transaction.
+     * @return _ovmStateTransitioner New OVM_StateTransitioner instance.
+     */
+    function create(
+        address _libAddressManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        override
+        public
+        returns (
+            iOVM_StateTransitioner _ovmStateTransitioner
+        )
+    {
+        Irequire(
+            msg.sender == resolve("OVM_FraudVerifier"),
+            "Create can only be done by the OVM_FraudVerifier."
+        );
+        return new OVM_StateTransitioner(
+            _libAddressManager,
+            _stateTransitionIndex,
+            _preStateRoot,
+            _transactionHash
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/OVM/verification/index.html b/coverage/OVM/verification/index.html new file mode 100644 index 000000000..ddf93ed3b --- /dev/null +++ b/coverage/OVM/verification/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for OVM/verification/ + + + + + + + +
+
+

+ all files OVM/verification/ +

+
+
+ 90.4% + Statements + 113/125 +
+
+ 78.05% + Branches + 64/82 +
+
+ 96.67% + Functions + 29/30 +
+
+ 90.48% + Lines + 114/126 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_FraudContributor.sol
100%3/3100%0/0100%1/1100%4/4
OVM_BondManager.sol
100%42/4286.67%26/30100%9/9100%41/41
OVM_FraudVerifier.sol
96.43%27/2894.44%17/18100%7/796.43%27/28
OVM_StateTransitioner.sol
80%40/5062.5%20/3290.91%10/1180.39%41/51
OVM_StateTransitionerFactory.sol
50%1/250%1/2100%2/250%1/2
+
+
+ + + + + + + diff --git a/coverage/base.css b/coverage/base.css new file mode 100644 index 000000000..29737bcb0 --- /dev/null +++ b/coverage/base.css @@ -0,0 +1,213 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.medium .chart { border:1px solid #f9cd0b; } +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } +/* light gray */ +span.cline-neutral { background: #eaeaea; } + +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json new file mode 100644 index 000000000..2a84143c0 --- /dev/null +++ b/coverage/coverage-final.json @@ -0,0 +1,78 @@ +{ +"contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol":{"l":{"23":78,"37":9,"42":6,"47":3,"65":22,"79":7},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol","s":{"1":78,"2":9,"3":6,"4":22,"5":7},"b":{"1":[6,3],"2":[3,3]},"f":{"1":78,"2":9,"3":22,"4":7},"fnMap":{"1":{"name":"constructor","line":20,"loc":{"start":{"line":20,"column":4},"end":{"line":24,"column":4}}},"2":{"name":"onlyFromCrossDomainAccount","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"getCrossDomainMessenger","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":66,"column":4}}},"4":{"name":"sendCrossDomainMessage","line":74,"loc":{"start":{"line":74,"column":4},"end":{"line":80,"column":4}}}},"statementMap":{"1":{"start":{"line":23,"column":8},"end":{"line":23,"column":29}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1159}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":1311}},"4":{"start":{"line":65,"column":8},"end":{"line":65,"column":55}},"5":{"start":{"line":79,"column":8},"end":{"line":79,"column":82}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":8}},{"start":{"line":42,"column":8},"end":{"line":42,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol":{"l":{"119":7,"120":1,"131":1,"141":6,"143":6,"168":5,"195":5,"196":2,"205":3,"207":3,"208":3,"209":3,"210":3,"211":1,"213":2,"215":3,"216":3,"217":3,"218":3,"219":3,"221":3,"239":25,"264":25,"281":1,"303":1,"308":1,"313":1,"318":1,"319":1,"321":1,"338":6,"340":6,"362":107},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol","s":{"1":7,"2":1,"3":1,"4":6,"5":6,"6":5,"7":5,"8":2,"9":3,"10":3,"11":3,"12":3,"13":3,"14":1,"15":2,"16":3,"17":3,"18":3,"19":3,"20":3,"21":3,"22":25,"23":25,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":6,"32":6,"33":107},"b":{"1":[1,6],"2":[2,3],"3":[1,2]},"f":{"1":7,"2":5,"3":5,"4":25,"5":25,"6":1,"7":1,"8":6,"9":107},"fnMap":{"1":{"name":"decodeEIP155Transaction","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":153,"column":4}}},"2":{"name":"decompressEIP155Transaction","line":160,"loc":{"start":{"line":160,"column":4},"end":{"line":177,"column":4}}},"3":{"name":"encodeEIP155Transaction","line":185,"loc":{"start":{"line":185,"column":4},"end":{"line":223,"column":4}}},"4":{"name":"encodeTransaction","line":230,"loc":{"start":{"line":230,"column":4},"end":{"line":248,"column":4}}},"5":{"name":"hashTransaction","line":255,"loc":{"start":{"line":255,"column":4},"end":{"line":265,"column":4}}},"6":{"name":"toEVMAccount","line":272,"loc":{"start":{"line":272,"column":4},"end":{"line":287,"column":4}}},"7":{"name":"encodeEVMAccount","line":294,"loc":{"start":{"line":294,"column":4},"end":{"line":322,"column":4}}},"8":{"name":"decodeEVMAccount","line":329,"loc":{"start":{"line":329,"column":4},"end":{"line":346,"column":4}}},"9":{"name":"hashBatchHeader","line":353,"loc":{"start":{"line":353,"column":4},"end":{"line":370,"column":4}}}},"statementMap":{"1":{"start":{"line":119,"column":8},"end":{"line":119,"column":2703}},"2":{"start":{"line":120,"column":12},"end":{"line":120,"column":2747}},"3":{"start":{"line":131,"column":12},"end":{"line":131,"column":3104}},"4":{"start":{"line":141,"column":12},"end":{"line":141,"column":89}},"5":{"start":{"line":143,"column":12},"end":{"line":143,"column":3487}},"6":{"start":{"line":168,"column":8},"end":{"line":168,"column":4339}},"7":{"start":{"line":195,"column":8},"end":{"line":195,"column":5277}},"8":{"start":{"line":196,"column":12},"end":{"line":196,"column":5321}},"9":{"start":{"line":205,"column":12},"end":{"line":205,"column":47}},"10":{"start":{"line":207,"column":12},"end":{"line":207,"column":63}},"11":{"start":{"line":208,"column":12},"end":{"line":208,"column":66}},"12":{"start":{"line":209,"column":12},"end":{"line":209,"column":66}},"13":{"start":{"line":210,"column":12},"end":{"line":210,"column":5856}},"14":{"start":{"line":211,"column":16},"end":{"line":211,"column":52}},"15":{"start":{"line":213,"column":16},"end":{"line":213,"column":67}},"16":{"start":{"line":215,"column":12},"end":{"line":215,"column":46}},"17":{"start":{"line":216,"column":12},"end":{"line":216,"column":63}},"18":{"start":{"line":217,"column":12},"end":{"line":217,"column":65}},"19":{"start":{"line":218,"column":12},"end":{"line":218,"column":55}},"20":{"start":{"line":219,"column":12},"end":{"line":219,"column":55}},"21":{"start":{"line":221,"column":12},"end":{"line":221,"column":47}},"22":{"start":{"line":239,"column":8},"end":{"line":239,"column":6746}},"23":{"start":{"line":264,"column":8},"end":{"line":264,"column":57}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":7723}},"25":{"start":{"line":303,"column":8},"end":{"line":303,"column":43}},"26":{"start":{"line":308,"column":8},"end":{"line":308,"column":8466}},"27":{"start":{"line":313,"column":8},"end":{"line":313,"column":8623}},"28":{"start":{"line":318,"column":8},"end":{"line":318,"column":80}},"29":{"start":{"line":319,"column":8},"end":{"line":319,"column":77}},"30":{"start":{"line":321,"column":8},"end":{"line":321,"column":43}},"31":{"start":{"line":338,"column":8},"end":{"line":338,"column":86}},"32":{"start":{"line":340,"column":8},"end":{"line":340,"column":9427}},"33":{"start":{"line":362,"column":8},"end":{"line":362,"column":10058}}},"branchMap":{"1":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":8},"end":{"line":119,"column":8}},{"start":{"line":119,"column":8},"end":{"line":119,"column":8}}]},"2":{"line":195,"type":"if","locations":[{"start":{"line":195,"column":8},"end":{"line":195,"column":8}},{"start":{"line":195,"column":8},"end":{"line":195,"column":8}}]},"3":{"line":210,"type":"if","locations":[{"start":{"line":210,"column":12},"end":{"line":210,"column":12}},{"start":{"line":210,"column":12},"end":{"line":210,"column":12}}]}}}, +"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol":{"l":{"39":379,"40":379,"50":2107,"67":2486},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol","s":{"1":379,"2":379,"3":2107,"4":2486},"b":{},"f":{"1":379,"2":2107,"3":2486},"fnMap":{"1":{"name":"setAddress","line":37,"loc":{"start":{"line":32,"column":4},"end":{"line":41,"column":4}}},"2":{"name":"getAddress","line":43,"loc":{"start":{"line":43,"column":4},"end":{"line":51,"column":4}}},"3":{"name":"_getNameHash","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":68,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":40}},"2":{"start":{"line":40,"column":8},"end":{"line":40,"column":48}},"3":{"start":{"line":50,"column":8},"end":{"line":50,"column":45}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":49}}},"branchMap":{}}, +"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol":{"l":{"29":1041,"46":2076},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol","s":{"1":1041,"2":2076},"b":{},"f":{"1":1041,"2":2076},"fnMap":{"1":{"name":"constructor","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":30,"column":4}}},"2":{"name":"resolve","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":47,"column":4}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":65}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":50}}},"branchMap":{}}, +"contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol":{"l":{"32":120,"33":120,"42":379,"46":379,"59":0,"60":0,"68":0,"73":0,"74":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol","s":{"1":120,"2":120,"3":379,"4":0,"5":0,"6":0,"7":0,"8":0},"b":{"1":[379,0],"2":[0,0]},"f":{"1":120,"2":379,"3":0,"4":0},"fnMap":{"1":{"name":"constructor","line":31,"loc":{"start":{"line":31,"column":4},"end":{"line":34,"column":4}}},"2":{"name":"onlyOwner","line":41,"loc":{"start":{"line":41,"column":4},"end":{"line":47,"column":4}}},"3":{"name":"renounceOwnership","line":57,"loc":{"start":{"line":54,"column":4},"end":{"line":61,"column":4}}},"4":{"name":"transferOwnership","line":66,"loc":{"start":{"line":63,"column":4},"end":{"line":75,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":25}},"2":{"start":{"line":33,"column":8},"end":{"line":33,"column":52}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":791}},"4":{"start":{"line":59,"column":8},"end":{"line":59,"column":52}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":25}},"6":{"start":{"line":68,"column":8},"end":{"line":68,"column":1280}},"7":{"start":{"line":73,"column":8},"end":{"line":73,"column":51}},"8":{"start":{"line":74,"column":8},"end":{"line":74,"column":24}}},"branchMap":{"1":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":8}},{"start":{"line":42,"column":8},"end":{"line":42,"column":8}}]},"2":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":8},"end":{"line":68,"column":8}},{"start":{"line":68,"column":8},"end":{"line":68,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol":{"l":{"42":36,"43":36,"54":31,"55":31,"60":31,"62":31,"63":22,"67":9},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol","s":{"1":36,"2":36,"3":31,"4":31,"5":31,"6":31},"b":{"1":[31,0],"2":[22,9]},"f":{"1":36,"2":31},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":4}}},"2":{"name":null,"line":51,"loc":{"start":{"line":51,"column":4},"end":{"line":71,"column":4}}}},"statementMap":{"1":{"start":{"line":42,"column":8},"end":{"line":42,"column":77}},"2":{"start":{"line":43,"column":8},"end":{"line":43,"column":62}},"3":{"start":{"line":54,"column":8},"end":{"line":54,"column":102}},"4":{"start":{"line":55,"column":8},"end":{"line":55,"column":1765}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":79}},"6":{"start":{"line":62,"column":8},"end":{"line":62,"column":1960}}},"branchMap":{"1":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":8},"end":{"line":55,"column":8}},{"start":{"line":55,"column":8},"end":{"line":55,"column":8}}]},"2":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol":{"l":{"55":512,"56":512,"60":512,"80":450,"86":446,"95":446,"97":446,"98":446,"99":446,"100":4230,"105":4230,"113":4230,"118":4230,"119":4230,"123":446,"127":446,"144":450,"163":651,"169":651,"174":651,"191":4,"210":5,"227":5,"246":68,"251":68,"257":68,"262":68,"263":68,"264":68,"273":68,"290":0,"309":56,"326":8,"345":2,"350":2,"351":2,"352":2,"356":2,"373":2,"392":7,"393":1,"396":6,"401":6,"418":1,"437":776,"463":5399,"468":5395,"469":5395,"470":5395,"474":5395,"477":33,"481":4334,"483":4334,"488":4334,"491":536,"493":536,"498":536,"499":536,"507":536,"512":536,"515":89,"517":89,"522":89,"525":403,"527":403,"532":403,"533":403,"541":403,"546":403,"568":1427,"569":1427,"570":1,"573":1426,"574":1426,"575":1426,"580":1426,"581":2634,"585":2634,"586":2634,"590":1426,"591":1426,"601":1426,"618":776},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol","s":{"1":512,"2":512,"3":450,"4":446,"5":446,"6":446,"7":446,"8":446,"9":4230,"10":4230,"11":4230,"12":4230,"13":4230,"14":446,"15":450,"16":651,"17":651,"18":651,"19":4,"20":5,"21":5,"22":68,"23":68,"24":68,"25":68,"26":68,"27":68,"28":0,"29":56,"30":8,"31":2,"32":2,"33":2,"34":2,"35":2,"36":7,"37":1,"38":6,"39":6,"40":1,"41":776,"42":5399,"43":5395,"44":5395,"45":5395,"46":33,"47":5362,"48":4334,"49":4334,"50":4334,"51":1028,"52":536,"53":536,"54":536,"55":536,"56":536,"57":492,"58":89,"59":89,"60":89,"61":403,"62":403,"63":403,"64":403,"65":403,"66":1427,"67":1427,"68":1,"69":1426,"70":1426,"71":1426,"72":2634,"73":2634,"74":1426,"75":1426,"76":776},"b":{"1":[446,0],"2":[4230,0],"3":[651,0],"4":[68,0],"5":[68,0],"6":[2,0],"7":[1,6],"8":[6,0],"9":[5395,4],"10":[33,5362],"11":[4334,1028],"12":[4334,0],"13":[536,492],"14":[536,0],"15":[536,0],"16":[89,403],"17":[89,0],"18":[403,0],"19":[403,0],"20":[1,1426]},"f":{"1":512,"2":450,"3":450,"4":651,"5":4,"6":5,"7":5,"8":68,"9":0,"10":56,"11":8,"12":2,"13":2,"14":7,"15":1,"16":776,"17":5399,"18":1427,"19":776},"fnMap":{"1":{"name":"toRLPItem","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":64,"column":4}}},"2":{"name":"readList","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":128,"column":4}}},"3":{"name":"readList","line":135,"loc":{"start":{"line":135,"column":4},"end":{"line":147,"column":4}}},"4":{"name":"readBytes","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":175,"column":4}}},"5":{"name":"readBytes","line":182,"loc":{"start":{"line":182,"column":4},"end":{"line":194,"column":4}}},"6":{"name":"readString","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":211,"column":4}}},"7":{"name":"readString","line":218,"loc":{"start":{"line":218,"column":4},"end":{"line":230,"column":4}}},"8":{"name":"readBytes32","line":237,"loc":{"start":{"line":237,"column":4},"end":{"line":274,"column":4}}},"9":{"name":"readBytes32","line":281,"loc":{"start":{"line":281,"column":4},"end":{"line":293,"column":4}}},"10":{"name":"readUint256","line":300,"loc":{"start":{"line":300,"column":4},"end":{"line":310,"column":4}}},"11":{"name":"readUint256","line":317,"loc":{"start":{"line":317,"column":4},"end":{"line":329,"column":4}}},"12":{"name":"readBool","line":336,"loc":{"start":{"line":336,"column":4},"end":{"line":357,"column":4}}},"13":{"name":"readBool","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":376,"column":4}}},"14":{"name":"readAddress","line":383,"loc":{"start":{"line":383,"column":4},"end":{"line":402,"column":4}}},"15":{"name":"readAddress","line":409,"loc":{"start":{"line":409,"column":4},"end":{"line":421,"column":4}}},"16":{"name":"readRawBytes","line":428,"loc":{"start":{"line":428,"column":4},"end":{"line":438,"column":4}}},"17":{"name":"_decodeLength","line":452,"loc":{"start":{"line":452,"column":4},"end":{"line":548,"column":4}}},"18":{"name":"_copy","line":557,"loc":{"start":{"line":557,"column":4},"end":{"line":602,"column":4}}},"19":{"name":"_copy","line":609,"loc":{"start":{"line":609,"column":4},"end":{"line":619,"column":4}}}},"statementMap":{"1":{"start":{"line":55,"column":8},"end":{"line":55,"column":19}},"2":{"start":{"line":60,"column":8},"end":{"line":60,"column":1063}},"3":{"start":{"line":80,"column":8},"end":{"line":80,"column":1475}},"4":{"start":{"line":86,"column":8},"end":{"line":86,"column":1575}},"5":{"start":{"line":95,"column":8},"end":{"line":95,"column":61}},"6":{"start":{"line":97,"column":8},"end":{"line":97,"column":29}},"7":{"start":{"line":98,"column":8},"end":{"line":98,"column":35}},"8":{"start":{"line":99,"column":8},"end":{"line":99,"column":2213}},"9":{"start":{"line":100,"column":12},"end":{"line":100,"column":2259}},"10":{"start":{"line":105,"column":12},"end":{"line":105,"column":2405}},"11":{"start":{"line":113,"column":12},"end":{"line":113,"column":2630}},"12":{"start":{"line":118,"column":12},"end":{"line":118,"column":25}},"13":{"start":{"line":119,"column":12},"end":{"line":119,"column":44}},"14":{"start":{"line":127,"column":8},"end":{"line":127,"column":18}},"15":{"start":{"line":144,"column":8},"end":{"line":144,"column":3303}},"16":{"start":{"line":163,"column":8},"end":{"line":163,"column":3665}},"17":{"start":{"line":169,"column":8},"end":{"line":169,"column":3783}},"18":{"start":{"line":174,"column":8},"end":{"line":174,"column":53}},"19":{"start":{"line":191,"column":8},"end":{"line":191,"column":4230}},"20":{"start":{"line":210,"column":8},"end":{"line":210,"column":37}},"21":{"start":{"line":227,"column":8},"end":{"line":227,"column":4903}},"22":{"start":{"line":246,"column":8},"end":{"line":246,"column":5252}},"23":{"start":{"line":251,"column":8},"end":{"line":251,"column":5374}},"24":{"start":{"line":257,"column":8},"end":{"line":257,"column":5492}},"25":{"start":{"line":262,"column":8},"end":{"line":262,"column":42}},"26":{"start":{"line":263,"column":8},"end":{"line":263,"column":19}},"27":{"start":{"line":273,"column":8},"end":{"line":273,"column":18}},"28":{"start":{"line":290,"column":8},"end":{"line":290,"column":6212}},"29":{"start":{"line":309,"column":8},"end":{"line":309,"column":40}},"30":{"start":{"line":326,"column":8},"end":{"line":326,"column":6888}},"31":{"start":{"line":345,"column":8},"end":{"line":345,"column":7220}},"32":{"start":{"line":350,"column":8},"end":{"line":350,"column":29}},"33":{"start":{"line":351,"column":8},"end":{"line":351,"column":19}},"34":{"start":{"line":356,"column":8},"end":{"line":356,"column":23}},"35":{"start":{"line":373,"column":8},"end":{"line":373,"column":7731}},"36":{"start":{"line":392,"column":8},"end":{"line":392,"column":8078}},"37":{"start":{"line":393,"column":12},"end":{"line":393,"column":29}},"38":{"start":{"line":396,"column":8},"end":{"line":396,"column":8151}},"39":{"start":{"line":401,"column":8},"end":{"line":401,"column":40}},"40":{"start":{"line":418,"column":8},"end":{"line":418,"column":8577}},"41":{"start":{"line":437,"column":8},"end":{"line":437,"column":25}},"42":{"start":{"line":463,"column":8},"end":{"line":463,"column":9468}},"43":{"start":{"line":468,"column":8},"end":{"line":468,"column":29}},"44":{"start":{"line":469,"column":8},"end":{"line":469,"column":22}},"45":{"start":{"line":474,"column":8},"end":{"line":474,"column":9691}},"46":{"start":{"line":477,"column":12},"end":{"line":477,"column":48}},"47":{"start":{"line":478,"column":15},"end":{"line":478,"column":9807}},"48":{"start":{"line":481,"column":12},"end":{"line":481,"column":42}},"49":{"start":{"line":483,"column":12},"end":{"line":483,"column":9932}},"50":{"start":{"line":488,"column":12},"end":{"line":488,"column":53}},"51":{"start":{"line":489,"column":15},"end":{"line":489,"column":10104}},"52":{"start":{"line":491,"column":12},"end":{"line":491,"column":47}},"53":{"start":{"line":493,"column":12},"end":{"line":493,"column":10220}},"54":{"start":{"line":498,"column":12},"end":{"line":498,"column":26}},"55":{"start":{"line":507,"column":12},"end":{"line":507,"column":10602}},"56":{"start":{"line":512,"column":12},"end":{"line":512,"column":67}},"57":{"start":{"line":513,"column":15},"end":{"line":513,"column":10801}},"58":{"start":{"line":515,"column":12},"end":{"line":515,"column":43}},"59":{"start":{"line":517,"column":12},"end":{"line":517,"column":10912}},"60":{"start":{"line":522,"column":12},"end":{"line":522,"column":54}},"61":{"start":{"line":525,"column":12},"end":{"line":525,"column":48}},"62":{"start":{"line":527,"column":12},"end":{"line":527,"column":11179}},"63":{"start":{"line":532,"column":12},"end":{"line":532,"column":27}},"64":{"start":{"line":541,"column":12},"end":{"line":541,"column":11561}},"65":{"start":{"line":546,"column":12},"end":{"line":546,"column":69}},"66":{"start":{"line":568,"column":8},"end":{"line":568,"column":45}},"67":{"start":{"line":569,"column":8},"end":{"line":569,"column":12253}},"68":{"start":{"line":570,"column":12},"end":{"line":570,"column":22}},"69":{"start":{"line":573,"column":8},"end":{"line":573,"column":36}},"70":{"start":{"line":574,"column":8},"end":{"line":574,"column":20}},"71":{"start":{"line":580,"column":8},"end":{"line":580,"column":12497}},"72":{"start":{"line":585,"column":12},"end":{"line":585,"column":20}},"73":{"start":{"line":586,"column":12},"end":{"line":586,"column":21}},"74":{"start":{"line":590,"column":8},"end":{"line":590,"column":55}},"75":{"start":{"line":601,"column":8},"end":{"line":601,"column":18}},"76":{"start":{"line":618,"column":8},"end":{"line":618,"column":44}}},"branchMap":{"1":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"2":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":12},"end":{"line":100,"column":12}},{"start":{"line":100,"column":12},"end":{"line":100,"column":12}}]},"3":{"line":169,"type":"if","locations":[{"start":{"line":169,"column":8},"end":{"line":169,"column":8}},{"start":{"line":169,"column":8},"end":{"line":169,"column":8}}]},"4":{"line":246,"type":"if","locations":[{"start":{"line":246,"column":8},"end":{"line":246,"column":8}},{"start":{"line":246,"column":8},"end":{"line":246,"column":8}}]},"5":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":8},"end":{"line":257,"column":8}},{"start":{"line":257,"column":8},"end":{"line":257,"column":8}}]},"6":{"line":345,"type":"if","locations":[{"start":{"line":345,"column":8},"end":{"line":345,"column":8}},{"start":{"line":345,"column":8},"end":{"line":345,"column":8}}]},"7":{"line":392,"type":"if","locations":[{"start":{"line":392,"column":8},"end":{"line":392,"column":8}},{"start":{"line":392,"column":8},"end":{"line":392,"column":8}}]},"8":{"line":396,"type":"if","locations":[{"start":{"line":396,"column":8},"end":{"line":396,"column":8}},{"start":{"line":396,"column":8},"end":{"line":396,"column":8}}]},"9":{"line":463,"type":"if","locations":[{"start":{"line":463,"column":8},"end":{"line":463,"column":8}},{"start":{"line":463,"column":8},"end":{"line":463,"column":8}}]},"10":{"line":474,"type":"if","locations":[{"start":{"line":474,"column":8},"end":{"line":474,"column":8}},{"start":{"line":474,"column":8},"end":{"line":474,"column":8}}]},"11":{"line":478,"type":"if","locations":[{"start":{"line":478,"column":15},"end":{"line":478,"column":15}},{"start":{"line":478,"column":15},"end":{"line":478,"column":15}}]},"12":{"line":483,"type":"if","locations":[{"start":{"line":483,"column":12},"end":{"line":483,"column":12}},{"start":{"line":483,"column":12},"end":{"line":483,"column":12}}]},"13":{"line":489,"type":"if","locations":[{"start":{"line":489,"column":15},"end":{"line":489,"column":15}},{"start":{"line":489,"column":15},"end":{"line":489,"column":15}}]},"14":{"line":493,"type":"if","locations":[{"start":{"line":493,"column":12},"end":{"line":493,"column":12}},{"start":{"line":493,"column":12},"end":{"line":493,"column":12}}]},"15":{"line":507,"type":"if","locations":[{"start":{"line":507,"column":12},"end":{"line":507,"column":12}},{"start":{"line":507,"column":12},"end":{"line":507,"column":12}}]},"16":{"line":513,"type":"if","locations":[{"start":{"line":513,"column":15},"end":{"line":513,"column":15}},{"start":{"line":513,"column":15},"end":{"line":513,"column":15}}]},"17":{"line":517,"type":"if","locations":[{"start":{"line":517,"column":12},"end":{"line":517,"column":12}},{"start":{"line":517,"column":12},"end":{"line":517,"column":12}}]},"18":{"line":527,"type":"if","locations":[{"start":{"line":527,"column":12},"end":{"line":527,"column":12}},{"start":{"line":527,"column":12},"end":{"line":527,"column":12}}]},"19":{"line":541,"type":"if","locations":[{"start":{"line":541,"column":12},"end":{"line":541,"column":12}},{"start":{"line":541,"column":12},"end":{"line":541,"column":12}}]},"20":{"line":569,"type":"if","locations":[{"start":{"line":569,"column":8},"end":{"line":569,"column":8}},{"start":{"line":569,"column":8},"end":{"line":569,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol":{"l":{"32":324,"34":324,"35":16,"37":308,"40":324,"57":157,"58":157,"75":139,"92":30,"109":52,"126":0,"127":0,"128":0,"152":465,"154":465,"155":415,"156":415,"158":50,"159":50,"160":50,"161":72,"162":72,"165":50,"166":50,"167":50,"168":72,"172":465,"190":52,"192":52,"193":52,"194":1643,"195":24,"199":52,"200":52,"201":45,"204":52,"222":1030,"223":1030,"224":1030,"226":1030,"227":420,"230":420,"231":420,"234":1030,"235":1030,"257":157,"258":8,"261":149,"262":149,"263":149,"264":1030,"267":149,"268":149,"269":149,"271":149,"272":1030,"274":1030,"275":1030,"277":1030,"278":1030,"281":149},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol","s":{"1":324,"2":324,"3":16,"4":308,"5":324,"6":157,"7":157,"8":139,"9":30,"10":52,"11":0,"12":0,"13":0,"14":465,"15":465,"16":415,"17":415,"18":50,"19":50,"20":50,"21":72,"22":50,"23":50,"24":50,"25":72,"26":465,"27":52,"28":52,"29":52,"30":1643,"31":52,"32":52,"33":45,"34":52,"35":1030,"36":1030,"37":1030,"38":1030,"39":420,"40":420,"41":1030,"42":157,"43":8,"44":149,"45":149,"46":149,"47":1030,"48":149,"49":149,"50":149,"51":1030,"52":1030,"53":1030,"54":1030,"55":149},"b":{"1":[16,308],"2":[415,50],"3":[24,1619],"4":[8,149]},"f":{"1":324,"2":157,"3":139,"4":30,"5":52,"6":0,"7":465,"8":52,"9":1030,"10":157},"fnMap":{"1":{"name":"writeBytes","line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":41,"column":4}}},"2":{"name":"writeList","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":59,"column":4}}},"3":{"name":"writeString","line":66,"loc":{"start":{"line":66,"column":4},"end":{"line":76,"column":4}}},"4":{"name":"writeAddress","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":93,"column":4}}},"5":{"name":"writeUint","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":110,"column":4}}},"6":{"name":"writeBool","line":117,"loc":{"start":{"line":117,"column":4},"end":{"line":129,"column":4}}},"7":{"name":"_writeLength","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":173,"column":4}}},"8":{"name":"_toBinary","line":181,"loc":{"start":{"line":181,"column":4},"end":{"line":205,"column":4}}},"9":{"name":"_memcpy","line":214,"loc":{"start":{"line":214,"column":4},"end":{"line":240,"column":4}}},"10":{"name":"_flatten","line":248,"loc":{"start":{"line":248,"column":4},"end":{"line":282,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":28}},"2":{"start":{"line":34,"column":8},"end":{"line":34,"column":711}},"3":{"start":{"line":35,"column":12},"end":{"line":35,"column":24}},"4":{"start":{"line":37,"column":12},"end":{"line":37,"column":73}},"5":{"start":{"line":40,"column":8},"end":{"line":40,"column":22}},"6":{"start":{"line":57,"column":8},"end":{"line":57,"column":41}},"7":{"start":{"line":58,"column":8},"end":{"line":58,"column":69}},"8":{"start":{"line":75,"column":8},"end":{"line":75,"column":37}},"9":{"start":{"line":92,"column":8},"end":{"line":92,"column":48}},"10":{"start":{"line":109,"column":8},"end":{"line":109,"column":41}},"11":{"start":{"line":126,"column":8},"end":{"line":126,"column":43}},"12":{"start":{"line":127,"column":8},"end":{"line":127,"column":55}},"13":{"start":{"line":128,"column":8},"end":{"line":128,"column":22}},"14":{"start":{"line":152,"column":8},"end":{"line":152,"column":28}},"15":{"start":{"line":154,"column":8},"end":{"line":154,"column":3384}},"16":{"start":{"line":155,"column":12},"end":{"line":155,"column":33}},"17":{"start":{"line":156,"column":12},"end":{"line":156,"column":58}},"18":{"start":{"line":158,"column":12},"end":{"line":158,"column":26}},"19":{"start":{"line":159,"column":12},"end":{"line":159,"column":25}},"20":{"start":{"line":160,"column":12},"end":{"line":160,"column":3586}},"21":{"start":{"line":162,"column":16},"end":{"line":162,"column":23}},"22":{"start":{"line":165,"column":12},"end":{"line":165,"column":42}},"23":{"start":{"line":166,"column":12},"end":{"line":166,"column":65}},"24":{"start":{"line":167,"column":12},"end":{"line":167,"column":3802}},"25":{"start":{"line":168,"column":16},"end":{"line":168,"column":73}},"26":{"start":{"line":172,"column":8},"end":{"line":172,"column":22}},"27":{"start":{"line":190,"column":8},"end":{"line":190,"column":45}},"28":{"start":{"line":192,"column":8},"end":{"line":192,"column":21}},"29":{"start":{"line":193,"column":8},"end":{"line":193,"column":4434}},"30":{"start":{"line":194,"column":12},"end":{"line":194,"column":4472}},"31":{"start":{"line":199,"column":8},"end":{"line":199,"column":44}},"32":{"start":{"line":200,"column":8},"end":{"line":200,"column":4587}},"33":{"start":{"line":201,"column":12},"end":{"line":201,"column":26}},"34":{"start":{"line":204,"column":8},"end":{"line":204,"column":18}},"35":{"start":{"line":222,"column":8},"end":{"line":222,"column":28}},"36":{"start":{"line":223,"column":8},"end":{"line":223,"column":26}},"37":{"start":{"line":224,"column":8},"end":{"line":224,"column":26}},"38":{"start":{"line":226,"column":8},"end":{"line":226,"column":5212}},"39":{"start":{"line":230,"column":12},"end":{"line":230,"column":21}},"40":{"start":{"line":231,"column":12},"end":{"line":231,"column":20}},"41":{"start":{"line":234,"column":8},"end":{"line":234,"column":44}},"42":{"start":{"line":257,"column":8},"end":{"line":257,"column":6057}},"43":{"start":{"line":258,"column":12},"end":{"line":258,"column":31}},"44":{"start":{"line":261,"column":8},"end":{"line":261,"column":19}},"45":{"start":{"line":262,"column":8},"end":{"line":262,"column":21}},"46":{"start":{"line":263,"column":8},"end":{"line":263,"column":6178}},"47":{"start":{"line":264,"column":12},"end":{"line":264,"column":33}},"48":{"start":{"line":267,"column":8},"end":{"line":267,"column":47}},"49":{"start":{"line":268,"column":8},"end":{"line":268,"column":28}},"50":{"start":{"line":271,"column":8},"end":{"line":271,"column":6403}},"51":{"start":{"line":272,"column":12},"end":{"line":272,"column":40}},"52":{"start":{"line":274,"column":12},"end":{"line":274,"column":27}},"53":{"start":{"line":277,"column":12},"end":{"line":277,"column":54}},"54":{"start":{"line":278,"column":12},"end":{"line":278,"column":42}},"55":{"start":{"line":281,"column":8},"end":{"line":281,"column":24}}},"branchMap":{"1":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":8}},{"start":{"line":34,"column":8},"end":{"line":34,"column":8}}]},"2":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":8},"end":{"line":154,"column":8}},{"start":{"line":154,"column":8},"end":{"line":154,"column":8}}]},"3":{"line":194,"type":"if","locations":[{"start":{"line":194,"column":12},"end":{"line":194,"column":12}},{"start":{"line":194,"column":12},"end":{"line":194,"column":12}}]},"4":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":8},"end":{"line":257,"column":8}},{"start":{"line":257,"column":8},"end":{"line":257,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol":{"l":{"8":6,"12":10,"16":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol","s":{"1":6,"2":10,"3":0},"b":{"1":[6,0],"2":[10,0],"3":[0,0]},"f":{"1":6,"2":10,"3":0},"fnMap":{"1":{"name":"add","line":7,"loc":{"start":{"line":7,"column":4},"end":{"line":9,"column":4}}},"2":{"name":"sub","line":11,"loc":{"start":{"line":11,"column":4},"end":{"line":13,"column":4}}},"3":{"name":"mul","line":15,"loc":{"start":{"line":15,"column":4},"end":{"line":17,"column":4}}}},"statementMap":{"1":{"start":{"line":8,"column":8},"end":{"line":8,"column":56}},"2":{"start":{"line":12,"column":8},"end":{"line":12,"column":57}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":70}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":8},"end":{"line":8,"column":8}},{"start":{"line":8,"column":8},"end":{"line":8,"column":8}}]},"2":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":8},"end":{"line":12,"column":8}},{"start":{"line":12,"column":8},"end":{"line":12,"column":8}}]},"3":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":8},"end":{"line":16,"column":8}},{"start":{"line":16,"column":8},"end":{"line":16,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol":{"l":{"26":39,"27":39,"29":39,"30":39,"33":39,"45":1,"46":1,"47":1,"51":2,"52":2,"53":2,"57":2,"58":2,"62":4,"63":4,"64":4,"68":2,"69":2,"73":2,"74":2,"78":2,"79":2,"81":2,"82":2,"86":0,"87":0,"94":0,"95":0,"96":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol","s":{"1":39,"2":39,"3":39,"4":39,"5":1,"6":1,"7":1,"8":2,"9":2,"10":2,"11":2,"12":2,"13":4,"14":4,"15":4,"16":2,"17":2,"18":2,"19":2,"20":2,"21":2,"22":2,"23":2,"24":0,"25":0,"26":0,"27":0,"28":0},"b":{"1":[2,0],"2":[0,0],"3":[0,0]},"f":{"1":39,"2":1,"3":2,"4":2,"5":4,"6":2,"7":2,"8":2,"9":0},"fnMap":{"1":{"name":"constructor","line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":42,"column":4}}},"2":{"name":"_mint","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"_burn","line":50,"loc":{"start":{"line":50,"column":4},"end":{"line":54,"column":4}}},"4":{"name":"_approve","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":59,"column":4}}},"5":{"name":"_transfer","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":65,"column":4}}},"6":{"name":"approve","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":70,"column":4}}},"7":{"name":"transfer","line":72,"loc":{"start":{"line":72,"column":4},"end":{"line":75,"column":4}}},"8":{"name":"transferFrom","line":77,"loc":{"start":{"line":77,"column":4},"end":{"line":83,"column":4}}},"9":{"name":"permit","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":97,"column":4}}}},"statementMap":{"1":{"start":{"line":26,"column":8},"end":{"line":26,"column":19}},"2":{"start":{"line":27,"column":8},"end":{"line":27,"column":23}},"3":{"start":{"line":29,"column":8},"end":{"line":29,"column":20}},"4":{"start":{"line":33,"column":8},"end":{"line":33,"column":1051}},"5":{"start":{"line":45,"column":8},"end":{"line":45,"column":43}},"6":{"start":{"line":46,"column":8},"end":{"line":46,"column":47}},"7":{"start":{"line":47,"column":8},"end":{"line":47,"column":44}},"8":{"start":{"line":51,"column":8},"end":{"line":51,"column":51}},"9":{"start":{"line":52,"column":8},"end":{"line":52,"column":43}},"10":{"start":{"line":53,"column":8},"end":{"line":53,"column":46}},"11":{"start":{"line":57,"column":8},"end":{"line":57,"column":40}},"12":{"start":{"line":58,"column":8},"end":{"line":58,"column":44}},"13":{"start":{"line":62,"column":8},"end":{"line":62,"column":51}},"14":{"start":{"line":63,"column":8},"end":{"line":63,"column":47}},"15":{"start":{"line":64,"column":8},"end":{"line":64,"column":38}},"16":{"start":{"line":68,"column":8},"end":{"line":68,"column":43}},"17":{"start":{"line":69,"column":8},"end":{"line":69,"column":19}},"18":{"start":{"line":73,"column":8},"end":{"line":73,"column":39}},"19":{"start":{"line":74,"column":8},"end":{"line":74,"column":19}},"20":{"start":{"line":78,"column":8},"end":{"line":78,"column":2609}},"21":{"start":{"line":79,"column":12},"end":{"line":79,"column":79}},"22":{"start":{"line":81,"column":8},"end":{"line":81,"column":33}},"23":{"start":{"line":82,"column":8},"end":{"line":82,"column":19}},"24":{"start":{"line":86,"column":8},"end":{"line":86,"column":65}},"25":{"start":{"line":87,"column":8},"end":{"line":87,"column":3019}},"26":{"start":{"line":94,"column":8},"end":{"line":94,"column":61}},"27":{"start":{"line":95,"column":8},"end":{"line":95,"column":107}},"28":{"start":{"line":96,"column":8},"end":{"line":96,"column":38}}},"branchMap":{"1":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]},"2":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"3":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":8},"end":{"line":95,"column":8}},{"start":{"line":95,"column":8},"end":{"line":95,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol":{"l":{"85":25,"90":24,"116":0,"120":0,"147":22,"148":0,"151":22,"152":22,"153":22,"155":22,"178":77,"179":73,"181":58,"183":58,"188":58,"190":58,"212":0,"245":95,"246":95,"248":95,"249":95,"250":95,"251":95,"254":95,"255":243,"256":243,"260":243,"262":243,"264":95,"270":148,"276":0,"282":229,"283":147,"285":0,"289":147,"290":147,"291":147,"292":147,"293":147,"296":82,"297":82,"298":82,"299":82,"300":82,"301":82,"303":82,"304":80,"310":73,"314":80,"315":80,"317":1,"320":0,"321":0,"325":1,"326":1,"327":1,"330":1,"333":0,"338":80,"339":80,"366":22,"369":22,"370":22,"376":22,"377":22,"379":22,"382":22,"383":22,"385":0,"388":0,"389":0,"393":0,"394":0,"397":0,"398":0,"402":0,"403":0,"405":0,"408":0,"409":0,"410":0,"413":0,"414":0,"418":0,"420":0,"424":0,"428":0,"430":0,"432":0,"435":0,"436":0,"440":0,"441":0,"446":0,"450":0,"453":0,"455":0,"456":0,"461":0,"463":0,"464":0,"466":0,"467":0,"473":22,"492":22,"495":22,"496":22,"497":22,"500":22,"502":65,"503":65,"505":65,"508":22,"509":22,"512":1,"513":1,"517":1,"519":1,"524":42,"526":42,"527":42,"528":42,"533":65,"538":22,"555":99,"556":95,"558":95,"559":265,"560":265,"566":95,"585":148,"587":148,"589":0,"592":148,"595":148,"612":172,"630":45,"647":51,"665":65,"666":0,"668":65,"686":87,"687":42,"689":45,"690":45,"692":45,"693":44,"695":1,"699":0,"719":82,"720":82,"721":4991,"723":82,"740":65,"742":65,"762":42,"763":42,"764":714,"766":42,"785":1,"786":1,"787":1,"788":1,"789":1,"811":22,"812":22,"813":22,"814":22,"815":22,"829":0,"830":0,"831":0,"833":0,"852":0,"853":0,"854":0,"875":42,"876":42,"877":42,"896":23,"897":23,"898":23,"899":23,"900":23,"917":45,"918":26,"920":19,"946":22,"949":22,"950":43,"954":22,"955":22,"958":22},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol","s":{"1":25,"2":24,"3":0,"4":0,"5":22,"6":0,"7":22,"8":22,"9":22,"10":22,"11":77,"12":73,"13":58,"14":58,"15":58,"16":58,"17":0,"18":95,"19":95,"20":95,"21":95,"22":95,"23":95,"24":95,"25":243,"26":243,"27":243,"28":243,"29":95,"30":148,"31":148,"32":0,"33":229,"34":147,"35":147,"36":147,"37":147,"38":147,"39":82,"40":82,"41":82,"42":82,"43":82,"44":82,"45":82,"46":82,"47":80,"48":73,"49":80,"50":2,"51":1,"52":0,"53":1,"54":1,"55":1,"56":0,"57":80,"58":80,"59":22,"60":22,"61":22,"62":22,"63":22,"64":22,"65":22,"66":22,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":22,"105":22,"106":22,"107":22,"108":22,"109":22,"110":65,"111":65,"112":65,"113":22,"114":22,"115":43,"116":1,"117":1,"118":1,"119":1,"120":42,"121":42,"122":42,"123":42,"124":42,"125":65,"126":22,"127":99,"128":95,"129":95,"130":265,"131":265,"132":95,"133":148,"134":148,"135":0,"136":148,"137":148,"138":172,"139":45,"140":51,"141":65,"142":0,"143":65,"144":87,"145":42,"146":45,"147":45,"148":45,"149":45,"150":44,"151":1,"152":1,"153":0,"154":82,"155":82,"156":82,"157":65,"158":65,"159":42,"160":42,"161":714,"162":42,"163":1,"164":1,"165":1,"166":1,"167":1,"168":22,"169":22,"170":22,"171":22,"172":22,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":42,"181":42,"182":42,"183":23,"184":23,"185":23,"186":23,"187":23,"188":45,"189":26,"190":19,"191":22,"192":22,"193":43,"194":22,"195":22,"196":22},"b":{"1":[0,22],"2":[58,0],"3":[95,148],"4":[88,7],"5":[148,0],"6":[141,7],"7":[0,0],"8":[147,82],"9":[0,147],"10":[82,0],"11":[80,2],"12":[73,7],"13":[1,1],"14":[0,1],"15":[22,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[22,43],"24":[1,42],"25":[1,0],"26":[42,0],"27":[42,0],"28":[0,148],"29":[0,65],"30":[42,45],"31":[45,0],"32":[44,1],"33":[1,0],"34":[26,19]},"f":{"1":25,"2":0,"3":22,"4":77,"5":0,"6":95,"7":22,"8":22,"9":99,"10":148,"11":172,"12":45,"13":51,"14":65,"15":87,"16":82,"17":65,"18":42,"19":1,"20":22,"21":0,"22":0,"23":42,"24":23,"25":45,"26":22},"fnMap":{"1":{"name":"verifyInclusionProof","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":93,"column":4}}},"2":{"name":"verifyExclusionProof","line":105,"loc":{"start":{"line":105,"column":4},"end":{"line":121,"column":4}}},"3":{"name":"update","line":134,"loc":{"start":{"line":134,"column":4},"end":{"line":156,"column":4}}},"4":{"name":"get","line":166,"loc":{"start":{"line":166,"column":4},"end":{"line":194,"column":4}}},"5":{"name":"getSingleNodeRootHash","line":202,"loc":{"start":{"line":202,"column":4},"end":{"line":216,"column":4}}},"6":{"name":"_walkNodePath","line":232,"loc":{"start":{"line":232,"column":4},"end":{"line":340,"column":4}}},"7":{"name":"_getNewPath","line":354,"loc":{"start":{"line":354,"column":4},"end":{"line":474,"column":4}}},"8":{"name":"_getUpdatedTrieRoot","line":482,"loc":{"start":{"line":482,"column":4},"end":{"line":539,"column":4}}},"9":{"name":"_parseProof","line":546,"loc":{"start":{"line":546,"column":4},"end":{"line":567,"column":4}}},"10":{"name":"_getNodeID","line":576,"loc":{"start":{"line":576,"column":4},"end":{"line":596,"column":4}}},"11":{"name":"_getNodePath","line":603,"loc":{"start":{"line":603,"column":4},"end":{"line":613,"column":4}}},"12":{"name":"_getNodeKey","line":621,"loc":{"start":{"line":621,"column":4},"end":{"line":631,"column":4}}},"13":{"name":"_getNodeValue","line":638,"loc":{"start":{"line":638,"column":4},"end":{"line":648,"column":4}}},"14":{"name":"_getNodeHash","line":656,"loc":{"start":{"line":656,"column":4},"end":{"line":670,"column":4}}},"15":{"name":"_getNodeType","line":677,"loc":{"start":{"line":677,"column":4},"end":{"line":700,"column":4}}},"16":{"name":"_getSharedNibbleLength","line":709,"loc":{"start":{"line":709,"column":4},"end":{"line":724,"column":4}}},"17":{"name":"_makeNode","line":731,"loc":{"start":{"line":731,"column":4},"end":{"line":746,"column":4}}},"18":{"name":"_makeNode","line":753,"loc":{"start":{"line":753,"column":4},"end":{"line":767,"column":4}}},"19":{"name":"_makeExtensionNode","line":775,"loc":{"start":{"line":775,"column":4},"end":{"line":790,"column":4}}},"20":{"name":"_makeLeafNode","line":801,"loc":{"start":{"line":801,"column":4},"end":{"line":816,"column":4}}},"21":{"name":"_makeEmptyBranchNode","line":822,"loc":{"start":{"line":822,"column":4},"end":{"line":834,"column":4}}},"22":{"name":"_editBranchValue","line":842,"loc":{"start":{"line":842,"column":4},"end":{"line":855,"column":4}}},"23":{"name":"_editBranchIndex","line":864,"loc":{"start":{"line":864,"column":4},"end":{"line":878,"column":4}}},"24":{"name":"_addHexPrefix","line":886,"loc":{"start":{"line":886,"column":4},"end":{"line":901,"column":4}}},"25":{"name":"_removeHexPrefix","line":908,"loc":{"start":{"line":908,"column":4},"end":{"line":922,"column":4}}},"26":{"name":"_joinNodeArrays","line":934,"loc":{"start":{"line":934,"column":4},"end":{"line":959,"column":4}}}},"statementMap":{"1":{"start":{"line":85,"column":8},"end":{"line":85,"column":2923}},"2":{"start":{"line":90,"column":8},"end":{"line":90,"column":3001}},"3":{"start":{"line":116,"column":8},"end":{"line":116,"column":3811}},"4":{"start":{"line":120,"column":8},"end":{"line":120,"column":30}},"5":{"start":{"line":147,"column":8},"end":{"line":147,"column":4811}},"6":{"start":{"line":148,"column":12},"end":{"line":148,"column":54}},"7":{"start":{"line":151,"column":8},"end":{"line":151,"column":53}},"8":{"start":{"line":152,"column":8},"end":{"line":152,"column":93}},"9":{"start":{"line":153,"column":8},"end":{"line":153,"column":88}},"10":{"start":{"line":155,"column":8},"end":{"line":155,"column":49}},"11":{"start":{"line":178,"column":8},"end":{"line":178,"column":53}},"12":{"start":{"line":179,"column":8},"end":{"line":179,"column":109}},"13":{"start":{"line":181,"column":8},"end":{"line":181,"column":46}},"14":{"start":{"line":183,"column":8},"end":{"line":183,"column":6018}},"15":{"start":{"line":188,"column":8},"end":{"line":188,"column":86}},"16":{"start":{"line":190,"column":8},"end":{"line":190,"column":6213}},"17":{"start":{"line":212,"column":8},"end":{"line":212,"column":6704}},"18":{"start":{"line":245,"column":8},"end":{"line":245,"column":30}},"19":{"start":{"line":246,"column":8},"end":{"line":246,"column":57}},"20":{"start":{"line":248,"column":8},"end":{"line":248,"column":37}},"21":{"start":{"line":249,"column":8},"end":{"line":249,"column":35}},"22":{"start":{"line":250,"column":8},"end":{"line":250,"column":39}},"23":{"start":{"line":251,"column":8},"end":{"line":251,"column":35}},"24":{"start":{"line":254,"column":8},"end":{"line":254,"column":7917}},"25":{"start":{"line":255,"column":12},"end":{"line":255,"column":34}},"26":{"start":{"line":256,"column":12},"end":{"line":256,"column":49}},"27":{"start":{"line":260,"column":12},"end":{"line":260,"column":26}},"28":{"start":{"line":262,"column":12},"end":{"line":262,"column":8247}},"29":{"start":{"line":264,"column":16},"end":{"line":264,"column":8359}},"30":{"start":{"line":268,"column":19},"end":{"line":268,"column":8511}},"31":{"start":{"line":270,"column":16},"end":{"line":270,"column":8647}},"32":{"start":{"line":276,"column":16},"end":{"line":276,"column":8893}},"33":{"start":{"line":282,"column":12},"end":{"line":282,"column":9077}},"34":{"start":{"line":283,"column":16},"end":{"line":283,"column":9153}},"35":{"start":{"line":289,"column":20},"end":{"line":289,"column":65}},"36":{"start":{"line":290,"column":20},"end":{"line":290,"column":90}},"37":{"start":{"line":291,"column":20},"end":{"line":291,"column":55}},"38":{"start":{"line":292,"column":20},"end":{"line":292,"column":42}},"39":{"start":{"line":295,"column":19},"end":{"line":295,"column":9813}},"40":{"start":{"line":296,"column":16},"end":{"line":296,"column":61}},"41":{"start":{"line":297,"column":16},"end":{"line":297,"column":45}},"42":{"start":{"line":298,"column":16},"end":{"line":298,"column":45}},"43":{"start":{"line":299,"column":16},"end":{"line":299,"column":79}},"44":{"start":{"line":300,"column":16},"end":{"line":300,"column":86}},"45":{"start":{"line":301,"column":16},"end":{"line":301,"column":96}},"46":{"start":{"line":303,"column":16},"end":{"line":303,"column":10325}},"47":{"start":{"line":304,"column":20},"end":{"line":304,"column":10412}},"48":{"start":{"line":310,"column":24},"end":{"line":310,"column":60}},"49":{"start":{"line":314,"column":20},"end":{"line":314,"column":52}},"50":{"start":{"line":316,"column":23},"end":{"line":316,"column":11009}},"51":{"start":{"line":317,"column":20},"end":{"line":317,"column":11106}},"52":{"start":{"line":320,"column":24},"end":{"line":320,"column":56}},"53":{"start":{"line":325,"column":24},"end":{"line":325,"column":73}},"54":{"start":{"line":326,"column":24},"end":{"line":326,"column":63}},"55":{"start":{"line":330,"column":20},"end":{"line":330,"column":67}},"56":{"start":{"line":333,"column":16},"end":{"line":333,"column":54}},"57":{"start":{"line":338,"column":8},"end":{"line":338,"column":61}},"58":{"start":{"line":339,"column":8},"end":{"line":339,"column":84}},"59":{"start":{"line":366,"column":8},"end":{"line":366,"column":49}},"60":{"start":{"line":369,"column":8},"end":{"line":369,"column":57}},"61":{"start":{"line":370,"column":8},"end":{"line":370,"column":54}},"62":{"start":{"line":376,"column":8},"end":{"line":376,"column":54}},"63":{"start":{"line":377,"column":8},"end":{"line":377,"column":33}},"64":{"start":{"line":379,"column":8},"end":{"line":379,"column":13744}},"65":{"start":{"line":382,"column":12},"end":{"line":382,"column":81}},"66":{"start":{"line":383,"column":12},"end":{"line":383,"column":29}},"67":{"start":{"line":384,"column":15},"end":{"line":384,"column":14072}},"68":{"start":{"line":385,"column":12},"end":{"line":385,"column":14131}},"69":{"start":{"line":388,"column":16},"end":{"line":388,"column":75}},"70":{"start":{"line":389,"column":16},"end":{"line":389,"column":33}},"71":{"start":{"line":393,"column":16},"end":{"line":393,"column":49}},"72":{"start":{"line":394,"column":16},"end":{"line":394,"column":33}},"73":{"start":{"line":397,"column":16},"end":{"line":397,"column":101}},"74":{"start":{"line":398,"column":16},"end":{"line":398,"column":33}},"75":{"start":{"line":402,"column":12},"end":{"line":402,"column":60}},"76":{"start":{"line":403,"column":12},"end":{"line":403,"column":90}},"77":{"start":{"line":405,"column":12},"end":{"line":405,"column":15218}},"78":{"start":{"line":408,"column":16},"end":{"line":408,"column":99}},"79":{"start":{"line":409,"column":16},"end":{"line":409,"column":94}},"80":{"start":{"line":410,"column":16},"end":{"line":410,"column":33}},"81":{"start":{"line":413,"column":16},"end":{"line":413,"column":82}},"82":{"start":{"line":414,"column":16},"end":{"line":414,"column":84}},"83":{"start":{"line":418,"column":12},"end":{"line":418,"column":62}},"84":{"start":{"line":420,"column":12},"end":{"line":420,"column":16068}},"85":{"start":{"line":424,"column":16},"end":{"line":424,"column":79}},"86":{"start":{"line":428,"column":16},"end":{"line":428,"column":55}},"87":{"start":{"line":430,"column":16},"end":{"line":430,"column":65}},"88":{"start":{"line":432,"column":16},"end":{"line":432,"column":16734}},"89":{"start":{"line":435,"column":20},"end":{"line":435,"column":106}},"90":{"start":{"line":436,"column":20},"end":{"line":436,"column":109}},"91":{"start":{"line":437,"column":23},"end":{"line":437,"column":17169}},"92":{"start":{"line":440,"column":20},"end":{"line":440,"column":111}},"93":{"start":{"line":441,"column":20},"end":{"line":441,"column":109}},"94":{"start":{"line":446,"column":20},"end":{"line":446,"column":94}},"95":{"start":{"line":450,"column":12},"end":{"line":450,"column":17956}},"96":{"start":{"line":453,"column":16},"end":{"line":453,"column":62}},"97":{"start":{"line":455,"column":16},"end":{"line":455,"column":50}},"98":{"start":{"line":456,"column":16},"end":{"line":456,"column":33}},"99":{"start":{"line":461,"column":16},"end":{"line":461,"column":67}},"100":{"start":{"line":463,"column":16},"end":{"line":463,"column":50}},"101":{"start":{"line":464,"column":16},"end":{"line":464,"column":33}},"102":{"start":{"line":466,"column":16},"end":{"line":466,"column":76}},"103":{"start":{"line":467,"column":16},"end":{"line":467,"column":33}},"104":{"start":{"line":473,"column":8},"end":{"line":473,"column":79}},"105":{"start":{"line":492,"column":8},"end":{"line":492,"column":57}},"106":{"start":{"line":495,"column":8},"end":{"line":495,"column":35}},"107":{"start":{"line":496,"column":8},"end":{"line":496,"column":32}},"108":{"start":{"line":497,"column":8},"end":{"line":497,"column":37}},"109":{"start":{"line":500,"column":8},"end":{"line":500,"column":19924}},"110":{"start":{"line":502,"column":12},"end":{"line":502,"column":38}},"111":{"start":{"line":503,"column":12},"end":{"line":503,"column":54}},"112":{"start":{"line":505,"column":12},"end":{"line":505,"column":20127}},"113":{"start":{"line":508,"column":16},"end":{"line":508,"column":63}},"114":{"start":{"line":509,"column":16},"end":{"line":509,"column":78}},"115":{"start":{"line":510,"column":19},"end":{"line":510,"column":20465}},"116":{"start":{"line":512,"column":16},"end":{"line":512,"column":63}},"117":{"start":{"line":513,"column":16},"end":{"line":513,"column":78}},"118":{"start":{"line":517,"column":16},"end":{"line":517,"column":20887}},"119":{"start":{"line":519,"column":20},"end":{"line":519,"column":78}},"120":{"start":{"line":521,"column":19},"end":{"line":521,"column":21106}},"121":{"start":{"line":524,"column":16},"end":{"line":524,"column":21310}},"122":{"start":{"line":526,"column":20},"end":{"line":526,"column":64}},"123":{"start":{"line":527,"column":20},"end":{"line":527,"column":69}},"124":{"start":{"line":528,"column":20},"end":{"line":528,"column":91}},"125":{"start":{"line":533,"column":12},"end":{"line":533,"column":63}},"126":{"start":{"line":538,"column":8},"end":{"line":538,"column":45}},"127":{"start":{"line":555,"column":8},"end":{"line":555,"column":77}},"128":{"start":{"line":556,"column":8},"end":{"line":556,"column":62}},"129":{"start":{"line":558,"column":8},"end":{"line":558,"column":22490}},"130":{"start":{"line":559,"column":12},"end":{"line":559,"column":68}},"131":{"start":{"line":560,"column":12},"end":{"line":560,"column":22622}},"132":{"start":{"line":566,"column":8},"end":{"line":566,"column":20}},"133":{"start":{"line":585,"column":8},"end":{"line":585,"column":27}},"134":{"start":{"line":587,"column":8},"end":{"line":587,"column":23295}},"135":{"start":{"line":589,"column":12},"end":{"line":589,"column":53}},"136":{"start":{"line":592,"column":12},"end":{"line":592,"column":50}},"137":{"start":{"line":595,"column":8},"end":{"line":595,"column":47}},"138":{"start":{"line":612,"column":8},"end":{"line":612,"column":82}},"139":{"start":{"line":630,"column":8},"end":{"line":630,"column":52}},"140":{"start":{"line":647,"column":8},"end":{"line":647,"column":79}},"141":{"start":{"line":665,"column":8},"end":{"line":665,"column":25348}},"142":{"start":{"line":666,"column":12},"end":{"line":666,"column":27}},"143":{"start":{"line":668,"column":12},"end":{"line":668,"column":56}},"144":{"start":{"line":686,"column":8},"end":{"line":686,"column":25851}},"145":{"start":{"line":687,"column":12},"end":{"line":687,"column":38}},"146":{"start":{"line":688,"column":15},"end":{"line":688,"column":25956}},"147":{"start":{"line":689,"column":12},"end":{"line":689,"column":51}},"148":{"start":{"line":690,"column":12},"end":{"line":690,"column":41}},"149":{"start":{"line":692,"column":12},"end":{"line":692,"column":26130}},"150":{"start":{"line":693,"column":16},"end":{"line":693,"column":40}},"151":{"start":{"line":694,"column":19},"end":{"line":694,"column":26254}},"152":{"start":{"line":695,"column":16},"end":{"line":695,"column":45}},"153":{"start":{"line":699,"column":8},"end":{"line":699,"column":34}},"154":{"start":{"line":719,"column":8},"end":{"line":719,"column":21}},"155":{"start":{"line":720,"column":8},"end":{"line":720,"column":26891}},"156":{"start":{"line":723,"column":8},"end":{"line":723,"column":16}},"157":{"start":{"line":740,"column":8},"end":{"line":740,"column":60}},"158":{"start":{"line":742,"column":8},"end":{"line":742,"column":27417}},"159":{"start":{"line":762,"column":8},"end":{"line":762,"column":55}},"160":{"start":{"line":763,"column":8},"end":{"line":763,"column":27962}},"161":{"start":{"line":764,"column":12},"end":{"line":764,"column":57}},"162":{"start":{"line":766,"column":8},"end":{"line":766,"column":29}},"163":{"start":{"line":785,"column":8},"end":{"line":785,"column":43}},"164":{"start":{"line":786,"column":8},"end":{"line":786,"column":53}},"165":{"start":{"line":787,"column":8},"end":{"line":787,"column":73}},"166":{"start":{"line":788,"column":8},"end":{"line":788,"column":48}},"167":{"start":{"line":789,"column":8},"end":{"line":789,"column":29}},"168":{"start":{"line":811,"column":8},"end":{"line":811,"column":43}},"169":{"start":{"line":812,"column":8},"end":{"line":812,"column":52}},"170":{"start":{"line":813,"column":8},"end":{"line":813,"column":73}},"171":{"start":{"line":814,"column":8},"end":{"line":814,"column":48}},"172":{"start":{"line":815,"column":8},"end":{"line":815,"column":29}},"173":{"start":{"line":829,"column":8},"end":{"line":829,"column":60}},"174":{"start":{"line":830,"column":8},"end":{"line":830,"column":30021}},"175":{"start":{"line":831,"column":12},"end":{"line":831,"column":34}},"176":{"start":{"line":833,"column":8},"end":{"line":833,"column":29}},"177":{"start":{"line":852,"column":8},"end":{"line":852,"column":63}},"178":{"start":{"line":853,"column":8},"end":{"line":853,"column":85}},"179":{"start":{"line":854,"column":8},"end":{"line":854,"column":41}},"180":{"start":{"line":875,"column":8},"end":{"line":875,"column":93}},"181":{"start":{"line":876,"column":8},"end":{"line":876,"column":65}},"182":{"start":{"line":877,"column":8},"end":{"line":877,"column":41}},"183":{"start":{"line":896,"column":8},"end":{"line":896,"column":58}},"184":{"start":{"line":897,"column":8},"end":{"line":897,"column":45}},"185":{"start":{"line":898,"column":8},"end":{"line":898,"column":53}},"186":{"start":{"line":899,"column":8},"end":{"line":899,"column":44}},"187":{"start":{"line":900,"column":8},"end":{"line":900,"column":47}},"188":{"start":{"line":917,"column":8},"end":{"line":917,"column":32479}},"189":{"start":{"line":918,"column":12},"end":{"line":918,"column":49}},"190":{"start":{"line":920,"column":12},"end":{"line":920,"column":49}},"191":{"start":{"line":946,"column":8},"end":{"line":946,"column":67}},"192":{"start":{"line":949,"column":8},"end":{"line":949,"column":33473}},"193":{"start":{"line":950,"column":12},"end":{"line":950,"column":25}},"194":{"start":{"line":954,"column":8},"end":{"line":954,"column":33609}},"195":{"start":{"line":955,"column":12},"end":{"line":955,"column":36}},"196":{"start":{"line":958,"column":8},"end":{"line":958,"column":18}}},"branchMap":{"1":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":8},"end":{"line":147,"column":8}},{"start":{"line":147,"column":8},"end":{"line":147,"column":8}}]},"2":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":8},"end":{"line":183,"column":8}},{"start":{"line":183,"column":8},"end":{"line":183,"column":8}}]},"3":{"line":262,"type":"if","locations":[{"start":{"line":262,"column":12},"end":{"line":262,"column":12}},{"start":{"line":262,"column":12},"end":{"line":262,"column":12}}]},"4":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":16},"end":{"line":264,"column":16}},{"start":{"line":264,"column":16},"end":{"line":264,"column":16}}]},"5":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":19},"end":{"line":268,"column":19}},{"start":{"line":268,"column":19},"end":{"line":268,"column":19}}]},"6":{"line":270,"type":"if","locations":[{"start":{"line":270,"column":16},"end":{"line":270,"column":16}},{"start":{"line":270,"column":16},"end":{"line":270,"column":16}}]},"7":{"line":276,"type":"if","locations":[{"start":{"line":276,"column":16},"end":{"line":276,"column":16}},{"start":{"line":276,"column":16},"end":{"line":276,"column":16}}]},"8":{"line":282,"type":"if","locations":[{"start":{"line":282,"column":12},"end":{"line":282,"column":12}},{"start":{"line":282,"column":12},"end":{"line":282,"column":12}}]},"9":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":16},"end":{"line":283,"column":16}},{"start":{"line":283,"column":16},"end":{"line":283,"column":16}}]},"10":{"line":295,"type":"if","locations":[{"start":{"line":295,"column":19},"end":{"line":295,"column":19}},{"start":{"line":295,"column":19},"end":{"line":295,"column":19}}]},"11":{"line":303,"type":"if","locations":[{"start":{"line":303,"column":16},"end":{"line":303,"column":16}},{"start":{"line":303,"column":16},"end":{"line":303,"column":16}}]},"12":{"line":304,"type":"if","locations":[{"start":{"line":304,"column":20},"end":{"line":304,"column":20}},{"start":{"line":304,"column":20},"end":{"line":304,"column":20}}]},"13":{"line":316,"type":"if","locations":[{"start":{"line":316,"column":23},"end":{"line":316,"column":23}},{"start":{"line":316,"column":23},"end":{"line":316,"column":23}}]},"14":{"line":317,"type":"if","locations":[{"start":{"line":317,"column":20},"end":{"line":317,"column":20}},{"start":{"line":317,"column":20},"end":{"line":317,"column":20}}]},"15":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"16":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":15},"end":{"line":384,"column":15}},{"start":{"line":384,"column":15},"end":{"line":384,"column":15}}]},"17":{"line":385,"type":"if","locations":[{"start":{"line":385,"column":12},"end":{"line":385,"column":12}},{"start":{"line":385,"column":12},"end":{"line":385,"column":12}}]},"18":{"line":405,"type":"if","locations":[{"start":{"line":405,"column":12},"end":{"line":405,"column":12}},{"start":{"line":405,"column":12},"end":{"line":405,"column":12}}]},"19":{"line":420,"type":"if","locations":[{"start":{"line":420,"column":12},"end":{"line":420,"column":12}},{"start":{"line":420,"column":12},"end":{"line":420,"column":12}}]},"20":{"line":432,"type":"if","locations":[{"start":{"line":432,"column":16},"end":{"line":432,"column":16}},{"start":{"line":432,"column":16},"end":{"line":432,"column":16}}]},"21":{"line":437,"type":"if","locations":[{"start":{"line":437,"column":23},"end":{"line":437,"column":23}},{"start":{"line":437,"column":23},"end":{"line":437,"column":23}}]},"22":{"line":450,"type":"if","locations":[{"start":{"line":450,"column":12},"end":{"line":450,"column":12}},{"start":{"line":450,"column":12},"end":{"line":450,"column":12}}]},"23":{"line":505,"type":"if","locations":[{"start":{"line":505,"column":12},"end":{"line":505,"column":12}},{"start":{"line":505,"column":12},"end":{"line":505,"column":12}}]},"24":{"line":510,"type":"if","locations":[{"start":{"line":510,"column":19},"end":{"line":510,"column":19}},{"start":{"line":510,"column":19},"end":{"line":510,"column":19}}]},"25":{"line":517,"type":"if","locations":[{"start":{"line":517,"column":16},"end":{"line":517,"column":16}},{"start":{"line":517,"column":16},"end":{"line":517,"column":16}}]},"26":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":19},"end":{"line":521,"column":19}},{"start":{"line":521,"column":19},"end":{"line":521,"column":19}}]},"27":{"line":524,"type":"if","locations":[{"start":{"line":524,"column":16},"end":{"line":524,"column":16}},{"start":{"line":524,"column":16},"end":{"line":524,"column":16}}]},"28":{"line":587,"type":"if","locations":[{"start":{"line":587,"column":8},"end":{"line":587,"column":8}},{"start":{"line":587,"column":8},"end":{"line":587,"column":8}}]},"29":{"line":665,"type":"if","locations":[{"start":{"line":665,"column":8},"end":{"line":665,"column":8}},{"start":{"line":665,"column":8},"end":{"line":665,"column":8}}]},"30":{"line":686,"type":"if","locations":[{"start":{"line":686,"column":8},"end":{"line":686,"column":8}},{"start":{"line":686,"column":8},"end":{"line":686,"column":8}}]},"31":{"line":688,"type":"if","locations":[{"start":{"line":688,"column":15},"end":{"line":688,"column":15}},{"start":{"line":688,"column":15},"end":{"line":688,"column":15}}]},"32":{"line":692,"type":"if","locations":[{"start":{"line":692,"column":12},"end":{"line":692,"column":12}},{"start":{"line":692,"column":12},"end":{"line":692,"column":12}}]},"33":{"line":694,"type":"if","locations":[{"start":{"line":694,"column":19},"end":{"line":694,"column":19}},{"start":{"line":694,"column":19},"end":{"line":694,"column":19}}]},"34":{"line":917,"type":"if","locations":[{"start":{"line":917,"column":8},"end":{"line":917,"column":8}},{"start":{"line":917,"column":8},"end":{"line":917,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol":{"l":{"41":15,"42":15,"66":0,"67":0,"93":12,"94":12,"117":20,"118":20,"137":0,"138":0,"160":47},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol","s":{"1":15,"2":15,"3":0,"4":0,"5":12,"6":12,"7":20,"8":20,"9":0,"10":0,"11":47},"b":{},"f":{"1":15,"2":0,"3":12,"4":20,"5":0,"6":47},"fnMap":{"1":{"name":"verifyInclusionProof","line":29,"loc":{"start":{"line":29,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"verifyExclusionProof","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":68,"column":4}}},"3":{"name":"update","line":81,"loc":{"start":{"line":81,"column":4},"end":{"line":95,"column":4}}},"4":{"name":"get","line":105,"loc":{"start":{"line":105,"column":4},"end":{"line":119,"column":4}}},"5":{"name":"getSingleNodeRootHash","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":139,"column":4}}},"6":{"name":"_getSecureKey","line":151,"loc":{"start":{"line":151,"column":4},"end":{"line":161,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":46}},"2":{"start":{"line":42,"column":8},"end":{"line":42,"column":78}},"3":{"start":{"line":66,"column":8},"end":{"line":66,"column":46}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":70}},"5":{"start":{"line":93,"column":8},"end":{"line":93,"column":46}},"6":{"start":{"line":94,"column":8},"end":{"line":94,"column":64}},"7":{"start":{"line":117,"column":8},"end":{"line":117,"column":46}},"8":{"start":{"line":118,"column":8},"end":{"line":118,"column":53}},"9":{"start":{"line":137,"column":8},"end":{"line":137,"column":46}},"10":{"start":{"line":138,"column":8},"end":{"line":138,"column":64}},"11":{"start":{"line":160,"column":8},"end":{"line":160,"column":48}}},"branchMap":{}}, +"contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol":{"l":{"27":40,"44":2,"61":31,"78":19,"95":3,"97":3,"115":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol","s":{"1":40,"2":2,"3":31,"4":19,"5":3,"6":3},"b":{},"f":{"1":40,"2":2,"3":31,"4":19,"5":3},"fnMap":{"1":{"name":"toBool","line":18,"loc":{"start":{"line":18,"column":4},"end":{"line":28,"column":4}}},"2":{"name":"fromBool","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":45,"column":4}}},"3":{"name":"toAddress","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":62,"column":4}}},"4":{"name":"fromAddress","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":79,"column":4}}},"5":{"name":"removeLeadingZeros","line":86,"loc":{"start":{"line":86,"column":4},"end":{"line":116,"column":4}}}},"statementMap":{"1":{"start":{"line":27,"column":8},"end":{"line":27,"column":23}},"2":{"start":{"line":44,"column":8},"end":{"line":44,"column":44}},"3":{"start":{"line":61,"column":8},"end":{"line":61,"column":45}},"4":{"start":{"line":78,"column":8},"end":{"line":78,"column":36}},"5":{"start":{"line":95,"column":8},"end":{"line":95,"column":24}},"6":{"start":{"line":115,"column":8},"end":{"line":115,"column":18}}},"branchMap":{}}, +"contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol":{"l":{"22":311,"23":311,"24":311,"26":308,"28":308,"81":308,"92":299,"93":73,"96":226,"106":1,"107":1,"108":1,"111":1,"121":164,"122":2,"123":2,"126":2,"129":162,"139":3,"143":15,"144":15,"145":15,"147":15,"151":15,"155":12,"156":12,"157":12,"159":12,"163":12,"167":5,"168":5,"169":5,"171":5,"175":5,"185":292,"187":292,"188":9144,"189":9144,"192":292,"202":26,"204":26,"205":708,"208":26,"219":26},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol","s":{"1":311,"2":311,"3":311,"4":308,"5":308,"6":299,"7":73,"8":226,"9":1,"10":1,"11":1,"12":164,"13":2,"14":2,"15":162,"16":3,"17":15,"18":15,"19":15,"20":15,"21":12,"22":12,"23":12,"24":12,"25":5,"26":5,"27":5,"28":5,"29":292,"30":292,"31":9144,"32":9144,"33":292,"34":26,"35":26,"36":708,"37":26,"38":26},"b":{"1":[311,0],"2":[311,0],"3":[308,3],"4":[73,226],"5":[2,162],"6":[15,0],"7":[15,0],"8":[12,0],"9":[12,0],"10":[5,0],"11":[5,0]},"f":{"1":311,"2":299,"3":1,"4":164,"5":3,"6":15,"7":12,"8":5,"9":292,"10":26,"11":26},"fnMap":{"1":{"name":"slice","line":13,"loc":{"start":{"line":13,"column":4},"end":{"line":82,"column":4}}},"2":{"name":"slice","line":84,"loc":{"start":{"line":84,"column":4},"end":{"line":97,"column":4}}},"3":{"name":"toBytes32PadLeft","line":99,"loc":{"start":{"line":99,"column":4},"end":{"line":112,"column":4}}},"4":{"name":"toBytes32","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":130,"column":4}}},"5":{"name":"toUint256","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"6":{"name":"toUint24","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":152,"column":4}}},"7":{"name":"toUint8","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":164,"column":4}}},"8":{"name":"toAddress","line":166,"loc":{"start":{"line":166,"column":4},"end":{"line":176,"column":4}}},"9":{"name":"toNibbles","line":178,"loc":{"start":{"line":178,"column":4},"end":{"line":193,"column":4}}},"10":{"name":"fromNibbles","line":195,"loc":{"start":{"line":195,"column":4},"end":{"line":209,"column":4}}},"11":{"name":"equal","line":211,"loc":{"start":{"line":211,"column":4},"end":{"line":220,"column":4}}}},"statementMap":{"1":{"start":{"line":22,"column":8},"end":{"line":22,"column":57}},"2":{"start":{"line":23,"column":8},"end":{"line":23,"column":60}},"3":{"start":{"line":24,"column":8},"end":{"line":24,"column":70}},"4":{"start":{"line":26,"column":8},"end":{"line":26,"column":30}},"5":{"start":{"line":81,"column":8},"end":{"line":81,"column":24}},"6":{"start":{"line":92,"column":8},"end":{"line":92,"column":3245}},"7":{"start":{"line":93,"column":12},"end":{"line":93,"column":28}},"8":{"start":{"line":96,"column":8},"end":{"line":96,"column":60}},"9":{"start":{"line":106,"column":8},"end":{"line":106,"column":19}},"10":{"start":{"line":107,"column":8},"end":{"line":107,"column":62}},"11":{"start":{"line":111,"column":8},"end":{"line":111,"column":18}},"12":{"start":{"line":121,"column":8},"end":{"line":121,"column":3855}},"13":{"start":{"line":122,"column":12},"end":{"line":122,"column":23}},"14":{"start":{"line":126,"column":12},"end":{"line":126,"column":22}},"15":{"start":{"line":129,"column":8},"end":{"line":129,"column":43}},"16":{"start":{"line":139,"column":8},"end":{"line":139,"column":41}},"17":{"start":{"line":143,"column":8},"end":{"line":143,"column":57}},"18":{"start":{"line":144,"column":8},"end":{"line":144,"column":68}},"19":{"start":{"line":145,"column":8},"end":{"line":145,"column":23}},"20":{"start":{"line":151,"column":8},"end":{"line":151,"column":23}},"21":{"start":{"line":155,"column":8},"end":{"line":155,"column":56}},"22":{"start":{"line":156,"column":8},"end":{"line":156,"column":67}},"23":{"start":{"line":157,"column":8},"end":{"line":157,"column":22}},"24":{"start":{"line":163,"column":8},"end":{"line":163,"column":23}},"25":{"start":{"line":167,"column":8},"end":{"line":167,"column":59}},"26":{"start":{"line":168,"column":8},"end":{"line":168,"column":69}},"27":{"start":{"line":169,"column":8},"end":{"line":169,"column":27}},"28":{"start":{"line":175,"column":8},"end":{"line":175,"column":26}},"29":{"start":{"line":185,"column":8},"end":{"line":185,"column":59}},"30":{"start":{"line":187,"column":8},"end":{"line":187,"column":5646}},"31":{"start":{"line":188,"column":12},"end":{"line":188,"column":42}},"32":{"start":{"line":189,"column":12},"end":{"line":189,"column":61}},"33":{"start":{"line":192,"column":8},"end":{"line":192,"column":22}},"34":{"start":{"line":202,"column":8},"end":{"line":202,"column":55}},"35":{"start":{"line":204,"column":8},"end":{"line":204,"column":6036}},"36":{"start":{"line":205,"column":12},"end":{"line":205,"column":62}},"37":{"start":{"line":208,"column":8},"end":{"line":208,"column":18}},"38":{"start":{"line":219,"column":8},"end":{"line":219,"column":53}}},"branchMap":{"1":{"line":22,"type":"if","locations":[{"start":{"line":22,"column":8},"end":{"line":22,"column":8}},{"start":{"line":22,"column":8},"end":{"line":22,"column":8}}]},"2":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":8},"end":{"line":23,"column":8}},{"start":{"line":23,"column":8},"end":{"line":23,"column":8}}]},"3":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":8}},{"start":{"line":24,"column":8},"end":{"line":24,"column":8}}]},"4":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":8}},{"start":{"line":92,"column":8},"end":{"line":92,"column":8}}]},"5":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":8},"end":{"line":121,"column":8}},{"start":{"line":121,"column":8},"end":{"line":121,"column":8}}]},"6":{"line":143,"type":"if","locations":[{"start":{"line":143,"column":8},"end":{"line":143,"column":8}},{"start":{"line":143,"column":8},"end":{"line":143,"column":8}}]},"7":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"8":{"line":155,"type":"if","locations":[{"start":{"line":155,"column":8},"end":{"line":155,"column":8}},{"start":{"line":155,"column":8},"end":{"line":155,"column":8}}]},"9":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"10":{"line":167,"type":"if","locations":[{"start":{"line":167,"column":8},"end":{"line":167,"column":8}},{"start":{"line":167,"column":8},"end":{"line":167,"column":8}}]},"11":{"line":168,"type":"if","locations":[{"start":{"line":168,"column":8},"end":{"line":168,"column":8}},{"start":{"line":168,"column":8},"end":{"line":168,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol":{"l":{"35":22,"37":22,"52":24,"53":9,"55":15,"77":15,"94":9,"95":9,"96":9},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol","s":{"1":22,"2":22,"3":24,"4":9,"5":15,"6":15,"7":9,"8":9,"9":9},"b":{"1":[9,15]},"f":{"1":22,"2":24,"3":15,"4":9},"fnMap":{"1":{"name":"recover","line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"getMessageHash","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":56,"column":4}}},"3":{"name":"getNativeMessageHash","line":68,"loc":{"start":{"line":68,"column":4},"end":{"line":78,"column":4}}},"4":{"name":"getEthSignedMessageHash","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":97,"column":4}}}},"statementMap":{"1":{"start":{"line":35,"column":8},"end":{"line":35,"column":75}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1000}},"3":{"start":{"line":52,"column":8},"end":{"line":52,"column":1277}},"4":{"start":{"line":53,"column":12},"end":{"line":53,"column":52}},"5":{"start":{"line":55,"column":8},"end":{"line":55,"column":45}},"6":{"start":{"line":77,"column":8},"end":{"line":77,"column":34}},"7":{"start":{"line":94,"column":8},"end":{"line":94,"column":64}},"8":{"start":{"line":95,"column":8},"end":{"line":95,"column":49}},"9":{"start":{"line":96,"column":8},"end":{"line":96,"column":63}}},"branchMap":{"1":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol":{"l":{"30":10},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol","s":{"1":10},"b":{},"f":{"1":10},"fnMap":{"1":{"name":"encodeRevertString","line":21,"loc":{"start":{"line":21,"column":4},"end":{"line":34,"column":4}}}},"statementMap":{"1":{"start":{"line":30,"column":8},"end":{"line":30,"column":830}}},"branchMap":{}}, +"contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol":{"l":{"37":34,"44":34,"61":18,"82":212,"86":212,"103":19,"107":19,"128":27,"136":27,"155":27,"156":27,"157":27,"159":27,"160":27,"179":0,"186":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol","s":{"1":34,"2":18,"3":212,"4":19,"5":27,"6":27,"7":27,"8":27,"9":27,"10":27,"11":0,"12":0},"b":{},"f":{"1":34,"2":18,"3":212,"4":19,"5":27,"6":27,"7":0},"fnMap":{"1":{"name":"getCode","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":45,"column":4}}},"2":{"name":"getCode","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":66,"column":4}}},"3":{"name":"getCodeSize","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":87,"column":4}}},"4":{"name":"getCodeHash","line":94,"loc":{"start":{"line":94,"column":4},"end":{"line":108,"column":4}}},"5":{"name":"createContract","line":120,"loc":{"start":{"line":120,"column":4},"end":{"line":137,"column":4}}},"6":{"name":"getAddressForCREATE","line":145,"loc":{"start":{"line":145,"column":4},"end":{"line":161,"column":4}}},"7":{"name":"getAddressForCREATE2","line":170,"loc":{"start":{"line":170,"column":4},"end":{"line":187,"column":4}}}},"statementMap":{"1":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":1471}},"3":{"start":{"line":86,"column":8},"end":{"line":86,"column":24}},"4":{"start":{"line":107,"column":8},"end":{"line":107,"column":24}},"5":{"start":{"line":136,"column":8},"end":{"line":136,"column":23}},"6":{"start":{"line":155,"column":8},"end":{"line":155,"column":47}},"7":{"start":{"line":156,"column":8},"end":{"line":156,"column":56}},"8":{"start":{"line":157,"column":8},"end":{"line":157,"column":51}},"9":{"start":{"line":159,"column":8},"end":{"line":159,"column":67}},"10":{"start":{"line":160,"column":8},"end":{"line":160,"column":65}},"11":{"start":{"line":179,"column":8},"end":{"line":179,"column":4349}},"12":{"start":{"line":186,"column":8},"end":{"line":186,"column":53}}},"branchMap":{}}, +"contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol":{"l":{"29":0,"30":0,"33":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol","s":{"1":0,"2":0,"3":0},"b":{"1":[0,0]},"f":{"1":0},"fnMap":{"1":{"name":"min","line":19,"loc":{"start":{"line":19,"column":4},"end":{"line":34,"column":4}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":550}},"2":{"start":{"line":30,"column":12},"end":{"line":30,"column":21}},"3":{"start":{"line":33,"column":8},"end":{"line":33,"column":17}}},"branchMap":{"1":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":8},"end":{"line":29,"column":8}},{"start":{"line":29,"column":8},"end":{"line":29,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol":{"l":{"32":118,"37":117,"38":0,"41":117,"61":117,"64":117,"65":117,"68":117,"71":117,"74":117,"75":117,"77":117,"78":273,"79":273,"81":273,"82":4620,"83":4620,"84":4620,"89":4620,"92":273,"93":27,"94":27,"95":27,"100":27,"103":273,"104":273,"107":117,"134":102,"139":101,"144":100,"149":99,"151":99,"152":653,"153":146,"160":507,"168":653,"171":99,"193":100,"198":100,"199":3,"204":97,"205":97,"206":97,"207":776,"208":206,"209":206,"214":97,"215":70,"218":97},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol","s":{"1":118,"2":117,"3":0,"4":117,"5":117,"6":117,"7":117,"8":117,"9":117,"10":117,"11":117,"12":117,"13":273,"14":273,"15":273,"16":4620,"17":4620,"18":4620,"19":273,"20":27,"21":27,"22":27,"23":273,"24":117,"25":102,"26":101,"27":100,"28":99,"29":99,"30":653,"31":146,"32":507,"33":653,"34":99,"35":100,"36":100,"37":3,"38":97,"39":97,"40":97,"41":776,"42":206,"43":206,"44":97,"45":70,"46":97},"b":{"1":[117,1],"2":[0,117],"3":[27,246],"4":[101,1],"5":[100,1],"6":[99,1],"7":[146,507],"8":[100,0],"9":[3,97],"10":[206,570],"11":[70,27]},"f":{"1":118,"2":102,"3":100},"fnMap":{"1":{"name":"getMerkleRoot","line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":108,"column":4}}},"2":{"name":"verify","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":172,"column":4}}},"3":{"name":"_ceilLog2","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":219,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":1067}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1197}},"3":{"start":{"line":38,"column":12},"end":{"line":38,"column":31}},"4":{"start":{"line":41,"column":8},"end":{"line":41,"column":1279}},"5":{"start":{"line":61,"column":8},"end":{"line":61,"column":40}},"6":{"start":{"line":64,"column":8},"end":{"line":64,"column":27}},"7":{"start":{"line":65,"column":8},"end":{"line":65,"column":28}},"8":{"start":{"line":68,"column":8},"end":{"line":68,"column":42}},"9":{"start":{"line":71,"column":8},"end":{"line":71,"column":25}},"10":{"start":{"line":74,"column":8},"end":{"line":74,"column":27}},"11":{"start":{"line":75,"column":8},"end":{"line":75,"column":25}},"12":{"start":{"line":77,"column":8},"end":{"line":77,"column":3156}},"13":{"start":{"line":78,"column":12},"end":{"line":78,"column":36}},"14":{"start":{"line":79,"column":12},"end":{"line":79,"column":42}},"15":{"start":{"line":81,"column":12},"end":{"line":81,"column":3279}},"16":{"start":{"line":82,"column":16},"end":{"line":82,"column":52}},"17":{"start":{"line":83,"column":16},"end":{"line":83,"column":52}},"18":{"start":{"line":89,"column":16},"end":{"line":89,"column":44}},"19":{"start":{"line":92,"column":12},"end":{"line":92,"column":3663}},"20":{"start":{"line":93,"column":16},"end":{"line":93,"column":52}},"21":{"start":{"line":94,"column":16},"end":{"line":94,"column":54}},"22":{"start":{"line":100,"column":16},"end":{"line":100,"column":54}},"23":{"start":{"line":103,"column":12},"end":{"line":103,"column":57}},"24":{"start":{"line":107,"column":8},"end":{"line":107,"column":27}},"25":{"start":{"line":134,"column":8},"end":{"line":134,"column":5110}},"26":{"start":{"line":139,"column":8},"end":{"line":139,"column":5239}},"27":{"start":{"line":144,"column":8},"end":{"line":144,"column":5354}},"28":{"start":{"line":149,"column":8},"end":{"line":149,"column":36}},"29":{"start":{"line":151,"column":8},"end":{"line":151,"column":5571}},"30":{"start":{"line":152,"column":12},"end":{"line":152,"column":5636}},"31":{"start":{"line":153,"column":16},"end":{"line":153,"column":5681}},"32":{"start":{"line":160,"column":16},"end":{"line":160,"column":5898}},"33":{"start":{"line":168,"column":12},"end":{"line":168,"column":23}},"34":{"start":{"line":171,"column":8},"end":{"line":171,"column":36}},"35":{"start":{"line":193,"column":8},"end":{"line":193,"column":6569}},"36":{"start":{"line":198,"column":8},"end":{"line":198,"column":6682}},"37":{"start":{"line":199,"column":12},"end":{"line":199,"column":20}},"38":{"start":{"line":204,"column":8},"end":{"line":204,"column":25}},"39":{"start":{"line":205,"column":8},"end":{"line":205,"column":27}},"40":{"start":{"line":206,"column":8},"end":{"line":206,"column":6934}},"41":{"start":{"line":207,"column":12},"end":{"line":207,"column":6989}},"42":{"start":{"line":208,"column":16},"end":{"line":208,"column":27}},"43":{"start":{"line":209,"column":16},"end":{"line":209,"column":24}},"44":{"start":{"line":214,"column":8},"end":{"line":214,"column":7181}},"45":{"start":{"line":215,"column":12},"end":{"line":215,"column":23}},"46":{"start":{"line":218,"column":8},"end":{"line":218,"column":22}}},"branchMap":{"1":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":8},"end":{"line":32,"column":8}},{"start":{"line":32,"column":8},"end":{"line":32,"column":8}}]},"2":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"3":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":12},"end":{"line":92,"column":12}},{"start":{"line":92,"column":12},"end":{"line":92,"column":12}}]},"4":{"line":134,"type":"if","locations":[{"start":{"line":134,"column":8},"end":{"line":134,"column":8}},{"start":{"line":134,"column":8},"end":{"line":134,"column":8}}]},"5":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"6":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"7":{"line":152,"type":"if","locations":[{"start":{"line":152,"column":12},"end":{"line":152,"column":12}},{"start":{"line":152,"column":12},"end":{"line":152,"column":12}}]},"8":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"9":{"line":198,"type":"if","locations":[{"start":{"line":198,"column":8},"end":{"line":198,"column":8}},{"start":{"line":198,"column":8},"end":{"line":198,"column":8}}]},"10":{"line":207,"type":"if","locations":[{"start":{"line":207,"column":12},"end":{"line":207,"column":12}},{"start":{"line":207,"column":12},"end":{"line":207,"column":12}}]},"11":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol":{"l":{"38":54,"50":14,"53":14,"55":14,"59":6},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol","s":{"1":54,"2":14,"3":14,"4":6},"b":{"1":[14,0]},"f":{"1":54,"2":14},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":39,"column":4}}},"2":{"name":"nonReentrant","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":60,"column":4}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":29}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":70}},"3":{"start":{"line":53,"column":8},"end":{"line":53,"column":25}},"4":{"start":{"line":59,"column":8},"end":{"line":59,"column":29}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol":{"l":{"60":572,"61":572,"64":572,"65":134,"69":572,"70":11,"73":0,"74":0,"75":0,"78":0,"81":11,"86":572,"87":572,"90":572,"91":572,"92":572,"106":470,"108":470,"130":538,"132":538,"137":535,"138":535,"140":535,"143":535,"146":535,"151":535,"155":0,"158":0,"164":0,"169":0,"186":1,"188":1,"193":1,"197":0,"198":0,"202":1,"203":1,"204":1,"218":0,"219":0,"239":441,"240":441,"254":0,"255":0,"256":0,"273":550,"274":550,"288":573,"289":573,"291":573,"292":573,"293":573,"298":573,"299":573,"300":573,"301":573,"307":573,"308":573,"311":573,"312":0,"330":2572,"331":2572,"333":2572,"334":2572,"335":2572,"340":2572,"341":2572,"342":2572,"343":2572,"349":2572,"374":1642},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol","s":{"1":572,"2":572,"3":572,"4":134,"5":572,"6":11,"7":0,"8":0,"9":0,"10":11,"11":572,"12":572,"13":572,"14":572,"15":470,"16":470,"17":538,"18":538,"19":535,"20":535,"21":535,"22":535,"23":535,"24":535,"25":0,"26":0,"27":0,"28":0,"29":1,"30":1,"31":1,"32":0,"33":1,"34":1,"35":1,"36":0,"37":0,"38":441,"39":441,"40":0,"41":0,"42":0,"43":550,"44":550,"45":573,"46":573,"47":573,"48":573,"49":573,"50":573,"51":573,"52":573,"53":573,"54":573,"55":0,"56":2572,"57":2572,"58":2572,"59":2572,"60":2572,"61":2572,"62":2572,"63":2572,"64":1642},"b":{"1":[134,438],"2":[11,561],"3":[0,11],"4":[535,3],"5":[535,0],"6":[535,0],"7":[0,0],"8":[0,0],"9":[1,0],"10":[0,1],"11":[573,0],"12":[0,573]},"f":{"1":572,"2":470,"3":538,"4":1,"5":0,"6":441,"7":0,"8":550,"9":573,"10":2572,"11":1642},"fnMap":{"1":{"name":"push","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":93,"column":4}}},"2":{"name":"push","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":112,"column":4}}},"3":{"name":"get","line":120,"loc":{"start":{"line":120,"column":4},"end":{"line":171,"column":4}}},"4":{"name":"deleteElementsAfterInclusive","line":179,"loc":{"start":{"line":179,"column":4},"end":{"line":205,"column":4}}},"5":{"name":"deleteElementsAfterInclusive","line":212,"loc":{"start":{"line":212,"column":4},"end":{"line":223,"column":4}}},"6":{"name":"getLength","line":230,"loc":{"start":{"line":230,"column":4},"end":{"line":241,"column":4}}},"7":{"name":"setExtraData","line":248,"loc":{"start":{"line":248,"column":4},"end":{"line":257,"column":4}}},"8":{"name":"getExtraData","line":264,"loc":{"start":{"line":264,"column":4},"end":{"line":275,"column":4}}},"9":{"name":"setContext","line":282,"loc":{"start":{"line":282,"column":4},"end":{"line":314,"column":4}}},"10":{"name":"getContext","line":321,"loc":{"start":{"line":321,"column":4},"end":{"line":356,"column":4}}},"11":{"name":"getBuffer","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":375,"column":4}}}},"statementMap":{"1":{"start":{"line":60,"column":8},"end":{"line":60,"column":57}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":72}},"3":{"start":{"line":64,"column":8},"end":{"line":64,"column":1385}},"4":{"start":{"line":65,"column":12},"end":{"line":65,"column":43}},"5":{"start":{"line":69,"column":8},"end":{"line":69,"column":1530}},"6":{"start":{"line":70,"column":12},"end":{"line":70,"column":1611}},"7":{"start":{"line":74,"column":16},"end":{"line":74,"column":54}},"8":{"start":{"line":75,"column":16},"end":{"line":75,"column":51}},"9":{"start":{"line":78,"column":16},"end":{"line":78,"column":64}},"10":{"start":{"line":81,"column":16},"end":{"line":81,"column":37}},"11":{"start":{"line":86,"column":8},"end":{"line":86,"column":64}},"12":{"start":{"line":87,"column":8},"end":{"line":87,"column":41}},"13":{"start":{"line":91,"column":8},"end":{"line":91,"column":33}},"14":{"start":{"line":92,"column":8},"end":{"line":92,"column":28}},"15":{"start":{"line":106,"column":8},"end":{"line":106,"column":57}},"16":{"start":{"line":108,"column":8},"end":{"line":108,"column":2968}},"17":{"start":{"line":130,"column":8},"end":{"line":130,"column":57}},"18":{"start":{"line":132,"column":8},"end":{"line":132,"column":3484}},"19":{"start":{"line":137,"column":8},"end":{"line":137,"column":72}},"20":{"start":{"line":138,"column":8},"end":{"line":138,"column":76}},"21":{"start":{"line":140,"column":8},"end":{"line":140,"column":3739}},"22":{"start":{"line":143,"column":12},"end":{"line":143,"column":63}},"23":{"start":{"line":146,"column":12},"end":{"line":146,"column":4055}},"24":{"start":{"line":151,"column":12},"end":{"line":151,"column":48}},"25":{"start":{"line":155,"column":12},"end":{"line":155,"column":63}},"26":{"start":{"line":158,"column":12},"end":{"line":158,"column":4566}},"27":{"start":{"line":164,"column":12},"end":{"line":164,"column":4767}},"28":{"start":{"line":169,"column":12},"end":{"line":169,"column":68}},"29":{"start":{"line":186,"column":8},"end":{"line":186,"column":57}},"30":{"start":{"line":188,"column":8},"end":{"line":188,"column":5432}},"31":{"start":{"line":193,"column":8},"end":{"line":193,"column":5566}},"32":{"start":{"line":198,"column":12},"end":{"line":198,"column":50}},"33":{"start":{"line":202,"column":8},"end":{"line":202,"column":31}},"34":{"start":{"line":203,"column":8},"end":{"line":203,"column":33}},"35":{"start":{"line":204,"column":8},"end":{"line":204,"column":28}},"36":{"start":{"line":218,"column":8},"end":{"line":218,"column":57}},"37":{"start":{"line":219,"column":8},"end":{"line":219,"column":6512}},"38":{"start":{"line":239,"column":8},"end":{"line":239,"column":57}},"39":{"start":{"line":240,"column":8},"end":{"line":240,"column":30}},"40":{"start":{"line":254,"column":8},"end":{"line":254,"column":57}},"41":{"start":{"line":255,"column":8},"end":{"line":255,"column":33}},"42":{"start":{"line":256,"column":8},"end":{"line":256,"column":28}},"43":{"start":{"line":273,"column":8},"end":{"line":273,"column":57}},"44":{"start":{"line":274,"column":8},"end":{"line":274,"column":28}},"45":{"start":{"line":288,"column":8},"end":{"line":288,"column":24}},"46":{"start":{"line":289,"column":8},"end":{"line":289,"column":24}},"47":{"start":{"line":291,"column":8},"end":{"line":291,"column":45}},"48":{"start":{"line":292,"column":8},"end":{"line":292,"column":42}},"49":{"start":{"line":298,"column":8},"end":{"line":298,"column":53}},"50":{"start":{"line":299,"column":8},"end":{"line":299,"column":51}},"51":{"start":{"line":300,"column":8},"end":{"line":300,"column":51}},"52":{"start":{"line":307,"column":8},"end":{"line":307,"column":8669}},"53":{"start":{"line":308,"column":12},"end":{"line":308,"column":36}},"54":{"start":{"line":311,"column":8},"end":{"line":311,"column":8761}},"55":{"start":{"line":312,"column":12},"end":{"line":312,"column":36}},"56":{"start":{"line":330,"column":8},"end":{"line":330,"column":41}},"57":{"start":{"line":331,"column":8},"end":{"line":331,"column":41}},"58":{"start":{"line":333,"column":8},"end":{"line":333,"column":26}},"59":{"start":{"line":334,"column":8},"end":{"line":334,"column":25}},"60":{"start":{"line":340,"column":8},"end":{"line":340,"column":30}},"61":{"start":{"line":341,"column":8},"end":{"line":341,"column":29}},"62":{"start":{"line":342,"column":8},"end":{"line":342,"column":29}},"63":{"start":{"line":349,"column":8},"end":{"line":349,"column":10056}},"64":{"start":{"line":374,"column":8},"end":{"line":374,"column":62}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"2":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":8}},{"start":{"line":69,"column":8},"end":{"line":69,"column":8}}]},"3":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":12},"end":{"line":70,"column":12}},{"start":{"line":70,"column":12},"end":{"line":70,"column":12}}]},"4":{"line":132,"type":"if","locations":[{"start":{"line":132,"column":8},"end":{"line":132,"column":8}},{"start":{"line":132,"column":8},"end":{"line":132,"column":8}}]},"5":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":8},"end":{"line":140,"column":8}},{"start":{"line":140,"column":8},"end":{"line":140,"column":8}}]},"6":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":12},"end":{"line":146,"column":12}},{"start":{"line":146,"column":12},"end":{"line":146,"column":12}}]},"7":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":12},"end":{"line":158,"column":12}},{"start":{"line":158,"column":12},"end":{"line":158,"column":12}}]},"8":{"line":164,"type":"if","locations":[{"start":{"line":164,"column":12},"end":{"line":164,"column":12}},{"start":{"line":164,"column":12},"end":{"line":164,"column":12}}]},"9":{"line":188,"type":"if","locations":[{"start":{"line":188,"column":8},"end":{"line":188,"column":8}},{"start":{"line":188,"column":8},"end":{"line":188,"column":8}}]},"10":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"11":{"line":307,"type":"if","locations":[{"start":{"line":307,"column":8},"end":{"line":307,"column":8}},{"start":{"line":307,"column":8},"end":{"line":307,"column":8}}]},"12":{"line":311,"type":"if","locations":[{"start":{"line":311,"column":8},"end":{"line":311,"column":8}},{"start":{"line":311,"column":8},"end":{"line":311,"column":8}}]}}}, +"contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol":{"l":{"41":18,"50":18,"72":2,"81":2,"100":1,"108":1,"124":5,"131":5,"144":12,"150":12,"163":11,"169":11,"182":9,"188":9,"201":7,"207":7,"219":6,"242":2,"262":9,"283":41,"284":7,"301":43,"308":43,"320":21,"348":146,"349":146,"354":146,"355":2,"359":0,"363":144,"375":145},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol","s":{"1":18,"2":18,"3":2,"4":2,"5":1,"6":1,"7":5,"8":5,"9":12,"10":12,"11":11,"12":11,"13":9,"14":9,"15":7,"16":7,"17":6,"18":2,"19":9,"20":41,"21":7,"22":43,"23":43,"24":21,"25":146,"26":146,"27":146,"28":144,"29":144,"30":145},"b":{"1":[7,34],"2":[2,144],"3":[0,144]},"f":{"1":18,"2":2,"3":1,"4":5,"5":12,"6":11,"7":9,"8":7,"9":6,"10":2,"11":9,"12":41,"13":43,"14":21,"15":146,"16":145},"fnMap":{"1":{"name":"safeCALL","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":51,"column":4}}},"2":{"name":"safeDELEGATECALL","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":82,"column":4}}},"3":{"name":"safeCREATE","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":109,"column":4}}},"4":{"name":"safeEXTCODESIZE","line":116,"loc":{"start":{"line":116,"column":4},"end":{"line":132,"column":4}}},"5":{"name":"safeCHAINID","line":138,"loc":{"start":{"line":138,"column":4},"end":{"line":151,"column":4}}},"6":{"name":"safeCALLER","line":157,"loc":{"start":{"line":157,"column":4},"end":{"line":170,"column":4}}},"7":{"name":"safeADDRESS","line":176,"loc":{"start":{"line":176,"column":4},"end":{"line":189,"column":4}}},"8":{"name":"safeGETNONCE","line":195,"loc":{"start":{"line":195,"column":4},"end":{"line":208,"column":4}}},"9":{"name":"safeSETNONCE","line":214,"loc":{"start":{"line":214,"column":4},"end":{"line":225,"column":4}}},"10":{"name":"safeCREATEEOA","line":234,"loc":{"start":{"line":234,"column":4},"end":{"line":251,"column":4}}},"11":{"name":"safeREVERT","line":257,"loc":{"start":{"line":257,"column":4},"end":{"line":270,"column":4}}},"12":{"name":"safeREQUIRE","line":277,"loc":{"start":{"line":277,"column":4},"end":{"line":288,"column":4}}},"13":{"name":"safeSLOAD","line":293,"loc":{"start":{"line":293,"column":4},"end":{"line":309,"column":4}}},"14":{"name":"safeSSTORE","line":314,"loc":{"start":{"line":314,"column":4},"end":{"line":327,"column":4}}},"15":{"name":"_safeExecutionManagerInteraction","line":339,"loc":{"start":{"line":339,"column":4},"end":{"line":365,"column":4}}},"16":{"name":"_safeExecutionManagerInteraction","line":367,"loc":{"start":{"line":367,"column":4},"end":{"line":379,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":1128}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":52}},"3":{"start":{"line":72,"column":8},"end":{"line":72,"column":1988}},"4":{"start":{"line":81,"column":8},"end":{"line":81,"column":52}},"5":{"start":{"line":100,"column":8},"end":{"line":100,"column":2718}},"6":{"start":{"line":108,"column":8},"end":{"line":108,"column":55}},"7":{"start":{"line":124,"column":8},"end":{"line":124,"column":3343}},"8":{"start":{"line":131,"column":8},"end":{"line":131,"column":48}},"9":{"start":{"line":144,"column":8},"end":{"line":144,"column":3817}},"10":{"start":{"line":150,"column":8},"end":{"line":150,"column":48}},"11":{"start":{"line":163,"column":8},"end":{"line":163,"column":4248}},"12":{"start":{"line":169,"column":8},"end":{"line":169,"column":48}},"13":{"start":{"line":182,"column":8},"end":{"line":182,"column":4683}},"14":{"start":{"line":188,"column":8},"end":{"line":188,"column":48}},"15":{"start":{"line":201,"column":8},"end":{"line":201,"column":5118}},"16":{"start":{"line":207,"column":8},"end":{"line":207,"column":48}},"17":{"start":{"line":219,"column":8},"end":{"line":219,"column":5513}},"18":{"start":{"line":242,"column":8},"end":{"line":242,"column":6076}},"19":{"start":{"line":262,"column":8},"end":{"line":262,"column":6544}},"20":{"start":{"line":283,"column":8},"end":{"line":283,"column":7099}},"21":{"start":{"line":284,"column":12},"end":{"line":284,"column":7134}},"22":{"start":{"line":301,"column":8},"end":{"line":301,"column":7383}},"23":{"start":{"line":308,"column":8},"end":{"line":308,"column":48}},"24":{"start":{"line":320,"column":8},"end":{"line":320,"column":7782}},"25":{"start":{"line":348,"column":8},"end":{"line":348,"column":48}},"26":{"start":{"line":349,"column":8},"end":{"line":349,"column":8669}},"27":{"start":{"line":354,"column":8},"end":{"line":354,"column":8752}},"28":{"start":{"line":358,"column":15},"end":{"line":358,"column":8893}},"29":{"start":{"line":363,"column":12},"end":{"line":363,"column":29}},"30":{"start":{"line":375,"column":8},"end":{"line":375,"column":9234}}},"branchMap":{"1":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":8},"end":{"line":283,"column":8}},{"start":{"line":283,"column":8},"end":{"line":283,"column":8}}]},"2":{"line":354,"type":"if","locations":[{"start":{"line":354,"column":8},"end":{"line":354,"column":8}},{"start":{"line":354,"column":8},"end":{"line":354,"column":8}}]},"3":{"line":358,"type":"if","locations":[{"start":{"line":358,"column":15},"end":{"line":358,"column":15}},{"start":{"line":358,"column":15},"end":{"line":358,"column":15}}]}}}, +"contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol":{"l":{"39":0,"40":0,"42":0,"56":0,"70":0,"71":0,"73":0,"90":7,"91":0,"94":7,"95":7,"97":7,"113":0,"129":0,"130":0,"133":0,"149":0,"165":0,"166":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":7,"9":0,"10":7,"11":7,"12":7,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"b":{"1":[0,7]},"f":{"1":0,"2":0,"3":0,"4":7,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"add","line":38,"loc":{"start":{"line":38,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"sub","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":57,"column":4}}},"3":{"name":"sub","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":74,"column":4}}},"4":{"name":"mul","line":86,"loc":{"start":{"line":86,"column":4},"end":{"line":98,"column":4}}},"5":{"name":"div","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":114,"column":4}}},"6":{"name":"div","line":128,"loc":{"start":{"line":128,"column":4},"end":{"line":134,"column":4}}},"7":{"name":"mod","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":150,"column":4}}},"8":{"name":"mod","line":164,"loc":{"start":{"line":164,"column":4},"end":{"line":167,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":25}},"2":{"start":{"line":40,"column":8},"end":{"line":40,"column":100}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":16}},"4":{"start":{"line":56,"column":8},"end":{"line":56,"column":69}},"5":{"start":{"line":70,"column":8},"end":{"line":70,"column":72}},"6":{"start":{"line":71,"column":8},"end":{"line":71,"column":25}},"7":{"start":{"line":73,"column":8},"end":{"line":73,"column":16}},"8":{"start":{"line":90,"column":8},"end":{"line":90,"column":2816}},"9":{"start":{"line":91,"column":12},"end":{"line":91,"column":20}},"10":{"start":{"line":94,"column":8},"end":{"line":94,"column":25}},"11":{"start":{"line":95,"column":8},"end":{"line":95,"column":110}},"12":{"start":{"line":97,"column":8},"end":{"line":97,"column":16}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":65}},"14":{"start":{"line":129,"column":8},"end":{"line":129,"column":71}},"15":{"start":{"line":130,"column":8},"end":{"line":130,"column":25}},"16":{"start":{"line":133,"column":8},"end":{"line":133,"column":16}},"17":{"start":{"line":149,"column":8},"end":{"line":149,"column":63}},"18":{"start":{"line":165,"column":8},"end":{"line":165,"column":72}},"19":{"start":{"line":166,"column":8},"end":{"line":166,"column":20}}},"branchMap":{"1":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol":{"l":{"63":7,"69":7,"80":7,"83":7,"89":7,"102":7,"103":7,"104":7,"109":7,"115":7,"116":1,"122":1,"123":1,"125":0,"131":6,"133":6},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol","s":{"1":7,"2":7,"3":7,"4":7,"5":7,"6":7,"7":7,"8":7,"9":7,"10":7,"11":1,"12":1,"13":1,"14":0,"15":6,"16":6},"b":{"1":[1,6],"2":[1,0]},"f":{"1":7},"fnMap":{"1":{"name":"execute","line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":139,"column":4}}}},"statementMap":{"1":{"start":{"line":63,"column":8},"end":{"line":63,"column":91}},"2":{"start":{"line":69,"column":8},"end":{"line":69,"column":2653}},"3":{"start":{"line":80,"column":8},"end":{"line":80,"column":119}},"4":{"start":{"line":83,"column":8},"end":{"line":83,"column":3201}},"5":{"start":{"line":89,"column":8},"end":{"line":89,"column":3483}},"6":{"start":{"line":102,"column":8},"end":{"line":102,"column":70}},"7":{"start":{"line":103,"column":8},"end":{"line":103,"column":85}},"8":{"start":{"line":104,"column":8},"end":{"line":104,"column":4275}},"9":{"start":{"line":109,"column":8},"end":{"line":109,"column":4487}},"10":{"start":{"line":115,"column":8},"end":{"line":115,"column":4721}},"11":{"start":{"line":116,"column":12},"end":{"line":116,"column":4772}},"12":{"start":{"line":122,"column":12},"end":{"line":122,"column":5049}},"13":{"start":{"line":123,"column":16},"end":{"line":123,"column":50}},"14":{"start":{"line":125,"column":16},"end":{"line":125,"column":42}},"15":{"start":{"line":131,"column":12},"end":{"line":131,"column":76}},"16":{"start":{"line":133,"column":12},"end":{"line":133,"column":5602}}},"branchMap":{"1":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":8},"end":{"line":115,"column":8}},{"start":{"line":115,"column":8},"end":{"line":115,"column":8}}]},"2":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":12},"end":{"line":122,"column":12}},{"start":{"line":122,"column":12},"end":{"line":122,"column":12}}]}}}, +"contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol":{"l":{"39":13,"50":1,"56":1,"57":1,"61":0,"81":2,"86":2,"99":2,"116":15},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol","s":{"1":13,"2":1,"3":1,"4":0,"5":2,"6":2,"7":2,"8":15},"b":{"1":[1,0]},"f":{"1":13,"2":1,"3":2,"4":2,"5":15},"fnMap":{"1":{"name":"constructor","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":40,"column":4}}},"2":{"name":null,"line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":65,"column":4}}},"3":{"name":"upgrade","line":76,"loc":{"start":{"line":76,"column":4},"end":{"line":87,"column":4}}},"4":{"name":"getImplementation","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":104,"column":4}}},"5":{"name":"_setImplementation","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":120,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":42}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":1366}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":1554}},"4":{"start":{"line":61,"column":12},"end":{"line":61,"column":1704}},"5":{"start":{"line":81,"column":8},"end":{"line":81,"column":2100}},"6":{"start":{"line":86,"column":8},"end":{"line":86,"column":42}},"7":{"start":{"line":99,"column":8},"end":{"line":99,"column":2610}},"8":{"start":{"line":116,"column":8},"end":{"line":116,"column":2955}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol":{"l":{"47":4,"48":0,"65":7,"72":7,"73":7,"75":7,"76":7,"103":21,"124":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol","s":{"1":4,"2":0,"3":7,"4":7,"5":7,"6":7,"7":7,"8":21,"9":0},"b":{"1":[0,4]},"f":{"1":54,"2":4,"3":7,"4":21,"5":0},"fnMap":{"1":{"name":"constructor","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":41}}},"2":{"name":"xDomainMessageSender","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"sendMessage","line":57,"loc":{"start":{"line":57,"column":4},"end":{"line":77,"column":4}}},"4":{"name":"_getXDomainCalldata","line":91,"loc":{"start":{"line":91,"column":4},"end":{"line":110,"column":4}}},"5":{"name":"_sendXDomainMessage","line":117,"loc":{"start":{"line":117,"column":4},"end":{"line":125,"column":4}}}},"statementMap":{"1":{"start":{"line":47,"column":8},"end":{"line":47,"column":93}},"2":{"start":{"line":48,"column":8},"end":{"line":48,"column":31}},"3":{"start":{"line":65,"column":8},"end":{"line":65,"column":2352}},"4":{"start":{"line":72,"column":8},"end":{"line":72,"column":24}},"5":{"start":{"line":73,"column":8},"end":{"line":73,"column":54}},"6":{"start":{"line":75,"column":8},"end":{"line":75,"column":54}},"7":{"start":{"line":76,"column":8},"end":{"line":76,"column":41}},"8":{"start":{"line":103,"column":8},"end":{"line":103,"column":3373}},"9":{"start":{"line":124,"column":8},"end":{"line":124,"column":49}}},"branchMap":{"1":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":8}},{"start":{"line":47,"column":8},"end":{"line":47,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol":{"l":{"50":12,"51":12,"52":12,"64":9,"65":9,"66":1,"71":8,"95":8,"102":8,"110":4,"112":4,"117":3,"118":3,"119":3,"123":3,"124":3,"125":3,"130":3,"137":3,"154":2,"161":2,"166":1,"190":8,"210":8,"212":8,"238":6,"250":6,"259":5,"264":5,"268":5,"288":5},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol","s":{"1":12,"2":12,"3":12,"4":9,"5":9,"6":1,"7":8,"8":8,"9":4,"10":4,"11":3,"12":3,"13":3,"14":3,"15":3,"16":3,"17":3,"18":3,"19":2,"20":2,"21":1,"22":8,"23":8,"24":8,"25":6,"26":6,"27":5,"28":5,"29":5,"30":5},"b":{"1":[12,0],"2":[1,8],"3":[0,1],"4":[4,4],"5":[3,1],"6":[3,0],"7":[1,1],"8":[5,0]},"f":{"1":36,"2":12,"3":9,"4":8,"5":2,"6":8,"7":8,"8":6,"9":5},"fnMap":{"1":{"name":"constructor","line":39,"loc":{"start":{"line":38,"column":4},"end":{"line":40,"column":5}}},"2":{"name":"initialize","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":53,"column":4}}},"3":{"name":"onlyRelayer","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":72,"column":4}}},"4":{"name":"relayMessage","line":93,"loc":{"start":{"line":83,"column":4},"end":{"line":138,"column":4}}},"5":{"name":"replayMessage","line":144,"loc":{"start":{"line":144,"column":4},"end":{"line":167,"column":4}}},"6":{"name":"_verifyXDomainMessage","line":180,"loc":{"start":{"line":180,"column":4},"end":{"line":194,"column":4}}},"7":{"name":"_verifyStateRootProof","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":220,"column":4}}},"8":{"name":"_verifyStorageProof","line":228,"loc":{"start":{"line":228,"column":4},"end":{"line":274,"column":4}}},"9":{"name":"_sendXDomainMessage","line":281,"loc":{"start":{"line":281,"column":4},"end":{"line":293,"column":4}}}},"statementMap":{"1":{"start":{"line":50,"column":8},"end":{"line":50,"column":102}},"2":{"start":{"line":51,"column":8},"end":{"line":51,"column":65}},"3":{"start":{"line":52,"column":8},"end":{"line":52,"column":48}},"4":{"start":{"line":64,"column":8},"end":{"line":64,"column":57}},"5":{"start":{"line":65,"column":8},"end":{"line":65,"column":2460}},"6":{"start":{"line":66,"column":12},"end":{"line":66,"column":2505}},"7":{"start":{"line":95,"column":8},"end":{"line":95,"column":3142}},"8":{"start":{"line":102,"column":8},"end":{"line":102,"column":3303}},"9":{"start":{"line":110,"column":8},"end":{"line":110,"column":64}},"10":{"start":{"line":112,"column":8},"end":{"line":112,"column":3567}},"11":{"start":{"line":117,"column":8},"end":{"line":117,"column":33}},"12":{"start":{"line":118,"column":8},"end":{"line":118,"column":49}},"13":{"start":{"line":119,"column":8},"end":{"line":119,"column":48}},"14":{"start":{"line":123,"column":8},"end":{"line":123,"column":4023}},"15":{"start":{"line":124,"column":12},"end":{"line":124,"column":57}},"16":{"start":{"line":125,"column":12},"end":{"line":125,"column":52}},"17":{"start":{"line":130,"column":8},"end":{"line":130,"column":4350}},"18":{"start":{"line":137,"column":8},"end":{"line":137,"column":38}},"19":{"start":{"line":154,"column":8},"end":{"line":154,"column":4915}},"20":{"start":{"line":161,"column":8},"end":{"line":161,"column":5076}},"21":{"start":{"line":166,"column":8},"end":{"line":166,"column":54}},"22":{"start":{"line":190,"column":8},"end":{"line":190,"column":5816}},"23":{"start":{"line":210,"column":8},"end":{"line":210,"column":122}},"24":{"start":{"line":212,"column":8},"end":{"line":212,"column":6441}},"25":{"start":{"line":238,"column":8},"end":{"line":238,"column":7225}},"26":{"start":{"line":250,"column":8},"end":{"line":250,"column":7558}},"27":{"start":{"line":259,"column":8},"end":{"line":259,"column":7836}},"28":{"start":{"line":264,"column":8},"end":{"line":264,"column":7986}},"29":{"start":{"line":268,"column":8},"end":{"line":268,"column":8119}},"30":{"start":{"line":288,"column":8},"end":{"line":288,"column":8632}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]},"2":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]},"3":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":12},"end":{"line":66,"column":12}},{"start":{"line":66,"column":12},"end":{"line":66,"column":12}}]},"4":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"5":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":8},"end":{"line":112,"column":8}},{"start":{"line":112,"column":8},"end":{"line":112,"column":8}}]},"6":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"7":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":8}},{"start":{"line":161,"column":8},"end":{"line":161,"column":8}}]},"8":{"line":259,"type":"if","locations":[{"start":{"line":259,"column":8},"end":{"line":259,"column":8}},{"start":{"line":259,"column":8},"end":{"line":259,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol":{"l":{"38":2,"42":1,"58":1,"59":1,"60":3,"61":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol","s":{"1":2,"2":1,"3":1,"4":3,"5":3},"b":{"1":[1,1]},"f":{"1":6,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":30,"loc":{"start":{"line":27,"column":4},"end":{"line":31,"column":5}}},"2":{"name":"onlyBatchRelayer","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"batchRelayMessages","line":56,"loc":{"start":{"line":53,"column":4},"end":{"line":69,"column":4}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":1192}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":121}},"3":{"start":{"line":59,"column":8},"end":{"line":59,"column":1913}},"4":{"start":{"line":60,"column":12},"end":{"line":60,"column":55}},"5":{"start":{"line":61,"column":12},"end":{"line":61,"column":2035}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":8}},{"start":{"line":38,"column":8},"end":{"line":38,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol":{"l":{"59":5,"64":4,"71":4,"73":4,"78":3,"79":3,"80":3,"84":3,"85":3,"86":3,"91":3,"98":3,"117":5,"134":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol","s":{"1":5,"2":4,"3":4,"4":4,"5":3,"6":3,"7":3,"8":3,"9":3,"10":3,"11":3,"12":3,"13":5,"14":3},"b":{"1":[4,1],"2":[3,1],"3":[3,0]},"f":{"1":18,"2":5,"3":5,"4":3},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":34,"column":4},"end":{"line":38,"column":5}}},"2":{"name":"relayMessage","line":56,"loc":{"start":{"line":49,"column":4},"end":{"line":99,"column":4}}},"3":{"name":"_verifyXDomainMessage","line":110,"loc":{"start":{"line":110,"column":4},"end":{"line":120,"column":4}}},"4":{"name":"_sendXDomainMessage","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":135,"column":4}}}},"statementMap":{"1":{"start":{"line":59,"column":8},"end":{"line":59,"column":1793}},"2":{"start":{"line":64,"column":8},"end":{"line":64,"column":1922}},"3":{"start":{"line":71,"column":8},"end":{"line":71,"column":64}},"4":{"start":{"line":73,"column":8},"end":{"line":73,"column":2150}},"5":{"start":{"line":78,"column":8},"end":{"line":78,"column":33}},"6":{"start":{"line":79,"column":8},"end":{"line":79,"column":49}},"7":{"start":{"line":80,"column":8},"end":{"line":80,"column":48}},"8":{"start":{"line":84,"column":8},"end":{"line":84,"column":2606}},"9":{"start":{"line":85,"column":12},"end":{"line":85,"column":57}},"10":{"start":{"line":86,"column":12},"end":{"line":86,"column":52}},"11":{"start":{"line":91,"column":8},"end":{"line":91,"column":2933}},"12":{"start":{"line":98,"column":8},"end":{"line":98,"column":38}},"13":{"start":{"line":117,"column":8},"end":{"line":117,"column":3513}},"14":{"start":{"line":134,"column":8},"end":{"line":134,"column":93}}},"branchMap":{"1":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":8},"end":{"line":59,"column":8}},{"start":{"line":59,"column":8},"end":{"line":59,"column":8}}]},"2":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":8},"end":{"line":73,"column":8}},{"start":{"line":73,"column":8},"end":{"line":73,"column":8}}]},"3":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":8},"end":{"line":84,"column":8}},{"start":{"line":84,"column":8},"end":{"line":84,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol":{"l":{"48":24,"72":0,"91":0,"107":2,"124":1,"139":1,"158":2,"165":2,"172":2,"178":2,"202":1,"207":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol","s":{"1":24,"2":0,"3":0,"4":2,"5":1,"6":1,"7":2,"8":2,"9":2,"10":2,"11":1,"12":1},"b":{},"f":{"1":24,"2":0,"3":0,"4":2,"5":1,"6":1,"7":2,"8":1},"fnMap":{"1":{"name":"constructor","line":46,"loc":{"start":{"line":42,"column":4},"end":{"line":49,"column":4}}},"2":{"name":"_handleFinalizeWithdrawal","line":65,"loc":{"start":{"line":65,"column":4},"end":{"line":73,"column":4}}},"3":{"name":"_handleInitiateDeposit","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":92,"column":4}}},"4":{"name":"getFinalizeDepositL2Gas","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":108,"column":4}}},"5":{"name":"deposit","line":118,"loc":{"start":{"line":118,"column":4},"end":{"line":125,"column":4}}},"6":{"name":"depositTo","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"7":{"name":"_initiateDeposit","line":150,"loc":{"start":{"line":150,"column":4},"end":{"line":179,"column":4}}},"8":{"name":"finalizeWithdrawal","line":199,"loc":{"start":{"line":193,"column":4},"end":{"line":208,"column":4}}}},"statementMap":{"1":{"start":{"line":48,"column":8},"end":{"line":48,"column":43}},"2":{"start":{"line":72,"column":8},"end":{"line":72,"column":48}},"3":{"start":{"line":91,"column":8},"end":{"line":91,"column":48}},"4":{"start":{"line":107,"column":8},"end":{"line":107,"column":46}},"5":{"start":{"line":124,"column":8},"end":{"line":124,"column":56}},"6":{"start":{"line":139,"column":8},"end":{"line":139,"column":49}},"7":{"start":{"line":158,"column":8},"end":{"line":158,"column":4675}},"8":{"start":{"line":165,"column":8},"end":{"line":165,"column":4857}},"9":{"start":{"line":172,"column":8},"end":{"line":172,"column":5050}},"10":{"start":{"line":178,"column":8},"end":{"line":178,"column":50}},"11":{"start":{"line":202,"column":8},"end":{"line":202,"column":5940}},"12":{"start":{"line":207,"column":8},"end":{"line":207,"column":46}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol":{"l":{"64":8,"66":8,"68":8,"76":5,"77":5,"102":0,"119":0,"136":9,"155":1,"171":1,"187":2,"190":2,"197":2,"203":2,"227":1,"228":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol","s":{"1":8,"2":8,"3":8,"4":5,"5":0,"6":0,"7":9,"8":1,"9":1,"10":2,"11":2,"12":2,"13":2,"14":1,"15":1},"b":{"1":[8,0],"2":[5,0]},"f":{"1":30,"2":8,"3":5,"4":0,"5":0,"6":9,"7":1,"8":1,"9":2,"10":1},"fnMap":{"1":{"name":"constructor","line":48,"loc":{"start":{"line":45,"column":4},"end":{"line":49,"column":5}}},"2":{"name":"init","line":59,"loc":{"start":{"line":59,"column":4},"end":{"line":69,"column":4}}},"3":{"name":"onlyInitialized","line":75,"loc":{"start":{"line":75,"column":4},"end":{"line":78,"column":4}}},"4":{"name":"_handleInitiateWithdrawal","line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":103,"column":4}}},"5":{"name":"_handleFinalizeDeposit","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":120,"column":4}}},"6":{"name":"getFinalizeWithdrawalL1Gas","line":128,"loc":{"start":{"line":128,"column":4},"end":{"line":137,"column":4}}},"7":{"name":"withdraw","line":153,"loc":{"start":{"line":148,"column":4},"end":{"line":156,"column":4}}},"8":{"name":"withdrawTo","line":169,"loc":{"start":{"line":163,"column":4},"end":{"line":172,"column":4}}},"9":{"name":"_initiateWithdrawal","line":180,"loc":{"start":{"line":180,"column":4},"end":{"line":204,"column":4}}},"10":{"name":"finalizeDeposit","line":225,"loc":{"start":{"line":218,"column":4},"end":{"line":229,"column":4}}}},"statementMap":{"1":{"start":{"line":64,"column":8},"end":{"line":64,"column":94}},"2":{"start":{"line":66,"column":8},"end":{"line":66,"column":39}},"3":{"start":{"line":68,"column":8},"end":{"line":68,"column":40}},"4":{"start":{"line":76,"column":8},"end":{"line":76,"column":94}},"5":{"start":{"line":102,"column":8},"end":{"line":102,"column":66}},"6":{"start":{"line":119,"column":8},"end":{"line":119,"column":66}},"7":{"start":{"line":136,"column":8},"end":{"line":136,"column":49}},"8":{"start":{"line":155,"column":8},"end":{"line":155,"column":47}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":40}},"10":{"start":{"line":187,"column":8},"end":{"line":187,"column":46}},"11":{"start":{"line":190,"column":8},"end":{"line":190,"column":5686}},"12":{"start":{"line":197,"column":8},"end":{"line":197,"column":5888}},"13":{"start":{"line":203,"column":8},"end":{"line":203,"column":58}},"14":{"start":{"line":227,"column":8},"end":{"line":227,"column":43}},"15":{"start":{"line":228,"column":8},"end":{"line":228,"column":43}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"2":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol":{"l":{"51":24,"76":2,"98":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol","s":{"1":24,"2":2,"3":1},"b":{},"f":{"1":24,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":49,"loc":{"start":{"line":41,"column":4},"end":{"line":52,"column":4}}},"2":{"name":"_handleInitiateDeposit","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":81,"column":4}}},"3":{"name":"_handleFinalizeWithdrawal","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":99,"column":4}}}},"statementMap":{"1":{"start":{"line":51,"column":8},"end":{"line":51,"column":25}},"2":{"start":{"line":76,"column":8},"end":{"line":76,"column":2273}},"3":{"start":{"line":98,"column":8},"end":{"line":98,"column":37}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol":{"l":{"50":24,"51":24,"62":0,"73":2,"87":1,"103":3,"111":3,"117":3,"140":1,"142":1,"161":1,"162":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol","s":{"1":24,"2":24,"3":2,"4":1,"5":3,"6":3,"7":3,"8":1,"9":1,"10":1,"11":1},"b":{"1":[1,0]},"f":{"1":24,"2":2,"3":1,"4":3,"5":1,"6":1},"fnMap":{"1":{"name":"constructor","line":48,"loc":{"start":{"line":43,"column":4},"end":{"line":52,"column":4}}},"2":{"name":"deposit","line":68,"loc":{"start":{"line":68,"column":4},"end":{"line":74,"column":4}}},"3":{"name":"depositTo","line":80,"loc":{"start":{"line":80,"column":4},"end":{"line":88,"column":4}}},"4":{"name":"_initiateDeposit","line":96,"loc":{"start":{"line":96,"column":4},"end":{"line":118,"column":4}}},"5":{"name":"finalizeWithdrawal","line":138,"loc":{"start":{"line":132,"column":4},"end":{"line":143,"column":4}}},"6":{"name":"_safeTransferETH","line":155,"loc":{"start":{"line":155,"column":4},"end":{"line":163,"column":4}}}},"statementMap":{"1":{"start":{"line":50,"column":8},"end":{"line":50,"column":23}},"2":{"start":{"line":51,"column":8},"end":{"line":51,"column":63}},"3":{"start":{"line":73,"column":8},"end":{"line":73,"column":47}},"4":{"start":{"line":87,"column":8},"end":{"line":87,"column":40}},"5":{"start":{"line":103,"column":8},"end":{"line":103,"column":2878}},"6":{"start":{"line":111,"column":8},"end":{"line":111,"column":3097}},"7":{"start":{"line":117,"column":8},"end":{"line":117,"column":52}},"8":{"start":{"line":140,"column":8},"end":{"line":140,"column":37}},"9":{"start":{"line":142,"column":8},"end":{"line":142,"column":46}},"10":{"start":{"line":161,"column":8},"end":{"line":161,"column":64}},"11":{"start":{"line":162,"column":8},"end":{"line":162,"column":79}}},"branchMap":{"1":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol":{"l":{"54":2,"65":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol","s":{"1":2,"2":1},"b":{},"f":{"1":30,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":43,"loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":5}}},"2":{"name":"_handleInitiateWithdrawal","line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":55,"column":4}}},"3":{"name":"_handleFinalizeDeposit","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":66,"column":4}}}},"statementMap":{"1":{"start":{"line":54,"column":8},"end":{"line":54,"column":33}},"2":{"start":{"line":65,"column":8},"end":{"line":65,"column":26}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol":{"l":{"73":222,"74":222,"75":222,"95":559,"112":382,"129":291,"130":291,"145":0,"160":100,"161":100,"176":0,"177":0,"192":0,"193":0,"211":47,"229":0,"245":0,"264":239,"269":238,"274":237,"282":236,"283":236,"287":236,"294":235,"295":235,"296":37600,"299":235,"308":235,"309":235,"314":235,"316":235,"317":235,"322":235,"323":235,"345":1,"397":104,"398":104,"399":104,"400":104,"406":104,"411":103,"416":102,"421":101,"426":100,"428":100,"436":100,"437":100,"442":100,"445":100,"448":100,"451":100,"455":100,"457":100,"458":100,"459":232,"461":232,"463":100,"467":226,"475":221,"478":221,"479":439,"480":439,"484":439,"491":439,"492":439,"493":439,"497":221,"498":179,"503":178,"504":178,"505":178,"509":88,"516":82,"521":81,"527":81,"528":81,"529":81,"530":81,"532":39,"533":39,"539":42,"544":42,"545":42,"551":81,"559":81,"587":2,"588":1,"595":1,"623":232,"624":232,"625":232,"626":232,"627":232,"629":232,"636":232,"659":476,"661":476,"662":476,"663":476,"664":476,"665":476,"673":476,"701":81,"702":81,"710":81,"727":179,"756":267,"757":267,"758":265,"760":265,"761":265,"762":265,"767":265,"790":100,"813":439,"814":419,"817":439,"818":439,"820":439,"821":439,"838":439,"855":1,"856":1,"858":1,"859":1,"860":1,"862":1,"863":1,"880":1,"900":81,"901":81,"903":81,"911":81,"919":81,"920":81,"927":81,"942":100,"943":4,"945":4,"950":2,"957":96,"962":95,"982":178,"988":177,"995":176,"1000":174,"1023":226,"1028":225,"1034":224,"1035":175,"1060":88,"1061":3,"1068":85,"1069":83,"1086":179,"1117":1,"1118":1,"1119":1,"1121":1,"1130":1,"1141":1,"1164":1,"1166":1,"1175":1,"1184":1,"1185":1,"1192":1,"1212":2,"1217":2,"1228":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol","s":{"1":222,"2":222,"3":222,"4":559,"5":382,"6":291,"7":291,"8":0,"9":100,"10":100,"11":0,"12":0,"13":0,"14":0,"15":47,"16":0,"17":0,"18":239,"19":238,"20":237,"21":236,"22":236,"23":236,"24":235,"25":235,"26":235,"27":235,"28":235,"29":235,"30":235,"31":235,"32":235,"33":1,"34":104,"35":104,"36":104,"37":104,"38":103,"39":102,"40":101,"41":100,"42":100,"43":100,"44":100,"45":100,"46":100,"47":100,"48":100,"49":100,"50":100,"51":100,"52":232,"53":232,"54":100,"55":226,"56":221,"57":221,"58":439,"59":439,"60":439,"61":221,"62":179,"63":178,"64":88,"65":82,"66":81,"67":81,"68":81,"69":81,"70":81,"71":39,"72":39,"73":42,"74":42,"75":42,"76":81,"77":81,"78":2,"79":1,"80":1,"81":232,"82":232,"83":232,"84":232,"85":232,"86":232,"87":476,"88":476,"89":476,"90":476,"91":476,"92":476,"93":81,"94":81,"95":179,"96":267,"97":267,"98":265,"99":265,"100":265,"101":265,"102":100,"103":439,"104":419,"105":439,"106":439,"107":439,"108":439,"109":1,"110":1,"111":1,"112":1,"113":1,"114":1,"115":1,"116":81,"117":81,"118":81,"119":81,"120":81,"121":81,"122":81,"123":100,"124":4,"125":4,"126":2,"127":96,"128":95,"129":178,"130":177,"131":176,"132":174,"133":226,"134":225,"135":224,"136":175,"137":88,"138":3,"139":85,"140":83,"141":179,"142":1,"143":1,"144":1,"145":1,"146":1,"147":1,"148":1,"149":1,"150":1,"151":1,"152":1,"153":1,"154":2,"155":2,"156":2},"b":{"1":[238,1],"2":[237,1],"3":[236,1],"4":[235,1],"5":[103,1],"6":[102,1],"7":[101,1],"8":[100,1],"9":[100,0],"10":[100,132],"11":[178,1],"12":[81,1],"13":[81,0],"14":[39,42],"15":[1,1],"16":[419,20],"17":[4,96],"18":[2,2],"19":[0,2],"20":[95,1],"21":[94,1],"22":[176,1],"23":[174,2],"24":[172,2],"25":[225,1],"26":[224,1],"27":[175,49],"28":[3,85],"29":[83,2],"30":[82,1],"31":[1,0],"32":[1,0],"33":[1,0],"34":[1,0],"35":[2,0],"36":[2,0]},"f":{"1":222,"2":559,"3":382,"4":291,"5":0,"6":100,"7":0,"8":0,"9":47,"10":0,"11":0,"12":239,"13":1,"14":104,"15":2,"16":232,"17":476,"18":81,"19":179,"20":267,"21":100,"22":439,"23":1,"24":81,"25":100,"26":178,"27":226,"28":88,"29":179,"30":1,"31":1,"32":2},"fnMap":{"1":{"name":"constructor","line":71,"loc":{"start":{"line":65,"column":4},"end":{"line":76,"column":4}}},"2":{"name":"batches","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":98,"column":4}}},"3":{"name":"queue","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":115,"column":4}}},"4":{"name":"getTotalElements","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":131,"column":4}}},"5":{"name":"getTotalBatches","line":137,"loc":{"start":{"line":137,"column":4},"end":{"line":146,"column":4}}},"6":{"name":"getNextQueueIndex","line":152,"loc":{"start":{"line":152,"column":4},"end":{"line":162,"column":4}}},"7":{"name":"getLastTimestamp","line":168,"loc":{"start":{"line":168,"column":4},"end":{"line":178,"column":4}}},"8":{"name":"getLastBlockNumber","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":194,"column":4}}},"9":{"name":"getQueueElement","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":215,"column":4}}},"10":{"name":"getNumPendingQueueElements","line":221,"loc":{"start":{"line":221,"column":4},"end":{"line":230,"column":4}}},"11":{"name":"getQueueLength","line":237,"loc":{"start":{"line":237,"column":4},"end":{"line":248,"column":4}}},"12":{"name":"enqueue","line":256,"loc":{"start":{"line":256,"column":4},"end":{"line":331,"column":4}}},"13":{"name":"appendQueueBatch","line":337,"loc":{"start":{"line":337,"column":4},"end":{"line":383,"column":4}}},"14":{"name":"appendSequencerBatch","line":393,"loc":{"start":{"line":393,"column":4},"end":{"line":564,"column":4}}},"15":{"name":"verifyTransaction","line":574,"loc":{"start":{"line":574,"column":4},"end":{"line":602,"column":4}}},"16":{"name":"_getBatchContext","line":614,"loc":{"start":{"line":614,"column":4},"end":{"line":642,"column":4}}},"17":{"name":"_getBatchExtraData","line":649,"loc":{"start":{"line":649,"column":4},"end":{"line":679,"column":4}}},"18":{"name":"_makeBatchExtraData","line":689,"loc":{"start":{"line":689,"column":4},"end":{"line":711,"column":4}}},"19":{"name":"_getQueueLeafHash","line":718,"loc":{"start":{"line":718,"column":4},"end":{"line":736,"column":4}}},"20":{"name":"_getQueueElement","line":743,"loc":{"start":{"line":743,"column":4},"end":{"line":772,"column":4}}},"21":{"name":"_getQueueLength","line":778,"loc":{"start":{"line":778,"column":4},"end":{"line":791,"column":4}}},"22":{"name":"_getSequencerLeafHash","line":800,"loc":{"start":{"line":800,"column":4},"end":{"line":839,"column":4}}},"23":{"name":"_getSequencerLeafHash","line":846,"loc":{"start":{"line":846,"column":4},"end":{"line":881,"column":4}}},"24":{"name":"_appendBatch","line":891,"loc":{"start":{"line":891,"column":4},"end":{"line":928,"column":4}}},"25":{"name":"_validateFirstBatchContext","line":934,"loc":{"start":{"line":934,"column":4},"end":{"line":966,"column":4}}},"26":{"name":"_validateContextBeforeEnqueue","line":974,"loc":{"start":{"line":974,"column":4},"end":{"line":1004,"column":4}}},"27":{"name":"_validateNextBatchContext","line":1013,"loc":{"start":{"line":1013,"column":4},"end":{"line":1041,"column":4}}},"28":{"name":"_validateFinalBatchContext","line":1050,"loc":{"start":{"line":1050,"column":4},"end":{"line":1070,"column":4}}},"29":{"name":"_hashTransactionChainElement","line":1077,"loc":{"start":{"line":1077,"column":4},"end":{"line":1095,"column":4}}},"30":{"name":"_verifySequencerTransaction","line":1105,"loc":{"start":{"line":1105,"column":4},"end":{"line":1142,"column":4}}},"31":{"name":"_verifyQueueTransaction","line":1152,"loc":{"start":{"line":1152,"column":4},"end":{"line":1193,"column":4}}},"32":{"name":"_verifyElement","line":1201,"loc":{"start":{"line":1201,"column":4},"end":{"line":1229,"column":4}}}},"statementMap":{"1":{"start":{"line":73,"column":8},"end":{"line":73,"column":65}},"2":{"start":{"line":74,"column":8},"end":{"line":74,"column":63}},"3":{"start":{"line":75,"column":8},"end":{"line":75,"column":55}},"4":{"start":{"line":95,"column":8},"end":{"line":95,"column":3203}},"5":{"start":{"line":112,"column":8},"end":{"line":112,"column":3582}},"6":{"start":{"line":129,"column":8},"end":{"line":129,"column":56}},"7":{"start":{"line":130,"column":8},"end":{"line":130,"column":37}},"8":{"start":{"line":145,"column":8},"end":{"line":145,"column":33}},"9":{"start":{"line":160,"column":8},"end":{"line":160,"column":57}},"10":{"start":{"line":161,"column":8},"end":{"line":161,"column":29}},"11":{"start":{"line":176,"column":8},"end":{"line":176,"column":56}},"12":{"start":{"line":177,"column":8},"end":{"line":177,"column":28}},"13":{"start":{"line":192,"column":8},"end":{"line":192,"column":58}},"14":{"start":{"line":193,"column":8},"end":{"line":193,"column":30}},"15":{"start":{"line":211,"column":8},"end":{"line":211,"column":5827}},"16":{"start":{"line":229,"column":8},"end":{"line":229,"column":53}},"17":{"start":{"line":245,"column":8},"end":{"line":245,"column":6538}},"18":{"start":{"line":264,"column":8},"end":{"line":264,"column":6982}},"19":{"start":{"line":269,"column":8},"end":{"line":269,"column":7135}},"20":{"start":{"line":274,"column":8},"end":{"line":274,"column":7289}},"21":{"start":{"line":282,"column":8},"end":{"line":282,"column":64}},"22":{"start":{"line":283,"column":8},"end":{"line":283,"column":39}},"23":{"start":{"line":287,"column":8},"end":{"line":287,"column":7932}},"24":{"start":{"line":294,"column":8},"end":{"line":294,"column":17}},"25":{"start":{"line":295,"column":8},"end":{"line":295,"column":8239}},"26":{"start":{"line":299,"column":8},"end":{"line":299,"column":8324}},"27":{"start":{"line":308,"column":8},"end":{"line":308,"column":39}},"28":{"start":{"line":314,"column":8},"end":{"line":314,"column":53}},"29":{"start":{"line":316,"column":8},"end":{"line":316,"column":37}},"30":{"start":{"line":317,"column":8},"end":{"line":317,"column":45}},"31":{"start":{"line":322,"column":8},"end":{"line":322,"column":54}},"32":{"start":{"line":323,"column":8},"end":{"line":323,"column":9103}},"33":{"start":{"line":345,"column":8},"end":{"line":345,"column":56}},"34":{"start":{"line":397,"column":8},"end":{"line":397,"column":35}},"35":{"start":{"line":398,"column":8},"end":{"line":398,"column":36}},"36":{"start":{"line":399,"column":8},"end":{"line":399,"column":26}},"37":{"start":{"line":406,"column":8},"end":{"line":406,"column":12031}},"38":{"start":{"line":411,"column":8},"end":{"line":411,"column":12192}},"39":{"start":{"line":416,"column":8},"end":{"line":416,"column":12333}},"40":{"start":{"line":421,"column":8},"end":{"line":421,"column":12446}},"41":{"start":{"line":426,"column":8},"end":{"line":426,"column":102}},"42":{"start":{"line":428,"column":8},"end":{"line":428,"column":12667}},"43":{"start":{"line":436,"column":8},"end":{"line":436,"column":53}},"44":{"start":{"line":437,"column":8},"end":{"line":437,"column":54}},"45":{"start":{"line":442,"column":8},"end":{"line":442,"column":90}},"46":{"start":{"line":445,"column":8},"end":{"line":445,"column":70}},"47":{"start":{"line":448,"column":8},"end":{"line":448,"column":28}},"48":{"start":{"line":451,"column":8},"end":{"line":451,"column":43}},"49":{"start":{"line":455,"column":8},"end":{"line":455,"column":51}},"50":{"start":{"line":457,"column":8},"end":{"line":457,"column":38}},"51":{"start":{"line":458,"column":8},"end":{"line":458,"column":14097}},"52":{"start":{"line":459,"column":12},"end":{"line":459,"column":65}},"53":{"start":{"line":461,"column":12},"end":{"line":461,"column":14224}},"54":{"start":{"line":463,"column":16},"end":{"line":463,"column":54}},"55":{"start":{"line":467,"column":12},"end":{"line":467,"column":14468}},"56":{"start":{"line":475,"column":12},"end":{"line":475,"column":35}},"57":{"start":{"line":478,"column":12},"end":{"line":478,"column":14783}},"58":{"start":{"line":479,"column":16},"end":{"line":479,"column":36}},"59":{"start":{"line":484,"column":16},"end":{"line":484,"column":15033}},"60":{"start":{"line":491,"column":16},"end":{"line":491,"column":79}},"61":{"start":{"line":497,"column":12},"end":{"line":497,"column":15473}},"62":{"start":{"line":498,"column":16},"end":{"line":498,"column":15566}},"63":{"start":{"line":503,"column":16},"end":{"line":503,"column":68}},"64":{"start":{"line":509,"column":8},"end":{"line":509,"column":15868}},"65":{"start":{"line":516,"column":8},"end":{"line":516,"column":16014}},"66":{"start":{"line":521,"column":8},"end":{"line":521,"column":16155}},"67":{"start":{"line":527,"column":8},"end":{"line":527,"column":87}},"68":{"start":{"line":528,"column":8},"end":{"line":528,"column":29}},"69":{"start":{"line":529,"column":8},"end":{"line":529,"column":26}},"70":{"start":{"line":530,"column":8},"end":{"line":530,"column":16545}},"71":{"start":{"line":532,"column":12},"end":{"line":532,"column":56}},"72":{"start":{"line":533,"column":12},"end":{"line":533,"column":55}},"73":{"start":{"line":539,"column":12},"end":{"line":539,"column":17265}},"74":{"start":{"line":544,"column":12},"end":{"line":544,"column":49}},"75":{"start":{"line":545,"column":12},"end":{"line":545,"column":48}},"76":{"start":{"line":551,"column":8},"end":{"line":551,"column":17737}},"77":{"start":{"line":559,"column":8},"end":{"line":559,"column":17944}},"78":{"start":{"line":587,"column":8},"end":{"line":587,"column":18958}},"79":{"start":{"line":588,"column":12},"end":{"line":588,"column":19018}},"80":{"start":{"line":595,"column":12},"end":{"line":595,"column":19223}},"81":{"start":{"line":623,"column":8},"end":{"line":623,"column":61}},"82":{"start":{"line":624,"column":8},"end":{"line":624,"column":40}},"83":{"start":{"line":625,"column":8},"end":{"line":625,"column":46}},"84":{"start":{"line":626,"column":8},"end":{"line":626,"column":28}},"85":{"start":{"line":627,"column":8},"end":{"line":627,"column":30}},"86":{"start":{"line":636,"column":8},"end":{"line":636,"column":20452}},"87":{"start":{"line":659,"column":8},"end":{"line":659,"column":57}},"88":{"start":{"line":661,"column":8},"end":{"line":661,"column":28}},"89":{"start":{"line":662,"column":8},"end":{"line":662,"column":29}},"90":{"start":{"line":663,"column":8},"end":{"line":663,"column":28}},"91":{"start":{"line":664,"column":8},"end":{"line":664,"column":30}},"92":{"start":{"line":673,"column":8},"end":{"line":673,"column":21814}},"93":{"start":{"line":701,"column":8},"end":{"line":701,"column":25}},"94":{"start":{"line":710,"column":8},"end":{"line":710,"column":24}},"95":{"start":{"line":727,"column":8},"end":{"line":727,"column":23233}},"96":{"start":{"line":756,"column":8},"end":{"line":756,"column":45}},"97":{"start":{"line":757,"column":8},"end":{"line":757,"column":58}},"98":{"start":{"line":758,"column":8},"end":{"line":758,"column":70}},"99":{"start":{"line":760,"column":8},"end":{"line":760,"column":31}},"100":{"start":{"line":761,"column":8},"end":{"line":761,"column":33}},"101":{"start":{"line":767,"column":8},"end":{"line":767,"column":24663}},"102":{"start":{"line":790,"column":8},"end":{"line":790,"column":45}},"103":{"start":{"line":813,"column":8},"end":{"line":813,"column":25984}},"104":{"start":{"line":814,"column":12},"end":{"line":814,"column":70}},"105":{"start":{"line":817,"column":8},"end":{"line":817,"column":49}},"106":{"start":{"line":818,"column":8},"end":{"line":818,"column":53}},"107":{"start":{"line":820,"column":8},"end":{"line":820,"column":24}},"108":{"start":{"line":838,"column":8},"end":{"line":838,"column":23}},"109":{"start":{"line":855,"column":8},"end":{"line":855,"column":52}},"110":{"start":{"line":856,"column":8},"end":{"line":856,"column":60}},"111":{"start":{"line":858,"column":8},"end":{"line":858,"column":80}},"112":{"start":{"line":859,"column":8},"end":{"line":859,"column":56}},"113":{"start":{"line":860,"column":8},"end":{"line":860,"column":60}},"114":{"start":{"line":862,"column":8},"end":{"line":862,"column":24}},"115":{"start":{"line":880,"column":8},"end":{"line":880,"column":23}},"116":{"start":{"line":900,"column":8},"end":{"line":900,"column":57}},"117":{"start":{"line":901,"column":8},"end":{"line":901,"column":78}},"118":{"start":{"line":903,"column":8},"end":{"line":903,"column":29394}},"119":{"start":{"line":911,"column":8},"end":{"line":911,"column":29688}},"120":{"start":{"line":919,"column":8},"end":{"line":919,"column":70}},"121":{"start":{"line":920,"column":8},"end":{"line":920,"column":29969}},"122":{"start":{"line":927,"column":8},"end":{"line":927,"column":59}},"123":{"start":{"line":942,"column":8},"end":{"line":942,"column":30681}},"124":{"start":{"line":943,"column":12},"end":{"line":943,"column":84}},"125":{"start":{"line":945,"column":12},"end":{"line":945,"column":30814}},"126":{"start":{"line":950,"column":12},"end":{"line":950,"column":30982}},"127":{"start":{"line":957,"column":8},"end":{"line":957,"column":31241}},"128":{"start":{"line":962,"column":8},"end":{"line":962,"column":31409}},"129":{"start":{"line":982,"column":12},"end":{"line":982,"column":32133}},"130":{"start":{"line":988,"column":12},"end":{"line":988,"column":32405}},"131":{"start":{"line":995,"column":12},"end":{"line":995,"column":32840}},"132":{"start":{"line":1000,"column":12},"end":{"line":1000,"column":33029}},"133":{"start":{"line":1023,"column":8},"end":{"line":1023,"column":34010}},"134":{"start":{"line":1028,"column":8},"end":{"line":1028,"column":34169}},"135":{"start":{"line":1034,"column":8},"end":{"line":1034,"column":34414}},"136":{"start":{"line":1035,"column":12},"end":{"line":1035,"column":34485}},"137":{"start":{"line":1060,"column":8},"end":{"line":1060,"column":35385}},"138":{"start":{"line":1061,"column":12},"end":{"line":1061,"column":35496}},"139":{"start":{"line":1068,"column":8},"end":{"line":1068,"column":99}},"140":{"start":{"line":1069,"column":8},"end":{"line":1069,"column":101}},"141":{"start":{"line":1086,"column":8},"end":{"line":1086,"column":36314}},"142":{"start":{"line":1117,"column":8},"end":{"line":1117,"column":104}},"143":{"start":{"line":1118,"column":8},"end":{"line":1118,"column":74}},"144":{"start":{"line":1119,"column":8},"end":{"line":1119,"column":65}},"145":{"start":{"line":1121,"column":8},"end":{"line":1121,"column":37737}},"146":{"start":{"line":1130,"column":8},"end":{"line":1130,"column":37958}},"147":{"start":{"line":1141,"column":8},"end":{"line":1141,"column":19}},"148":{"start":{"line":1164,"column":8},"end":{"line":1164,"column":57}},"149":{"start":{"line":1166,"column":8},"end":{"line":1166,"column":39506}},"150":{"start":{"line":1175,"column":8},"end":{"line":1175,"column":39724}},"151":{"start":{"line":1184,"column":8},"end":{"line":1184,"column":74}},"152":{"start":{"line":1185,"column":8},"end":{"line":1185,"column":40049}},"153":{"start":{"line":1192,"column":8},"end":{"line":1192,"column":19}},"154":{"start":{"line":1212,"column":8},"end":{"line":1212,"column":40839}},"155":{"start":{"line":1217,"column":8},"end":{"line":1217,"column":41010}},"156":{"start":{"line":1228,"column":8},"end":{"line":1228,"column":19}}},"branchMap":{"1":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":8},"end":{"line":264,"column":8}},{"start":{"line":264,"column":8},"end":{"line":264,"column":8}}]},"2":{"line":269,"type":"if","locations":[{"start":{"line":269,"column":8},"end":{"line":269,"column":8}},{"start":{"line":269,"column":8},"end":{"line":269,"column":8}}]},"3":{"line":274,"type":"if","locations":[{"start":{"line":274,"column":8},"end":{"line":274,"column":8}},{"start":{"line":274,"column":8},"end":{"line":274,"column":8}}]},"4":{"line":287,"type":"if","locations":[{"start":{"line":287,"column":8},"end":{"line":287,"column":8}},{"start":{"line":287,"column":8},"end":{"line":287,"column":8}}]},"5":{"line":406,"type":"if","locations":[{"start":{"line":406,"column":8},"end":{"line":406,"column":8}},{"start":{"line":406,"column":8},"end":{"line":406,"column":8}}]},"6":{"line":411,"type":"if","locations":[{"start":{"line":411,"column":8},"end":{"line":411,"column":8}},{"start":{"line":411,"column":8},"end":{"line":411,"column":8}}]},"7":{"line":416,"type":"if","locations":[{"start":{"line":416,"column":8},"end":{"line":416,"column":8}},{"start":{"line":416,"column":8},"end":{"line":416,"column":8}}]},"8":{"line":421,"type":"if","locations":[{"start":{"line":421,"column":8},"end":{"line":421,"column":8}},{"start":{"line":421,"column":8},"end":{"line":421,"column":8}}]},"9":{"line":428,"type":"if","locations":[{"start":{"line":428,"column":8},"end":{"line":428,"column":8}},{"start":{"line":428,"column":8},"end":{"line":428,"column":8}}]},"10":{"line":461,"type":"if","locations":[{"start":{"line":461,"column":12},"end":{"line":461,"column":12}},{"start":{"line":461,"column":12},"end":{"line":461,"column":12}}]},"11":{"line":498,"type":"if","locations":[{"start":{"line":498,"column":16},"end":{"line":498,"column":16}},{"start":{"line":498,"column":16},"end":{"line":498,"column":16}}]},"12":{"line":516,"type":"if","locations":[{"start":{"line":516,"column":8},"end":{"line":516,"column":8}},{"start":{"line":516,"column":8},"end":{"line":516,"column":8}}]},"13":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":8},"end":{"line":521,"column":8}},{"start":{"line":521,"column":8},"end":{"line":521,"column":8}}]},"14":{"line":530,"type":"if","locations":[{"start":{"line":530,"column":8},"end":{"line":530,"column":8}},{"start":{"line":530,"column":8},"end":{"line":530,"column":8}}]},"15":{"line":587,"type":"if","locations":[{"start":{"line":587,"column":8},"end":{"line":587,"column":8}},{"start":{"line":587,"column":8},"end":{"line":587,"column":8}}]},"16":{"line":813,"type":"if","locations":[{"start":{"line":813,"column":8},"end":{"line":813,"column":8}},{"start":{"line":813,"column":8},"end":{"line":813,"column":8}}]},"17":{"line":942,"type":"if","locations":[{"start":{"line":942,"column":8},"end":{"line":942,"column":8}},{"start":{"line":942,"column":8},"end":{"line":942,"column":8}}]},"18":{"line":945,"type":"if","locations":[{"start":{"line":945,"column":12},"end":{"line":945,"column":12}},{"start":{"line":945,"column":12},"end":{"line":945,"column":12}}]},"19":{"line":950,"type":"if","locations":[{"start":{"line":950,"column":12},"end":{"line":950,"column":12}},{"start":{"line":950,"column":12},"end":{"line":950,"column":12}}]},"20":{"line":957,"type":"if","locations":[{"start":{"line":957,"column":8},"end":{"line":957,"column":8}},{"start":{"line":957,"column":8},"end":{"line":957,"column":8}}]},"21":{"line":962,"type":"if","locations":[{"start":{"line":962,"column":8},"end":{"line":962,"column":8}},{"start":{"line":962,"column":8},"end":{"line":962,"column":8}}]},"22":{"line":988,"type":"if","locations":[{"start":{"line":988,"column":12},"end":{"line":988,"column":12}},{"start":{"line":988,"column":12},"end":{"line":988,"column":12}}]},"23":{"line":995,"type":"if","locations":[{"start":{"line":995,"column":12},"end":{"line":995,"column":12}},{"start":{"line":995,"column":12},"end":{"line":995,"column":12}}]},"24":{"line":1000,"type":"if","locations":[{"start":{"line":1000,"column":12},"end":{"line":1000,"column":12}},{"start":{"line":1000,"column":12},"end":{"line":1000,"column":12}}]},"25":{"line":1023,"type":"if","locations":[{"start":{"line":1023,"column":8},"end":{"line":1023,"column":8}},{"start":{"line":1023,"column":8},"end":{"line":1023,"column":8}}]},"26":{"line":1028,"type":"if","locations":[{"start":{"line":1028,"column":8},"end":{"line":1028,"column":8}},{"start":{"line":1028,"column":8},"end":{"line":1028,"column":8}}]},"27":{"line":1034,"type":"if","locations":[{"start":{"line":1034,"column":8},"end":{"line":1034,"column":8}},{"start":{"line":1034,"column":8},"end":{"line":1034,"column":8}}]},"28":{"line":1060,"type":"if","locations":[{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}},{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}}]},"29":{"line":1068,"type":"if","locations":[{"start":{"line":1068,"column":8},"end":{"line":1068,"column":8}},{"start":{"line":1068,"column":8},"end":{"line":1068,"column":8}}]},"30":{"line":1069,"type":"if","locations":[{"start":{"line":1069,"column":8},"end":{"line":1069,"column":8}},{"start":{"line":1069,"column":8},"end":{"line":1069,"column":8}}]},"31":{"line":1121,"type":"if","locations":[{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}},{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}}]},"32":{"line":1130,"type":"if","locations":[{"start":{"line":1130,"column":8},"end":{"line":1130,"column":8}},{"start":{"line":1130,"column":8},"end":{"line":1130,"column":8}}]},"33":{"line":1166,"type":"if","locations":[{"start":{"line":1166,"column":8},"end":{"line":1166,"column":8}},{"start":{"line":1166,"column":8},"end":{"line":1166,"column":8}}]},"34":{"line":1185,"type":"if","locations":[{"start":{"line":1185,"column":8},"end":{"line":1185,"column":8}},{"start":{"line":1185,"column":8},"end":{"line":1185,"column":8}}]},"35":{"line":1212,"type":"if","locations":[{"start":{"line":1212,"column":8},"end":{"line":1212,"column":8}},{"start":{"line":1212,"column":8},"end":{"line":1212,"column":8}}]},"36":{"line":1217,"type":"if","locations":[{"start":{"line":1217,"column":8},"end":{"line":1217,"column":8}},{"start":{"line":1217,"column":8},"end":{"line":1217,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol":{"l":{"56":504,"65":573,"69":573,"87":0,"101":550,"115":441,"128":470,"142":102,"158":538,"171":0,"187":1,"203":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol","s":{"1":504,"2":573,"3":0,"4":550,"5":441,"6":470,"7":102,"8":538,"9":0,"10":1,"11":0},"b":{"1":[573,0]},"f":{"1":504,"2":573,"3":0,"4":550,"5":441,"6":470,"7":102,"8":538,"9":0,"10":1,"11":0},"fnMap":{"1":{"name":"constructor","line":54,"loc":{"start":{"line":50,"column":4},"end":{"line":57,"column":4}}},"2":{"name":"onlyOwner","line":64,"loc":{"start":{"line":64,"column":4},"end":{"line":70,"column":4}}},"3":{"name":"setGlobalMetadata","line":85,"loc":{"start":{"line":80,"column":4},"end":{"line":88,"column":4}}},"4":{"name":"getGlobalMetadata","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":102,"column":4}}},"5":{"name":"length","line":107,"loc":{"start":{"line":107,"column":4},"end":{"line":116,"column":4}}},"6":{"name":"push","line":126,"loc":{"start":{"line":121,"column":4},"end":{"line":129,"column":4}}},"7":{"name":"push","line":140,"loc":{"start":{"line":134,"column":4},"end":{"line":143,"column":4}}},"8":{"name":"get","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":159,"column":4}}},"9":{"name":"deleteElementsAfterInclusive","line":169,"loc":{"start":{"line":164,"column":4},"end":{"line":174,"column":4}}},"10":{"name":"deleteElementsAfterInclusive","line":185,"loc":{"start":{"line":179,"column":4},"end":{"line":191,"column":4}}},"11":{"name":"setNextOverwritableIndex","line":201,"loc":{"start":{"line":196,"column":4},"end":{"line":204,"column":4}}}},"statementMap":{"1":{"start":{"line":56,"column":8},"end":{"line":56,"column":21}},"2":{"start":{"line":65,"column":8},"end":{"line":65,"column":1959}},"3":{"start":{"line":87,"column":8},"end":{"line":87,"column":51}},"4":{"start":{"line":101,"column":8},"end":{"line":101,"column":36}},"5":{"start":{"line":115,"column":8},"end":{"line":115,"column":42}},"6":{"start":{"line":128,"column":8},"end":{"line":128,"column":27}},"7":{"start":{"line":142,"column":8},"end":{"line":142,"column":44}},"8":{"start":{"line":158,"column":8},"end":{"line":158,"column":41}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":3842}},"10":{"start":{"line":187,"column":8},"end":{"line":187,"column":4155}},"11":{"start":{"line":203,"column":8},"end":{"line":203,"column":44}}},"branchMap":{"1":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol":{"l":{"54":60,"55":60,"74":125,"90":52,"91":52,"105":24,"119":0,"120":0,"135":25,"141":24,"146":24,"151":23,"158":22,"173":4,"178":3,"183":1,"188":1,"206":0,"211":0,"222":0,"238":1,"243":1,"247":1,"268":74,"270":74,"271":74,"272":74,"278":74,"300":22,"301":22,"307":22,"321":22,"322":22,"324":22,"325":20,"331":2,"340":21,"348":21,"356":21,"374":1,"379":1,"384":1,"392":1,"412":4},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol","s":{"1":60,"2":60,"3":125,"4":52,"5":52,"6":24,"7":0,"8":0,"9":25,"10":24,"11":24,"12":23,"13":22,"14":4,"15":3,"16":1,"17":1,"18":0,"19":0,"20":0,"21":1,"22":1,"23":1,"24":74,"25":74,"26":74,"27":74,"28":22,"29":22,"30":22,"31":22,"32":22,"33":20,"34":2,"35":21,"36":21,"37":21,"38":1,"39":1,"40":1,"41":1,"42":4},"b":{"1":[24,1],"2":[24,0],"3":[23,1],"4":[22,1],"5":[3,1],"6":[1,2],"7":[1,0],"8":[0,0],"9":[0,0],"10":[1,0],"11":[20,2],"12":[1,1],"13":[1,0],"14":[1,0]},"f":{"1":60,"2":125,"3":52,"4":24,"5":0,"6":25,"7":4,"8":0,"9":1,"10":74,"11":22,"12":22,"13":1,"14":4},"fnMap":{"1":{"name":"constructor","line":52,"loc":{"start":{"line":47,"column":4},"end":{"line":56,"column":4}}},"2":{"name":"batches","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":77,"column":4}}},"3":{"name":"getTotalElements","line":82,"loc":{"start":{"line":82,"column":4},"end":{"line":92,"column":4}}},"4":{"name":"getTotalBatches","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":106,"column":4}}},"5":{"name":"getLastSequencerTimestamp","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":121,"column":4}}},"6":{"name":"appendStateBatch","line":126,"loc":{"start":{"line":126,"column":4},"end":{"line":162,"column":4}}},"7":{"name":"deleteStateBatch","line":167,"loc":{"start":{"line":167,"column":4},"end":{"line":189,"column":4}}},"8":{"name":"verifyStateCommitment","line":194,"loc":{"start":{"line":194,"column":4},"end":{"line":223,"column":4}}},"9":{"name":"insideFraudProofWindow","line":228,"loc":{"start":{"line":228,"column":4},"end":{"line":248,"column":4}}},"10":{"name":"_getBatchExtraData","line":260,"loc":{"start":{"line":260,"column":4},"end":{"line":282,"column":4}}},"11":{"name":"_makeBatchExtraData","line":290,"loc":{"start":{"line":290,"column":4},"end":{"line":308,"column":4}}},"12":{"name":"_appendBatch","line":315,"loc":{"start":{"line":315,"column":4},"end":{"line":363,"column":4}}},"13":{"name":"_deleteBatch","line":369,"loc":{"start":{"line":369,"column":4},"end":{"line":396,"column":4}}},"14":{"name":"_isValidBatchHeader","line":403,"loc":{"start":{"line":403,"column":4},"end":{"line":413,"column":4}}}},"statementMap":{"1":{"start":{"line":54,"column":8},"end":{"line":54,"column":45}},"2":{"start":{"line":55,"column":8},"end":{"line":55,"column":57}},"3":{"start":{"line":74,"column":8},"end":{"line":74,"column":2401}},"4":{"start":{"line":90,"column":8},"end":{"line":90,"column":55}},"5":{"start":{"line":91,"column":8},"end":{"line":91,"column":37}},"6":{"start":{"line":105,"column":8},"end":{"line":105,"column":33}},"7":{"start":{"line":119,"column":8},"end":{"line":119,"column":64}},"8":{"start":{"line":120,"column":8},"end":{"line":120,"column":46}},"9":{"start":{"line":135,"column":8},"end":{"line":135,"column":3782}},"10":{"start":{"line":141,"column":8},"end":{"line":141,"column":4012}},"11":{"start":{"line":146,"column":8},"end":{"line":146,"column":4190}},"12":{"start":{"line":151,"column":8},"end":{"line":151,"column":4300}},"13":{"start":{"line":158,"column":8},"end":{"line":158,"column":4670}},"14":{"start":{"line":173,"column":8},"end":{"line":173,"column":4976}},"15":{"start":{"line":178,"column":8},"end":{"line":178,"column":5135}},"16":{"start":{"line":183,"column":8},"end":{"line":183,"column":5247}},"17":{"start":{"line":188,"column":8},"end":{"line":188,"column":33}},"18":{"start":{"line":206,"column":8},"end":{"line":206,"column":5787}},"19":{"start":{"line":211,"column":8},"end":{"line":211,"column":5899}},"20":{"start":{"line":222,"column":8},"end":{"line":222,"column":19}},"21":{"start":{"line":238,"column":8},"end":{"line":238,"column":6480}},"22":{"start":{"line":243,"column":8},"end":{"line":243,"column":6601}},"23":{"start":{"line":247,"column":8},"end":{"line":247,"column":76}},"24":{"start":{"line":268,"column":8},"end":{"line":268,"column":57}},"25":{"start":{"line":270,"column":8},"end":{"line":270,"column":28}},"26":{"start":{"line":271,"column":8},"end":{"line":271,"column":37}},"27":{"start":{"line":278,"column":8},"end":{"line":278,"column":7685}},"28":{"start":{"line":300,"column":8},"end":{"line":300,"column":25}},"29":{"start":{"line":307,"column":8},"end":{"line":307,"column":24}},"30":{"start":{"line":321,"column":8},"end":{"line":321,"column":51}},"31":{"start":{"line":322,"column":8},"end":{"line":322,"column":84}},"32":{"start":{"line":324,"column":8},"end":{"line":324,"column":8914}},"33":{"start":{"line":325,"column":12},"end":{"line":325,"column":59}},"34":{"start":{"line":331,"column":12},"end":{"line":331,"column":9429}},"35":{"start":{"line":340,"column":8},"end":{"line":340,"column":9854}},"36":{"start":{"line":348,"column":8},"end":{"line":348,"column":10179}},"37":{"start":{"line":356,"column":8},"end":{"line":356,"column":10406}},"38":{"start":{"line":374,"column":8},"end":{"line":374,"column":10922}},"39":{"start":{"line":379,"column":8},"end":{"line":379,"column":11044}},"40":{"start":{"line":384,"column":8},"end":{"line":384,"column":11156}},"41":{"start":{"line":392,"column":8},"end":{"line":392,"column":11375}},"42":{"start":{"line":412,"column":8},"end":{"line":412,"column":99}}},"branchMap":{"1":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]},"2":{"line":141,"type":"if","locations":[{"start":{"line":141,"column":8},"end":{"line":141,"column":8}},{"start":{"line":141,"column":8},"end":{"line":141,"column":8}}]},"3":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"4":{"line":151,"type":"if","locations":[{"start":{"line":151,"column":8},"end":{"line":151,"column":8}},{"start":{"line":151,"column":8},"end":{"line":151,"column":8}}]},"5":{"line":173,"type":"if","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":8}},{"start":{"line":173,"column":8},"end":{"line":173,"column":8}}]},"6":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":8},"end":{"line":178,"column":8}},{"start":{"line":178,"column":8},"end":{"line":178,"column":8}}]},"7":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":8},"end":{"line":183,"column":8}},{"start":{"line":183,"column":8},"end":{"line":183,"column":8}}]},"8":{"line":206,"type":"if","locations":[{"start":{"line":206,"column":8},"end":{"line":206,"column":8}},{"start":{"line":206,"column":8},"end":{"line":206,"column":8}}]},"9":{"line":211,"type":"if","locations":[{"start":{"line":211,"column":8},"end":{"line":211,"column":8}},{"start":{"line":211,"column":8},"end":{"line":211,"column":8}}]},"10":{"line":243,"type":"if","locations":[{"start":{"line":243,"column":8},"end":{"line":243,"column":8}},{"start":{"line":243,"column":8},"end":{"line":243,"column":8}}]},"11":{"line":324,"type":"if","locations":[{"start":{"line":324,"column":8},"end":{"line":324,"column":8}},{"start":{"line":324,"column":8},"end":{"line":324,"column":8}}]},"12":{"line":331,"type":"if","locations":[{"start":{"line":331,"column":12},"end":{"line":331,"column":12}},{"start":{"line":331,"column":12},"end":{"line":331,"column":12}}]},"13":{"line":374,"type":"if","locations":[{"start":{"line":374,"column":8},"end":{"line":374,"column":8}},{"start":{"line":374,"column":8},"end":{"line":374,"column":8}}]},"14":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol":{"l":{"85":27,"86":27,"87":27,"88":27,"104":55,"105":55,"106":55,"109":55,"110":46,"122":201,"123":201,"124":192,"127":192,"128":165,"131":27,"139":42,"140":4,"142":38,"162":0,"165":0,"170":0,"178":0,"186":0,"187":0,"188":0,"196":0,"208":0,"211":0,"231":4,"246":150,"261":1,"276":1,"291":1,"306":1,"325":1,"340":1,"357":6,"384":28,"388":28,"391":27,"396":27,"423":1,"427":1,"430":0,"436":0,"458":3,"472":1,"501":1,"510":1,"511":0,"515":1,"516":0,"520":1,"523":1,"524":1,"528":1,"531":1,"534":1,"540":1,"570":154,"571":154,"572":154,"574":154,"604":8,"605":8,"606":8,"607":8,"609":8,"639":10,"641":10,"670":48,"672":48,"693":7,"695":7,"730":2,"732":2,"753":3,"772":2,"789":0,"807":29,"812":29,"814":29,"815":2,"841":27,"845":27,"846":27,"847":27,"851":27,"860":24,"889":172,"894":1,"898":171,"903":169,"938":196,"939":196,"945":196,"946":196,"947":196,"955":196,"961":196,"965":196,"969":196,"970":23,"980":23,"981":5,"987":18,"993":14,"998":18,"1002":10,"1004":8,"1012":18,"1016":191,"1018":191,"1047":27,"1050":0,"1060":27,"1061":0,"1071":27,"1074":27,"1076":27,"1079":10,"1080":10,"1081":10,"1082":10,"1090":10,"1095":17,"1096":17,"1097":1,"1108":16,"1115":16,"1135":0,"1136":0,"1152":28,"1153":28,"1167":29,"1168":29,"1184":57,"1185":57,"1201":369,"1202":367,"1217":28,"1218":28,"1236":17,"1237":17,"1259":55,"1260":55,"1281":7,"1282":0,"1285":7,"1286":7,"1300":535,"1301":0,"1305":535,"1306":2,"1311":533,"1317":533,"1318":144,"1336":53,"1340":53,"1346":53,"1347":47,"1348":47,"1372":62,"1373":0,"1379":62,"1380":0,"1385":62,"1391":62,"1392":46,"1410":7,"1414":7,"1420":7,"1423":7,"1425":7,"1426":7,"1452":20,"1455":0,"1459":20,"1460":7,"1469":13,"1498":23,"1499":3,"1508":20,"1523":19,"1528":19,"1542":13,"1567":196,"1581":244,"1582":0,"1585":244,"1602":0,"1608":0,"1613":0,"1620":0,"1646":0,"1647":0,"1651":0,"1652":0,"1656":0,"1687":0,"1688":0,"1689":0,"1691":0,"1694":0,"1718":0,"1735":0,"1759":392,"1760":202,"1764":392,"1765":308,"1769":392,"1770":16,"1783":0,"1784":0,"1785":0,"1786":0,"1787":0,"1788":0,"1790":0,"1799":27,"1800":27,"1801":27,"1802":27,"1803":27,"1804":27,"1806":27,"1808":27,"1809":27,"1810":27,"1812":27,"1837":0,"1839":0,"1840":0,"1841":0,"1843":0,"1845":0,"1846":0,"1847":0,"1848":0,"1849":0,"1853":0,"1856":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol","s":{"1":27,"2":27,"3":27,"4":27,"5":55,"6":55,"7":55,"8":46,"9":201,"10":192,"11":192,"12":165,"13":27,"14":42,"15":4,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":4,"27":150,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":6,"35":28,"36":28,"37":27,"38":27,"39":1,"40":1,"41":0,"42":0,"43":3,"44":1,"45":1,"46":1,"47":0,"48":1,"49":0,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":154,"58":154,"59":154,"60":154,"61":8,"62":8,"63":8,"64":8,"65":8,"66":10,"67":10,"68":48,"69":48,"70":7,"71":7,"72":2,"73":2,"74":3,"75":2,"76":0,"77":29,"78":29,"79":29,"80":2,"81":27,"82":27,"83":27,"84":27,"85":27,"86":24,"87":172,"88":1,"89":171,"90":169,"91":196,"92":196,"93":196,"94":196,"95":196,"96":196,"97":196,"98":196,"99":196,"100":23,"101":23,"102":5,"103":18,"104":14,"105":18,"106":10,"107":8,"108":18,"109":191,"110":191,"111":27,"112":0,"113":27,"114":0,"115":27,"116":27,"117":27,"118":10,"119":10,"120":10,"121":17,"122":17,"123":1,"124":16,"125":16,"126":0,"127":0,"128":28,"129":28,"130":29,"131":29,"132":57,"133":57,"134":369,"135":367,"136":28,"137":28,"138":17,"139":17,"140":55,"141":55,"142":7,"143":0,"144":7,"145":7,"146":535,"147":0,"148":535,"149":2,"150":533,"151":533,"152":144,"153":53,"154":53,"155":53,"156":47,"157":47,"158":62,"159":0,"160":62,"161":0,"162":62,"163":62,"164":46,"165":7,"166":7,"167":7,"168":7,"169":7,"170":7,"171":20,"172":0,"173":20,"174":7,"175":13,"176":23,"177":3,"178":20,"179":19,"180":13,"181":196,"182":244,"183":0,"184":244,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":392,"202":202,"203":392,"204":308,"205":392,"206":16,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":27,"215":27,"216":27,"217":27,"218":27,"219":27,"220":27,"221":27,"222":27,"223":27,"224":27,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0},"b":{"1":[46,9],"2":[165,27],"3":[4,38],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,1],"8":[0,1],"9":[2,27],"10":[1,171],"11":[23,173],"12":[5,18],"13":[14,4],"14":[10,8],"15":[0,27],"16":[0,27],"17":[10,17],"18":[1,16],"19":[0,7],"20":[0,535],"21":[2,533],"22":[144,389],"23":[47,6],"24":[0,62],"25":[0,62],"26":[46,16],"27":[7,0],"28":[0,20],"29":[7,13],"30":[3,20],"31":[0,244],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[202,190],"37":[308,84],"38":[16,376],"39":[0,0],"40":[0,0],"41":[0,0]},"f":{"1":27,"2":55,"3":201,"4":42,"5":0,"6":4,"7":150,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":6,"15":28,"16":1,"17":3,"18":1,"19":1,"20":154,"21":8,"22":10,"23":48,"24":7,"25":2,"26":3,"27":2,"28":0,"29":29,"30":27,"31":172,"32":196,"33":27,"34":0,"35":28,"36":29,"37":57,"38":369,"39":28,"40":17,"41":55,"42":7,"43":535,"44":53,"45":62,"46":7,"47":20,"48":23,"49":19,"50":13,"51":196,"52":244,"53":0,"54":0,"55":0,"56":0,"57":0,"58":392,"59":0,"60":27,"61":0},"fnMap":{"1":{"name":"constructor","line":83,"loc":{"start":{"line":78,"column":4},"end":{"line":89,"column":4}}},"2":{"name":"netGasCost","line":101,"loc":{"start":{"line":101,"column":4},"end":{"line":112,"column":4}}},"3":{"name":"fixedGasDiscount","line":119,"loc":{"start":{"line":119,"column":4},"end":{"line":133,"column":4}}},"4":{"name":"notStatic","line":138,"loc":{"start":{"line":138,"column":4},"end":{"line":143,"column":4}}},"5":{"name":"run","line":155,"loc":{"start":{"line":155,"column":4},"end":{"line":212,"column":4}}},"6":{"name":"ovmCALLER","line":223,"loc":{"start":{"line":223,"column":4},"end":{"line":232,"column":4}}},"7":{"name":"ovmADDRESS","line":238,"loc":{"start":{"line":238,"column":4},"end":{"line":247,"column":4}}},"8":{"name":"ovmTIMESTAMP","line":253,"loc":{"start":{"line":253,"column":4},"end":{"line":262,"column":4}}},"9":{"name":"ovmNUMBER","line":268,"loc":{"start":{"line":268,"column":4},"end":{"line":277,"column":4}}},"10":{"name":"ovmGASLIMIT","line":283,"loc":{"start":{"line":283,"column":4},"end":{"line":292,"column":4}}},"11":{"name":"ovmCHAINID","line":298,"loc":{"start":{"line":298,"column":4},"end":{"line":307,"column":4}}},"12":{"name":"ovmL1QUEUEORIGIN","line":317,"loc":{"start":{"line":317,"column":4},"end":{"line":326,"column":4}}},"13":{"name":"ovmL1TXORIGIN","line":332,"loc":{"start":{"line":332,"column":4},"end":{"line":341,"column":4}}},"14":{"name":"ovmREVERT","line":351,"loc":{"start":{"line":351,"column":4},"end":{"line":358,"column":4}}},"15":{"name":"ovmCREATE","line":377,"loc":{"start":{"line":371,"column":4},"end":{"line":400,"column":4}}},"16":{"name":"ovmCREATE2","line":416,"loc":{"start":{"line":409,"column":4},"end":{"line":440,"column":4}}},"17":{"name":"ovmGETNONCE","line":451,"loc":{"start":{"line":451,"column":4},"end":{"line":459,"column":4}}},"18":{"name":"ovmSETNONCE","line":470,"loc":{"start":{"line":465,"column":4},"end":{"line":473,"column":4}}},"19":{"name":"ovmCREATEEOA","line":494,"loc":{"start":{"line":486,"column":4},"end":{"line":541,"column":4}}},"20":{"name":"ovmCALL","line":563,"loc":{"start":{"line":556,"column":4},"end":{"line":580,"column":4}}},"21":{"name":"ovmSTATICCALL","line":597,"loc":{"start":{"line":590,"column":4},"end":{"line":615,"column":4}}},"22":{"name":"ovmDELEGATECALL","line":632,"loc":{"start":{"line":625,"column":4},"end":{"line":647,"column":4}}},"23":{"name":"ovmSLOAD","line":664,"loc":{"start":{"line":659,"column":4},"end":{"line":676,"column":4}}},"24":{"name":"ovmSSTORE","line":690,"loc":{"start":{"line":683,"column":4},"end":{"line":700,"column":4}}},"25":{"name":"ovmEXTCODECOPY","line":714,"loc":{"start":{"line":714,"column":4},"end":{"line":737,"column":4}}},"26":{"name":"ovmEXTCODESIZE","line":744,"loc":{"start":{"line":744,"column":4},"end":{"line":756,"column":4}}},"27":{"name":"ovmEXTCODEHASH","line":763,"loc":{"start":{"line":763,"column":4},"end":{"line":775,"column":4}}},"28":{"name":"getMaxTransactionGasLimit","line":781,"loc":{"start":{"line":781,"column":4},"end":{"line":790,"column":4}}},"29":{"name":"_checkDeployerAllowed","line":800,"loc":{"start":{"line":800,"column":4},"end":{"line":817,"column":4}}},"30":{"name":"_createContract","line":830,"loc":{"start":{"line":830,"column":4},"end":{"line":864,"column":4}}},"31":{"name":"_callContract","line":875,"loc":{"start":{"line":875,"column":4},"end":{"line":910,"column":4}}},"32":{"name":"_handleExternalMessage","line":924,"loc":{"start":{"line":924,"column":4},"end":{"line":1022,"column":4}}},"33":{"name":"_handleContractCreation","line":1035,"loc":{"start":{"line":1035,"column":4},"end":{"line":1116,"column":4}}},"34":{"name":"_hasAccount","line":1127,"loc":{"start":{"line":1127,"column":4},"end":{"line":1137,"column":4}}},"35":{"name":"_hasEmptyAccount","line":1144,"loc":{"start":{"line":1144,"column":4},"end":{"line":1154,"column":4}}},"36":{"name":"_setAccountNonce","line":1161,"loc":{"start":{"line":1161,"column":4},"end":{"line":1169,"column":4}}},"37":{"name":"_getAccountNonce","line":1176,"loc":{"start":{"line":1176,"column":4},"end":{"line":1186,"column":4}}},"38":{"name":"_getAccountEthAddress","line":1193,"loc":{"start":{"line":1193,"column":4},"end":{"line":1203,"column":4}}},"39":{"name":"_initPendingAccount","line":1209,"loc":{"start":{"line":1209,"column":4},"end":{"line":1219,"column":4}}},"40":{"name":"_commitPendingAccount","line":1229,"loc":{"start":{"line":1229,"column":4},"end":{"line":1242,"column":4}}},"41":{"name":"_getContractStorage","line":1250,"loc":{"start":{"line":1250,"column":4},"end":{"line":1261,"column":4}}},"42":{"name":"_putContractStorage","line":1269,"loc":{"start":{"line":1269,"column":4},"end":{"line":1287,"column":4}}},"43":{"name":"_checkAccountLoad","line":1294,"loc":{"start":{"line":1294,"column":4},"end":{"line":1322,"column":4}}},"44":{"name":"_checkAccountChange","line":1329,"loc":{"start":{"line":1329,"column":4},"end":{"line":1352,"column":4}}},"45":{"name":"_checkContractStorageLoad","line":1360,"loc":{"start":{"line":1360,"column":4},"end":{"line":1394,"column":4}}},"46":{"name":"_checkContractStorageChange","line":1402,"loc":{"start":{"line":1402,"column":4},"end":{"line":1428,"column":4}}},"47":{"name":"_encodeRevertData","line":1441,"loc":{"start":{"line":1441,"column":4},"end":{"line":1475,"column":4}}},"48":{"name":"_decodeRevertData","line":1485,"loc":{"start":{"line":1485,"column":4},"end":{"line":1509,"column":4}}},"49":{"name":"_revertWithFlag","line":1516,"loc":{"start":{"line":1516,"column":4},"end":{"line":1531,"column":4}}},"50":{"name":"_revertWithFlag","line":1537,"loc":{"start":{"line":1537,"column":4},"end":{"line":1543,"column":4}}},"51":{"name":"_getNuisanceGasLimit","line":1558,"loc":{"start":{"line":1558,"column":4},"end":{"line":1568,"column":4}}},"52":{"name":"_useNuisanceGas","line":1574,"loc":{"start":{"line":1574,"column":4},"end":{"line":1586,"column":4}}},"53":{"name":"_checkNeedsNewEpoch","line":1597,"loc":{"start":{"line":1597,"column":4},"end":{"line":1627,"column":4}}},"54":{"name":"_isValidGasLimit","line":1635,"loc":{"start":{"line":1635,"column":4},"end":{"line":1674,"column":4}}},"55":{"name":"_updateCumulativeGas","line":1681,"loc":{"start":{"line":1681,"column":4},"end":{"line":1703,"column":4}}},"56":{"name":"_getGasMetadata","line":1710,"loc":{"start":{"line":1710,"column":4},"end":{"line":1722,"column":4}}},"57":{"name":"_putGasMetadata","line":1729,"loc":{"start":{"line":1729,"column":4},"end":{"line":1740,"column":4}}},"58":{"name":"_switchMessageContext","line":1752,"loc":{"start":{"line":1752,"column":4},"end":{"line":1772,"column":4}}},"59":{"name":"_initContext","line":1778,"loc":{"start":{"line":1778,"column":4},"end":{"line":1791,"column":4}}},"60":{"name":"_resetContext","line":1796,"loc":{"start":{"line":1796,"column":4},"end":{"line":1813,"column":4}}},"61":{"name":"simulateMessage","line":1825,"loc":{"start":{"line":1825,"column":4},"end":{"line":1862,"column":4}}}},"statementMap":{"1":{"start":{"line":85,"column":8},"end":{"line":85,"column":74}},"2":{"start":{"line":86,"column":8},"end":{"line":86,"column":39}},"3":{"start":{"line":87,"column":8},"end":{"line":87,"column":37}},"4":{"start":{"line":88,"column":8},"end":{"line":88,"column":22}},"5":{"start":{"line":104,"column":8},"end":{"line":104,"column":39}},"6":{"start":{"line":106,"column":8},"end":{"line":106,"column":49}},"7":{"start":{"line":109,"column":8},"end":{"line":109,"column":3969}},"8":{"start":{"line":110,"column":12},"end":{"line":110,"column":60}},"9":{"start":{"line":122,"column":8},"end":{"line":122,"column":39}},"10":{"start":{"line":124,"column":8},"end":{"line":124,"column":49}},"11":{"start":{"line":127,"column":8},"end":{"line":127,"column":4602}},"12":{"start":{"line":128,"column":12},"end":{"line":128,"column":54}},"13":{"start":{"line":131,"column":12},"end":{"line":131,"column":52}},"14":{"start":{"line":139,"column":8},"end":{"line":139,"column":4939}},"15":{"start":{"line":140,"column":12},"end":{"line":140,"column":55}},"16":{"start":{"line":162,"column":8},"end":{"line":162,"column":99}},"17":{"start":{"line":165,"column":8},"end":{"line":165,"column":60}},"18":{"start":{"line":170,"column":8},"end":{"line":170,"column":6129}},"19":{"start":{"line":178,"column":8},"end":{"line":178,"column":33}},"20":{"start":{"line":186,"column":8},"end":{"line":186,"column":6951}},"21":{"start":{"line":187,"column":12},"end":{"line":187,"column":26}},"22":{"start":{"line":188,"column":12},"end":{"line":188,"column":18}},"23":{"start":{"line":196,"column":8},"end":{"line":196,"column":7365}},"24":{"start":{"line":208,"column":8},"end":{"line":208,"column":22}},"25":{"start":{"line":211,"column":8},"end":{"line":211,"column":54}},"26":{"start":{"line":231,"column":8},"end":{"line":231,"column":39}},"27":{"start":{"line":246,"column":8},"end":{"line":246,"column":40}},"28":{"start":{"line":261,"column":8},"end":{"line":261,"column":46}},"29":{"start":{"line":276,"column":8},"end":{"line":276,"column":43}},"30":{"start":{"line":291,"column":8},"end":{"line":291,"column":45}},"31":{"start":{"line":306,"column":8},"end":{"line":306,"column":39}},"32":{"start":{"line":325,"column":8},"end":{"line":325,"column":50}},"33":{"start":{"line":340,"column":8},"end":{"line":340,"column":47}},"34":{"start":{"line":357,"column":8},"end":{"line":357,"column":60}},"35":{"start":{"line":384,"column":8},"end":{"line":384,"column":38}},"36":{"start":{"line":388,"column":8},"end":{"line":388,"column":37}},"37":{"start":{"line":391,"column":8},"end":{"line":391,"column":12120}},"38":{"start":{"line":396,"column":8},"end":{"line":396,"column":12259}},"39":{"start":{"line":423,"column":8},"end":{"line":423,"column":38}},"40":{"start":{"line":427,"column":8},"end":{"line":427,"column":37}},"41":{"start":{"line":430,"column":8},"end":{"line":430,"column":13215}},"42":{"start":{"line":436,"column":8},"end":{"line":436,"column":13358}},"43":{"start":{"line":458,"column":8},"end":{"line":458,"column":45}},"44":{"start":{"line":472,"column":8},"end":{"line":472,"column":45}},"45":{"start":{"line":501,"column":8},"end":{"line":501,"column":15412}},"46":{"start":{"line":510,"column":8},"end":{"line":510,"column":15716}},"47":{"start":{"line":511,"column":12},"end":{"line":511,"column":87}},"48":{"start":{"line":515,"column":8},"end":{"line":515,"column":15949}},"49":{"start":{"line":516,"column":12},"end":{"line":516,"column":18}},"50":{"start":{"line":520,"column":8},"end":{"line":520,"column":31}},"51":{"start":{"line":523,"column":8},"end":{"line":523,"column":55}},"52":{"start":{"line":524,"column":8},"end":{"line":524,"column":38}},"53":{"start":{"line":528,"column":8},"end":{"line":528,"column":92}},"54":{"start":{"line":531,"column":8},"end":{"line":531,"column":46}},"55":{"start":{"line":534,"column":8},"end":{"line":534,"column":16780}},"56":{"start":{"line":540,"column":8},"end":{"line":540,"column":31}},"57":{"start":{"line":570,"column":8},"end":{"line":570,"column":65}},"58":{"start":{"line":571,"column":8},"end":{"line":571,"column":67}},"59":{"start":{"line":572,"column":8},"end":{"line":572,"column":47}},"60":{"start":{"line":574,"column":8},"end":{"line":574,"column":17970}},"61":{"start":{"line":604,"column":8},"end":{"line":604,"column":65}},"62":{"start":{"line":605,"column":8},"end":{"line":605,"column":67}},"63":{"start":{"line":606,"column":8},"end":{"line":606,"column":47}},"64":{"start":{"line":607,"column":8},"end":{"line":607,"column":41}},"65":{"start":{"line":609,"column":8},"end":{"line":609,"column":19091}},"66":{"start":{"line":639,"column":8},"end":{"line":639,"column":65}},"67":{"start":{"line":641,"column":8},"end":{"line":641,"column":20043}},"68":{"start":{"line":670,"column":8},"end":{"line":670,"column":46}},"69":{"start":{"line":672,"column":8},"end":{"line":672,"column":20768}},"70":{"start":{"line":693,"column":8},"end":{"line":693,"column":46}},"71":{"start":{"line":695,"column":8},"end":{"line":695,"column":21293}},"72":{"start":{"line":730,"column":8},"end":{"line":730,"column":51}},"73":{"start":{"line":732,"column":8},"end":{"line":732,"column":22625}},"74":{"start":{"line":753,"column":8},"end":{"line":753,"column":23119}},"75":{"start":{"line":772,"column":8},"end":{"line":772,"column":23567}},"76":{"start":{"line":789,"column":8},"end":{"line":789,"column":52}},"77":{"start":{"line":807,"column":8},"end":{"line":807,"column":24656}},"78":{"start":{"line":812,"column":8},"end":{"line":812,"column":49}},"79":{"start":{"line":814,"column":8},"end":{"line":814,"column":24934}},"80":{"start":{"line":815,"column":12},"end":{"line":815,"column":58}},"81":{"start":{"line":841,"column":8},"end":{"line":841,"column":73}},"82":{"start":{"line":845,"column":8},"end":{"line":845,"column":65}},"83":{"start":{"line":846,"column":8},"end":{"line":846,"column":63}},"84":{"start":{"line":847,"column":8},"end":{"line":847,"column":55}},"85":{"start":{"line":851,"column":8},"end":{"line":851,"column":26479}},"86":{"start":{"line":860,"column":8},"end":{"line":860,"column":26781}},"87":{"start":{"line":889,"column":8},"end":{"line":889,"column":27852}},"88":{"start":{"line":894,"column":12},"end":{"line":894,"column":32}},"89":{"start":{"line":898,"column":8},"end":{"line":898,"column":28436}},"90":{"start":{"line":903,"column":8},"end":{"line":903,"column":28544}},"91":{"start":{"line":938,"column":8},"end":{"line":938,"column":65}},"92":{"start":{"line":939,"column":8},"end":{"line":939,"column":69}},"93":{"start":{"line":945,"column":8},"end":{"line":945,"column":67}},"94":{"start":{"line":946,"column":8},"end":{"line":946,"column":66}},"95":{"start":{"line":947,"column":8},"end":{"line":947,"column":55}},"96":{"start":{"line":955,"column":8},"end":{"line":955,"column":30971}},"97":{"start":{"line":961,"column":8},"end":{"line":961,"column":69}},"98":{"start":{"line":965,"column":8},"end":{"line":965,"column":63}},"99":{"start":{"line":969,"column":8},"end":{"line":969,"column":31643}},"100":{"start":{"line":970,"column":12},"end":{"line":970,"column":31716}},"101":{"start":{"line":980,"column":12},"end":{"line":980,"column":32198}},"102":{"start":{"line":981,"column":16},"end":{"line":981,"column":36}},"103":{"start":{"line":987,"column":12},"end":{"line":987,"column":32623}},"104":{"start":{"line":993,"column":16},"end":{"line":993,"column":60}},"105":{"start":{"line":998,"column":12},"end":{"line":998,"column":33142}},"106":{"start":{"line":1002,"column":16},"end":{"line":1002,"column":46}},"107":{"start":{"line":1004,"column":16},"end":{"line":1004,"column":33}},"108":{"start":{"line":1012,"column":12},"end":{"line":1012,"column":54}},"109":{"start":{"line":1016,"column":8},"end":{"line":1016,"column":97}},"110":{"start":{"line":1018,"column":8},"end":{"line":1018,"column":34093}},"111":{"start":{"line":1047,"column":8},"end":{"line":1047,"column":35080}},"112":{"start":{"line":1050,"column":12},"end":{"line":1050,"column":35291}},"113":{"start":{"line":1060,"column":8},"end":{"line":1060,"column":35634}},"114":{"start":{"line":1061,"column":12},"end":{"line":1061,"column":35714}},"115":{"start":{"line":1071,"column":8},"end":{"line":1071,"column":36}},"116":{"start":{"line":1074,"column":8},"end":{"line":1074,"column":71}},"117":{"start":{"line":1076,"column":8},"end":{"line":1076,"column":36312}},"118":{"start":{"line":1079,"column":12},"end":{"line":1079,"column":34}},"119":{"start":{"line":1081,"column":12},"end":{"line":1081,"column":63}},"120":{"start":{"line":1090,"column":12},"end":{"line":1090,"column":38}},"121":{"start":{"line":1095,"column":8},"end":{"line":1095,"column":68}},"122":{"start":{"line":1096,"column":8},"end":{"line":1096,"column":37248}},"123":{"start":{"line":1097,"column":12},"end":{"line":1097,"column":37327}},"124":{"start":{"line":1108,"column":8},"end":{"line":1108,"column":37793}},"125":{"start":{"line":1115,"column":8},"end":{"line":1115,"column":28}},"126":{"start":{"line":1135,"column":8},"end":{"line":1135,"column":34}},"127":{"start":{"line":1136,"column":8},"end":{"line":1136,"column":51}},"128":{"start":{"line":1152,"column":8},"end":{"line":1152,"column":34}},"129":{"start":{"line":1153,"column":8},"end":{"line":1153,"column":56}},"130":{"start":{"line":1167,"column":8},"end":{"line":1167,"column":36}},"131":{"start":{"line":1168,"column":8},"end":{"line":1168,"column":56}},"132":{"start":{"line":1184,"column":8},"end":{"line":1184,"column":34}},"133":{"start":{"line":1185,"column":8},"end":{"line":1185,"column":56}},"134":{"start":{"line":1201,"column":8},"end":{"line":1201,"column":34}},"135":{"start":{"line":1202,"column":8},"end":{"line":1202,"column":61}},"136":{"start":{"line":1217,"column":8},"end":{"line":1217,"column":34}},"137":{"start":{"line":1218,"column":8},"end":{"line":1218,"column":51}},"138":{"start":{"line":1236,"column":8},"end":{"line":1236,"column":36}},"139":{"start":{"line":1237,"column":8},"end":{"line":1237,"column":41463}},"140":{"start":{"line":1259,"column":8},"end":{"line":1259,"column":49}},"141":{"start":{"line":1260,"column":8},"end":{"line":1260,"column":66}},"142":{"start":{"line":1281,"column":8},"end":{"line":1281,"column":42888}},"143":{"start":{"line":1282,"column":12},"end":{"line":1282,"column":18}},"144":{"start":{"line":1285,"column":8},"end":{"line":1285,"column":51}},"145":{"start":{"line":1286,"column":8},"end":{"line":1286,"column":66}},"146":{"start":{"line":1300,"column":8},"end":{"line":1300,"column":43493}},"147":{"start":{"line":1301,"column":12},"end":{"line":1301,"column":49}},"148":{"start":{"line":1305,"column":8},"end":{"line":1305,"column":43681}},"149":{"start":{"line":1306,"column":12},"end":{"line":1306,"column":59}},"150":{"start":{"line":1311,"column":8},"end":{"line":1311,"column":44063}},"151":{"start":{"line":1317,"column":8},"end":{"line":1317,"column":44270}},"152":{"start":{"line":1318,"column":12},"end":{"line":1318,"column":44327}},"153":{"start":{"line":1336,"column":8},"end":{"line":1336,"column":34}},"154":{"start":{"line":1340,"column":8},"end":{"line":1340,"column":45260}},"155":{"start":{"line":1346,"column":8},"end":{"line":1346,"column":45468}},"156":{"start":{"line":1347,"column":12},"end":{"line":1347,"column":62}},"157":{"start":{"line":1348,"column":12},"end":{"line":1348,"column":45591}},"158":{"start":{"line":1372,"column":8},"end":{"line":1372,"column":46695}},"159":{"start":{"line":1373,"column":12},"end":{"line":1373,"column":49}},"160":{"start":{"line":1379,"column":8},"end":{"line":1379,"column":47096}},"161":{"start":{"line":1380,"column":12},"end":{"line":1380,"column":59}},"162":{"start":{"line":1385,"column":8},"end":{"line":1385,"column":47501}},"163":{"start":{"line":1391,"column":8},"end":{"line":1391,"column":47698}},"164":{"start":{"line":1392,"column":12},"end":{"line":1392,"column":46}},"165":{"start":{"line":1410,"column":8},"end":{"line":1410,"column":49}},"166":{"start":{"line":1414,"column":8},"end":{"line":1414,"column":48692}},"167":{"start":{"line":1420,"column":8},"end":{"line":1420,"column":48891}},"168":{"start":{"line":1423,"column":12},"end":{"line":1423,"column":41}},"169":{"start":{"line":1425,"column":12},"end":{"line":1425,"column":69}},"170":{"start":{"line":1426,"column":12},"end":{"line":1426,"column":47}},"171":{"start":{"line":1452,"column":8},"end":{"line":1452,"column":49929}},"172":{"start":{"line":1455,"column":12},"end":{"line":1455,"column":28}},"173":{"start":{"line":1459,"column":8},"end":{"line":1459,"column":50123}},"174":{"start":{"line":1460,"column":12},"end":{"line":1460,"column":50188}},"175":{"start":{"line":1469,"column":8},"end":{"line":1469,"column":50379}},"176":{"start":{"line":1498,"column":8},"end":{"line":1498,"column":51255}},"177":{"start":{"line":1499,"column":12},"end":{"line":1499,"column":51303}},"178":{"start":{"line":1508,"column":8},"end":{"line":1508,"column":77}},"179":{"start":{"line":1523,"column":8},"end":{"line":1523,"column":51849}},"180":{"start":{"line":1542,"column":8},"end":{"line":1542,"column":40}},"181":{"start":{"line":1567,"column":8},"end":{"line":1567,"column":60}},"182":{"start":{"line":1581,"column":8},"end":{"line":1581,"column":53501}},"183":{"start":{"line":1582,"column":12},"end":{"line":1582,"column":59}},"184":{"start":{"line":1585,"column":8},"end":{"line":1585,"column":47}},"185":{"start":{"line":1602,"column":8},"end":{"line":1602,"column":54058}},"186":{"start":{"line":1608,"column":12},"end":{"line":1608,"column":54260}},"187":{"start":{"line":1613,"column":12},"end":{"line":1613,"column":54394}},"188":{"start":{"line":1620,"column":12},"end":{"line":1620,"column":54619}},"189":{"start":{"line":1646,"column":8},"end":{"line":1646,"column":55372}},"190":{"start":{"line":1647,"column":12},"end":{"line":1647,"column":24}},"191":{"start":{"line":1651,"column":8},"end":{"line":1651,"column":55532}},"192":{"start":{"line":1652,"column":12},"end":{"line":1652,"column":24}},"193":{"start":{"line":1656,"column":8},"end":{"line":1656,"column":19}},"194":{"start":{"line":1687,"column":8},"end":{"line":1687,"column":39}},"195":{"start":{"line":1688,"column":8},"end":{"line":1688,"column":56851}},"196":{"start":{"line":1689,"column":12},"end":{"line":1689,"column":75}},"197":{"start":{"line":1691,"column":12},"end":{"line":1691,"column":72}},"198":{"start":{"line":1694,"column":8},"end":{"line":1694,"column":57104}},"199":{"start":{"line":1718,"column":8},"end":{"line":1718,"column":57699}},"200":{"start":{"line":1735,"column":8},"end":{"line":1735,"column":58099}},"201":{"start":{"line":1759,"column":8},"end":{"line":1759,"column":58790}},"202":{"start":{"line":1760,"column":12},"end":{"line":1760,"column":67}},"203":{"start":{"line":1764,"column":8},"end":{"line":1764,"column":58990}},"204":{"start":{"line":1765,"column":12},"end":{"line":1765,"column":69}},"205":{"start":{"line":1769,"column":8},"end":{"line":1769,"column":59194}},"206":{"start":{"line":1770,"column":12},"end":{"line":1770,"column":65}},"207":{"start":{"line":1783,"column":8},"end":{"line":1783,"column":63}},"208":{"start":{"line":1784,"column":8},"end":{"line":1784,"column":62}},"209":{"start":{"line":1785,"column":8},"end":{"line":1785,"column":63}},"210":{"start":{"line":1786,"column":8},"end":{"line":1786,"column":71}},"211":{"start":{"line":1787,"column":8},"end":{"line":1787,"column":65}},"212":{"start":{"line":1788,"column":8},"end":{"line":1788,"column":77}},"213":{"start":{"line":1790,"column":8},"end":{"line":1790,"column":82}},"214":{"start":{"line":1799,"column":8},"end":{"line":1799,"column":52}},"215":{"start":{"line":1800,"column":8},"end":{"line":1800,"column":42}},"216":{"start":{"line":1801,"column":8},"end":{"line":1801,"column":39}},"217":{"start":{"line":1802,"column":8},"end":{"line":1802,"column":41}},"218":{"start":{"line":1803,"column":8},"end":{"line":1803,"column":43}},"219":{"start":{"line":1804,"column":8},"end":{"line":1804,"column":85}},"220":{"start":{"line":1806,"column":8},"end":{"line":1806,"column":41}},"221":{"start":{"line":1808,"column":8},"end":{"line":1808,"column":44}},"222":{"start":{"line":1809,"column":8},"end":{"line":1809,"column":45}},"223":{"start":{"line":1810,"column":8},"end":{"line":1810,"column":38}},"224":{"start":{"line":1812,"column":8},"end":{"line":1812,"column":40}},"225":{"start":{"line":1837,"column":8},"end":{"line":1837,"column":40}},"226":{"start":{"line":1839,"column":8},"end":{"line":1839,"column":41}},"227":{"start":{"line":1840,"column":8},"end":{"line":1840,"column":33}},"228":{"start":{"line":1841,"column":8},"end":{"line":1841,"column":47}},"229":{"start":{"line":1843,"column":8},"end":{"line":1843,"column":40}},"230":{"start":{"line":1845,"column":8},"end":{"line":1845,"column":61}},"231":{"start":{"line":1846,"column":8},"end":{"line":1846,"column":61862}},"232":{"start":{"line":1847,"column":12},"end":{"line":1847,"column":85}},"233":{"start":{"line":1848,"column":12},"end":{"line":1848,"column":61981}},"234":{"start":{"line":1849,"column":16},"end":{"line":1849,"column":42}},"235":{"start":{"line":1853,"column":16},"end":{"line":1853,"column":60}},"236":{"start":{"line":1856,"column":12},"end":{"line":1856,"column":62361}}},"branchMap":{"1":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":8},"end":{"line":109,"column":8}},{"start":{"line":109,"column":8},"end":{"line":109,"column":8}}]},"2":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":8},"end":{"line":127,"column":8}},{"start":{"line":127,"column":8},"end":{"line":127,"column":8}}]},"3":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"4":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]},"5":{"line":170,"type":"if","locations":[{"start":{"line":170,"column":8},"end":{"line":170,"column":8}},{"start":{"line":170,"column":8},"end":{"line":170,"column":8}}]},"6":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"7":{"line":510,"type":"if","locations":[{"start":{"line":510,"column":8},"end":{"line":510,"column":8}},{"start":{"line":510,"column":8},"end":{"line":510,"column":8}}]},"8":{"line":515,"type":"if","locations":[{"start":{"line":515,"column":8},"end":{"line":515,"column":8}},{"start":{"line":515,"column":8},"end":{"line":515,"column":8}}]},"9":{"line":814,"type":"if","locations":[{"start":{"line":814,"column":8},"end":{"line":814,"column":8}},{"start":{"line":814,"column":8},"end":{"line":814,"column":8}}]},"10":{"line":889,"type":"if","locations":[{"start":{"line":889,"column":8},"end":{"line":889,"column":8}},{"start":{"line":889,"column":8},"end":{"line":889,"column":8}}]},"11":{"line":969,"type":"if","locations":[{"start":{"line":969,"column":8},"end":{"line":969,"column":8}},{"start":{"line":969,"column":8},"end":{"line":969,"column":8}}]},"12":{"line":980,"type":"if","locations":[{"start":{"line":980,"column":12},"end":{"line":980,"column":12}},{"start":{"line":980,"column":12},"end":{"line":980,"column":12}}]},"13":{"line":987,"type":"if","locations":[{"start":{"line":987,"column":12},"end":{"line":987,"column":12}},{"start":{"line":987,"column":12},"end":{"line":987,"column":12}}]},"14":{"line":998,"type":"if","locations":[{"start":{"line":998,"column":12},"end":{"line":998,"column":12}},{"start":{"line":998,"column":12},"end":{"line":998,"column":12}}]},"15":{"line":1047,"type":"if","locations":[{"start":{"line":1047,"column":8},"end":{"line":1047,"column":8}},{"start":{"line":1047,"column":8},"end":{"line":1047,"column":8}}]},"16":{"line":1060,"type":"if","locations":[{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}},{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}}]},"17":{"line":1076,"type":"if","locations":[{"start":{"line":1076,"column":8},"end":{"line":1076,"column":8}},{"start":{"line":1076,"column":8},"end":{"line":1076,"column":8}}]},"18":{"line":1096,"type":"if","locations":[{"start":{"line":1096,"column":8},"end":{"line":1096,"column":8}},{"start":{"line":1096,"column":8},"end":{"line":1096,"column":8}}]},"19":{"line":1281,"type":"if","locations":[{"start":{"line":1281,"column":8},"end":{"line":1281,"column":8}},{"start":{"line":1281,"column":8},"end":{"line":1281,"column":8}}]},"20":{"line":1300,"type":"if","locations":[{"start":{"line":1300,"column":8},"end":{"line":1300,"column":8}},{"start":{"line":1300,"column":8},"end":{"line":1300,"column":8}}]},"21":{"line":1305,"type":"if","locations":[{"start":{"line":1305,"column":8},"end":{"line":1305,"column":8}},{"start":{"line":1305,"column":8},"end":{"line":1305,"column":8}}]},"22":{"line":1317,"type":"if","locations":[{"start":{"line":1317,"column":8},"end":{"line":1317,"column":8}},{"start":{"line":1317,"column":8},"end":{"line":1317,"column":8}}]},"23":{"line":1346,"type":"if","locations":[{"start":{"line":1346,"column":8},"end":{"line":1346,"column":8}},{"start":{"line":1346,"column":8},"end":{"line":1346,"column":8}}]},"24":{"line":1372,"type":"if","locations":[{"start":{"line":1372,"column":8},"end":{"line":1372,"column":8}},{"start":{"line":1372,"column":8},"end":{"line":1372,"column":8}}]},"25":{"line":1379,"type":"if","locations":[{"start":{"line":1379,"column":8},"end":{"line":1379,"column":8}},{"start":{"line":1379,"column":8},"end":{"line":1379,"column":8}}]},"26":{"line":1391,"type":"if","locations":[{"start":{"line":1391,"column":8},"end":{"line":1391,"column":8}},{"start":{"line":1391,"column":8},"end":{"line":1391,"column":8}}]},"27":{"line":1420,"type":"if","locations":[{"start":{"line":1420,"column":8},"end":{"line":1420,"column":8}},{"start":{"line":1420,"column":8},"end":{"line":1420,"column":8}}]},"28":{"line":1452,"type":"if","locations":[{"start":{"line":1452,"column":8},"end":{"line":1452,"column":8}},{"start":{"line":1452,"column":8},"end":{"line":1452,"column":8}}]},"29":{"line":1459,"type":"if","locations":[{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}},{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}}]},"30":{"line":1498,"type":"if","locations":[{"start":{"line":1498,"column":8},"end":{"line":1498,"column":8}},{"start":{"line":1498,"column":8},"end":{"line":1498,"column":8}}]},"31":{"line":1581,"type":"if","locations":[{"start":{"line":1581,"column":8},"end":{"line":1581,"column":8}},{"start":{"line":1581,"column":8},"end":{"line":1581,"column":8}}]},"32":{"line":1602,"type":"if","locations":[{"start":{"line":1602,"column":8},"end":{"line":1602,"column":8}},{"start":{"line":1602,"column":8},"end":{"line":1602,"column":8}}]},"33":{"line":1646,"type":"if","locations":[{"start":{"line":1646,"column":8},"end":{"line":1646,"column":8}},{"start":{"line":1646,"column":8},"end":{"line":1646,"column":8}}]},"34":{"line":1651,"type":"if","locations":[{"start":{"line":1651,"column":8},"end":{"line":1651,"column":8}},{"start":{"line":1651,"column":8},"end":{"line":1651,"column":8}}]},"35":{"line":1688,"type":"if","locations":[{"start":{"line":1688,"column":8},"end":{"line":1688,"column":8}},{"start":{"line":1688,"column":8},"end":{"line":1688,"column":8}}]},"36":{"line":1759,"type":"if","locations":[{"start":{"line":1759,"column":8},"end":{"line":1759,"column":8}},{"start":{"line":1759,"column":8},"end":{"line":1759,"column":8}}]},"37":{"line":1764,"type":"if","locations":[{"start":{"line":1764,"column":8},"end":{"line":1764,"column":8}},{"start":{"line":1764,"column":8},"end":{"line":1764,"column":8}}]},"38":{"line":1769,"type":"if","locations":[{"start":{"line":1769,"column":8},"end":{"line":1769,"column":8}},{"start":{"line":1769,"column":8},"end":{"line":1769,"column":8}}]},"39":{"line":1837,"type":"if","locations":[{"start":{"line":1837,"column":8},"end":{"line":1837,"column":8}},{"start":{"line":1837,"column":8},"end":{"line":1837,"column":8}}]},"40":{"line":1846,"type":"if","locations":[{"start":{"line":1846,"column":8},"end":{"line":1846,"column":8}},{"start":{"line":1846,"column":8},"end":{"line":1846,"column":8}}]},"41":{"line":1848,"type":"if","locations":[{"start":{"line":1848,"column":12},"end":{"line":1848,"column":12}},{"start":{"line":1848,"column":12},"end":{"line":1848,"column":12}}]}}}, +"contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol":{"l":{"43":277,"54":277,"56":277,"58":277,"60":277,"61":277,"62":277,"65":277,"66":277,"146":152},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol","s":{"1":277,"2":277,"3":277,"4":277,"5":277,"6":277,"7":277,"8":152},"b":{},"f":{"1":277},"fnMap":{"1":{"name":"isBytecodeSafe","line":31,"loc":{"start":{"line":31,"column":4},"end":{"line":147,"column":4}}}},"statementMap":{"1":{"start":{"line":43,"column":8},"end":{"line":43,"column":1492}},"2":{"start":{"line":54,"column":8},"end":{"line":54,"column":109}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":112}},"4":{"start":{"line":58,"column":8},"end":{"line":58,"column":77}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":26}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":19}},"7":{"start":{"line":65,"column":8},"end":{"line":65,"column":42}},"8":{"start":{"line":146,"column":8},"end":{"line":146,"column":19}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol":{"l":{"57":207,"71":921,"75":920,"97":0,"111":12,"127":12,"141":0,"142":0,"143":0,"161":4,"179":537,"197":31,"216":31,"234":60,"252":369,"270":0,"284":30,"285":30,"286":30,"287":30,"288":30,"306":18,"307":18,"308":18,"326":538,"347":61,"368":7,"369":7,"370":3,"373":4,"374":4,"376":4,"387":70,"402":5,"420":0,"421":0,"439":0,"440":0,"466":14,"473":14,"474":8,"497":57,"501":6,"505":51,"525":74,"545":69,"568":19,"591":9,"592":9,"593":3,"596":6,"597":6,"599":6,"610":30,"625":5,"645":0,"646":0,"666":0,"667":0,"689":606,"708":97,"730":687,"732":687,"733":268,"736":687},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol","s":{"1":207,"2":921,"3":0,"4":12,"5":12,"6":0,"7":0,"8":0,"9":4,"10":537,"11":31,"12":31,"13":60,"14":369,"15":0,"16":30,"17":30,"18":30,"19":30,"20":30,"21":18,"22":18,"23":18,"24":538,"25":61,"26":7,"27":7,"28":3,"29":4,"30":4,"31":4,"32":70,"33":5,"34":0,"35":0,"36":0,"37":0,"38":14,"39":14,"40":8,"41":57,"42":6,"43":51,"44":74,"45":69,"46":19,"47":9,"48":9,"49":3,"50":6,"51":6,"52":6,"53":30,"54":5,"55":0,"56":0,"57":0,"58":0,"59":606,"60":97,"61":687,"62":687,"63":268,"64":687},"b":{"1":[920,1],"2":[3,4],"3":[8,6],"4":[6,51],"5":[3,6],"6":[268,419]},"f":{"1":207,"2":921,"3":0,"4":12,"5":12,"6":0,"7":4,"8":537,"9":31,"10":31,"11":60,"12":369,"13":0,"14":30,"15":18,"16":538,"17":61,"18":7,"19":70,"20":5,"21":0,"22":0,"23":14,"24":57,"25":74,"26":69,"27":19,"28":9,"29":30,"30":5,"31":0,"32":0,"33":606,"34":97,"35":687},"fnMap":{"1":{"name":"constructor","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":58,"column":4}}},"2":{"name":"authenticated","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":76,"column":4}}},"3":{"name":"isAuthenticated","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":98,"column":4}}},"4":{"name":"setExecutionManager","line":109,"loc":{"start":{"line":104,"column":4},"end":{"line":112,"column":4}}},"5":{"name":"putAccount","line":125,"loc":{"start":{"line":119,"column":4},"end":{"line":128,"column":4}}},"6":{"name":"putEmptyAccount","line":139,"loc":{"start":{"line":134,"column":4},"end":{"line":144,"column":4}}},"7":{"name":"getAccount","line":151,"loc":{"start":{"line":151,"column":4},"end":{"line":162,"column":4}}},"8":{"name":"hasAccount","line":169,"loc":{"start":{"line":169,"column":4},"end":{"line":180,"column":4}}},"9":{"name":"hasEmptyAccount","line":187,"loc":{"start":{"line":187,"column":4},"end":{"line":201,"column":4}}},"10":{"name":"setAccountNonce","line":214,"loc":{"start":{"line":208,"column":4},"end":{"line":217,"column":4}}},"11":{"name":"getAccountNonce","line":224,"loc":{"start":{"line":224,"column":4},"end":{"line":235,"column":4}}},"12":{"name":"getAccountEthAddress","line":242,"loc":{"start":{"line":242,"column":4},"end":{"line":253,"column":4}}},"13":{"name":"getAccountStorageRoot","line":260,"loc":{"start":{"line":260,"column":4},"end":{"line":271,"column":4}}},"14":{"name":"initPendingAccount","line":282,"loc":{"start":{"line":277,"column":4},"end":{"line":289,"column":4}}},"15":{"name":"commitPendingAccount","line":304,"loc":{"start":{"line":297,"column":4},"end":{"line":309,"column":4}}},"16":{"name":"testAndSetAccountLoaded","line":321,"loc":{"start":{"line":316,"column":4},"end":{"line":330,"column":4}}},"17":{"name":"testAndSetAccountChanged","line":342,"loc":{"start":{"line":337,"column":4},"end":{"line":351,"column":4}}},"18":{"name":"commitAccount","line":363,"loc":{"start":{"line":358,"column":4},"end":{"line":377,"column":4}}},"19":{"name":"incrementTotalUncommittedAccounts","line":385,"loc":{"start":{"line":382,"column":4},"end":{"line":388,"column":4}}},"20":{"name":"getTotalUncommittedAccounts","line":394,"loc":{"start":{"line":394,"column":4},"end":{"line":403,"column":4}}},"21":{"name":"wasAccountChanged","line":410,"loc":{"start":{"line":410,"column":4},"end":{"line":422,"column":4}}},"22":{"name":"wasAccountCommitted","line":429,"loc":{"start":{"line":429,"column":4},"end":{"line":441,"column":4}}},"23":{"name":"putContractStorage","line":461,"loc":{"start":{"line":454,"column":4},"end":{"line":476,"column":4}}},"24":{"name":"getContractStorage","line":484,"loc":{"start":{"line":484,"column":4},"end":{"line":506,"column":4}}},"25":{"name":"hasContractStorage","line":514,"loc":{"start":{"line":514,"column":4},"end":{"line":526,"column":4}}},"26":{"name":"testAndSetContractStorageLoaded","line":540,"loc":{"start":{"line":534,"column":4},"end":{"line":549,"column":4}}},"27":{"name":"testAndSetContractStorageChanged","line":563,"loc":{"start":{"line":557,"column":4},"end":{"line":572,"column":4}}},"28":{"name":"commitContractStorage","line":586,"loc":{"start":{"line":580,"column":4},"end":{"line":600,"column":4}}},"29":{"name":"incrementTotalUncommittedContractStorage","line":608,"loc":{"start":{"line":605,"column":4},"end":{"line":611,"column":4}}},"30":{"name":"getTotalUncommittedContractStorage","line":617,"loc":{"start":{"line":617,"column":4},"end":{"line":626,"column":4}}},"31":{"name":"wasContractStorageChanged","line":634,"loc":{"start":{"line":634,"column":4},"end":{"line":647,"column":4}}},"32":{"name":"wasContractStorageCommitted","line":655,"loc":{"start":{"line":655,"column":4},"end":{"line":668,"column":4}}},"33":{"name":"_getItemHash","line":680,"loc":{"start":{"line":680,"column":4},"end":{"line":690,"column":4}}},"34":{"name":"_getItemHash","line":698,"loc":{"start":{"line":698,"column":4},"end":{"line":712,"column":4}}},"35":{"name":"_testAndSetItemState","line":721,"loc":{"start":{"line":721,"column":4},"end":{"line":737,"column":4}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":21}},"2":{"start":{"line":71,"column":8},"end":{"line":71,"column":2475}},"3":{"start":{"line":97,"column":8},"end":{"line":97,"column":69}},"4":{"start":{"line":111,"column":8},"end":{"line":111,"column":49}},"5":{"start":{"line":127,"column":8},"end":{"line":127,"column":36}},"6":{"start":{"line":141,"column":8},"end":{"line":141,"column":65}},"7":{"start":{"line":142,"column":8},"end":{"line":142,"column":55}},"8":{"start":{"line":143,"column":8},"end":{"line":143,"column":49}},"9":{"start":{"line":161,"column":8},"end":{"line":161,"column":33}},"10":{"start":{"line":179,"column":8},"end":{"line":179,"column":56}},"11":{"start":{"line":197,"column":8},"end":{"line":197,"column":5447}},"12":{"start":{"line":216,"column":8},"end":{"line":216,"column":40}},"13":{"start":{"line":234,"column":8},"end":{"line":234,"column":39}},"14":{"start":{"line":252,"column":8},"end":{"line":252,"column":44}},"15":{"start":{"line":270,"column":8},"end":{"line":270,"column":45}},"16":{"start":{"line":284,"column":8},"end":{"line":284,"column":65}},"17":{"start":{"line":285,"column":8},"end":{"line":285,"column":24}},"18":{"start":{"line":286,"column":8},"end":{"line":286,"column":55}},"19":{"start":{"line":287,"column":8},"end":{"line":287,"column":49}},"20":{"start":{"line":288,"column":8},"end":{"line":288,"column":29}},"21":{"start":{"line":306,"column":8},"end":{"line":306,"column":65}},"22":{"start":{"line":307,"column":8},"end":{"line":307,"column":39}},"23":{"start":{"line":308,"column":8},"end":{"line":308,"column":35}},"24":{"start":{"line":326,"column":8},"end":{"line":326,"column":8632}},"25":{"start":{"line":347,"column":8},"end":{"line":347,"column":9161}},"26":{"start":{"line":368,"column":8},"end":{"line":368,"column":45}},"27":{"start":{"line":369,"column":8},"end":{"line":369,"column":9676}},"28":{"start":{"line":370,"column":12},"end":{"line":370,"column":24}},"29":{"start":{"line":373,"column":8},"end":{"line":373,"column":50}},"30":{"start":{"line":374,"column":8},"end":{"line":374,"column":36}},"31":{"start":{"line":376,"column":8},"end":{"line":376,"column":19}},"32":{"start":{"line":387,"column":8},"end":{"line":387,"column":36}},"33":{"start":{"line":402,"column":8},"end":{"line":402,"column":39}},"34":{"start":{"line":420,"column":8},"end":{"line":420,"column":45}},"35":{"start":{"line":421,"column":8},"end":{"line":421,"column":57}},"36":{"start":{"line":439,"column":8},"end":{"line":439,"column":45}},"37":{"start":{"line":440,"column":8},"end":{"line":440,"column":59}},"38":{"start":{"line":466,"column":8},"end":{"line":466,"column":68}},"39":{"start":{"line":473,"column":8},"end":{"line":473,"column":12609}},"40":{"start":{"line":474,"column":12},"end":{"line":474,"column":58}},"41":{"start":{"line":497,"column":8},"end":{"line":497,"column":13277}},"42":{"start":{"line":501,"column":12},"end":{"line":501,"column":29}},"43":{"start":{"line":505,"column":8},"end":{"line":505,"column":67}},"44":{"start":{"line":525,"column":8},"end":{"line":525,"column":86}},"45":{"start":{"line":545,"column":8},"end":{"line":545,"column":14610}},"46":{"start":{"line":568,"column":8},"end":{"line":568,"column":15225}},"47":{"start":{"line":591,"column":8},"end":{"line":591,"column":52}},"48":{"start":{"line":592,"column":8},"end":{"line":592,"column":15834}},"49":{"start":{"line":593,"column":12},"end":{"line":593,"column":24}},"50":{"start":{"line":596,"column":8},"end":{"line":596,"column":50}},"51":{"start":{"line":597,"column":8},"end":{"line":597,"column":43}},"52":{"start":{"line":599,"column":8},"end":{"line":599,"column":19}},"53":{"start":{"line":610,"column":8},"end":{"line":610,"column":43}},"54":{"start":{"line":625,"column":8},"end":{"line":625,"column":46}},"55":{"start":{"line":645,"column":8},"end":{"line":645,"column":52}},"56":{"start":{"line":646,"column":8},"end":{"line":646,"column":57}},"57":{"start":{"line":666,"column":8},"end":{"line":666,"column":52}},"58":{"start":{"line":667,"column":8},"end":{"line":667,"column":59}},"59":{"start":{"line":689,"column":8},"end":{"line":689,"column":52}},"60":{"start":{"line":708,"column":8},"end":{"line":708,"column":18596}},"61":{"start":{"line":730,"column":8},"end":{"line":730,"column":62}},"62":{"start":{"line":732,"column":8},"end":{"line":732,"column":19270}},"63":{"start":{"line":733,"column":12},"end":{"line":733,"column":44}},"64":{"start":{"line":736,"column":8},"end":{"line":736,"column":27}}},"branchMap":{"1":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":8}},{"start":{"line":71,"column":8},"end":{"line":71,"column":8}}]},"2":{"line":369,"type":"if","locations":[{"start":{"line":369,"column":8},"end":{"line":369,"column":8}},{"start":{"line":369,"column":8},"end":{"line":369,"column":8}}]},"3":{"line":473,"type":"if","locations":[{"start":{"line":473,"column":8},"end":{"line":473,"column":8}},{"start":{"line":473,"column":8},"end":{"line":473,"column":8}}]},"4":{"line":497,"type":"if","locations":[{"start":{"line":497,"column":8},"end":{"line":497,"column":8}},{"start":{"line":497,"column":8},"end":{"line":497,"column":8}}]},"5":{"line":592,"type":"if","locations":[{"start":{"line":592,"column":8},"end":{"line":592,"column":8}},{"start":{"line":592,"column":8},"end":{"line":592,"column":8}}]},"6":{"line":732,"type":"if","locations":[{"start":{"line":732,"column":8},"end":{"line":732,"column":8}},{"start":{"line":732,"column":8},"end":{"line":732,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol":{"l":{"39":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol","s":{"1":0},"b":{},"f":{"1":0},"fnMap":{"1":{"name":"create","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":40,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":43}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol":{"l":{"57":0,"58":0,"59":0,"60":0,"62":0,"74":0,"75":0,"77":0,"78":0,"79":0,"85":0,"86":0,"94":0,"95":0,"96":0,"104":0,"105":0,"107":0,"115":0,"125":0,"127":0,"138":0,"139":0,"141":0,"149":0,"150":0,"152":0,"153":0,"154":0,"157":0,"158":0,"159":0,"162":0,"163":0,"164":0,"166":0,"173":0,"180":0,"182":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0},"fnMap":{"1":{"name":"getInterfaceImplementer","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":63,"column":4}}},"2":{"name":"setInterfaceImplementer","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":87,"column":4}}},"3":{"name":"setManager","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":97,"column":4}}},"4":{"name":"getManager","line":102,"loc":{"start":{"line":102,"column":4},"end":{"line":109,"column":4}}},"5":{"name":"interfaceHash","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":116,"column":4}}},"6":{"name":"updateERC165Cache","line":124,"loc":{"start":{"line":124,"column":4},"end":{"line":128,"column":4}}},"7":{"name":"implementsERC165Interface","line":137,"loc":{"start":{"line":137,"column":4},"end":{"line":142,"column":4}}},"8":{"name":"implementsERC165InterfaceNoCache","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":167,"column":4}}},"9":{"name":"isERC165Interface","line":172,"loc":{"start":{"line":172,"column":4},"end":{"line":174,"column":4}}},"10":{"name":"noThrowCall","line":177,"loc":{"start":{"line":177,"column":4},"end":{"line":198,"column":4}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":63}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":3386}},"3":{"start":{"line":59,"column":12},"end":{"line":59,"column":63}},"4":{"start":{"line":60,"column":12},"end":{"line":60,"column":91}},"5":{"start":{"line":62,"column":8},"end":{"line":62,"column":47}},"6":{"start":{"line":74,"column":8},"end":{"line":74,"column":63}},"7":{"start":{"line":75,"column":8},"end":{"line":75,"column":65}},"8":{"start":{"line":77,"column":8},"end":{"line":77,"column":80}},"9":{"start":{"line":78,"column":8},"end":{"line":78,"column":4625}},"10":{"start":{"line":79,"column":12},"end":{"line":79,"column":4705}},"11":{"start":{"line":85,"column":8},"end":{"line":85,"column":54}},"12":{"start":{"line":86,"column":8},"end":{"line":86,"column":72}},"13":{"start":{"line":94,"column":8},"end":{"line":94,"column":66}},"14":{"start":{"line":95,"column":8},"end":{"line":95,"column":72}},"15":{"start":{"line":96,"column":8},"end":{"line":96,"column":47}},"16":{"start":{"line":104,"column":8},"end":{"line":104,"column":5986}},"17":{"start":{"line":105,"column":12},"end":{"line":105,"column":24}},"18":{"start":{"line":107,"column":12},"end":{"line":107,"column":34}},"19":{"start":{"line":115,"column":8},"end":{"line":115,"column":58}},"20":{"start":{"line":125,"column":8},"end":{"line":125,"column":6972}},"21":{"start":{"line":127,"column":8},"end":{"line":127,"column":51}},"22":{"start":{"line":138,"column":8},"end":{"line":138,"column":7770}},"23":{"start":{"line":139,"column":12},"end":{"line":139,"column":76}},"24":{"start":{"line":141,"column":8},"end":{"line":141,"column":63}},"25":{"start":{"line":149,"column":8},"end":{"line":149,"column":23}},"26":{"start":{"line":150,"column":8},"end":{"line":150,"column":22}},"27":{"start":{"line":152,"column":8},"end":{"line":152,"column":59}},"28":{"start":{"line":153,"column":8},"end":{"line":153,"column":8523}},"29":{"start":{"line":154,"column":12},"end":{"line":154,"column":24}},"30":{"start":{"line":157,"column":8},"end":{"line":157,"column":61}},"31":{"start":{"line":158,"column":8},"end":{"line":158,"column":8667}},"32":{"start":{"line":159,"column":12},"end":{"line":159,"column":24}},"33":{"start":{"line":162,"column":8},"end":{"line":162,"column":63}},"34":{"start":{"line":163,"column":8},"end":{"line":163,"column":8813}},"35":{"start":{"line":164,"column":12},"end":{"line":164,"column":23}},"36":{"start":{"line":166,"column":8},"end":{"line":166,"column":20}},"37":{"start":{"line":173,"column":8},"end":{"line":173,"column":103}},"38":{"start":{"line":180,"column":8},"end":{"line":180,"column":34}}},"branchMap":{"1":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":8},"end":{"line":58,"column":8}},{"start":{"line":58,"column":8},"end":{"line":58,"column":8}}]},"2":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":8},"end":{"line":75,"column":8}},{"start":{"line":75,"column":8},"end":{"line":75,"column":8}}]},"3":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":77,"column":8}},{"start":{"line":77,"column":8},"end":{"line":77,"column":8}}]},"4":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]},"5":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":12},"end":{"line":79,"column":12}},{"start":{"line":79,"column":12},"end":{"line":79,"column":12}}]},"6":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":8},"end":{"line":94,"column":8}},{"start":{"line":94,"column":8},"end":{"line":94,"column":8}}]},"7":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":8},"end":{"line":104,"column":8}},{"start":{"line":104,"column":8},"end":{"line":104,"column":8}}]},"8":{"line":138,"type":"if","locations":[{"start":{"line":138,"column":8},"end":{"line":138,"column":8}},{"start":{"line":138,"column":8},"end":{"line":138,"column":8}}]},"9":{"line":153,"type":"if","locations":[{"start":{"line":153,"column":8},"end":{"line":153,"column":8}},{"start":{"line":153,"column":8},"end":{"line":153,"column":8}}]},"10":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":8},"end":{"line":158,"column":8}},{"start":{"line":158,"column":8},"end":{"line":158,"column":8}}]},"11":{"line":163,"type":"if","locations":[{"start":{"line":163,"column":8},"end":{"line":163,"column":8}},{"start":{"line":163,"column":8},"end":{"line":163,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol":{"l":{"40":0,"46":0,"50":0,"70":0,"74":0,"75":0,"78":0,"82":0,"86":0,"102":0,"122":0,"139":0,"156":0,"170":0,"171":0,"188":29,"192":29,"193":25,"196":4,"200":4,"201":1,"204":3,"210":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":29,"16":29,"17":25,"18":4,"19":4,"20":1,"21":3,"22":3},"b":{"1":[0,0],"2":[25,4],"3":[1,3]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":29},"fnMap":{"1":{"name":"onlyOwner","line":39,"loc":{"start":{"line":39,"column":4},"end":{"line":51,"column":4}}},"2":{"name":"initialize","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":90,"column":4}}},"3":{"name":"getOwner","line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":107,"column":4}}},"4":{"name":"setWhitelistedDeployer","line":120,"loc":{"start":{"line":114,"column":4},"end":{"line":126,"column":4}}},"5":{"name":"setOwner","line":137,"loc":{"start":{"line":132,"column":4},"end":{"line":143,"column":4}}},"6":{"name":"setAllowArbitraryDeployment","line":154,"loc":{"start":{"line":149,"column":4},"end":{"line":160,"column":4}}},"7":{"name":"enableArbitraryContractDeployment","line":168,"loc":{"start":{"line":165,"column":4},"end":{"line":172,"column":4}}},"8":{"name":"isDeployerAllowed","line":179,"loc":{"start":{"line":179,"column":4},"end":{"line":211,"column":4}}}},"statementMap":{"1":{"start":{"line":40,"column":8},"end":{"line":40,"column":1617}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":1775}},"3":{"start":{"line":70,"column":8},"end":{"line":70,"column":2421}},"4":{"start":{"line":74,"column":8},"end":{"line":74,"column":2555}},"5":{"start":{"line":75,"column":12},"end":{"line":75,"column":18}},"6":{"start":{"line":78,"column":8},"end":{"line":78,"column":2621}},"7":{"start":{"line":82,"column":8},"end":{"line":82,"column":2757}},"8":{"start":{"line":86,"column":8},"end":{"line":86,"column":2892}},"9":{"start":{"line":102,"column":8},"end":{"line":102,"column":3237}},"10":{"start":{"line":122,"column":8},"end":{"line":122,"column":3758}},"11":{"start":{"line":139,"column":8},"end":{"line":139,"column":4149}},"12":{"start":{"line":156,"column":8},"end":{"line":156,"column":4591}},"13":{"start":{"line":170,"column":8},"end":{"line":170,"column":40}},"14":{"start":{"line":171,"column":8},"end":{"line":171,"column":27}},"15":{"start":{"line":188,"column":8},"end":{"line":188,"column":5404}},"16":{"start":{"line":192,"column":8},"end":{"line":192,"column":5538}},"17":{"start":{"line":193,"column":12},"end":{"line":193,"column":23}},"18":{"start":{"line":196,"column":8},"end":{"line":196,"column":5611}},"19":{"start":{"line":200,"column":8},"end":{"line":200,"column":5773}},"20":{"start":{"line":201,"column":12},"end":{"line":201,"column":23}},"21":{"start":{"line":204,"column":8},"end":{"line":204,"column":5858}},"22":{"start":{"line":210,"column":8},"end":{"line":210,"column":28}}},"branchMap":{"1":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":8},"end":{"line":74,"column":8}},{"start":{"line":74,"column":8},"end":{"line":74,"column":8}}]},"2":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":8},"end":{"line":192,"column":8}},{"start":{"line":192,"column":8},"end":{"line":192,"column":8}}]},"3":{"line":200,"type":"if","locations":[{"start":{"line":200,"column":8},"end":{"line":200,"column":8}},{"start":{"line":200,"column":8},"end":{"line":200,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol":{"l":{"32":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol","s":{"1":0},"b":{},"f":{"1":0},"fnMap":{"1":{"name":"constructor","line":30,"loc":{"start":{"line":22,"column":4},"end":{"line":33,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":47}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol":{"l":{"41":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol","s":{"1":1},"b":{},"f":{"1":1},"fnMap":{"1":{"name":"getL1MessageSender","line":32,"loc":{"start":{"line":32,"column":4},"end":{"line":42,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":64}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol":{"l":{"43":31},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol","s":{"1":31},"b":{},"f":{"1":31},"fnMap":{"1":{"name":"passMessageToL1","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":49,"column":4}}}},"statementMap":{"1":{"start":{"line":43,"column":8},"end":{"line":43,"column":1351}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol":{"l":{"25":1,"43":2,"47":2,"48":2,"56":2,"61":2,"74":4,"86":1,"98":2,"110":4},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol","s":{"1":1,"2":2,"3":2,"4":2,"5":2,"6":2,"7":4,"8":1,"9":2,"10":4},"b":{},"f":{"1":1,"2":2,"3":2,"4":4,"5":1,"6":2,"7":4},"fnMap":{"1":{"name":null,"line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":30,"column":4}}},"2":{"name":"init","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"upgrade","line":51,"loc":{"start":{"line":51,"column":4},"end":{"line":62,"column":4}}},"4":{"name":"_setImplementation","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":78,"column":4}}},"5":{"name":"_getImplementation","line":80,"loc":{"start":{"line":80,"column":4},"end":{"line":91,"column":4}}},"6":{"name":"_setOwner","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":102,"column":4}}},"7":{"name":"_getOwner","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":115,"column":4}}}},"statementMap":{"1":{"start":{"line":25,"column":8},"end":{"line":25,"column":678}},"2":{"start":{"line":43,"column":8},"end":{"line":43,"column":1017}},"3":{"start":{"line":47,"column":8},"end":{"line":47,"column":24}},"4":{"start":{"line":48,"column":8},"end":{"line":48,"column":42}},"5":{"start":{"line":56,"column":8},"end":{"line":56,"column":1345}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":42}},"7":{"start":{"line":74,"column":8},"end":{"line":74,"column":1768}},"8":{"start":{"line":86,"column":8},"end":{"line":86,"column":2050}},"9":{"start":{"line":98,"column":8},"end":{"line":98,"column":2288}},"10":{"start":{"line":110,"column":8},"end":{"line":110,"column":2543}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol":{"l":{"52":7,"54":5,"55":5,"56":5,"59":5,"60":5,"63":5,"68":5,"76":5,"78":2,"79":2,"83":5,"92":5,"117":7,"118":3,"120":2,"122":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol","s":{"1":7,"2":5,"3":5,"4":5,"5":5,"6":5,"7":5,"8":5,"9":5,"10":2,"11":2,"12":5,"13":5,"14":7,"15":3,"16":4,"17":2,"18":2},"b":{"1":[2,3],"2":[3,4],"3":[2,2]},"f":{"1":7,"2":7},"fnMap":{"1":{"name":null,"line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":97,"column":4}}},"2":{"name":"_getTransactionType","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":126,"column":4}}}},"statementMap":{"1":{"start":{"line":52,"column":8},"end":{"line":52,"column":98}},"2":{"start":{"line":54,"column":8},"end":{"line":54,"column":83}},"3":{"start":{"line":55,"column":8},"end":{"line":55,"column":84}},"4":{"start":{"line":56,"column":8},"end":{"line":56,"column":54}},"5":{"start":{"line":59,"column":8},"end":{"line":59,"column":70}},"6":{"start":{"line":60,"column":8},"end":{"line":60,"column":87}},"7":{"start":{"line":63,"column":8},"end":{"line":63,"column":2436}},"8":{"start":{"line":68,"column":8},"end":{"line":68,"column":2618}},"9":{"start":{"line":76,"column":8},"end":{"line":76,"column":2784}},"10":{"start":{"line":78,"column":12},"end":{"line":78,"column":94}},"11":{"start":{"line":79,"column":12},"end":{"line":79,"column":85}},"12":{"start":{"line":83,"column":8},"end":{"line":83,"column":3190}},"13":{"start":{"line":92,"column":8},"end":{"line":92,"column":3423}},"14":{"start":{"line":117,"column":8},"end":{"line":117,"column":3983}},"15":{"start":{"line":118,"column":12},"end":{"line":118,"column":57}},"16":{"start":{"line":119,"column":10},"end":{"line":119,"column":4081}},"17":{"start":{"line":120,"column":12},"end":{"line":120,"column":53}},"18":{"start":{"line":122,"column":12},"end":{"line":122,"column":4198}}},"branchMap":{"1":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"2":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":8},"end":{"line":117,"column":8}},{"start":{"line":117,"column":8},"end":{"line":117,"column":8}}]},"3":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":10},"end":{"line":119,"column":10}},{"start":{"line":119,"column":10},"end":{"line":119,"column":10}}]}}}, +"contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol":{"l":{"13":28,"14":28,"15":14,"16":14},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol","s":{"1":28,"2":14,"3":14},"b":{},"f":{"1":28},"fnMap":{"1":{"name":"contributesToFraudProof","line":12,"loc":{"start":{"line":12,"column":4},"end":{"line":17,"column":4}}}},"statementMap":{"1":{"start":{"line":13,"column":8},"end":{"line":13,"column":36}},"2":{"start":{"line":15,"column":8},"end":{"line":15,"column":47}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":110}}},"branchMap":{}}, +"contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol":{"l":{"69":63,"80":46,"81":46,"83":45,"84":45,"90":13,"91":12,"95":11,"97":11,"98":11,"99":8,"100":8,"101":8,"108":1,"109":1,"118":11,"123":1,"127":10,"133":18,"139":18,"144":7,"145":7,"146":7,"148":6,"149":6,"154":5,"156":5,"160":4,"163":3,"164":3,"166":3,"175":6,"176":6,"182":5,"183":5,"186":5,"190":4,"193":4,"196":4,"201":3,"206":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol","s":{"1":63,"2":46,"3":46,"4":45,"5":45,"6":13,"7":12,"8":11,"9":11,"10":11,"11":8,"12":8,"13":8,"14":3,"15":1,"16":1,"17":11,"18":1,"19":10,"20":18,"21":18,"22":7,"23":7,"24":7,"25":6,"26":6,"27":5,"28":5,"29":4,"30":3,"31":3,"32":3,"33":6,"34":6,"35":5,"36":5,"37":5,"38":4,"39":4,"40":4,"41":3,"42":2},"b":{"1":[45,1],"2":[12,1],"3":[11,1],"4":[8,3],"5":[1,2],"6":[1,10],"7":[18,0],"8":[7,0],"9":[6,1],"10":[4,1],"11":[3,1],"12":[3,0],"13":[5,1],"14":[4,1],"15":[4,0]},"f":{"1":63,"2":46,"3":13,"4":18,"5":7,"6":5,"7":6,"8":3,"9":2},"fnMap":{"1":{"name":"constructor","line":67,"loc":{"start":{"line":63,"column":4},"end":{"line":70,"column":4}}},"2":{"name":"recordGasSpent","line":78,"loc":{"start":{"line":78,"column":4},"end":{"line":85,"column":4}}},"3":{"name":"finalize","line":89,"loc":{"start":{"line":89,"column":4},"end":{"line":128,"column":4}}},"4":{"name":"deposit","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"5":{"name":"startWithdrawal","line":143,"loc":{"start":{"line":143,"column":4},"end":{"line":150,"column":4}}},"6":{"name":"finalizeWithdrawal","line":153,"loc":{"start":{"line":153,"column":4},"end":{"line":170,"column":4}}},"7":{"name":"claim","line":174,"loc":{"start":{"line":174,"column":4},"end":{"line":197,"column":4}}},"8":{"name":"isCollateralized","line":200,"loc":{"start":{"line":200,"column":4},"end":{"line":202,"column":4}}},"9":{"name":"getGasSpent","line":205,"loc":{"start":{"line":205,"column":4},"end":{"line":207,"column":4}}}},"statementMap":{"1":{"start":{"line":69,"column":8},"end":{"line":69,"column":21}},"2":{"start":{"line":80,"column":8},"end":{"line":80,"column":133}},"3":{"start":{"line":81,"column":8},"end":{"line":81,"column":68}},"4":{"start":{"line":83,"column":8},"end":{"line":83,"column":56}},"5":{"start":{"line":84,"column":8},"end":{"line":84,"column":64}},"6":{"start":{"line":90,"column":8},"end":{"line":90,"column":86}},"7":{"start":{"line":91,"column":8},"end":{"line":91,"column":91}},"8":{"start":{"line":95,"column":8},"end":{"line":95,"column":54}},"9":{"start":{"line":97,"column":8},"end":{"line":97,"column":44}},"10":{"start":{"line":98,"column":8},"end":{"line":98,"column":3657}},"11":{"start":{"line":99,"column":12},"end":{"line":99,"column":48}},"12":{"start":{"line":100,"column":12},"end":{"line":100,"column":57}},"13":{"start":{"line":101,"column":12},"end":{"line":101,"column":45}},"14":{"start":{"line":102,"column":15},"end":{"line":102,"column":3863}},"15":{"start":{"line":108,"column":12},"end":{"line":108,"column":57}},"16":{"start":{"line":109,"column":12},"end":{"line":109,"column":45}},"17":{"start":{"line":118,"column":8},"end":{"line":118,"column":4758}},"18":{"start":{"line":123,"column":12},"end":{"line":123,"column":18}},"19":{"start":{"line":127,"column":8},"end":{"line":127,"column":44}},"20":{"start":{"line":133,"column":8},"end":{"line":133,"column":5212}},"21":{"start":{"line":139,"column":8},"end":{"line":139,"column":53}},"22":{"start":{"line":144,"column":8},"end":{"line":144,"column":45}},"23":{"start":{"line":145,"column":8},"end":{"line":145,"column":72}},"24":{"start":{"line":146,"column":8},"end":{"line":146,"column":70}},"25":{"start":{"line":148,"column":8},"end":{"line":148,"column":37}},"26":{"start":{"line":149,"column":8},"end":{"line":149,"column":57}},"27":{"start":{"line":154,"column":8},"end":{"line":154,"column":45}},"28":{"start":{"line":156,"column":8},"end":{"line":156,"column":5998}},"29":{"start":{"line":160,"column":8},"end":{"line":160,"column":63}},"30":{"start":{"line":163,"column":8},"end":{"line":163,"column":44}},"31":{"start":{"line":164,"column":8},"end":{"line":164,"column":35}},"32":{"start":{"line":166,"column":8},"end":{"line":166,"column":6334}},"33":{"start":{"line":175,"column":8},"end":{"line":175,"column":38}},"34":{"start":{"line":176,"column":8},"end":{"line":176,"column":6686}},"35":{"start":{"line":182,"column":8},"end":{"line":182,"column":62}},"36":{"start":{"line":183,"column":8},"end":{"line":183,"column":65}},"37":{"start":{"line":186,"column":8},"end":{"line":186,"column":53}},"38":{"start":{"line":190,"column":8},"end":{"line":190,"column":98}},"39":{"start":{"line":193,"column":8},"end":{"line":193,"column":39}},"40":{"start":{"line":196,"column":8},"end":{"line":196,"column":68}},"41":{"start":{"line":201,"column":8},"end":{"line":201,"column":55}},"42":{"start":{"line":206,"column":8},"end":{"line":206,"column":59}}},"branchMap":{"1":{"line":81,"type":"if","locations":[{"start":{"line":81,"column":8},"end":{"line":81,"column":8}},{"start":{"line":81,"column":8},"end":{"line":81,"column":8}}]},"2":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]},"3":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"4":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"5":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":15},"end":{"line":102,"column":15}},{"start":{"line":102,"column":15},"end":{"line":102,"column":15}}]},"6":{"line":118,"type":"if","locations":[{"start":{"line":118,"column":8},"end":{"line":118,"column":8}},{"start":{"line":118,"column":8},"end":{"line":118,"column":8}}]},"7":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":8}},{"start":{"line":133,"column":8},"end":{"line":133,"column":8}}]},"8":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":145,"column":8}},{"start":{"line":145,"column":8},"end":{"line":145,"column":8}}]},"9":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"10":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"11":{"line":160,"type":"if","locations":[{"start":{"line":160,"column":8},"end":{"line":160,"column":8}},{"start":{"line":160,"column":8},"end":{"line":160,"column":8}}]},"12":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":8},"end":{"line":166,"column":8}},{"start":{"line":166,"column":8},"end":{"line":166,"column":8}}]},"13":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":8},"end":{"line":176,"column":8}},{"start":{"line":176,"column":8},"end":{"line":176,"column":8}}]},"14":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"15":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol":{"l":{"74":21,"105":12,"107":12,"108":0,"111":12,"112":12,"114":12,"123":11,"133":10,"138":9,"140":9,"171":6,"172":6,"174":6,"179":5,"184":4,"193":3,"203":2,"208":1,"211":1,"213":1,"241":12,"257":9,"278":1,"279":1,"282":1,"287":1,"290":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol","s":{"1":21,"2":12,"3":12,"4":0,"5":12,"6":12,"7":12,"8":11,"9":10,"10":9,"11":9,"12":6,"13":6,"14":6,"15":5,"16":4,"17":3,"18":2,"19":1,"20":1,"21":1,"22":12,"23":9,"24":1,"25":1,"26":1,"27":1,"28":1},"b":{"1":[0,12],"2":[11,1],"3":[10,1],"4":[9,1],"5":[5,1],"6":[4,1],"7":[3,1],"8":[2,1],"9":[1,1]},"f":{"1":33,"2":21,"3":12,"4":6,"5":12,"6":9,"7":1},"fnMap":{"1":{"name":"constructor","line":50,"loc":{"start":{"line":47,"column":4},"end":{"line":51,"column":5}}},"2":{"name":"getStateTransitioner","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":75,"column":4}}},"3":{"name":"initializeFraudVerification","line":103,"loc":{"start":{"line":92,"column":4},"end":{"line":146,"column":4}}},"4":{"name":"finalizeFraudVerification","line":169,"loc":{"start":{"line":158,"column":4},"end":{"line":219,"column":4}}},"5":{"name":"_hasStateTransitioner","line":231,"loc":{"start":{"line":231,"column":4},"end":{"line":242,"column":4}}},"6":{"name":"_deployTransitioner","line":250,"loc":{"start":{"line":250,"column":4},"end":{"line":265,"column":4}}},"7":{"name":"_cancelStateTransition","line":272,"loc":{"start":{"line":272,"column":4},"end":{"line":295,"column":4}}}},"statementMap":{"1":{"start":{"line":74,"column":8},"end":{"line":74,"column":81}},"2":{"start":{"line":105,"column":8},"end":{"line":105,"column":68}},"3":{"start":{"line":107,"column":8},"end":{"line":107,"column":3959}},"4":{"start":{"line":108,"column":12},"end":{"line":108,"column":18}},"5":{"start":{"line":111,"column":8},"end":{"line":111,"column":122}},"6":{"start":{"line":112,"column":8},"end":{"line":112,"column":142}},"7":{"start":{"line":114,"column":8},"end":{"line":114,"column":4320}},"8":{"start":{"line":123,"column":8},"end":{"line":123,"column":4585}},"9":{"start":{"line":133,"column":8},"end":{"line":133,"column":4878}},"10":{"start":{"line":138,"column":8},"end":{"line":138,"column":76}},"11":{"start":{"line":140,"column":8},"end":{"line":140,"column":5238}},"12":{"start":{"line":171,"column":8},"end":{"line":171,"column":90}},"13":{"start":{"line":172,"column":8},"end":{"line":172,"column":122}},"14":{"start":{"line":174,"column":8},"end":{"line":174,"column":6732}},"15":{"start":{"line":179,"column":8},"end":{"line":179,"column":6888}},"16":{"start":{"line":184,"column":8},"end":{"line":184,"column":7179}},"17":{"start":{"line":193,"column":8},"end":{"line":193,"column":7444}},"18":{"start":{"line":203,"column":8},"end":{"line":203,"column":7814}},"19":{"start":{"line":208,"column":8},"end":{"line":208,"column":71}},"20":{"start":{"line":211,"column":8},"end":{"line":211,"column":142}},"21":{"start":{"line":213,"column":8},"end":{"line":213,"column":8258}},"22":{"start":{"line":241,"column":8},"end":{"line":241,"column":82}},"23":{"start":{"line":257,"column":8},"end":{"line":257,"column":9503}},"24":{"start":{"line":278,"column":8},"end":{"line":278,"column":122}},"25":{"start":{"line":279,"column":8},"end":{"line":279,"column":86}},"26":{"start":{"line":282,"column":8},"end":{"line":282,"column":10441}},"27":{"start":{"line":287,"column":8},"end":{"line":287,"column":116}},"28":{"start":{"line":290,"column":8},"end":{"line":290,"column":10767}}},"branchMap":{"1":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"2":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":8},"end":{"line":114,"column":8}},{"start":{"line":114,"column":8},"end":{"line":114,"column":8}}]},"3":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"4":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":8}},{"start":{"line":133,"column":8},"end":{"line":133,"column":8}}]},"5":{"line":174,"type":"if","locations":[{"start":{"line":174,"column":8},"end":{"line":174,"column":8}},{"start":{"line":174,"column":8},"end":{"line":174,"column":8}}]},"6":{"line":179,"type":"if","locations":[{"start":{"line":179,"column":8},"end":{"line":179,"column":8}},{"start":{"line":179,"column":8},"end":{"line":179,"column":8}}]},"7":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":8},"end":{"line":184,"column":8}},{"start":{"line":184,"column":8},"end":{"line":184,"column":8}}]},"8":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"9":{"line":203,"type":"if","locations":[{"start":{"line":203,"column":8},"end":{"line":203,"column":8}},{"start":{"line":203,"column":8},"end":{"line":203,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol":{"l":{"97":42,"98":42,"99":42,"100":42,"102":42,"117":13,"121":13,"141":0,"156":1,"171":1,"196":2,"205":2,"214":1,"216":1,"220":1,"221":1,"224":0,"228":1,"234":1,"247":0,"268":3,"273":3,"278":2,"279":2,"281":2,"283":0,"286":2,"295":1,"298":1,"303":0,"307":1,"331":1,"340":0,"345":0,"350":0,"355":0,"357":0,"379":2,"384":2,"389":1,"391":1,"401":1,"422":2,"427":1,"428":1,"430":1,"439":1,"442":1,"461":3,"466":2,"471":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol","s":{"1":42,"2":42,"3":42,"4":42,"5":42,"6":13,"7":0,"8":1,"9":1,"10":2,"11":2,"12":1,"13":1,"14":1,"15":1,"16":0,"17":1,"18":1,"19":0,"20":3,"21":3,"22":2,"23":2,"24":2,"25":0,"26":2,"27":1,"28":1,"29":0,"30":1,"31":1,"32":0,"33":0,"34":0,"35":0,"36":0,"37":2,"38":2,"39":1,"40":1,"41":1,"42":2,"43":1,"44":1,"45":1,"46":1,"47":1,"48":3,"49":2,"50":1},"b":{"1":[13,0],"2":[2,0],"3":[1,0],"4":[0,1],"5":[1,0],"6":[3,0],"7":[2,1],"8":[0,2],"9":[1,0],"10":[0,1],"11":[0,0],"12":[2,0],"13":[1,1],"14":[1,1],"15":[2,1],"16":[1,1]},"f":{"1":42,"2":13,"3":0,"4":1,"5":1,"6":2,"7":3,"8":1,"9":2,"10":2,"11":3},"fnMap":{"1":{"name":"constructor","line":95,"loc":{"start":{"line":89,"column":4},"end":{"line":103,"column":4}}},"2":{"name":"onlyDuringPhase","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":122,"column":4}}},"3":{"name":"getPreStateRoot","line":133,"loc":{"start":{"line":133,"column":4},"end":{"line":142,"column":4}}},"4":{"name":"getPostStateRoot","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":157,"column":4}}},"5":{"name":"isComplete","line":163,"loc":{"start":{"line":163,"column":4},"end":{"line":172,"column":4}}},"6":{"name":"proveContractState","line":193,"loc":{"start":{"line":185,"column":4},"end":{"line":249,"column":4}}},"7":{"name":"proveStorageSlot","line":265,"loc":{"start":{"line":257,"column":4},"end":{"line":312,"column":4}}},"8":{"name":"applyTransaction","line":329,"loc":{"start":{"line":323,"column":4},"end":{"line":358,"column":4}}},"9":{"name":"commitContractState","line":377,"loc":{"start":{"line":370,"column":4},"end":{"line":404,"column":4}}},"10":{"name":"commitStorageSlot","line":420,"loc":{"start":{"line":412,"column":4},"end":{"line":446,"column":4}}},"11":{"name":"completeTransition","line":459,"loc":{"start":{"line":456,"column":4},"end":{"line":472,"column":4}}}},"statementMap":{"1":{"start":{"line":97,"column":8},"end":{"line":97,"column":51}},"2":{"start":{"line":98,"column":8},"end":{"line":98,"column":35}},"3":{"start":{"line":99,"column":8},"end":{"line":99,"column":36}},"4":{"start":{"line":100,"column":8},"end":{"line":100,"column":41}},"5":{"start":{"line":102,"column":8},"end":{"line":102,"column":107}},"6":{"start":{"line":117,"column":8},"end":{"line":117,"column":4442}},"7":{"start":{"line":141,"column":8},"end":{"line":141,"column":27}},"8":{"start":{"line":156,"column":8},"end":{"line":156,"column":28}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":48}},"10":{"start":{"line":196,"column":8},"end":{"line":196,"column":6424}},"11":{"start":{"line":205,"column":8},"end":{"line":205,"column":6778}},"12":{"start":{"line":214,"column":8},"end":{"line":214,"column":7009}},"13":{"start":{"line":216,"column":12},"end":{"line":216,"column":7108}},"14":{"start":{"line":220,"column":12},"end":{"line":220,"column":60}},"15":{"start":{"line":221,"column":12},"end":{"line":221,"column":7300}},"16":{"start":{"line":224,"column":16},"end":{"line":224,"column":78}},"17":{"start":{"line":228,"column":16},"end":{"line":228,"column":7787}},"18":{"start":{"line":234,"column":12},"end":{"line":234,"column":8038}},"19":{"start":{"line":247,"column":12},"end":{"line":247,"column":63}},"20":{"start":{"line":268,"column":8},"end":{"line":268,"column":9237}},"21":{"start":{"line":273,"column":8},"end":{"line":273,"column":9402}},"22":{"start":{"line":278,"column":8},"end":{"line":278,"column":88}},"23":{"start":{"line":279,"column":8},"end":{"line":279,"column":21}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":9685}},"25":{"start":{"line":283,"column":12},"end":{"line":283,"column":29}},"26":{"start":{"line":286,"column":12},"end":{"line":286,"column":9989}},"27":{"start":{"line":295,"column":12},"end":{"line":295,"column":10236}},"28":{"start":{"line":298,"column":16},"end":{"line":298,"column":10392}},"29":{"start":{"line":303,"column":16},"end":{"line":303,"column":33}},"30":{"start":{"line":307,"column":8},"end":{"line":307,"column":10652}},"31":{"start":{"line":331,"column":8},"end":{"line":331,"column":11252}},"32":{"start":{"line":340,"column":8},"end":{"line":340,"column":11732}},"33":{"start":{"line":345,"column":8},"end":{"line":345,"column":106}},"34":{"start":{"line":350,"column":8},"end":{"line":350,"column":72}},"35":{"start":{"line":355,"column":8},"end":{"line":355,"column":70}},"36":{"start":{"line":357,"column":8},"end":{"line":357,"column":45}},"37":{"start":{"line":379,"column":8},"end":{"line":379,"column":13348}},"38":{"start":{"line":384,"column":8},"end":{"line":384,"column":13526}},"39":{"start":{"line":389,"column":8},"end":{"line":389,"column":93}},"40":{"start":{"line":391,"column":8},"end":{"line":391,"column":13798}},"41":{"start":{"line":401,"column":8},"end":{"line":401,"column":14153}},"42":{"start":{"line":422,"column":8},"end":{"line":422,"column":14795}},"43":{"start":{"line":427,"column":8},"end":{"line":427,"column":93}},"44":{"start":{"line":428,"column":8},"end":{"line":428,"column":85}},"45":{"start":{"line":430,"column":8},"end":{"line":430,"column":15172}},"46":{"start":{"line":439,"column":8},"end":{"line":439,"column":63}},"47":{"start":{"line":442,"column":8},"end":{"line":442,"column":15596}},"48":{"start":{"line":461,"column":8},"end":{"line":461,"column":16010}},"49":{"start":{"line":466,"column":8},"end":{"line":466,"column":16180}},"50":{"start":{"line":471,"column":8},"end":{"line":471,"column":39}}},"branchMap":{"1":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":8},"end":{"line":117,"column":8}},{"start":{"line":117,"column":8},"end":{"line":117,"column":8}}]},"2":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]},"3":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]},"4":{"line":221,"type":"if","locations":[{"start":{"line":221,"column":12},"end":{"line":221,"column":12}},{"start":{"line":221,"column":12},"end":{"line":221,"column":12}}]},"5":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":16},"end":{"line":228,"column":16}},{"start":{"line":228,"column":16},"end":{"line":228,"column":16}}]},"6":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":8},"end":{"line":268,"column":8}},{"start":{"line":268,"column":8},"end":{"line":268,"column":8}}]},"7":{"line":273,"type":"if","locations":[{"start":{"line":273,"column":8},"end":{"line":273,"column":8}},{"start":{"line":273,"column":8},"end":{"line":273,"column":8}}]},"8":{"line":281,"type":"if","locations":[{"start":{"line":281,"column":8},"end":{"line":281,"column":8}},{"start":{"line":281,"column":8},"end":{"line":281,"column":8}}]},"9":{"line":295,"type":"if","locations":[{"start":{"line":295,"column":12},"end":{"line":295,"column":12}},{"start":{"line":295,"column":12},"end":{"line":295,"column":12}}]},"10":{"line":331,"type":"if","locations":[{"start":{"line":331,"column":8},"end":{"line":331,"column":8}},{"start":{"line":331,"column":8},"end":{"line":331,"column":8}}]},"11":{"line":340,"type":"if","locations":[{"start":{"line":340,"column":8},"end":{"line":340,"column":8}},{"start":{"line":340,"column":8},"end":{"line":340,"column":8}}]},"12":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"13":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":8},"end":{"line":384,"column":8}},{"start":{"line":384,"column":8},"end":{"line":384,"column":8}}]},"14":{"line":422,"type":"if","locations":[{"start":{"line":422,"column":8},"end":{"line":422,"column":8}},{"start":{"line":422,"column":8},"end":{"line":422,"column":8}}]},"15":{"line":461,"type":"if","locations":[{"start":{"line":461,"column":8},"end":{"line":461,"column":8}},{"start":{"line":461,"column":8},"end":{"line":461,"column":8}}]},"16":{"line":466,"type":"if","locations":[{"start":{"line":466,"column":8},"end":{"line":466,"column":8}},{"start":{"line":466,"column":8},"end":{"line":466,"column":8}}]}}}, +"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol":{"l":{"56":1,"60":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol","s":{"1":1,"2":0},"b":{"1":[0,1]},"f":{"1":3,"2":1},"fnMap":{"1":{"name":"constructor","line":29,"loc":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}}},"2":{"name":"create","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":66,"column":4}}}},"statementMap":{"1":{"start":{"line":56,"column":8},"end":{"line":56,"column":1919}},"2":{"start":{"line":60,"column":8},"end":{"line":60,"column":2068}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]}}}} diff --git a/coverage/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html b/coverage/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..5fa3e67a7 --- /dev/null +++ b/coverage/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for iOVM/accounts/iOVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / iOVM/accounts/ iOVM_ECDSAContractAccount.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_ECDSAContractAccount
+ */
+interface iOVM_ECDSAContractAccount {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    ) external returns (bool _success, bytes memory _returndata);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/accounts/index.html b/coverage/iOVM/accounts/index.html new file mode 100644 index 000000000..62cb35f7b --- /dev/null +++ b/coverage/iOVM/accounts/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for iOVM/accounts/ + + + + + + + +
+
+

+ all files iOVM/accounts/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_ECDSAContractAccount.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html b/coverage/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html new file mode 100644 index 000000000..4426f72ea --- /dev/null +++ b/coverage/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html @@ -0,0 +1,173 @@ + + + + Code coverage report for iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/messaging/ iAbs_BaseCrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iAbs_BaseCrossDomainMessenger
+ */
+interface iAbs_BaseCrossDomainMessenger {
+ 
+    /**********
+     * Events *
+     **********/
+    event SentMessage(bytes message);
+    event RelayedMessage(bytes32 msgHash);
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+    function xDomainMessageSender() external view returns (address);
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sends a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _message Message to send to the target.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function sendMessage(
+        address _target,
+        bytes calldata _message,
+        uint32 _gasLimit
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html b/coverage/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html new file mode 100644 index 000000000..7e00c950c --- /dev/null +++ b/coverage/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html @@ -0,0 +1,257 @@ + + + + Code coverage report for iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/messaging/ iOVM_L1CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title iOVM_L1CrossDomainMessenger
+ */
+interface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    struct L2MessageInclusionProof {
+        bytes32 stateRoot;
+        Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;
+        Lib_OVMCodec.ChainInclusionProof stateRootProof;
+        bytes stateTrieWitness;
+        bytes storageTrieWitness;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @param _proof Inclusion proof for the given message.
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        L2MessageInclusionProof memory _proof
+    ) external;
+ 
+    /**
+     * Replays a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _sender Original sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function replayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        uint32 _gasLimit
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html b/coverage/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html new file mode 100644 index 000000000..b32e59d35 --- /dev/null +++ b/coverage/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/messaging/ iOVM_L1MultiMessageRelayer.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+interface iOVM_L1MultiMessageRelayer {
+ 
+    struct L2ToL1Message {
+        address target;
+        address sender;
+        bytes message;
+        uint256 messageNonce;
+        iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;
+    }
+ 
+    function batchRelayMessages(L2ToL1Message[] calldata _messages) external; 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html b/coverage/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html new file mode 100644 index 000000000..cf02333cc --- /dev/null +++ b/coverage/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html @@ -0,0 +1,155 @@ + + + + Code coverage report for iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/messaging/ iOVM_L2CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title iOVM_L2CrossDomainMessenger
+ */
+interface iOVM_L2CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/bridge/messaging/index.html b/coverage/iOVM/bridge/messaging/index.html new file mode 100644 index 000000000..58a002500 --- /dev/null +++ b/coverage/iOVM/bridge/messaging/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for iOVM/bridge/messaging/ + + + + + + + +
+
+

+ all files iOVM/bridge/messaging/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iAbs_BaseCrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MultiMessageRelayer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html b/coverage/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html new file mode 100644 index 000000000..84ad6f409 --- /dev/null +++ b/coverage/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html @@ -0,0 +1,230 @@ + + + + Code coverage report for iOVM/bridge/tokens/iOVM_L1ETHGateway.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/tokens/ iOVM_L1ETHGateway.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L1ETHGateway
+ */
+interface iOVM_L1ETHGateway {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event DepositInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+ 
+    event WithdrawalFinalized(
+        address indexed _to,
+        uint256 _amount
+    );
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function deposit()
+        external
+        payable;
+ 
+    function depositTo(
+        address _to
+    )
+        external
+        payable;
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+    function getFinalizeDepositL2Gas()
+        external
+        view
+        returns(
+            uint32
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html b/coverage/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html new file mode 100644 index 000000000..1a088713e --- /dev/null +++ b/coverage/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html @@ -0,0 +1,218 @@ + + + + Code coverage report for iOVM/bridge/tokens/iOVM_L1TokenGateway.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/tokens/ iOVM_L1TokenGateway.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L1TokenGateway
+ */
+interface iOVM_L1TokenGateway {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event DepositInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+  
+    event WithdrawalFinalized(
+        address indexed _to,
+        uint256 _amount
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function deposit(
+        uint _amount
+    )
+        external;
+ 
+    function depositTo(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html b/coverage/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html new file mode 100644 index 000000000..8c248edb0 --- /dev/null +++ b/coverage/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html @@ -0,0 +1,218 @@ + + + + Code coverage report for iOVM/bridge/tokens/iOVM_L2DepositedToken.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/tokens/ iOVM_L2DepositedToken.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L2DepositedToken
+ */
+interface iOVM_L2DepositedToken {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event WithdrawalInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+ 
+    event DepositFinalized(
+        address indexed _to,
+        uint256 _amount
+    );    
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function withdraw(
+        uint _amount
+    )
+        external;
+ 
+    function withdrawTo(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/bridge/tokens/index.html b/coverage/iOVM/bridge/tokens/index.html new file mode 100644 index 000000000..1ad5e98f3 --- /dev/null +++ b/coverage/iOVM/bridge/tokens/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for iOVM/bridge/tokens/ + + + + + + + +
+
+

+ all files iOVM/bridge/tokens/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_L1ETHGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1TokenGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2DepositedToken.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html b/coverage/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html new file mode 100644 index 000000000..03738305b --- /dev/null +++ b/coverage/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html @@ -0,0 +1,782 @@ + + + + Code coverage report for iOVM/chain/iOVM_CanonicalTransactionChain.sol + + + + + + + +
+
+

+ all files / iOVM/chain/ iOVM_CanonicalTransactionChain.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_ChainStorageContainer } from "./iOVM_ChainStorageContainer.sol";
+ 
+/**
+ * @title iOVM_CanonicalTransactionChain
+ */
+interface iOVM_CanonicalTransactionChain {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event TransactionEnqueued(
+        address _l1TxOrigin,
+        address _target,
+        uint256 _gasLimit,
+        bytes _data,
+        uint256 _queueIndex,
+        uint256 _timestamp
+    );
+ 
+    event QueueBatchAppended(
+        uint256 _startingQueueIndex,
+        uint256 _numQueueElements,
+        uint256 _totalElements
+    );
+ 
+    event SequencerBatchAppended(
+        uint256 _startingQueueIndex,
+        uint256 _numQueueElements,
+        uint256 _totalElements
+    );
+ 
+    event TransactionBatchAppended(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot,
+        uint256 _batchSize,
+        uint256 _prevTotalElements,
+        bytes _extraData
+    );
+ 
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct BatchContext {
+        uint256 numSequencedTransactions;
+        uint256 numSubsequentQueueTransactions;
+        uint256 timestamp;
+        uint256 blockNumber;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        external
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        );
+ 
+    /**
+     * Accesses the queue storage container.
+     * @return Reference to the queue storage container.
+     */
+    function queue()
+        external
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        );
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        external
+        view
+        returns (
+            uint256 _totalElements
+        );
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        external
+        view
+        returns (
+            uint256 _totalBatches
+        );
+ 
+    /**
+     * Returns the index of the next element to be enqueued.
+     * @return Index for the next queue element.
+     */
+    function getNextQueueIndex()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function getQueueElement(
+        uint256 _index
+    )
+        external
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        );
+ 
+    /**
+     * Returns the timestamp of the last transaction.
+     * @return Timestamp for the last transaction.
+     */
+    function getLastTimestamp()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Returns the blocknumber of the last transaction.
+     * @return Blocknumber for the last transaction.
+     */
+    function getLastBlockNumber()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Get the number of queue elements which have not yet been included.
+     * @return Number of pending queue elements.
+     */
+    function getNumPendingQueueElements()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Retrieves the length of the queue, including
+     * both pending and canonical transactions.
+     * @return Length of the queue.
+     */
+    function getQueueLength()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+ 
+    /**
+     * Adds a transaction to the queue.
+     * @param _target Target contract to send the transaction to.
+     * @param _gasLimit Gas limit for the given transaction.
+     * @param _data Transaction data.
+     */
+    function enqueue(
+        address _target,
+        uint256 _gasLimit,
+        bytes memory _data
+    )
+        external;
+ 
+    /**
+     * Appends a given number of queued transactions as a single batch.
+     * @param _numQueuedTransactions Number of transactions to append.
+     */
+    function appendQueueBatch(
+        uint256 _numQueuedTransactions
+    )
+        external;
+ 
+    /**
+     * Allows the sequencer to append a batch of transactions.
+     * @dev This function uses a custom encoding scheme for efficiency reasons.
+     * .param _shouldStartAtElement Specific batch we expect to start appending to.
+     * .param _totalElementsToAppend Total number of batch elements we expect to append.
+     * .param _contexts Array of batch contexts.
+     * .param _transactionDataFields Array of raw transaction data.
+     */
+    function appendSequencerBatch(
+        // uint40 _shouldStartAtElement,
+        // uint24 _totalElementsToAppend,
+        // BatchContext[] _contexts,
+        // bytes[] _transactionDataFields
+    )
+        external;
+ 
+    /**
+     * Verifies whether a transaction is included in the chain.
+     * @param _transaction Transaction to verify.
+     * @param _txChainElement Transaction chain element corresponding to the transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
+     * @return True if the transaction exists in the CTC, false if not.
+     */
+    function verifyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        external
+        view
+        returns (
+            bool
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/chain/iOVM_ChainStorageContainer.sol.html b/coverage/iOVM/chain/iOVM_ChainStorageContainer.sol.html new file mode 100644 index 000000000..382c309c4 --- /dev/null +++ b/coverage/iOVM/chain/iOVM_ChainStorageContainer.sol.html @@ -0,0 +1,398 @@ + + + + Code coverage report for iOVM/chain/iOVM_ChainStorageContainer.sol + + + + + + + +
+
+

+ all files / iOVM/chain/ iOVM_ChainStorageContainer.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_ChainStorageContainer
+ */
+interface iOVM_ChainStorageContainer {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sets the container's global metadata field. We're using `bytes27` here because we use five
+     * bytes to maintain the length of the underlying data structure, meaning we have an extra
+     * 27 bytes to store arbitrary data.
+     * @param _globalMetadata New global metadata to set.
+     */
+    function setGlobalMetadata(
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Retrieves the container's global metadata field.
+     * @return Container global metadata field.
+     */
+    function getGlobalMetadata()
+        external
+        view
+        returns (
+            bytes27
+        );
+ 
+    /**
+     * Retrieves the number of objects stored in the container.
+     * @return Number of objects in the container.
+     */
+    function length()
+        external
+        view
+        returns (
+            uint256
+        );
+ 
+    /**
+     * Pushes an object into the container.
+     * @param _object A 32 byte value to insert into the container.
+     */
+    function push(
+        bytes32 _object
+    )
+        external;
+ 
+    /**
+     * Pushes an object into the container. Function allows setting the global metadata since
+     * we'll need to touch the "length" storage slot anyway, which also contains the global
+     * metadata (it's an optimization).
+     * @param _object A 32 byte value to insert into the container.
+     * @param _globalMetadata New global metadata for the container.
+     */
+    function push(
+        bytes32 _object,
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Retrieves an object from the container.
+     * @param _index Index of the particular object to access.
+     * @return 32 byte object value.
+     */
+    function get(
+        uint256 _index
+    )
+        external
+        view
+        returns (
+            bytes32
+        );
+ 
+    /**
+     * Removes all objects after and including a given index.
+     * @param _index Object index to delete from.
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index
+    )
+        external;
+ 
+    /**
+     * Removes all objects after and including a given index. Also allows setting the global
+     * metadata field.
+     * @param _index Object index to delete from.
+     * @param _globalMetadata New global metadata for the container.
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index,
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Marks an index as overwritable, meaing the underlying buffer can start to write values over
+     * any objects before and including the given index.
+     */
+    function setNextOverwritableIndex(
+        uint256 _index
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/chain/iOVM_StateCommitmentChain.sol.html b/coverage/iOVM/chain/iOVM_StateCommitmentChain.sol.html new file mode 100644 index 000000000..713fcd358 --- /dev/null +++ b/coverage/iOVM/chain/iOVM_StateCommitmentChain.sol.html @@ -0,0 +1,419 @@ + + + + Code coverage report for iOVM/chain/iOVM_StateCommitmentChain.sol + + + + + + + +
+
+

+ all files / iOVM/chain/ iOVM_StateCommitmentChain.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateCommitmentChain
+ */
+interface iOVM_StateCommitmentChain {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event StateBatchAppended(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot,
+        uint256 _batchSize,
+        uint256 _prevTotalElements,
+        bytes _extraData
+    );
+ 
+    event StateBatchDeleted(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        external
+        view
+        returns (
+            uint256 _totalElements
+        );
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        external
+        view
+        returns (
+            uint256 _totalBatches
+        );
+ 
+    /**
+     * Retrieves the timestamp of the last batch submitted by the sequencer.
+     * @return _lastSequencerTimestamp Last sequencer batch timestamp.
+     */
+    function getLastSequencerTimestamp()
+        external
+        view
+        returns (
+            uint256 _lastSequencerTimestamp
+        );
+ 
+    /**
+     * Appends a batch of state roots to the chain.
+     * @param _batch Batch of state roots.
+     * @param _shouldStartAtElement Index of the element at which this batch should start.
+     */
+    function appendStateBatch(
+        bytes32[] calldata _batch,
+        uint256 _shouldStartAtElement
+    )
+        external;
+ 
+    /**
+     * Deletes all state roots after (and including) a given batch.
+     * @param _batchHeader Header of the batch to start deleting from.
+     */
+    function deleteStateBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        external;
+ 
+    /**
+     * Verifies a batch inclusion proof.
+     * @param _element Hash of the element to verify a proof for.
+     * @param _batchHeader Header of the batch in which the element was included.
+     * @param _proof Merkle inclusion proof for the element.
+     */
+    function verifyStateCommitment(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        external
+        view
+        returns (
+            bool _verified
+        );
+ 
+    /**
+     * Checks whether a given batch is still inside its fraud proof window.
+     * @param _batchHeader Header of the batch to check.
+     * @return _inside Whether or not the batch is inside the fraud proof window.
+     */
+    function insideFraudProofWindow(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        external
+        view
+        returns (
+            bool _inside
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/chain/index.html b/coverage/iOVM/chain/index.html new file mode 100644 index 000000000..bba16e950 --- /dev/null +++ b/coverage/iOVM/chain/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for iOVM/chain/ + + + + + + + +
+
+

+ all files iOVM/chain/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_CanonicalTransactionChain.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ChainStorageContainer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateCommitmentChain.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/iOVM/execution/iOVM_ExecutionManager.sol.html b/coverage/iOVM/execution/iOVM_ExecutionManager.sol.html new file mode 100644 index 000000000..18c089ea7 --- /dev/null +++ b/coverage/iOVM/execution/iOVM_ExecutionManager.sol.html @@ -0,0 +1,533 @@ + + + + Code coverage report for iOVM/execution/iOVM_ExecutionManager.sol + + + + + + + +
+
+

+ all files / iOVM/execution/ iOVM_ExecutionManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+interface iOVM_ExecutionManager {
+    /**********
+     * Enums *
+     *********/
+ 
+    enum RevertFlag {
+        OUT_OF_GAS,
+        INTENTIONAL_REVERT,
+        EXCEEDS_NUISANCE_GAS,
+        INVALID_STATE_ACCESS,
+        UNSAFE_BYTECODE,
+        CREATE_COLLISION,
+        STATIC_VIOLATION,
+        CREATOR_NOT_ALLOWED
+    }
+ 
+    enum GasMetadataKey {
+        CURRENT_EPOCH_START_TIMESTAMP,
+        CUMULATIVE_SEQUENCER_QUEUE_GAS,
+        CUMULATIVE_L1TOL2_QUEUE_GAS,
+        PREV_EPOCH_SEQUENCER_QUEUE_GAS,
+        PREV_EPOCH_L1TOL2_QUEUE_GAS
+    }
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct GasMeterConfig {
+        uint256 minTransactionGasLimit;
+        uint256 maxTransactionGasLimit;
+        uint256 maxGasPerQueuePerEpoch;
+        uint256 secondsPerEpoch;
+    }
+ 
+    struct GlobalContext {
+        uint256 ovmCHAINID;
+    }
+ 
+    struct TransactionContext {
+        Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;
+        uint256 ovmTIMESTAMP;
+        uint256 ovmNUMBER;
+        uint256 ovmGASLIMIT;
+        uint256 ovmTXGASLIMIT;
+        address ovmL1TXORIGIN;
+    }
+ 
+    struct TransactionRecord {
+        uint256 ovmGasRefund;
+    }
+ 
+    struct MessageContext {
+        address ovmCALLER;
+        address ovmADDRESS;
+        bool isStatic;
+    }
+ 
+    struct MessageRecord {
+        uint256 nuisanceGasLeft;
+    }
+ 
+ 
+    /************************************
+     * Transaction Execution Entrypoint *
+     ************************************/
+ 
+    function run(
+        Lib_OVMCodec.Transaction calldata _transaction,
+        address _txStateManager
+    ) external;
+ 
+ 
+    /*******************
+     * Context Opcodes *
+     *******************/
+ 
+    function ovmCALLER() external view returns (address _caller);
+    function ovmADDRESS() external view returns (address _address);
+    function ovmTIMESTAMP() external view returns (uint256 _timestamp);
+    function ovmNUMBER() external view returns (uint256 _number);
+    function ovmGASLIMIT() external view returns (uint256 _gasLimit);
+    function ovmCHAINID() external view returns (uint256 _chainId);
+ 
+ 
+    /**********************
+     * L2 Context Opcodes *
+     **********************/
+ 
+    function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
+    function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
+ 
+ 
+    /*******************
+     * Halting Opcodes *
+     *******************/
+ 
+    function ovmREVERT(bytes memory _data) external;
+ 
+ 
+    /*****************************
+     * Contract Creation Opcodes *
+     *****************************/
+ 
+    function ovmCREATE(bytes memory _bytecode) external returns (address _contract, bytes memory _revertdata);
+    function ovmCREATE2(bytes memory _bytecode, bytes32 _salt) external returns (address _contract, bytes memory _revertdata);
+ 
+ 
+    /*******************************
+     * Account Abstraction Opcodes *
+     ******************************/
+ 
+    function ovmGETNONCE() external returns (uint256 _nonce);
+    function ovmSETNONCE(uint256 _nonce) external;
+    function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
+ 
+ 
+    /****************************
+     * Contract Calling Opcodes *
+     ****************************/
+ 
+    function ovmCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+    function ovmSTATICCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+    function ovmDELEGATECALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+ 
+ 
+    /****************************
+     * Contract Storage Opcodes *
+     ****************************/
+ 
+    function ovmSLOAD(bytes32 _key) external returns (bytes32 _value);
+    function ovmSSTORE(bytes32 _key, bytes32 _value) external;
+ 
+ 
+    /*************************
+     * Contract Code Opcodes *
+     *************************/
+ 
+    function ovmEXTCODECOPY(address _contract, uint256 _offset, uint256 _length) external returns (bytes memory _code);
+    function ovmEXTCODESIZE(address _contract) external returns (uint256 _size);
+    function ovmEXTCODEHASH(address _contract) external returns (bytes32 _hash);
+ 
+ 
+    /***************************************
+     * Public Functions: Execution Context *
+     ***************************************/
+ 
+    function getMaxTransactionGasLimit() external view returns (uint _maxTransactionGasLimit);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/execution/iOVM_SafetyChecker.sol.html b/coverage/iOVM/execution/iOVM_SafetyChecker.sol.html new file mode 100644 index 000000000..32921e244 --- /dev/null +++ b/coverage/iOVM/execution/iOVM_SafetyChecker.sol.html @@ -0,0 +1,107 @@ + + + + Code coverage report for iOVM/execution/iOVM_SafetyChecker.sol + + + + + + + +
+
+

+ all files / iOVM/execution/ iOVM_SafetyChecker.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_SafetyChecker
+ */
+interface iOVM_SafetyChecker {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/execution/iOVM_StateManager.sol.html b/coverage/iOVM/execution/iOVM_StateManager.sol.html new file mode 100644 index 000000000..10e5b015f --- /dev/null +++ b/coverage/iOVM/execution/iOVM_StateManager.sol.html @@ -0,0 +1,296 @@ + + + + Code coverage report for iOVM/execution/iOVM_StateManager.sol + + + + + + + +
+
+

+ all files / iOVM/execution/ iOVM_StateManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateManager
+ */
+interface iOVM_StateManager {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum ItemState {
+        ITEM_UNTOUCHED,
+        ITEM_LOADED,
+        ITEM_CHANGED,
+        ITEM_COMMITTED
+    }
+ 
+    /***************************
+     * Public Functions: Misc *
+     ***************************/
+ 
+    function isAuthenticated(address _address) external view returns (bool);
+ 
+    /***************************
+     * Public Functions: Setup *
+     ***************************/
+ 
+    function owner() external view returns (address _owner);
+    function ovmExecutionManager() external view returns (address _ovmExecutionManager);
+    function setExecutionManager(address _ovmExecutionManager) external;
+ 
+ 
+    /************************************
+     * Public Functions: Account Access *
+     ************************************/
+ 
+    function putAccount(address _address, Lib_OVMCodec.Account memory _account) external;
+    function putEmptyAccount(address _address) external;
+    function getAccount(address _address) external view returns (Lib_OVMCodec.Account memory _account);
+    function hasAccount(address _address) external view returns (bool _exists);
+    function hasEmptyAccount(address _address) external view returns (bool _exists);
+    function setAccountNonce(address _address, uint256 _nonce) external;
+    function getAccountNonce(address _address) external view returns (uint256 _nonce);
+    function getAccountEthAddress(address _address) external view returns (address _ethAddress);
+    function getAccountStorageRoot(address _address) external view returns (bytes32 _storageRoot);
+    function initPendingAccount(address _address) external;
+    function commitPendingAccount(address _address, address _ethAddress, bytes32 _codeHash) external;
+    function testAndSetAccountLoaded(address _address) external returns (bool _wasAccountAlreadyLoaded);
+    function testAndSetAccountChanged(address _address) external returns (bool _wasAccountAlreadyChanged);
+    function commitAccount(address _address) external returns (bool _wasAccountCommitted);
+    function incrementTotalUncommittedAccounts() external;
+    function getTotalUncommittedAccounts() external view returns (uint256 _total);
+    function wasAccountChanged(address _address) external view returns (bool);
+    function wasAccountCommitted(address _address) external view returns (bool);
+ 
+ 
+    /************************************
+     * Public Functions: Storage Access *
+     ************************************/
+ 
+    function putContractStorage(address _contract, bytes32 _key, bytes32 _value) external;
+    function getContractStorage(address _contract, bytes32 _key) external view returns (bytes32 _value);
+    function hasContractStorage(address _contract, bytes32 _key) external view returns (bool _exists);
+    function testAndSetContractStorageLoaded(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyLoaded);
+    function testAndSetContractStorageChanged(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyChanged);
+    function commitContractStorage(address _contract, bytes32 _key) external returns (bool _wasContractStorageCommitted);
+    function incrementTotalUncommittedContractStorage() external;
+    function getTotalUncommittedContractStorage() external view returns (uint256 _total);
+    function wasContractStorageChanged(address _contract, bytes32 _key) external view returns (bool);
+    function wasContractStorageCommitted(address _contract, bytes32 _key) external view returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/execution/iOVM_StateManagerFactory.sol.html b/coverage/iOVM/execution/iOVM_StateManagerFactory.sol.html new file mode 100644 index 000000000..ccc0b1d51 --- /dev/null +++ b/coverage/iOVM/execution/iOVM_StateManagerFactory.sol.html @@ -0,0 +1,134 @@ + + + + Code coverage report for iOVM/execution/iOVM_StateManagerFactory.sol + + + + + + + +
+
+

+ all files / iOVM/execution/ iOVM_StateManagerFactory.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { iOVM_StateManager } from "./iOVM_StateManager.sol";
+ 
+/**
+ * @title iOVM_StateManagerFactory
+ */
+interface iOVM_StateManagerFactory {
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    function create(
+        address _owner
+    )
+        external
+        returns (
+            iOVM_StateManager _ovmStateManager
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/execution/index.html b/coverage/iOVM/execution/index.html new file mode 100644 index 000000000..920d0dec2 --- /dev/null +++ b/coverage/iOVM/execution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for iOVM/execution/ + + + + + + + +
+
+

+ all files iOVM/execution/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_ExecutionManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_SafetyChecker.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManagerFactory.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html b/coverage/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html new file mode 100644 index 000000000..32c1ad98b --- /dev/null +++ b/coverage/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html @@ -0,0 +1,125 @@ + + + + Code coverage report for iOVM/predeploys/iOVM_DeployerWhitelist.sol + + + + + + + +
+
+

+ all files / iOVM/predeploys/ iOVM_DeployerWhitelist.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_DeployerWhitelist
+ */
+interface iOVM_DeployerWhitelist {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function initialize(address _owner, bool _allowArbitraryDeployment) external;
+    function getOwner() external returns (address _owner);
+    function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;
+    function setOwner(address _newOwner) external;
+    function setAllowArbitraryDeployment(bool _allowArbitraryDeployment) external;
+    function enableArbitraryContractDeployment() external;
+    function isDeployerAllowed(address _deployer) external returns (bool _allowed);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/predeploys/iOVM_ERC20.sol.html b/coverage/iOVM/predeploys/iOVM_ERC20.sol.html new file mode 100644 index 000000000..b9619f473 --- /dev/null +++ b/coverage/iOVM/predeploys/iOVM_ERC20.sol.html @@ -0,0 +1,224 @@ + + + + Code coverage report for iOVM/predeploys/iOVM_ERC20.sol + + + + + + + +
+
+

+ all files / iOVM/predeploys/ iOVM_ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_ERC20
+ */
+interface iOVM_ERC20 {
+    /* This is a slight change to the ERC20 base standard.
+    function totalSupply() constant returns (uint256 supply);
+    is replaced with:
+    uint256 public totalSupply;
+    This automatically creates a getter function for the totalSupply.
+    This is moved to the base contract since public getter functions are not
+    currently recognised as an implementation of the matching abstract
+    function by the compiler.
+    */
+    /// total amount of tokens
+    function totalSupply() external view returns (uint256);
+ 
+    /// @param _owner The address from which the balance will be retrieved
+    /// @return balance The balance
+    function balanceOf(address _owner) external view returns (uint256 balance);
+ 
+    /// @notice send `_value` token to `_to` from `msg.sender`
+    /// @param _to The address of the recipient
+    /// @param _value The amount of token to be transferred
+    /// @return success Whether the transfer was successful or not
+    function transfer(address _to, uint256 _value) external returns (bool success);
+ 
+    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
+    /// @param _from The address of the sender
+    /// @param _to The address of the recipient
+    /// @param _value The amount of token to be transferred
+    /// @return success Whether the transfer was successful or not
+    function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
+ 
+    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
+    /// @param _spender The address of the account able to transfer the tokens
+    /// @param _value The amount of tokens to be approved for transfer
+    /// @return success Whether the approval was successful or not
+    function approve(address _spender, uint256 _value) external returns (bool success);
+ 
+    /// @param _owner The address of the account owning tokens
+    /// @param _spender The address of the account able to transfer the tokens
+    /// @return remaining Amount of remaining tokens allowed to spent
+    function allowance(address _owner, address _spender) external view returns (uint256 remaining);
+ 
+    // solhint-disable-next-line no-simple-event-func-name
+    event Transfer(address indexed _from, address indexed _to, uint256 _value);
+    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
+    event Mint(address indexed _account, uint256 _amount);
+    event Burn(address indexed _account, uint256 _amount);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/predeploys/iOVM_L1MessageSender.sol.html b/coverage/iOVM/predeploys/iOVM_L1MessageSender.sol.html new file mode 100644 index 000000000..1fb36e2dd --- /dev/null +++ b/coverage/iOVM/predeploys/iOVM_L1MessageSender.sol.html @@ -0,0 +1,107 @@ + + + + Code coverage report for iOVM/predeploys/iOVM_L1MessageSender.sol + + + + + + + +
+
+

+ all files / iOVM/predeploys/ iOVM_L1MessageSender.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_L1MessageSender
+ */
+interface iOVM_L1MessageSender {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function getL1MessageSender() external view returns (address _l1MessageSender);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html b/coverage/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html new file mode 100644 index 000000000..d43cbd99b --- /dev/null +++ b/coverage/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html @@ -0,0 +1,140 @@ + + + + Code coverage report for iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol + + + + + + + +
+
+

+ all files / iOVM/predeploys/ iOVM_L2ToL1MessagePasser.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_L2ToL1MessagePasser
+ */
+interface iOVM_L2ToL1MessagePasser {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event L2ToL1Message(
+        uint256 _nonce,
+        address _sender,
+        bytes _data
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function passMessageToL1(bytes calldata _message) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/predeploys/index.html b/coverage/iOVM/predeploys/index.html new file mode 100644 index 000000000..d766508c8 --- /dev/null +++ b/coverage/iOVM/predeploys/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for iOVM/predeploys/ + + + + + + + +
+
+

+ all files iOVM/predeploys/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_DeployerWhitelist.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ERC20.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MessageSender.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2ToL1MessagePasser.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/iOVM/verification/iOVM_BondManager.sol.html b/coverage/iOVM/verification/iOVM_BondManager.sol.html new file mode 100644 index 000000000..8d7748deb --- /dev/null +++ b/coverage/iOVM/verification/iOVM_BondManager.sol.html @@ -0,0 +1,389 @@ + + + + Code coverage report for iOVM/verification/iOVM_BondManager.sol + + + + + + + +
+
+

+ all files / iOVM/verification/ iOVM_BondManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+interface ERC20 {
+    function transfer(address, uint256) external returns (bool);
+    function transferFrom(address, address, uint256) external returns (bool);
+}
+ 
+/// All the errors which may be encountered on the bond manager
+library Errors {
+    string constant ERC20_ERR = "BondManager: Could not post bond";
+    string constant ALREADY_FINALIZED = "BondManager: Fraud proof for this pre-state root has already been finalized";
+    string constant SLASHED = "BondManager: Cannot finalize withdrawal, you probably got slashed";
+    string constant WRONG_STATE = "BondManager: Wrong bond state for proposer";
+    string constant CANNOT_CLAIM = "BondManager: Cannot claim yet. Dispute must be finalized first";
+ 
+    string constant WITHDRAWAL_PENDING = "BondManager: Withdrawal already pending";
+    string constant TOO_EARLY = "BondManager: Too early to finalize your withdrawal";
+ 
+    string constant ONLY_TRANSITIONER = "BondManager: Only the transitioner for this pre-state root may call this function";
+    string constant ONLY_FRAUD_VERIFIER = "BondManager: Only the fraud verifier may call this function";
+    string constant ONLY_STATE_COMMITMENT_CHAIN = "BondManager: Only the state commitment chain may call this function";
+    string constant WAIT_FOR_DISPUTES = "BondManager: Wait for other potential disputes";
+}
+ 
+/**
+ * @title iOVM_BondManager
+ */
+interface iOVM_BondManager {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    /// The lifecycle of a proposer's bond
+    enum State {
+        // Before depositing or after getting slashed, a user is uncollateralized
+        NOT_COLLATERALIZED,
+        // After depositing, a user is collateralized
+        COLLATERALIZED,
+        // After a user has initiated a withdrawal
+        WITHDRAWING
+    }
+ 
+    /// A bond posted by a proposer
+    struct Bond {
+        // The user's state
+        State state;
+        // The timestamp at which a proposer issued their withdrawal request
+        uint32 withdrawalTimestamp;
+        // The time when the first disputed was initiated for this bond
+        uint256 firstDisputeAt;
+        // The earliest observed state root for this bond which has had fraud
+        bytes32 earliestDisputedStateRoot;
+        // The state root's timestamp
+        uint256 earliestTimestamp;
+    }
+ 
+    // Per pre-state root, store the number of state provisions that were made
+    // and how many of these calls were made by each user. Payouts will then be
+    // claimed by users proportionally for that dispute.
+    struct Rewards {
+        // Flag to check if rewards for a fraud proof are claimable
+        bool canClaim;
+        // Total number of `recordGasSpent` calls made
+        uint256 total;
+        // The gas spent by each user to provide witness data. The sum of all
+        // values inside this map MUST be equal to the value of `total`
+        mapping(address => uint256) gasSpent;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function recordGasSpent(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        address _who,
+        uint256 _gasSpent
+    ) external;
+ 
+    function finalize(
+        bytes32 _preStateRoot,
+        address _publisher,
+        uint256 _timestamp
+    ) external;
+ 
+    function deposit() external;
+ 
+    function startWithdrawal() external;
+ 
+    function finalizeWithdrawal() external;
+ 
+    function claim(
+        address _who
+    ) external;
+ 
+    function isCollateralized(
+        address _who
+    ) external view returns (bool);
+ 
+    function getGasSpent(
+        bytes32 _preStateRoot,
+        address _who
+    ) external view returns (uint256);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/verification/iOVM_FraudVerifier.sol.html b/coverage/iOVM/verification/iOVM_FraudVerifier.sol.html new file mode 100644 index 000000000..a3b2ed104 --- /dev/null +++ b/coverage/iOVM/verification/iOVM_FraudVerifier.sol.html @@ -0,0 +1,260 @@ + + + + Code coverage report for iOVM/verification/iOVM_FraudVerifier.sol + + + + + + + +
+
+

+ all files / iOVM/verification/ iOVM_FraudVerifier.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
+ 
+/**
+ * @title iOVM_FraudVerifier
+ */
+interface iOVM_FraudVerifier {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event FraudProofInitialized(
+        bytes32 _preStateRoot,
+        uint256 _preStateRootIndex,
+        bytes32 _transactionHash,
+        address _who
+    );
+ 
+    event FraudProofFinalized(
+        bytes32 _preStateRoot,
+        uint256 _preStateRootIndex,
+        bytes32 _transactionHash,
+        address _who
+    );
+ 
+ 
+    /***************************************
+     * Public Functions: Transition Status *
+     ***************************************/
+ 
+    function getStateTransitioner(bytes32 _preStateRoot, bytes32 _txHash) external view returns (iOVM_StateTransitioner _transitioner);
+ 
+ 
+    /****************************************
+     * Public Functions: Fraud Verification *
+     ****************************************/
+ 
+    function initializeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
+        Lib_OVMCodec.Transaction calldata _transaction,
+        Lib_OVMCodec.TransactionChainElement calldata _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader calldata _transactionBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _transactionProof
+    ) external;
+ 
+    function finalizeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
+        bytes32 _txHash,
+        bytes32 _postStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _postStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _postStateRootProof
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/verification/iOVM_StateTransitioner.sol.html b/coverage/iOVM/verification/iOVM_StateTransitioner.sol.html new file mode 100644 index 000000000..3a0d781b4 --- /dev/null +++ b/coverage/iOVM/verification/iOVM_StateTransitioner.sol.html @@ -0,0 +1,314 @@ + + + + Code coverage report for iOVM/verification/iOVM_StateTransitioner.sol + + + + + + + +
+
+

+ all files / iOVM/verification/ iOVM_StateTransitioner.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateTransitioner
+ */
+interface iOVM_StateTransitioner {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event AccountCommitted(
+        address _address
+    );
+ 
+    event ContractStorageCommitted(
+        address _address,
+        bytes32 _key
+    );
+ 
+ 
+    /**********************************
+     * Public Functions: State Access *
+     **********************************/
+ 
+    function getPreStateRoot() external view returns (bytes32 _preStateRoot);
+    function getPostStateRoot() external view returns (bytes32 _postStateRoot);
+    function isComplete() external view returns (bool _complete);
+ 
+ 
+    /***********************************
+     * Public Functions: Pre-Execution *
+     ***********************************/
+ 
+    function proveContractState(
+        address _ovmContractAddress,
+        address _ethContractAddress,
+        bytes calldata _stateTrieWitness
+    ) external;
+ 
+    function proveStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes calldata _storageTrieWitness
+    ) external;
+ 
+ 
+    /*******************************
+     * Public Functions: Execution *
+     *******************************/
+ 
+    function applyTransaction(
+        Lib_OVMCodec.Transaction calldata _transaction
+    ) external;
+ 
+ 
+    /************************************
+     * Public Functions: Post-Execution *
+     ************************************/
+ 
+    function commitContractState(
+        address _ovmContractAddress,
+        bytes calldata _stateTrieWitness
+    ) external;
+ 
+    function commitStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes calldata _storageTrieWitness
+    ) external;
+ 
+ 
+    /**********************************
+     * Public Functions: Finalization *
+     **********************************/
+ 
+    function completeTransition() external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/verification/iOVM_StateTransitionerFactory.sol.html b/coverage/iOVM/verification/iOVM_StateTransitionerFactory.sol.html new file mode 100644 index 000000000..a4498df98 --- /dev/null +++ b/coverage/iOVM/verification/iOVM_StateTransitionerFactory.sol.html @@ -0,0 +1,143 @@ + + + + Code coverage report for iOVM/verification/iOVM_StateTransitionerFactory.sol + + + + + + + +
+
+

+ all files / iOVM/verification/ iOVM_StateTransitionerFactory.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
+ 
+/**
+ * @title iOVM_StateTransitionerFactory
+ */
+interface iOVM_StateTransitionerFactory {
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    function create(
+        address _proxyManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        external
+        returns (
+            iOVM_StateTransitioner _ovmStateTransitioner
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/iOVM/verification/index.html b/coverage/iOVM/verification/index.html new file mode 100644 index 000000000..bc1507a4f --- /dev/null +++ b/coverage/iOVM/verification/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for iOVM/verification/ + + + + + + + +
+
+

+ all files iOVM/verification/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_BondManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_FraudVerifier.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitioner.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitionerFactory.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/index.html b/coverage/index.html new file mode 100644 index 000000000..ea6ba8e13 --- /dev/null +++ b/coverage/index.html @@ -0,0 +1,366 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 82.21% + Statements + 1248/1518 +
+
+ 67.99% + Branches + 393/578 +
+
+ 82.88% + Functions + 363/438 +
+
+ 82.63% + Lines + 1313/1589 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM/accounts/
91.67%22/2466.67%4/6100%6/692%23/25
OVM/bridge/messaging/
96.55%56/5876.92%20/2695.24%20/2196.67%58/60
OVM/bridge/tokens/
90.7%39/4350%3/686.67%26/3088.89%40/45
OVM/chain/
92.82%194/20981.37%83/10282.46%47/5793.36%211/226
OVM/execution/
76.05%235/30967.02%63/9481.63%80/9876.73%244/318
OVM/predeploys/
41.76%38/9129.41%10/3440%12/3040.22%37/92
OVM/verification/
90.4%113/12578.05%64/8296.67%29/3090.48%114/126
iOVM/accounts/
100%0/0100%0/0100%0/0100%0/0
iOVM/bridge/messaging/
100%0/0100%0/0100%0/0100%0/0
iOVM/bridge/tokens/
100%0/0100%0/0100%0/0100%0/0
iOVM/chain/
100%0/0100%0/0100%0/0100%0/0
iOVM/execution/
100%0/0100%0/0100%0/0100%0/0
iOVM/predeploys/
100%0/0100%0/0100%0/0100%0/0
iOVM/verification/
100%0/0100%0/0100%0/0100%0/0
libraries/bridge/
100%5/5100%4/4100%4/4100%6/6
libraries/codec/
100%33/33100%6/6100%9/9100%33/33
libraries/resolver/
75%15/2050%4/881.82%9/1178.26%18/23
libraries/rlp/
96.95%127/13172.92%35/4893.1%27/2997.22%140/144
libraries/standards/
80.65%25/3125%3/1283.33%10/1281.25%26/32
libraries/trie/
71.98%149/20755.88%38/6881.25%26/3271.57%146/204
libraries/utils/
89.07%163/18367.57%50/7491.11%41/4589.27%183/205
libraries/wrappers/
69.39%34/4975%6/870.83%17/2468%34/50
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/accounts/OVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/OVM/accounts/OVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..f86195d44 --- /dev/null +++ b/coverage/lcov-report/OVM/accounts/OVM_ECDSAContractAccount.sol.html @@ -0,0 +1,485 @@ + + + + Code coverage report for OVM/accounts/OVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / OVM/accounts/ OVM_ECDSAContractAccount.sol +

+
+
+ 93.75% + Statements + 15/16 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 1/1 +
+
+ 93.75% + Lines + 15/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + +  +  +  +  +  + + +  +  +  +  +  + + +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+import { Lib_SafeMathWrapper } from "../../libraries/wrappers/Lib_SafeMathWrapper.sol";
+ 
+/**
+ * @title OVM_ECDSAContractAccount
+ * @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the
+ * ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by 
+ * providing eth_sign and EIP155 formatted transaction encodings.
+ *
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    // TODO: should be the amount sufficient to cover the gas costs of all of the transactions up
+    // to and including the CALL/CREATE which forms the entrypoint of the transaction.
+    uint256 constant EXECUTION_VALIDATION_GAS_OVERHEAD = 25000;
+    address constant ETH_ERC20_ADDRESS = 0x4200000000000000000000000000000000000006;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Executes a signed transaction.
+     * @param _transaction Signed EOA transaction.
+     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     * @return Whether or not the call returned (rather than reverted).
+     * @return Data returned by the call.
+     */
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        override
+        public
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
+ 
+        // Address of this contract within the ovm (ovmADDRESS) should be the same as the
+        // recovered address of the user who signed this message. This is how we manage to shim
+        // account abstraction even though the user isn't a contract.
+        // Need to make sure that the transaction nonce is right and bump it if so.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_ECDSAUtils.recover(
+                _transaction,
+                isEthSign,
+                _v,
+                _r,
+                _s
+            ) == Lib_SafeExecutionManagerWrapper.safeADDRESS(),
+            "Signature provided for EOA transaction execution is invalid."
+        );
+ 
+        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
+ 
+        // Need to make sure that the transaction chainId is correct.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.chainId == Lib_SafeExecutionManagerWrapper.safeCHAINID(),
+            "Transaction chainId does not match expected OVM chainId."
+        );
+ 
+        // Need to make sure that the transaction nonce is right.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
+            "Transaction nonce does not match the expected nonce."
+        );
+ 
+        // TEMPORARY: Disable gas checks for mainnet.
+        // // Need to make sure that the gas is sufficient to execute the transaction.
+        // Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+        //    gasleft() >= Lib_SafeMathWrapper.add(decodedTx.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD),
+        //    "Gas is not sufficient to execute the transaction."
+        // );
+ 
+        // Transfer fee to relayer.
+        address relayer = Lib_SafeExecutionManagerWrapper.safeCALLER();
+        uint256 fee = Lib_SafeMathWrapper.mul(decodedTx.gasLimit, decodedTx.gasPrice);
+        (bool success, ) = Lib_SafeExecutionManagerWrapper.safeCALL(
+            gasleft(),
+            ETH_ERC20_ADDRESS,
+            abi.encodeWithSignature("transfer(address,uint256)", relayer, fee)
+        );
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            success == true,
+            "Fee was not transferred to relayer."
+        );
+ 
+        // Contract creations are signalled by sending a transaction to the zero address.
+        if (decodedTx.to == address(0)) {
+            (address created, bytes memory revertData) = Lib_SafeExecutionManagerWrapper.safeCREATE(
+                decodedTx.gasLimit,
+                decodedTx.data
+            );
+ 
+            // Return true if the contract creation succeeded, false w/ revertData otherwise.
+            Eif (created != address(0)) {
+                return (true, abi.encode(created));
+            } else {
+                return (false, revertData);
+            }
+        } else {
+            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
+            // the nonce of the calling account. Normally an EOA would bump the nonce for both
+            // cases, but since this is a contract we'd end up bumping the nonce twice.
+            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
+ 
+            return Lib_SafeExecutionManagerWrapper.safeCALL(
+                decodedTx.gasLimit,
+                decodedTx.to,
+                decodedTx.data
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/accounts/OVM_ProxyEOA.sol.html b/coverage/lcov-report/OVM/accounts/OVM_ProxyEOA.sol.html new file mode 100644 index 000000000..d8de28f6d --- /dev/null +++ b/coverage/lcov-report/OVM/accounts/OVM_ProxyEOA.sol.html @@ -0,0 +1,428 @@ + + + + Code coverage report for OVM/accounts/OVM_ProxyEOA.sol + + + + + + + +
+
+

+ all files / OVM/accounts/ OVM_ProxyEOA.sol +

+
+
+ 87.5% + Statements + 7/8 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 5/5 +
+
+ 88.89% + Lines + 8/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_ProxyEOA
+ * @dev The Proxy EOA contract uses a delegate call to execute the logic in an implementation contract.
+ * In combination with the logic implemented in the ECDSA Contract Account, this enables a form of upgradable 
+ * 'account abstraction' on layer 2. 
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ProxyEOA {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _implementation Address of the initial implementation contract.
+     */
+    constructor(
+        address _implementation
+    )
+    {
+        _setImplementation(_implementation);
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        (bool success, bytes memory returndata) = Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
+            gasleft(),
+            getImplementation(),
+            msg.data
+        );
+ 
+        Eif (success) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            Lib_SafeExecutionManagerWrapper.safeREVERT(
+                string(returndata)
+            );
+        }
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Changes the implementation address.
+     * @param _implementation New implementation address.
+     */
+    function upgrade(
+        address _implementation
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_SafeExecutionManagerWrapper.safeADDRESS() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
+            "EOAs can only upgrade their own EOA implementation"
+        );
+ 
+        _setImplementation(_implementation);
+    }
+ 
+    /**
+     * Gets the address of the current implementation.
+     * @return Current implementation address.
+     */
+    function getImplementation()
+        public
+        returns (
+            address
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                IMPLEMENTATION_KEY
+            )
+        );
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _setImplementation(
+        address _implementation
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            IMPLEMENTATION_KEY,
+            Lib_Bytes32Utils.fromAddress(_implementation)
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/accounts/index.html b/coverage/lcov-report/OVM/accounts/index.html new file mode 100644 index 000000000..a286f49e4 --- /dev/null +++ b/coverage/lcov-report/OVM/accounts/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for OVM/accounts/ + + + + + + + +
+
+

+ all files OVM/accounts/ +

+
+
+ 91.67% + Statements + 22/24 +
+
+ 66.67% + Branches + 4/6 +
+
+ 100% + Functions + 6/6 +
+
+ 92% + Lines + 23/25 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_ECDSAContractAccount.sol
93.75%15/1675%3/4100%1/193.75%15/16
OVM_ProxyEOA.sol
87.5%7/850%1/2100%5/588.89%8/9
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html b/coverage/lcov-report/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html new file mode 100644 index 000000000..6457a4c5d --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html @@ -0,0 +1,443 @@ + + + + Code coverage report for OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / OVM/bridge/messaging/ Abs_BaseCrossDomainMessenger.sol +

+
+
+ 77.78% + Statements + 7/9 +
+
+ 50% + Branches + 1/2 +
+
+ 80% + Functions + 4/5 +
+
+ 77.78% + Lines + 7/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/* Library Imports */
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/**
+ * @title Abs_BaseCrossDomainMessenger
+ * @dev The Base Cross Domain Messenger is an abstract contract providing the interface and common functionality used in the
+ * L1 and L2 Cross Domain Messengers. It can also serve as a template for developers wishing to implement a custom bridge 
+ * contract to suit their needs.
+ *
+ * Compiler used: defined by child contract
+ * Runtime target: defined by child contract
+ */
+abstract contract Abs_BaseCrossDomainMessenger is iAbs_BaseCrossDomainMessenger, Lib_ReentrancyGuard {
+    /**************
+     *  Constants *
+     **************/
+ 
+    // The default x-domain message sender being set to a non-zero value makes
+    // deployment a bit more expensive, but in exchange the refund on every call to
+    // `relayMessage` by the L1 and L2 messengers will be higher.
+    address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    mapping (bytes32 => bool) public relayedMessages;
+    mapping (bytes32 => bool) public successfulMessages;
+    mapping (bytes32 => bool) public sentMessages;
+    uint256 public messageNonce;
+    address internal xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    constructor() Lib_ReentrancyGuard() {}
+ 
+    function xDomainMessageSender() public override view returns (address) {
+        Irequire(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set");
+        return xDomainMsgSender;
+    }
+ 
+    /**
+     * Sends a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _message Message to send to the target.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function sendMessage(
+        address _target,
+        bytes memory _message,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            msg.sender,
+            _message,
+            messageNonce
+        );
+ 
+        messageNonce += 1;
+        sentMessages[keccak256(xDomainCalldata)] = true;
+ 
+        _sendXDomainMessage(xDomainCalldata, _gasLimit);
+        emit SentMessage(xDomainCalldata);
+    }
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Generates the correct cross domain calldata for a message.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @return ABI encoded cross domain calldata.
+     */
+    function _getXDomainCalldata(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodeWithSignature(
+            "relayMessage(address,address,bytes,uint256)",
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * param // Message to send.
+     * param // Gas limit for the provided message.
+     */
+    function _sendXDomainMessage(
+        bytes memory, // _message,
+        uint256 // _gasLimit
+    )
+        virtual
+        internal
+    {
+        revert("Implement me in child contracts!");
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html b/coverage/lcov-report/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html new file mode 100644 index 000000000..07a375b6a --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html @@ -0,0 +1,947 @@ + + + + Code coverage report for OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / OVM/bridge/messaging/ OVM_L1CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 30/30 +
+
+ 75% + Branches + 12/16 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 31/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  + +  +  +  +  + + + +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_AddressManager } from "../../../libraries/resolver/Lib_AddressManager.sol";
+import { Lib_SecureMerkleTrie } from "../../../libraries/trie/Lib_SecureMerkleTrie.sol";
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+import { iOVM_CanonicalTransactionChain } from "../../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_StateCommitmentChain } from "../../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+ 
+/* Contract Imports */
+import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_L1CrossDomainMessenger
+ * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. 
+ * In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted 
+ * via this contract's replay function. 
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * Pass a default zero address to the address resolver. This will be updated when initialized.
+     */
+    constructor()
+        Lib_AddressResolver(address(0))
+    {}
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    function initialize(
+        address _libAddressManager
+    )
+        public
+    {
+        Erequire(address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized.");
+        libAddressManager = Lib_AddressManager(_libAddressManager);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may successfully call a method.
+     */
+    modifier onlyRelayer() {
+        address relayer = resolve("OVM_L2MessageRelayer");
+        if (relayer != address(0)) {
+            Irequire(
+                msg.sender == relayer,
+                "Only OVM_L2MessageRelayer can relay L2-to-L1 messages."
+            );
+        }
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @inheritdoc iOVM_L1CrossDomainMessenger
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        L2MessageInclusionProof memory _proof
+    )
+        override
+        public
+        nonReentrant
+        onlyRelayer()
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        require(
+            _verifyXDomainMessage(
+                xDomainCalldata,
+                _proof
+            ) == true,
+            "Provided message could not be verified."
+        );
+ 
+        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
+ 
+        require(
+            successfulMessages[xDomainCalldataHash] == false,
+            "Provided message has already been received."
+        );
+ 
+        xDomainMsgSender = _sender;
+        (bool success, ) = _target.call(_message);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+        // Mark the message as received if the call was successful. Ensures that a message can be
+        // relayed multiple times in the case that the call reverted.
+        Eif (success == true) {
+            successfulMessages[xDomainCalldataHash] = true;
+            emit RelayedMessage(xDomainCalldataHash);
+        }
+ 
+        // Store an identifier that can be used to prove that the given message was relayed by some
+        // user. Gives us an easy way to pay relayers for their work.
+        bytes32 relayId = keccak256(
+            abi.encodePacked(
+                xDomainCalldata,
+                msg.sender,
+                block.number
+            )
+        );
+        relayedMessages[relayId] = true;
+    }
+ 
+    /**
+     * Replays a cross domain message to the target messenger.
+     * @inheritdoc iOVM_L1CrossDomainMessenger
+     */
+    function replayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        require(
+            sentMessages[keccak256(xDomainCalldata)] == true,
+            "Provided message has not already been sent."
+        );
+ 
+        _sendXDomainMessage(xDomainCalldata, _gasLimit);
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Verifies that the given message is valid.
+     * @param _xDomainCalldata Calldata to verify.
+     * @param _proof Inclusion proof for the message.
+     * @return Whether or not the provided message is valid.
+     */
+    function _verifyXDomainMessage(
+        bytes memory _xDomainCalldata,
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        return (
+            _verifyStateRootProof(_proof)
+            && _verifyStorageProof(_xDomainCalldata, _proof)
+        );
+    }
+ 
+    /**
+     * Verifies that the state root within an inclusion proof is valid.
+     * @param _proof Message inclusion proof.
+     * @return Whether or not the provided proof is valid.
+     */
+    function _verifyStateRootProof(
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+ 
+        return (
+            ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) == false
+            && ovmStateCommitmentChain.verifyStateCommitment(
+                _proof.stateRoot,
+                _proof.stateRootBatchHeader,
+                _proof.stateRootProof
+            )
+        );
+    }
+ 
+    /**
+     * Verifies that the storage proof within an inclusion proof is valid.
+     * @param _xDomainCalldata Encoded message calldata.
+     * @param _proof Message inclusion proof.
+     * @return Whether or not the provided proof is valid.
+     */
+    function _verifyStorageProof(
+        bytes memory _xDomainCalldata,
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 storageKey = keccak256(
+            abi.encodePacked(
+                keccak256(
+                    abi.encodePacked(
+                        _xDomainCalldata,
+                        resolve("OVM_L2CrossDomainMessenger")
+                    )
+                ),
+                uint256(0)
+            )
+        );
+ 
+        (
+            bool exists,
+            bytes memory encodedMessagePassingAccount
+        ) = Lib_SecureMerkleTrie.get(
+            abi.encodePacked(0x4200000000000000000000000000000000000000),
+            _proof.stateTrieWitness,
+            _proof.stateRoot
+        );
+ 
+        Erequire(
+            exists == true,
+            "Message passing predeploy has not been initialized or invalid proof provided."
+        );
+ 
+        Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
+            encodedMessagePassingAccount
+        );
+ 
+        return Lib_SecureMerkleTrie.verifyInclusionProof(
+            abi.encodePacked(storageKey),
+            abi.encodePacked(uint8(1)),
+            _proof.storageTrieWitness,
+            account.storageRoot
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * @param _message Message to send.
+     * @param _gasLimit OVM gas limit for the message.
+     */
+    function _sendXDomainMessage(
+        bytes memory _message,
+        uint256 _gasLimit
+    )
+        override
+        internal
+    {
+        iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).enqueue(
+            resolve("OVM_L2CrossDomainMessenger"),
+            _gasLimit,
+            _message
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html b/coverage/lcov-report/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html new file mode 100644 index 000000000..421554d4f --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html @@ -0,0 +1,275 @@ + + + + Code coverage report for OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol + + + + + + + +
+
+

+ all files / OVM/bridge/messaging/ OVM_L1MultiMessageRelayer.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+import { iOVM_L1MultiMessageRelayer } from "../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol";
+ 
+/* Contract Imports */
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+ 
+/**
+ * @title OVM_L1MultiMessageRelayer
+ * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the 
+ * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain
+ * Message Sender.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+    constructor(
+        address _libAddressManager
+    ) 
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyBatchRelayer() {
+        require(
+            msg.sender == resolve("OVM_L2BatchMessageRelayer"),
+            "OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer"
+        );
+        _;
+    }
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying
+     * @param _messages An array of L2 to L1 messages
+     */
+    function batchRelayMessages(L2ToL1Message[] calldata _messages) 
+        override
+        external
+        onlyBatchRelayer 
+    {
+        iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(resolve("Proxy__OVM_L1CrossDomainMessenger"));
+        for (uint256 i = 0; i < _messages.length; i++) {
+            L2ToL1Message memory message = _messages[i];
+            messenger.relayMessage(
+                message.target,
+                message.sender,
+                message.message,
+                message.messageNonce,
+                message.proof
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html b/coverage/lcov-report/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html new file mode 100644 index 000000000..16a8bd88d --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html @@ -0,0 +1,473 @@ + + + + Code coverage report for OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / OVM/bridge/messaging/ OVM_L2CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  + +  + +  +  +  +  + + + +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/* Interface Imports */
+import { iOVM_L2CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol";
+import { iOVM_L1MessageSender } from "../../../iOVM/predeploys/iOVM_L1MessageSender.sol";
+import { iOVM_L2ToL1MessagePasser } from "../../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
+ 
+/* Contract Imports */
+import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_L2CrossDomainMessenger
+ * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point
+ * for L2 messages sent via the L1 Cross Domain Messenger.
+ * 
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+  */
+contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @inheritdoc iOVM_L2CrossDomainMessenger
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    )
+        override
+        nonReentrant
+        public
+    {
+        require(
+            _verifyXDomainMessage() == true,
+            "Provided message could not be verified."
+        );
+ 
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
+ 
+        require(
+            successfulMessages[xDomainCalldataHash] == false,
+            "Provided message has already been received."
+        );
+ 
+        xDomainMsgSender = _sender;
+        (bool success, ) = _target.call(_message);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+        // Mark the message as received if the call was successful. Ensures that a message can be
+        // relayed multiple times in the case that the call reverted.
+        Eif (success == true) {
+            successfulMessages[xDomainCalldataHash] = true;
+            emit RelayedMessage(xDomainCalldataHash);
+        }
+ 
+        // Store an identifier that can be used to prove that the given message was relayed by some
+        // user. Gives us an easy way to pay relayers for their work.
+        bytes32 relayId = keccak256(
+            abi.encodePacked(
+                xDomainCalldata,
+                msg.sender,
+                block.number
+            )
+        );
+        relayedMessages[relayId] = true;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Verifies that a received cross domain message is valid.
+     * @return _valid Whether or not the message is valid.
+     */
+    function _verifyXDomainMessage()
+        view
+        internal
+        returns (
+            bool _valid
+        )
+    {
+        return (
+            iOVM_L1MessageSender(resolve("OVM_L1MessageSender")).getL1MessageSender() == resolve("OVM_L1CrossDomainMessenger")
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * @param _message Message to send.
+     * param _gasLimit Gas limit for the provided message.
+     */
+    function _sendXDomainMessage(
+        bytes memory _message,
+        uint256 // _gasLimit
+    )
+        override
+        internal
+    {
+        iOVM_L2ToL1MessagePasser(resolve("OVM_L2ToL1MessagePasser")).passMessageToL1(_message);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/messaging/index.html b/coverage/lcov-report/OVM/bridge/messaging/index.html new file mode 100644 index 000000000..d1b88f421 --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/messaging/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for OVM/bridge/messaging/ + + + + + + + +
+
+

+ all files OVM/bridge/messaging/ +

+
+
+ 96.55% + Statements + 56/58 +
+
+ 76.92% + Branches + 20/26 +
+
+ 95.24% + Functions + 20/21 +
+
+ 96.67% + Lines + 58/60 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_BaseCrossDomainMessenger.sol
77.78%7/950%1/280%4/577.78%7/9
OVM_L1CrossDomainMessenger.sol
100%30/3075%12/16100%9/9100%31/31
OVM_L1MultiMessageRelayer.sol
100%5/5100%2/2100%3/3100%6/6
OVM_L2CrossDomainMessenger.sol
100%14/1483.33%5/6100%4/4100%14/14
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html b/coverage/lcov-report/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html new file mode 100644 index 000000000..d4b0621e5 --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html @@ -0,0 +1,692 @@ + + + + Code coverage report for OVM/bridge/tokens/Abs_L1TokenGateway.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ Abs_L1TokenGateway.sol +

+
+
+ 83.33% + Statements + 10/12 +
+
+ 100% + Branches + 0/0 +
+
+ 75% + Functions + 6/8 +
+
+ 83.33% + Lines + 10/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm 
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+ 
+/**
+ * @title Abs_L1TokenGateway
+ * @dev An L1 Token Gateway is a contract which stores deposited L1 funds that are in use on L2.
+ * It synchronizes a corresponding L2 representation of the "deposited token", informing it
+ * of new deposits and releasing L1 funds when there are newly finalized withdrawals.
+ *
+ * NOTE: This abstract contract gives all the core functionality of an L1 token gateway, 
+ * but provides easy hooks in case developers need extensions in child contracts.
+ * In many cases, the default OVM_L1ERC20Gateway will suffice.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+abstract contract Abs_L1TokenGateway is iOVM_L1TokenGateway, OVM_CrossDomainEnabled {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    address public l2DepositedToken;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l2DepositedToken iOVM_L2DepositedToken-compatible address on the chain being deposited into.
+     * @param _l1messenger L1 Messenger address being used for cross-chain communications.
+     */
+    constructor(
+        address _l2DepositedToken,
+        address _l1messenger 
+    )
+        OVM_CrossDomainEnabled(_l1messenger)
+    {
+        l2DepositedToken = _l2DepositedToken;
+    }
+ 
+    /********************************
+     * Overridable Accounting logic *
+     ********************************/
+ 
+    // Default gas value which can be overridden if more complex logic runs on L2.
+    uint32 public DEFAULT_FINALIZE_DEPOSIT_L2_GAS = 1200000;
+ 
+    /**
+     * @dev Core logic to be performed when a withdrawal is finalized on L1.
+     * In most cases, this will simply send locked funds to the withdrawer.
+     *
+     * param _to Address being withdrawn to.
+     * param _amount Amount being withdrawn.
+     */
+    function _handleFinalizeWithdrawal(
+        address, // _to,
+        uint256 // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Implement me in child contracts");
+    }
+ 
+    /**
+     * @dev Core logic to be performed when a deposit is initiated on L1.
+     * In most cases, this will simply send locked funds to the withdrawer.
+     *
+     * param _from Address being deposited from on L1.
+     * param _to Address being deposited into on L2.
+     * param _amount Amount being deposited.
+     */
+    function _handleInitiateDeposit(
+        address, // _from,
+        address, // _to,
+        uint256 // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Implement me in child contracts");
+    }
+ 
+    /**
+     * @dev Overridable getter for the L2 gas limit, in the case it may be
+     * dynamic, and the above public constant does not suffice.
+     *
+     */
+ 
+    function getFinalizeDepositL2Gas()
+        public
+        view
+        returns(
+            uint32
+        )
+    {
+        return DEFAULT_FINALIZE_DEPOSIT_L2_GAS;
+    }
+ 
+    /**************
+     * Depositing *
+     **************/
+ 
+    /**
+     * @dev deposit an amount of the ERC20 to the caller's balance on L2
+     * @param _amount Amount of the ERC20 to deposit
+     */
+    function deposit(
+        uint _amount
+    )
+        public
+        override
+    {
+        _initiateDeposit(msg.sender, msg.sender, _amount);
+    }
+ 
+    /**
+     * @dev deposit an amount of ERC20 to a recipients's balance on L2
+     * @param _to L2 address to credit the withdrawal to
+     * @param _amount Amount of the ERC20 to deposit
+     */
+    function depositTo(
+        address _to,
+        uint _amount
+    )
+        public
+        override
+    {
+        _initiateDeposit(msg.sender, _to, _amount);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by informing the L2 Deposited Token
+     * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)
+     *
+     * @param _from Account to pull the deposit from on L1
+     * @param _to Account to give the deposit to on L2
+     * @param _amount Amount of the ERC20 to deposit.
+     */
+    function _initiateDeposit(
+        address _from,
+        address _to,
+        uint _amount
+    )
+        internal
+    {
+        // Call our deposit accounting handler implemented by child contracts.
+        _handleInitiateDeposit(
+            _from,
+            _to,
+            _amount
+        );
+ 
+        // Construct calldata for l2DepositedToken.finalizeDeposit(_to, _amount)
+        bytes memory data = abi.encodeWithSelector(
+            iOVM_L2DepositedToken.finalizeDeposit.selector,
+            _to,
+            _amount
+        );
+ 
+        // Send calldata into L2
+        sendCrossDomainMessage(
+            l2DepositedToken,
+            data,
+            getFinalizeDepositL2Gas()
+        );
+ 
+        emit DepositInitiated(_from, _to, _amount);
+    }
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    /**
+     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the 
+     * L1 ERC20 token. 
+     * This call will fail if the initialized withdrawal from L2 has not been finalized. 
+     *
+     * @param _to L1 address to credit the withdrawal to
+     * @param _amount Amount of the ERC20 to withdraw
+     */
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external
+        override 
+        onlyFromCrossDomainAccount(l2DepositedToken)
+    {
+        // Call our withdrawal accounting handler implemented by child contracts.
+        _handleFinalizeWithdrawal(
+            _to,
+            _amount
+        );
+ 
+        emit WithdrawalFinalized(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html b/coverage/lcov-report/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html new file mode 100644 index 000000000..ba6d6780c --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html @@ -0,0 +1,755 @@ + + + + Code coverage report for OVM/bridge/tokens/Abs_L2DepositedToken.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ Abs_L2DepositedToken.sol +

+
+
+ 86.67% + Statements + 13/15 +
+
+ 50% + Branches + 2/4 +
+
+ 80% + Functions + 8/10 +
+
+ 87.5% + Lines + 14/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  + +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+ 
+/**
+ * @title Abs_L2DepositedToken
+ * @dev An L2 Deposited Token is an L2 representation of funds which were deposited from L1.
+ * Usually contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
+ * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
+ *
+ * NOTE: This abstract contract gives all the core functionality of a deposited token implementation except for the
+ * token's internal accounting itself.  This gives developers an easy way to implement children with their own token code.
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+abstract contract Abs_L2DepositedToken is iOVM_L2DepositedToken, OVM_CrossDomainEnabled {
+ 
+    /*******************
+     * Contract Events *
+     *******************/
+ 
+    event Initialized(iOVM_L1TokenGateway _l1TokenGateway);
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    iOVM_L1TokenGateway public l1TokenGateway;
+ 
+    /********************************
+     * Constructor & Initialization *
+     ********************************/
+ 
+    /**
+     * @param _l2CrossDomainMessenger L1 Messenger address being used for cross-chain communications.
+     */
+    constructor(
+        address _l2CrossDomainMessenger
+    )
+        OVM_CrossDomainEnabled(_l2CrossDomainMessenger)
+    {}
+ 
+    /**
+     * @dev Initialize this contract with the L1 token gateway address.
+     * The flow: 1) this contract gets deployed on L2, 2) the L1
+     * gateway is deployed with addr from (1), 3) L1 gateway address passed here.
+     *
+     * @param _l1TokenGateway Address of the corresponding L1 gateway deployed to the main chain
+     */
+ 
+    function init(
+        iOVM_L1TokenGateway _l1TokenGateway
+    )
+        public
+    {
+        Erequire(address(l1TokenGateway) == address(0), "Contract has already been initialized");
+ 
+        l1TokenGateway = _l1TokenGateway;
+        
+        emit Initialized(l1TokenGateway);
+    }
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyInitialized() {
+        Erequire(address(l1TokenGateway) != address(0), "Contract has not yet been initialized");
+        _;
+    }
+ 
+    /********************************
+     * Overridable Accounting logic *
+     ********************************/
+ 
+    // Default gas value which can be overridden if more complex logic runs on L2.
+    uint32 constant DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS = 100000;
+ 
+    /**
+     * @dev Core logic to be performed when a withdrawal from L2 is initialized.
+     * In most cases, this will simply burn the withdrawn L2 funds.
+     *
+     * param _to Address being withdrawn to
+     * param _amount Amount being withdrawn
+     */
+ 
+    function _handleInitiateWithdrawal(
+        address, // _to,
+        uint // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Accounting must be implemented by child contract.");
+    }
+ 
+    /**
+     * @dev Core logic to be performed when a deposit from L2 is finalized on L2.
+     * In most cases, this will simply _mint() to credit L2 funds to the recipient.
+     *
+     * param _to Address being deposited to on L2
+     * param _amount Amount which was deposited on L1
+     */
+    function _handleFinalizeDeposit(
+        address, // _to
+        uint // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Accounting must be implemented by child contract.");
+    }
+ 
+    /**
+     * @dev Overridable getter for the *L1* gas limit of settling the withdrawal, in the case it may be
+     * dynamic, and the above public constant does not suffice.
+     *
+     */
+ 
+    function getFinalizeWithdrawalL1Gas()
+        public
+        view
+        virtual
+        returns(
+            uint32
+        )
+    {
+        return DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS;
+    }
+ 
+ 
+    /***************
+     * Withdrawing *
+     ***************/
+ 
+    /**
+     * @dev initiate a withdraw of some tokens to the caller's account on L1
+     * @param _amount Amount of the token to withdraw
+     */
+    function withdraw(
+        uint _amount
+    )
+        external
+        override
+        onlyInitialized()
+    {
+        _initiateWithdrawal(msg.sender, _amount);
+    }
+ 
+    /**
+     * @dev initiate a withdraw of some token to a recipient's account on L1
+     * @param _to L1 adress to credit the withdrawal to
+     * @param _amount Amount of the token to withdraw
+     */
+    function withdrawTo(
+        address _to,
+        uint _amount
+    )
+        external
+        override
+        onlyInitialized()
+    {
+        _initiateWithdrawal(_to, _amount);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by storing the token and informing the L2 token Gateway of the deposit.
+     *
+     * @param _to Account to give the withdrawal to on L1
+     * @param _amount Amount of the token to withdraw
+     */
+    function _initiateWithdrawal(
+        address _to,
+        uint _amount
+    )
+        internal
+    {
+        // Call our withdrawal accounting handler implemented by child contracts (usually a _burn)
+        _handleInitiateWithdrawal(_to, _amount);
+ 
+        // Construct calldata for l1TokenGateway.finalizeWithdrawal(_to, _amount)
+        bytes memory data = abi.encodeWithSelector(
+            iOVM_L1TokenGateway.finalizeWithdrawal.selector,
+            _to,
+            _amount
+        );
+ 
+        // Send message up to L1 gateway
+        sendCrossDomainMessage(
+            address(l1TokenGateway),
+            data,
+            getFinalizeWithdrawalL1Gas()
+        );
+ 
+        emit WithdrawalInitiated(msg.sender, _to, _amount);
+    }
+ 
+    /************************************
+     * Cross-chain Function: Depositing *
+     ************************************/
+ 
+    /**
+     * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this 
+     * L2 token. 
+     * This call will fail if it did not originate from a corresponding deposit in OVM_l1TokenGateway. 
+     *
+     * @param _to Address to receive the withdrawal at
+     * @param _amount Amount of the token to withdraw
+     */
+    function finalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        external
+        override 
+        onlyInitialized()
+        onlyFromCrossDomainAccount(address(l1TokenGateway))
+    {
+        _handleFinalizeDeposit(_to, _amount);
+        emit DepositFinalized(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html b/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html new file mode 100644 index 000000000..ca0c061f1 --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html @@ -0,0 +1,365 @@ + + + + Code coverage report for OVM/bridge/tokens/OVM_L1ERC20Gateway.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ OVM_L1ERC20Gateway.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 3/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm 
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+import { Abs_L1TokenGateway } from "./Abs_L1TokenGateway.sol";
+import { iOVM_ERC20 } from "../../../iOVM/predeploys/iOVM_ERC20.sol";
+ 
+/**
+ * @title OVM_L1ERC20Gateway
+ * @dev The L1 ERC20 Gateway is a contract which stores deposited L1 funds that are in use on L2.
+ * It synchronizes a corresponding L2 ERC20 Gateway, informing it of deposits, and listening to it
+ * for newly finalized withdrawals.
+ *
+ * NOTE: This contract extends Abs_L1TokenGateway, which is where we
+ * takes care of most of the initialization and the cross-chain logic.
+ * If you are looking to implement your own deposit/withdrawal contracts, you
+ * may also want to extend the abstract contract in a similar manner.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1ERC20Gateway is Abs_L1TokenGateway {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+    
+    iOVM_ERC20 public l1ERC20;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l1ERC20 L1 ERC20 address this contract stores deposits for
+     * @param _l2DepositedERC20 L2 Gateway address on the chain being deposited into
+     */
+    constructor(
+        iOVM_ERC20 _l1ERC20,
+        address _l2DepositedERC20,
+        address _l1messenger 
+    )
+        Abs_L1TokenGateway(
+            _l2DepositedERC20,
+            _l1messenger
+        )
+    {
+        l1ERC20 = _l1ERC20;
+    }
+ 
+ 
+    /**************
+     * Accounting *
+     **************/
+ 
+    /**
+     * @dev When a deposit is initiated on L1, the L1 Gateway
+     * transfers the funds to itself for future withdrawals
+     *
+     * @param _from L1 address ETH is being deposited from
+     * param _to L2 address that the ETH is being deposited to
+     * @param _amount Amount of ERC20 to send
+     */
+    function _handleInitiateDeposit(
+        address _from,
+        address, // _to,
+        uint256 _amount
+    )
+        internal
+        override
+    {
+         // Hold on to the newly deposited funds
+        l1ERC20.transferFrom(
+            _from,
+            address(this),
+            _amount
+        );
+    }
+ 
+    /**
+     * @dev When a withdrawal is finalized on L1, the L1 Gateway
+     * transfers the funds to the withdrawer
+     *
+     * @param _to L1 address that the ERC20 is being withdrawn to
+     * @param _amount Amount of ERC20 to send
+     */
+    function _handleFinalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        // Transfer withdrawn funds out to withdrawer
+        l1ERC20.transfer(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html b/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html new file mode 100644 index 000000000..af1be607b --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html @@ -0,0 +1,557 @@ + + + + Code coverage report for OVM/bridge/tokens/OVM_L1ETHGateway.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ OVM_L1ETHGateway.sol +

+
+
+ 100% + Statements + 11/11 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 6/6 +
+
+ 91.67% + Lines + 11/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1ETHGateway } from "../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol";
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/**
+ * @title OVM_L1ETHGateway
+ * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {
+ 
+    /********************
+     * Public Constants *
+     ********************/
+ 
+    uint32 public constant override getFinalizeDepositL2Gas = 1200000;
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    address public ovmEth;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address manager for this OE deployment
+     * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken
+     */
+    constructor(
+        address _libAddressManager,
+        address _ovmEth
+    )
+        OVM_CrossDomainEnabled(address(0)) // overridden in constructor code
+        Lib_AddressResolver(_libAddressManager)
+    {
+        ovmEth = _ovmEth;
+        messenger = resolve("Proxy__OVM_L1CrossDomainMessenger"); // overrides OVM_CrossDomainEnabled constructor setting because resolve() is not yet accessible
+    }
+ 
+    /**************
+     * Depositing *
+     **************/
+ 
+    receive()
+        external
+        payable
+    {
+        _initiateDeposit(msg.sender, msg.sender);
+    }
+ 
+    /**
+     * @dev deposit an amount of the ETH to the caller's balance on L2
+     */
+    function deposit() 
+        external
+        override
+        payable
+    {
+        _initiateDeposit(msg.sender, msg.sender);
+    }
+ 
+    /**
+     * @dev deposit an amount of ETH to a recipients's balance on L2
+     * @param _to L2 address to credit the withdrawal to
+     */
+    function depositTo(
+        address _to
+    )
+        external
+        override
+        payable
+    {
+        _initiateDeposit(msg.sender, _to);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.
+     *
+     * @param _from Account to pull the deposit from on L1
+     * @param _to Account to give the deposit to on L2
+     */
+    function _initiateDeposit(
+        address _from,
+        address _to
+    )
+        internal
+    {
+        // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)
+        bytes memory data =
+            abi.encodeWithSelector(
+                iOVM_L2DepositedToken.finalizeDeposit.selector,
+                _to,
+                msg.value
+            );
+ 
+        // Send calldata into L2
+        sendCrossDomainMessage(
+            ovmEth,
+            data,
+            getFinalizeDepositL2Gas
+        );
+ 
+        emit DepositInitiated(_from, _to, msg.value);
+    }
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    /**
+     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the
+     * L1 ETH token.
+     * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized. 
+     *
+     * @param _to L1 address to credit the withdrawal to
+     * @param _amount Amount of the ETH to withdraw
+     */
+    function finalizeWithdrawal(
+        address _to,
+        uint256 _amount
+    )
+        external
+        override
+        onlyFromCrossDomainAccount(ovmEth)
+    {
+        _safeTransferETH(_to, _amount);
+ 
+        emit WithdrawalFinalized(_to, _amount);
+    }
+ 
+    /**********************************
+     * Internal Functions: Accounting *
+     **********************************/
+ 
+    /**
+     * @dev Internal accounting function for moving around L1 ETH.
+     *
+     * @param _to L1 address to transfer ETH to
+     * @param _value Amount of ETH to send to
+     */
+    function _safeTransferETH(
+        address _to,
+        uint256 _value
+    )
+        internal
+    {
+        (bool success, ) = _to.call{value: _value}(new bytes(0));
+        Erequire(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html b/coverage/lcov-report/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html new file mode 100644 index 000000000..74ff02ea8 --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html @@ -0,0 +1,266 @@ + + + + Code coverage report for OVM/bridge/tokens/OVM_L2DepositedERC20.sol + + + + + + + +
+
+

+ all files / OVM/bridge/tokens/ OVM_L2DepositedERC20.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Contract Imports */
+import { UniswapV2ERC20 } from "../../../libraries/standards/UniswapV2ERC20.sol";
+ 
+/* Library Imports */
+import { Abs_L2DepositedToken } from "./Abs_L2DepositedToken.sol";
+ 
+/**
+ * @title OVM_L2DepositedERC20
+ * @dev The L2 Deposited ERC20 is an ERC20 implementation which represents L1 assets deposited into L2.
+ * This contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
+ * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
+ *
+ * NOTE: This contract implements the Abs_L2DepositedToken contract using Uniswap's ERC20 as the implementation.
+ * Alternative implementations can be used in this similar manner.
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract OVM_L2DepositedERC20 is Abs_L2DepositedToken, UniswapV2ERC20 {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.
+     * @param _name ERC20 name
+     * @param _symbol ERC20 symbol
+     */
+    constructor(
+        address _l2CrossDomainMessenger,
+        string memory _name,
+        string memory _symbol
+    )
+        Abs_L2DepositedToken(_l2CrossDomainMessenger)
+        UniswapV2ERC20(_name, _symbol)
+    {}
+ 
+    // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2 usage.
+    function _handleInitiateWithdrawal(
+        address, // _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        _burn(msg.sender, _amount);
+    }
+ 
+    // When a deposit is finalized, we credit the account on L2 with the same amount of tokens.
+    function _handleFinalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        _mint(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/bridge/tokens/index.html b/coverage/lcov-report/OVM/bridge/tokens/index.html new file mode 100644 index 000000000..81e37f18b --- /dev/null +++ b/coverage/lcov-report/OVM/bridge/tokens/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for OVM/bridge/tokens/ + + + + + + + +
+
+

+ all files OVM/bridge/tokens/ +

+
+
+ 90.7% + Statements + 39/43 +
+
+ 50% + Branches + 3/6 +
+
+ 86.67% + Functions + 26/30 +
+
+ 88.89% + Lines + 40/45 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_L1TokenGateway.sol
83.33%10/12100%0/075%6/883.33%10/12
Abs_L2DepositedToken.sol
86.67%13/1550%2/480%8/1087.5%14/16
OVM_L1ERC20Gateway.sol
100%3/3100%0/0100%3/3100%3/3
OVM_L1ETHGateway.sol
100%11/1150%1/2100%6/691.67%11/12
OVM_L2DepositedERC20.sol
100%2/2100%0/0100%3/3100%2/2
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/chain/OVM_CanonicalTransactionChain.sol.html b/coverage/lcov-report/OVM/chain/OVM_CanonicalTransactionChain.sol.html new file mode 100644 index 000000000..c0026a36e --- /dev/null +++ b/coverage/lcov-report/OVM/chain/OVM_CanonicalTransactionChain.sol.html @@ -0,0 +1,3755 @@ + + + + Code coverage report for OVM/chain/OVM_CanonicalTransactionChain.sol + + + + + + + +
+
+

+ all files / OVM/chain/ OVM_CanonicalTransactionChain.sol +

+
+
+ 95.51% + Statements + 149/156 +
+
+ 87.5% + Branches + 63/72 +
+
+ 84.38% + Functions + 27/32 +
+
+ 95.88% + Lines + 163/170 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +222× +222× +222× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +559× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +382× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +291× +291× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +100× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +47× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +239× +  +  +  +  +238× +  +  +  +  +237× +  +  +  +  +  +  +  +236× +236× +  +  +  +236× +  +  +  +  +  +  +235× +235× +37600× +  +  +235× +  +  +  +  +  +  +  +  +235× +235× +  +  +  +  +235× +  +235× +235× +  +  +  +  +235× +235× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +104× +104× +104× +104× +  +  +  +  +  +104× +  +  +  +  +103× +  +  +  +  +102× +  +  +  +  +101× +  +  +  +  +100× +  +100× +  +  +  +  +  +  +  +100× +100× +  +  +  +  +100× +  +  +100× +  +  +100× +  +  +100× +  +  +  +100× +  +100× +100× +232× +  +232× +  +100× +  +  +  +226× +  +  +  +  +  +  +  +221× +  +  +221× +439× +439× +  +  +  +439× +  +  +  +  +  +  +439× +439× +439× +  +  +  +221× +179× +  +  +  +  +178× +178× +178× +  +  +  +88× +  +  +  +  +  +  +82× +  +  +  +  +81× +  +  +  +  +  +81× +81× +81× +81× +  +39× +39× +  +  +  +  +  +42× +  +  +  +  +42× +42× +  +  +  +  +  +81× +  +  +  +  +  +  +  +81× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +232× +232× +232× +232× +232× +  +232× +  +  +  +  +  +  +232× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +476× +  +476× +476× +476× +476× +476× +  +  +  +  +  +  +  +476× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +81× +81× +  +  +  +  +  +  +  +81× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +179× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +267× +267× +265× +  +265× +265× +265× +  +  +  +  +265× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +439× +419× +  +  +439× +439× +  +439× +439× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +439× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +81× +81× +  +81× +  +  +  +  +  +  +  +81× +  +  +  +  +  +  +  +81× +81× +  +  +  +  +  +  +81× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× + +  + +  +  +  +  + +  +  +  +  +  +  +96× +  +  +  +  +95× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +178× +  +  +  +  +  +177× +  +  +  +  +  +  +176× +  +  +  +  +174× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +226× +  +  +  +  +225× +  +  +  +  +  +224× +175× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +88× + +  +  +  +  +  +  +85× +83× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +179× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
+import { Lib_Math } from "../../libraries/utils/Lib_Math.sol";
+ 
+/* Interface Imports */
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/* Contract Imports */
+import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
+ 
+ 
+/**
+ * @title OVM_CanonicalTransactionChain
+ * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions
+ * which must be applied to the rollup state. It defines the ordering of rollup transactions by
+ * writing them to the 'CTC:batches' instance of the Chain Storage Container.
+ * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer
+ * will eventually append it to the rollup state.
+ * If the Sequencer does not include an enqueued transaction within the 'force inclusion period',
+ * then any account may force it to be included by calling appendQueueBatch().
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_AddressResolver {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    // L2 tx gas-related
+    uint256 constant public MIN_ROLLUP_TX_GAS = 100000;
+    uint256 constant public MAX_ROLLUP_TX_SIZE = 10000;
+    uint256 constant public L2_GAS_DISCOUNT_DIVISOR = 32;
+ 
+    // Encoding-related (all in bytes)
+    uint256 constant internal BATCH_CONTEXT_SIZE = 16;
+    uint256 constant internal BATCH_CONTEXT_LENGTH_POS = 12;
+    uint256 constant internal BATCH_CONTEXT_START_POS = 15;
+    uint256 constant internal TX_DATA_HEADER_SIZE = 3;
+    uint256 constant internal BYTES_TILL_TX_DATA = 65;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    uint256 public forceInclusionPeriodSeconds;
+    uint256 public forceInclusionPeriodBlocks;
+    uint256 public maxTransactionGasLimit;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    constructor(
+        address _libAddressManager,
+        uint256 _forceInclusionPeriodSeconds,
+        uint256 _forceInclusionPeriodBlocks,
+        uint256 _maxTransactionGasLimit
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        forceInclusionPeriodSeconds = _forceInclusionPeriodSeconds;
+        forceInclusionPeriodBlocks = _forceInclusionPeriodBlocks;
+        maxTransactionGasLimit = _maxTransactionGasLimit;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        override
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:CTC:batches")
+        );
+    }
+ 
+    /**
+     * Accesses the queue storage container.
+     * @return Reference to the queue storage container.
+     */
+    function queue()
+        override
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:CTC:queue")
+        );
+    }
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        override
+        public
+        view
+        returns (
+            uint256 _totalElements
+        )
+    {
+        (uint40 totalElements,,,) = _getBatchExtraData();
+        return uint256(totalElements);
+    }
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        override
+        public
+        view
+        returns (
+            uint256 _totalBatches
+        )
+    {
+        return batches().length();
+    }
+ 
+    /**
+     * Returns the index of the next element to be enqueued.
+     * @return Index for the next queue element.
+     */
+    function getNextQueueIndex()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,uint40 nextQueueIndex,,) = _getBatchExtraData();
+        return nextQueueIndex;
+    }
+ 
+    /**
+     * Returns the timestamp of the last transaction.
+     * @return Timestamp for the last transaction.
+     */
+    function getLastTimestamp()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,,uint40 lastTimestamp,) = _getBatchExtraData();
+        return lastTimestamp;
+    }
+ 
+    /**
+     * Returns the blocknumber of the last transaction.
+     * @return Blocknumber for the last transaction.
+     */
+    function getLastBlockNumber()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,,,uint40 lastBlockNumber) = _getBatchExtraData();
+        return lastBlockNumber;
+    }
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function getQueueElement(
+        uint256 _index
+    )
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        )
+    {
+        return _getQueueElement(
+            _index,
+            queue()
+        );
+    }
+ 
+    /**
+     * Get the number of queue elements which have not yet been included.
+     * @return Number of pending queue elements.
+     */
+    function getNumPendingQueueElements()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        return getQueueLength() - getNextQueueIndex();
+    }
+ 
+   /**
+     * Retrieves the length of the queue, including
+     * both pending and canonical transactions.
+     * @return Length of the queue.
+     */
+    function getQueueLength()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        return _getQueueLength(
+            queue()
+        );
+    }
+ 
+    /**
+     * Adds a transaction to the queue.
+     * @param _target Target L2 contract to send the transaction to.
+     * @param _gasLimit Gas limit for the enqueued L2 transaction.
+     * @param _data Transaction data.
+     */
+    function enqueue(
+        address _target,
+        uint256 _gasLimit,
+        bytes memory _data
+    )
+        override
+        public
+    {
+        require(
+            _data.length <= MAX_ROLLUP_TX_SIZE,
+            "Transaction data size exceeds maximum for rollup transaction."
+        );
+ 
+        require(
+            _gasLimit <= maxTransactionGasLimit,
+            "Transaction gas limit exceeds maximum for rollup transaction."
+        );
+ 
+        require(
+            _gasLimit >= MIN_ROLLUP_TX_GAS,
+            "Transaction gas limit too low to enqueue."
+        );
+ 
+        // We need to consume some amount of L1 gas in order to rate limit transactions going into
+        // L2. However, L2 is cheaper than L1 so we only need to burn some small proportion of the
+        // provided L1 gas.
+        uint256 gasToConsume = _gasLimit/L2_GAS_DISCOUNT_DIVISOR;
+        uint256 startingGas = gasleft();
+ 
+        // Although this check is not necessary (burn below will run out of gas if not true), it
+        // gives the user an explicit reason as to why the enqueue attempt failed.
+        require(
+            startingGas > gasToConsume,
+            "Insufficient gas for L2 rate limiting burn."
+        );
+ 
+        // Here we do some "dumb" work in order to burn gas, although we should probably replace
+        // this with something like minting gas token later on.
+        uint256 i;
+        while(startingGas - gasleft() < gasToConsume) {
+            i++;
+        }
+ 
+        bytes32 transactionHash = keccak256(
+            abi.encode(
+                msg.sender,
+                _target,
+                _gasLimit,
+                _data
+            )
+        );
+ 
+        bytes32 timestampAndBlockNumber;
+        assembly {
+            timestampAndBlockNumber := timestamp()
+            timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
+        }
+ 
+        iOVM_ChainStorageContainer queueRef = queue();
+ 
+        queueRef.push(transactionHash);
+        queueRef.push(timestampAndBlockNumber);
+ 
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the real queue length we need
+        // to divide by 2 and subtract 1.
+        uint256 queueIndex = queueRef.length() / 2 - 1;
+        emit TransactionEnqueued(
+            msg.sender,
+            _target,
+            _gasLimit,
+            _data,
+            queueIndex,
+            block.timestamp
+        );
+    }
+ 
+    /**
+     * Appends a given number of queued transactions as a single batch.
+     * param _numQueuedTransactions Number of transactions to append.
+     */
+    function appendQueueBatch(
+        uint256 // _numQueuedTransactions
+    )
+        override
+        public
+        pure
+    {
+        // TEMPORARY: Disable `appendQueueBatch` for minnet
+        revert("appendQueueBatch is currently disabled.");
+ 
+        // _numQueuedTransactions = Lib_Math.min(_numQueuedTransactions, getNumPendingQueueElements());
+        // require(
+        //     _numQueuedTransactions > 0,
+        //     "Must append more than zero transactions."
+        // );
+ 
+        // bytes32[] memory leaves = new bytes32[](_numQueuedTransactions);
+        // uint40 nextQueueIndex = getNextQueueIndex();
+ 
+        // for (uint256 i = 0; i < _numQueuedTransactions; i++) {
+        //     if (msg.sender != resolve("OVM_Sequencer")) {
+        //         Lib_OVMCodec.QueueElement memory el = getQueueElement(nextQueueIndex);
+        //         require(
+        //             el.timestamp + forceInclusionPeriodSeconds < block.timestamp,
+        //             "Queue transactions cannot be submitted during the sequencer inclusion period."
+        //         );
+        //     }
+        //     leaves[i] = _getQueueLeafHash(nextQueueIndex);
+        //     nextQueueIndex++;
+        // }
+ 
+        // Lib_OVMCodec.QueueElement memory lastElement = getQueueElement(nextQueueIndex - 1);
+ 
+        // _appendBatch(
+        //     Lib_MerkleTree.getMerkleRoot(leaves),
+        //     _numQueuedTransactions,
+        //     _numQueuedTransactions,
+        //     lastElement.timestamp,
+        //     lastElement.blockNumber
+        // );
+ 
+        // emit QueueBatchAppended(
+        //     nextQueueIndex - _numQueuedTransactions,
+        //     _numQueuedTransactions,
+        //     getTotalElements()
+        // );
+    }
+ 
+    /**
+     * Allows the sequencer to append a batch of transactions.
+     * @dev This function uses a custom encoding scheme for efficiency reasons.
+     * .param _shouldStartAtElement Specific batch we expect to start appending to.
+     * .param _totalElementsToAppend Total number of batch elements we expect to append.
+     * .param _contexts Array of batch contexts.
+     * .param _transactionDataFields Array of raw transaction data.
+     */
+    function appendSequencerBatch()
+        override
+        public
+    {
+        uint40 shouldStartAtElement;
+        uint24 totalElementsToAppend;
+        uint24 numContexts;
+        assembly {
+            shouldStartAtElement  := shr(216, calldataload(4))
+            totalElementsToAppend := shr(232, calldataload(9))
+            numContexts           := shr(232, calldataload(12))
+        }
+ 
+        require(
+            shouldStartAtElement == getTotalElements(),
+            "Actual batch start index does not match expected start index."
+        );
+ 
+        require(
+            msg.sender == resolve("OVM_Sequencer"),
+            "Function can only be called by the Sequencer."
+        );
+ 
+        require(
+            numContexts > 0,
+            "Must provide at least one batch context."
+        );
+ 
+        require(
+            totalElementsToAppend > 0,
+            "Must append at least one element."
+        );
+ 
+        uint40 nextTransactionPtr = uint40(BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts);
+ 
+        Erequire(
+            msg.data.length >= nextTransactionPtr,
+            "Not enough BatchContexts provided."
+        );
+ 
+        // Take a reference to the queue and its length so we don't have to keep resolving it.
+        // Length isn't going to change during the course of execution, so it's fine to simply
+        // resolve this once at the start. Saves gas.
+        iOVM_ChainStorageContainer queueRef = queue();
+        uint40 queueLength = _getQueueLength(queueRef);
+ 
+        // Reserve some memory to save gas on hashing later on. This is a relatively safe estimate
+        // for the average transaction size that will prevent having to resize this chunk of memory
+        // later on. Saves gas.
+        bytes memory hashMemory = new bytes((msg.data.length / totalElementsToAppend) * 2);
+ 
+        // Initialize the array of canonical chain leaves that we will append.
+        bytes32[] memory leaves = new bytes32[](totalElementsToAppend);
+ 
+        // Each leaf index corresponds to a tx, either sequenced or enqueued.
+        uint32 leafIndex = 0;
+ 
+        // Counter for number of sequencer transactions appended so far.
+        uint32 numSequencerTransactions = 0;
+ 
+        // We will sequentially append leaves which are pointers to the queue.
+        // The initial queue index is what is currently in storage.
+        uint40 nextQueueIndex = getNextQueueIndex();
+ 
+        BatchContext memory curContext;
+        for (uint32 i = 0; i < numContexts; i++) {
+            BatchContext memory nextContext = _getBatchContext(i);
+ 
+            if (i == 0) {
+                // Execute a special check for the first batch.
+                _validateFirstBatchContext(nextContext);
+            }
+ 
+            // Execute this check on every single batch, including the first one.
+            _validateNextBatchContext(
+                curContext,
+                nextContext,
+                nextQueueIndex,
+                queueRef
+            );
+ 
+            // Now we can update our current context.
+            curContext = nextContext;
+ 
+            // Process sequencer transactions first.
+            for (uint32 j = 0; j < curContext.numSequencedTransactions; j++) {
+                uint256 txDataLength;
+                assembly {
+                    txDataLength := shr(232, calldataload(nextTransactionPtr))
+                }
+ 
+                leaves[leafIndex] = _getSequencerLeafHash(
+                    curContext,
+                    nextTransactionPtr,
+                    txDataLength,
+                    hashMemory
+                );
+ 
+                nextTransactionPtr += uint40(TX_DATA_HEADER_SIZE + txDataLength);
+                numSequencerTransactions++;
+                leafIndex++;
+            }
+ 
+            // Now process any subsequent queue transactions.
+            for (uint32 j = 0; j < curContext.numSubsequentQueueTransactions; j++) {
+                require(
+                    nextQueueIndex < queueLength,
+                    "Not enough queued transactions to append."
+                );
+ 
+                leaves[leafIndex] = _getQueueLeafHash(nextQueueIndex);
+                nextQueueIndex++;
+                leafIndex++;
+            }
+        }
+ 
+        _validateFinalBatchContext(
+            curContext,
+            nextQueueIndex,
+            queueLength,
+            queueRef
+        );
+ 
+        require(
+            msg.data.length == nextTransactionPtr,
+            "Not all sequencer transactions were processed."
+        );
+ 
+        Erequire(
+            leafIndex == totalElementsToAppend,
+            "Actual transaction index does not match expected total elements to append."
+        );
+ 
+        // Generate the required metadata that we need to append this batch
+        uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
+        uint40 blockTimestamp;
+        uint40 blockNumber;
+        if (curContext.numSubsequentQueueTransactions == 0) {
+            // The last element is a sequencer tx, therefore pull timestamp and block number from the last context.
+            blockTimestamp = uint40(curContext.timestamp);
+            blockNumber = uint40(curContext.blockNumber);
+        } else {
+            // The last element is a queue tx, therefore pull timestamp and block number from the queue element.
+            // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at least one queue element.
+            // We increment nextQueueIndex after processing each queue element,
+            // so the index of the last element we processed is nextQueueIndex - 1.
+            Lib_OVMCodec.QueueElement memory lastElement = _getQueueElement(
+                nextQueueIndex - 1,
+                queueRef
+            );
+ 
+            blockTimestamp = lastElement.timestamp;
+            blockNumber = lastElement.blockNumber;
+        }
+ 
+        // For efficiency reasons getMerkleRoot modifies the `leaves` argument in place
+        // while calculating the root hash therefore any arguments passed to it must not
+        // be used again afterwards
+        _appendBatch(
+            Lib_MerkleTree.getMerkleRoot(leaves),
+            totalElementsToAppend,
+            numQueuedTransactions,
+            blockTimestamp,
+            blockNumber
+        );
+ 
+        emit SequencerBatchAppended(
+            nextQueueIndex - numQueuedTransactions,
+            numQueuedTransactions,
+            getTotalElements()
+        );
+    }
+ 
+    /**
+     * Verifies whether a transaction is included in the chain.
+     * @param _transaction Transaction to verify.
+     * @param _txChainElement Transaction chain element corresponding to the transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
+     * @return True if the transaction exists in the CTC, false if not.
+     */
+    function verifyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        if (_txChainElement.isSequenced == true) {
+            return _verifySequencerTransaction(
+                _transaction,
+                _txChainElement,
+                _batchHeader,
+                _inclusionProof
+            );
+        } else {
+            return _verifyQueueTransaction(
+                _transaction,
+                _txChainElement.queueIndex,
+                _batchHeader,
+                _inclusionProof
+            );
+        }
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Returns the BatchContext located at a particular index.
+     * @param _index The index of the BatchContext
+     * @return The BatchContext at the specified index.
+     */
+    function _getBatchContext(
+        uint256 _index
+    )
+        internal
+        pure
+        returns (
+            BatchContext memory
+        )
+    {
+        uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;
+        uint256 numSequencedTransactions;
+        uint256 numSubsequentQueueTransactions;
+        uint256 ctxTimestamp;
+        uint256 ctxBlockNumber;
+ 
+        assembly {
+            numSequencedTransactions       := shr(232, calldataload(contextPtr))
+            numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))
+            ctxTimestamp                   := shr(216, calldataload(add(contextPtr, 6)))
+            ctxBlockNumber                 := shr(216, calldataload(add(contextPtr, 11)))
+        }
+ 
+        return BatchContext({
+            numSequencedTransactions: numSequencedTransactions,
+            numSubsequentQueueTransactions: numSubsequentQueueTransactions,
+            timestamp: ctxTimestamp,
+            blockNumber: ctxBlockNumber
+        });
+    }
+ 
+    /**
+     * Parses the batch context from the extra data.
+     * @return Total number of elements submitted.
+     * @return Index of the next queue element.
+     */
+    function _getBatchExtraData()
+        internal
+        view
+        returns (
+            uint40,
+            uint40,
+            uint40,
+            uint40
+        )
+    {
+        bytes27 extraData = batches().getGlobalMetadata();
+ 
+        uint40 totalElements;
+        uint40 nextQueueIndex;
+        uint40 lastTimestamp;
+        uint40 lastBlockNumber;
+        assembly {
+            extraData       :=  shr(40, extraData)
+            totalElements   :=  and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            nextQueueIndex  :=  shr(40, and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000))
+            lastTimestamp   :=  shr(80, and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000))
+            lastBlockNumber :=  shr(120, and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000))
+        }
+ 
+        return (
+            totalElements,
+            nextQueueIndex,
+            lastTimestamp,
+            lastBlockNumber
+        );
+    }
+ 
+    /**
+     * Encodes the batch context for the extra data.
+     * @param _totalElements Total number of elements submitted.
+     * @param _nextQueueIndex Index of the next queue element.
+     * @param _timestamp Timestamp for the last batch.
+     * @param _blockNumber Block number of the last batch.
+     * @return Encoded batch context.
+     */
+    function _makeBatchExtraData(
+        uint40 _totalElements,
+        uint40 _nextQueueIndex,
+        uint40 _timestamp,
+        uint40 _blockNumber
+    )
+        internal
+        pure
+        returns (
+            bytes27
+        )
+    {
+        bytes27 extraData;
+        assembly {
+            extraData := _totalElements
+            extraData := or(extraData, shl(40, _nextQueueIndex))
+            extraData := or(extraData, shl(80, _timestamp))
+            extraData := or(extraData, shl(120, _blockNumber))
+            extraData := shl(40, extraData)
+        }
+ 
+        return extraData;
+    }
+ 
+    /**
+     * Retrieves the hash of a queue element.
+     * @param _index Index of the queue element to retrieve a hash for.
+     * @return Hash of the queue element.
+     */
+    function _getQueueLeafHash(
+        uint256 _index
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return _hashTransactionChainElement(
+            Lib_OVMCodec.TransactionChainElement({
+                isSequenced: false,
+                queueIndex: _index,
+                timestamp: 0,
+                blockNumber: 0,
+                txData: hex""
+            })
+        );
+    }
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function _getQueueElement(
+        uint256 _index,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        )
+    {
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the actual desired queue index
+        // we need to multiply by 2.
+        uint40 trueIndex = uint40(_index * 2);
+        bytes32 transactionHash = _queueRef.get(trueIndex);
+        bytes32 timestampAndBlockNumber = _queueRef.get(trueIndex + 1);
+ 
+        uint40 elementTimestamp;
+        uint40 elementBlockNumber;
+        assembly {
+            elementTimestamp   :=         and(timestampAndBlockNumber, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            elementBlockNumber := shr(40, and(timestampAndBlockNumber, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
+        }
+ 
+        return Lib_OVMCodec.QueueElement({
+            transactionHash: transactionHash,
+            timestamp: elementTimestamp,
+            blockNumber: elementBlockNumber
+        });
+    }
+ 
+    /**
+     * Retrieves the length of the queue.
+     * @return Length of the queue.
+     */
+    function _getQueueLength(
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the real queue length we need
+        // to divide by 2.
+        return uint40(_queueRef.length() / 2);
+    }
+ 
+    /**
+     * Retrieves the hash of a sequencer element.
+     * @param _context Batch context for the given element.
+     * @param _nextTransactionPtr Pointer to the next transaction in the calldata.
+     * @param _txDataLength Length of the transaction item.
+     * @return Hash of the sequencer element.
+     */
+    function _getSequencerLeafHash(
+        BatchContext memory _context,
+        uint256 _nextTransactionPtr,
+        uint256 _txDataLength,
+        bytes memory _hashMemory
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        // Only allocate more memory if we didn't reserve enough to begin with.
+        if (BYTES_TILL_TX_DATA + _txDataLength > _hashMemory.length) {
+            _hashMemory = new bytes(BYTES_TILL_TX_DATA + _txDataLength);
+        }
+ 
+        uint256 ctxTimestamp = _context.timestamp;
+        uint256 ctxBlockNumber = _context.blockNumber;
+ 
+        bytes32 leafHash;
+        assembly {
+            let chainElementStart := add(_hashMemory, 0x20)
+ 
+            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
+            // This distinguishes sequencer ChainElements from queue ChainElements because
+            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
+            // elements is always zero
+            mstore8(chainElementStart, 1)
+ 
+            mstore(add(chainElementStart, 1), ctxTimestamp)
+            mstore(add(chainElementStart, 33), ctxBlockNumber)
+ 
+            calldatacopy(add(chainElementStart, BYTES_TILL_TX_DATA), add(_nextTransactionPtr, 3), _txDataLength)
+ 
+            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, _txDataLength))
+        }
+ 
+        return leafHash;
+    }
+ 
+    /**
+     * Retrieves the hash of a sequencer element.
+     * @param _txChainElement The chain element which is hashed to calculate the leaf.
+     * @return Hash of the sequencer element.
+     */
+    function _getSequencerLeafHash(
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement
+    )
+        internal
+        view
+        returns(
+            bytes32
+        )
+    {
+        bytes memory txData = _txChainElement.txData;
+        uint256 txDataLength = _txChainElement.txData.length;
+ 
+        bytes memory chainElement = new bytes(BYTES_TILL_TX_DATA + txDataLength);
+        uint256 ctxTimestamp = _txChainElement.timestamp;
+        uint256 ctxBlockNumber = _txChainElement.blockNumber;
+ 
+        bytes32 leafHash;
+        assembly {
+            let chainElementStart := add(chainElement, 0x20)
+ 
+            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
+            // This distinguishes sequencer ChainElements from queue ChainElements because
+            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
+            // elements is always zero
+            mstore8(chainElementStart, 1)
+ 
+            mstore(add(chainElementStart, 1), ctxTimestamp)
+            mstore(add(chainElementStart, 33), ctxBlockNumber)
+ 
+            pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart, BYTES_TILL_TX_DATA), txDataLength))
+ 
+            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, txDataLength))
+        }
+ 
+        return leafHash;
+    }
+ 
+    /**
+     * Inserts a batch into the chain of batches.
+     * @param _transactionRoot Root of the transaction tree for this batch.
+     * @param _batchSize Number of elements in the batch.
+     * @param _numQueuedTransactions Number of queue transactions in the batch.
+     * @param _timestamp The latest batch timestamp.
+     * @param _blockNumber The latest batch blockNumber.
+     */
+    function _appendBatch(
+        bytes32 _transactionRoot,
+        uint256 _batchSize,
+        uint256 _numQueuedTransactions,
+        uint40 _timestamp,
+        uint40 _blockNumber
+    )
+        internal
+    {
+        iOVM_ChainStorageContainer batchesRef = batches();
+        (uint40 totalElements, uint40 nextQueueIndex,,) = _getBatchExtraData();
+ 
+        Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({
+            batchIndex: batchesRef.length(),
+            batchRoot: _transactionRoot,
+            batchSize: _batchSize,
+            prevTotalElements: totalElements,
+            extraData: hex""
+        });
+ 
+        emit TransactionBatchAppended(
+            header.batchIndex,
+            header.batchRoot,
+            header.batchSize,
+            header.prevTotalElements,
+            header.extraData
+        );
+ 
+        bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);
+        bytes27 latestBatchContext = _makeBatchExtraData(
+            totalElements + uint40(header.batchSize),
+            nextQueueIndex + uint40(_numQueuedTransactions),
+            _timestamp,
+            _blockNumber
+        );
+ 
+        batchesRef.push(batchHeaderHash, latestBatchContext);
+    }
+ 
+    /**
+     * Checks that the first batch context in a sequencer submission is valid
+     * @param _firstContext The batch context to validate.
+     */
+    function _validateFirstBatchContext(
+        BatchContext memory _firstContext
+    )
+        internal
+        view
+    {
+        // If there are existing elements, this batch must have the same context 
+        // or a later timestamp and block number.
+        if (getTotalElements() > 0) {
+            (,, uint40 lastTimestamp, uint40 lastBlockNumber) = _getBatchExtraData();
+ 
+            require(
+                _firstContext.blockNumber >= lastBlockNumber,
+                "Context block number is lower than last submitted."
+            );
+ 
+            Irequire(
+                _firstContext.timestamp >= lastTimestamp,
+                "Context timestamp is lower than last submitted."
+            );
+        }
+ 
+        // Sequencer cannot submit contexts which are more than the force inclusion period old.
+        require(
+            _firstContext.timestamp + forceInclusionPeriodSeconds >= block.timestamp,
+            "Context timestamp too far in the past."
+        );
+ 
+        require(
+            _firstContext.blockNumber + forceInclusionPeriodBlocks >= block.number,
+            "Context block number too far in the past."
+        );
+    }
+ 
+    /**
+     * Checks that a given batch context has a time context which is below a given que element
+     * @param _context The batch context to validate has values lower.
+     * @param _queueIndex Index of the queue element we are validating came later than the context.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateContextBeforeEnqueue(
+        BatchContext memory _context,
+        uint40 _queueIndex,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+            Lib_OVMCodec.QueueElement memory nextQueueElement = _getQueueElement(
+                _queueIndex,
+                _queueRef
+            );
+ 
+            // If the force inclusion period has passed for an enqueued transaction, it MUST be the next chain element.
+            require(
+                block.timestamp < nextQueueElement.timestamp + forceInclusionPeriodSeconds,
+                "Previously enqueued batches have expired and must be appended before a new sequencer batch."
+            );
+ 
+            // Just like sequencer transaction times must be increasing relative to each other,
+            // We also require that they be increasing relative to any interspersed queue elements.
+            require(
+                _context.timestamp <= nextQueueElement.timestamp,
+                "Sequencer transaction timestamp exceeds that of next queue element."
+            );
+ 
+            require(
+                _context.blockNumber <= nextQueueElement.blockNumber,
+                "Sequencer transaction blockNumber exceeds that of next queue element."
+            );
+    }
+ 
+    /**
+     * Checks that a given batch context is valid based on its previous context, and the next queue elemtent.
+     * @param _prevContext The previously validated batch context.
+     * @param _nextContext The batch context to validate with this call.
+     * @param _nextQueueIndex Index of the next queue element to process for the _nextContext's subsequentQueueElements.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateNextBatchContext(
+        BatchContext memory _prevContext,
+        BatchContext memory _nextContext,
+        uint40 _nextQueueIndex,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+        // All sequencer transactions' times must be greater than or equal to the previous ones.
+        require(
+            _nextContext.timestamp >= _prevContext.timestamp,
+            "Context timestamp values must monotonically increase."
+        );
+ 
+        require(
+            _nextContext.blockNumber >= _prevContext.blockNumber,
+            "Context blockNumber values must monotonically increase."
+        );
+ 
+        // If there is going to be a queue element pulled in from this context:
+        if (_nextContext.numSubsequentQueueTransactions > 0) {
+            _validateContextBeforeEnqueue(
+                _nextContext,
+                _nextQueueIndex,
+                _queueRef
+            );
+        }
+    }
+ 
+    /**
+     * Checks that the final batch context in a sequencer submission is valid.
+     * @param _finalContext The batch context to validate.
+     * @param _queueLength The length of the queue at the start of the batchAppend call.
+     * @param _nextQueueIndex The next element in the queue that will be pulled into the CTC.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateFinalBatchContext(
+        BatchContext memory _finalContext,
+        uint40 _nextQueueIndex,
+        uint40 _queueLength,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+        // If the queue is not now empty, check the mononoticity of whatever the next batch that will come in is.
+        if (_queueLength - _nextQueueIndex > 0 && _finalContext.numSubsequentQueueTransactions == 0) {
+            _validateContextBeforeEnqueue(
+                _finalContext,
+                _nextQueueIndex,
+                _queueRef
+            );
+        }
+        // Batches cannot be added from the future, or subsequent enqueue() contexts would violate monotonicity.
+        require(_finalContext.timestamp <= block.timestamp, "Context timestamp is from the future.");
+        require(_finalContext.blockNumber <= block.number, "Context block number is from the future.");
+    }
+ 
+    /**
+     * Hashes a transaction chain element.
+     * @param _element Chain element to hash.
+     * @return Hash of the chain element.
+     */
+    function _hashTransactionChainElement(
+        Lib_OVMCodec.TransactionChainElement memory _element
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(
+            abi.encode(
+                _element.isSequenced,
+                _element.queueIndex,
+                _element.timestamp,
+                _element.blockNumber,
+                _element.txData
+            )
+        );
+    }
+ 
+    /**
+     * Verifies a sequencer transaction, returning true if it was indeed included in the CTC
+     * @param _transaction The transaction we are verifying inclusion of.
+     * @param _txChainElement The chain element that the transaction is claimed to be a part of.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof An inclusion proof into the CTC at a particular index.
+     * @return True if the transaction was included in the specified location, else false.
+     */
+    function _verifySequencerTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        OVM_ExecutionManager ovmExecutionManager = OVM_ExecutionManager(resolve("OVM_ExecutionManager"));
+        uint256 gasLimit = ovmExecutionManager.getMaxTransactionGasLimit();
+        bytes32 leafHash = _getSequencerLeafHash(_txChainElement);
+ 
+        Erequire(
+            _verifyElement(
+                leafHash,
+                _batchHeader,
+                _inclusionProof
+            ),
+            "Invalid Sequencer transaction inclusion proof."
+        );
+ 
+        Erequire(
+            _transaction.blockNumber        == _txChainElement.blockNumber
+            && _transaction.timestamp       == _txChainElement.timestamp
+            && _transaction.entrypoint      == resolve("OVM_DecompressionPrecompileAddress")
+            && _transaction.gasLimit        == gasLimit
+            && _transaction.l1TxOrigin      == address(0)
+            && _transaction.l1QueueOrigin   == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
+            && keccak256(_transaction.data) == keccak256(_txChainElement.txData),
+            "Invalid Sequencer transaction."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * Verifies a queue transaction, returning true if it was indeed included in the CTC
+     * @param _transaction The transaction we are verifying inclusion of.
+     * @param _queueIndex The queueIndex of the queued transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof An inclusion proof into the CTC at a particular index (should point to queue tx).
+     * @return True if the transaction was included in the specified location, else false.
+     */
+    function _verifyQueueTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        uint256 _queueIndex,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 leafHash = _getQueueLeafHash(_queueIndex);
+ 
+        Erequire(
+            _verifyElement(
+                leafHash,
+                _batchHeader,
+                _inclusionProof
+            ),
+            "Invalid Queue transaction inclusion proof."
+        );
+ 
+        bytes32 transactionHash = keccak256(
+            abi.encode(
+                _transaction.l1TxOrigin,
+                _transaction.entrypoint,
+                _transaction.gasLimit,
+                _transaction.data
+            )
+        );
+ 
+        Lib_OVMCodec.QueueElement memory el = getQueueElement(_queueIndex);
+        Erequire(
+            el.transactionHash      == transactionHash
+            && el.timestamp   == _transaction.timestamp
+            && el.blockNumber == _transaction.blockNumber,
+            "Invalid Queue transaction."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * Verifies a batch inclusion proof.
+     * @param _element Hash of the element to verify a proof for.
+     * @param _batchHeader Header of the batch in which the element was included.
+     * @param _proof Merkle inclusion proof for the element.
+     */
+    function _verifyElement(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        Erequire(
+            Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(uint32(_batchHeader.batchIndex)),
+            "Invalid batch header."
+        );
+ 
+        Erequire(
+            Lib_MerkleTree.verify(
+                _batchHeader.batchRoot,
+                _element,
+                _proof.index,
+                _proof.siblings,
+                _batchHeader.batchSize
+            ),
+            "Invalid inclusion proof."
+        );
+ 
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/chain/OVM_ChainStorageContainer.sol.html b/coverage/lcov-report/OVM/chain/OVM_ChainStorageContainer.sol.html new file mode 100644 index 000000000..537ad24b1 --- /dev/null +++ b/coverage/lcov-report/OVM/chain/OVM_ChainStorageContainer.sol.html @@ -0,0 +1,680 @@ + + + + Code coverage report for OVM/chain/OVM_ChainStorageContainer.sol + + + + + + + +
+
+

+ all files / OVM/chain/ OVM_ChainStorageContainer.sol +

+
+
+ 72.73% + Statements + 8/11 +
+
+ 50% + Branches + 1/2 +
+
+ 72.73% + Functions + 8/11 +
+
+ 75% + Lines + 9/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +504× +  +  +  +  +  +  +  +  +573× +  +  +  +573× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +550× +  +  +  +  +  +  +  +  +  +  +  +  +  +441× +  +  +  +  +  +  +  +  +  +  +  +  +470× +  +  +  +  +  +  +  +  +  +  +  +  +  +102× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_RingBuffer } from "../../libraries/utils/Lib_RingBuffer.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/**
+ * @title OVM_ChainStorageContainer
+ * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.
+ * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used
+ * in a fraud proof due to the fraud window having passed, and the associated chain state or
+ * transactions being finalized.
+ * Three distinct Chain Storage Containers will be deployed on Layer 1:
+ * 1. Stores transaction batches for the Canonical Transaction Chain
+ * 2. Stores queued transactions for the Canonical Transaction Chain
+ * 3. Stores chain state batches for the State Commitment Chain
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {
+ 
+    /*************
+     * Libraries *
+     *************/
+ 
+    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    string public owner;
+    Lib_RingBuffer.RingBuffer internal buffer;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _owner Name of the contract that owns this container (will be resolved later).
+     */
+    constructor(
+        address _libAddressManager,
+        string memory _owner
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        owner = _owner;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyOwner() {
+        Erequire(
+            msg.sender == resolve(owner),
+            "OVM_ChainStorageContainer: Function can only be called by the owner."
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function setGlobalMetadata(
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        return buffer.setExtraData(_globalMetadata);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function getGlobalMetadata()
+        override
+        public
+        view
+        returns (
+            bytes27
+        )
+    {
+        return buffer.getExtraData();
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function length()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return uint256(buffer.getLength());
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function push(
+        bytes32 _object
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.push(_object);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function push(
+        bytes32 _object,
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.push(_object, _globalMetadata);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function get(
+        uint256 _index
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        return buffer.get(uint40(_index));
+    }
+    
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.deleteElementsAfterInclusive(
+            uint40(_index)
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index,
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.deleteElementsAfterInclusive(
+            uint40(_index),
+            _globalMetadata
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function setNextOverwritableIndex(
+        uint256 _index
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.nextOverwritableIndex = _index;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/chain/OVM_StateCommitmentChain.sol.html b/coverage/lcov-report/OVM/chain/OVM_StateCommitmentChain.sol.html new file mode 100644 index 000000000..059e03525 --- /dev/null +++ b/coverage/lcov-report/OVM/chain/OVM_StateCommitmentChain.sol.html @@ -0,0 +1,1307 @@ + + + + Code coverage report for OVM/chain/OVM_StateCommitmentChain.sol + + + + + + + +
+
+

+ all files / OVM/chain/ OVM_StateCommitmentChain.sol +

+
+
+ 88.1% + Statements + 37/42 +
+
+ 67.86% + Branches + 19/28 +
+
+ 85.71% + Functions + 12/14 +
+
+ 88.64% + Lines + 39/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +60× +60× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +125× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +24× +  +  +  +  +24× +  +  +  +  +23× +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +74× +  +74× +74× +74× +  +  +  +  +  +74× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +22× +20× +  +  +  +  +  + +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
+ 
+/* Interface Imports */
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/* External Imports */
+import '@openzeppelin/contracts/math/SafeMath.sol';
+ 
+/**
+ * @title OVM_StateCommitmentChain
+ * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which
+ * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).
+ * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique
+ * state root calculated off-chain by applying the canonical transactions one by one.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 public FRAUD_PROOF_WINDOW;
+    uint256 public SEQUENCER_PUBLISH_WINDOW;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager,
+        uint256 _fraudProofWindow,
+        uint256 _sequencerPublishWindow
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        FRAUD_PROOF_WINDOW = _fraudProofWindow;
+        SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:SCC:batches")
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getTotalElements()
+        override
+        public
+        view
+        returns (
+            uint256 _totalElements
+        )
+    {
+        (uint40 totalElements, ) = _getBatchExtraData();
+        return uint256(totalElements);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getTotalBatches()
+        override
+        public
+        view
+        returns (
+            uint256 _totalBatches
+        )
+    {
+        return batches().length();
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getLastSequencerTimestamp()
+        override
+        public
+        view
+        returns (
+            uint256 _lastSequencerTimestamp
+        )
+    {
+        (, uint40 lastSequencerTimestamp) = _getBatchExtraData();
+        return uint256(lastSequencerTimestamp);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function appendStateBatch(
+        bytes32[] memory _batch,
+        uint256 _shouldStartAtElement
+    )
+        override
+        public
+    {
+        // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the
+        // publication of batches by some other user.
+        require(
+            _shouldStartAtElement == getTotalElements(),
+            "Actual batch start index does not match expected start index."
+        );
+ 
+        // Proposers must have previously staked at the BondManager
+        Erequire(
+            iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender),
+            "Proposer does not have enough collateral posted"
+        );
+ 
+        require(
+            _batch.length > 0,
+            "Cannot submit an empty state batch."
+        );
+ 
+        require(
+            getTotalElements() + _batch.length <= iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(),
+            "Number of state roots cannot exceed the number of canonical transactions."
+        );
+ 
+        // Pass the block's timestamp and the publisher of the data
+        // to be used in the fraud proofs
+        _appendBatch(
+            _batch,
+            abi.encode(block.timestamp, msg.sender)
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function deleteStateBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        override
+        public
+    {
+        require(
+            msg.sender == resolve("OVM_FraudVerifier"),
+            "State batches can only be deleted by the OVM_FraudVerifier."
+        );
+ 
+        require(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        Erequire(
+            insideFraudProofWindow(_batchHeader),
+            "State batches can only be deleted within the fraud proof window."
+        );
+ 
+        _deleteBatch(_batchHeader);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function verifyStateCommitment(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        require(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        require(
+            Lib_MerkleTree.verify(
+                _batchHeader.batchRoot,
+                _element,
+                _proof.index,
+                _proof.siblings,
+                _batchHeader.batchSize
+            ),
+            "Invalid inclusion proof."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function insideFraudProofWindow(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        override
+        public
+        view
+        returns (
+            bool _inside
+        )
+    {
+        (uint256 timestamp,) = abi.decode(
+            _batchHeader.extraData,
+            (uint256, address)
+        );
+ 
+        Erequire(
+            timestamp != 0,
+            "Batch header timestamp cannot be zero"
+        );
+        return SafeMath.add(timestamp, FRAUD_PROOF_WINDOW) > block.timestamp;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Parses the batch context from the extra data.
+     * @return Total number of elements submitted.
+     * @return Timestamp of the last batch submitted by the sequencer.
+     */
+    function _getBatchExtraData()
+        internal
+        view
+        returns (
+            uint40,
+            uint40
+        )
+    {
+        bytes27 extraData = batches().getGlobalMetadata();
+ 
+        uint40 totalElements;
+        uint40 lastSequencerTimestamp;
+        assembly {
+            extraData              := shr(40, extraData)
+            totalElements          :=         and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            lastSequencerTimestamp := shr(40, and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
+        }
+ 
+        return (
+            totalElements,
+            lastSequencerTimestamp
+        );
+    }
+ 
+    /**
+     * Encodes the batch context for the extra data.
+     * @param _totalElements Total number of elements submitted.
+     * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.
+     * @return Encoded batch context.
+     */
+    function _makeBatchExtraData(
+        uint40 _totalElements,
+        uint40 _lastSequencerTimestamp
+    )
+        internal
+        pure
+        returns (
+            bytes27
+        )
+    {
+        bytes27 extraData;
+        assembly {
+            extraData := _totalElements
+            extraData := or(extraData, shl(40, _lastSequencerTimestamp))
+            extraData := shl(40, extraData)
+        }
+ 
+        return extraData;
+    }
+ 
+    /**
+     * Appends a batch to the chain.
+     * @param _batch Elements within the batch.
+     * @param _extraData Any extra data to append to the batch.
+     */
+    function _appendBatch(
+        bytes32[] memory _batch,
+        bytes memory _extraData
+    )
+        internal
+    {
+        address sequencer = resolve("OVM_Proposer");
+        (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();
+ 
+        if (msg.sender == sequencer) {
+            lastSequencerTimestamp = uint40(block.timestamp);
+        } else {
+            // We keep track of the last batch submitted by the sequencer so there's a window in
+            // which only the sequencer can publish state roots. A window like this just reduces
+            // the chance of "system breaking" state roots being published while we're still in
+            // testing mode. This window should be removed or significantly reduced in the future.
+            require(
+                lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,
+                "Cannot publish state roots within the sequencer publication window."
+            );
+        }
+ 
+        // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place
+        // while calculating the root hash therefore any arguments passed to it must not
+        // be used again afterwards
+        Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({
+            batchIndex: getTotalBatches(),
+            batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),
+            batchSize: _batch.length,
+            prevTotalElements: totalElements,
+            extraData: _extraData
+        });
+ 
+        emit StateBatchAppended(
+            batchHeader.batchIndex,
+            batchHeader.batchRoot,
+            batchHeader.batchSize,
+            batchHeader.prevTotalElements,
+            batchHeader.extraData
+        );
+ 
+        batches().push(
+            Lib_OVMCodec.hashBatchHeader(batchHeader),
+            _makeBatchExtraData(
+                uint40(batchHeader.prevTotalElements + batchHeader.batchSize),
+                lastSequencerTimestamp
+            )
+        );
+    }
+ 
+    /**
+     * Removes a batch and all subsequent batches from the chain.
+     * @param _batchHeader Header of the batch to remove.
+     */
+    function _deleteBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+    {
+        Erequire(
+            _batchHeader.batchIndex < batches().length(),
+            "Invalid batch index."
+        );
+ 
+        Erequire(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        batches().deleteElementsAfterInclusive(
+            _batchHeader.batchIndex,
+            _makeBatchExtraData(
+                uint40(_batchHeader.prevTotalElements),
+                0
+            )
+        );
+ 
+        emit StateBatchDeleted(
+            _batchHeader.batchIndex,
+            _batchHeader.batchRoot
+        );
+    }
+ 
+    /**
+     * Checks that a batch header matches the stored hash for the given index.
+     * @param _batchHeader Batch header to validate.
+     * @return Whether or not the header matches the stored one.
+     */
+    function _isValidBatchHeader(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/chain/index.html b/coverage/lcov-report/OVM/chain/index.html new file mode 100644 index 000000000..3b8188133 --- /dev/null +++ b/coverage/lcov-report/OVM/chain/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for OVM/chain/ + + + + + + + +
+
+

+ all files OVM/chain/ +

+
+
+ 92.82% + Statements + 194/209 +
+
+ 81.37% + Branches + 83/102 +
+
+ 82.46% + Functions + 47/57 +
+
+ 93.36% + Lines + 211/226 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_CanonicalTransactionChain.sol
95.51%149/15687.5%63/7284.38%27/3295.88%163/170
OVM_ChainStorageContainer.sol
72.73%8/1150%1/272.73%8/1175%9/12
OVM_StateCommitmentChain.sol
88.1%37/4267.86%19/2885.71%12/1488.64%39/44
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/execution/OVM_ExecutionManager.sol.html b/coverage/lcov-report/OVM/execution/OVM_ExecutionManager.sol.html new file mode 100644 index 000000000..774beb5aa --- /dev/null +++ b/coverage/lcov-report/OVM/execution/OVM_ExecutionManager.sol.html @@ -0,0 +1,5654 @@ + + + + Code coverage report for OVM/execution/OVM_ExecutionManager.sol + + + + + + + +
+
+

+ all files / OVM/execution/ OVM_ExecutionManager.sol +

+
+
+ 74.58% + Statements + 176/236 +
+
+ 62.2% + Branches + 51/82 +
+
+ 83.61% + Functions + 51/61 +
+
+ 75.21% + Lines + 182/242 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244 +1245 +1246 +1247 +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1310 +1311 +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319 +1320 +1321 +1322 +1323 +1324 +1325 +1326 +1327 +1328 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1348 +1349 +1350 +1351 +1352 +1353 +1354 +1355 +1356 +1357 +1358 +1359 +1360 +1361 +1362 +1363 +1364 +1365 +1366 +1367 +1368 +1369 +1370 +1371 +1372 +1373 +1374 +1375 +1376 +1377 +1378 +1379 +1380 +1381 +1382 +1383 +1384 +1385 +1386 +1387 +1388 +1389 +1390 +1391 +1392 +1393 +1394 +1395 +1396 +1397 +1398 +1399 +1400 +1401 +1402 +1403 +1404 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1424 +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432 +1433 +1434 +1435 +1436 +1437 +1438 +1439 +1440 +1441 +1442 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +1458 +1459 +1460 +1461 +1462 +1463 +1464 +1465 +1466 +1467 +1468 +1469 +1470 +1471 +1472 +1473 +1474 +1475 +1476 +1477 +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489 +1490 +1491 +1492 +1493 +1494 +1495 +1496 +1497 +1498 +1499 +1500 +1501 +1502 +1503 +1504 +1505 +1506 +1507 +1508 +1509 +1510 +1511 +1512 +1513 +1514 +1515 +1516 +1517 +1518 +1519 +1520 +1521 +1522 +1523 +1524 +1525 +1526 +1527 +1528 +1529 +1530 +1531 +1532 +1533 +1534 +1535 +1536 +1537 +1538 +1539 +1540 +1541 +1542 +1543 +1544 +1545 +1546 +1547 +1548 +1549 +1550 +1551 +1552 +1553 +1554 +1555 +1556 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1576 +1577 +1578 +1579 +1580 +1581 +1582 +1583 +1584 +1585 +1586 +1587 +1588 +1589 +1590 +1591 +1592 +1593 +1594 +1595 +1596 +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609 +1610 +1611 +1612 +1613 +1614 +1615 +1616 +1617 +1618 +1619 +1620 +1621 +1622 +1623 +1624 +1625 +1626 +1627 +1628 +1629 +1630 +1631 +1632 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1652 +1653 +1654 +1655 +1656 +1657 +1658 +1659 +1660 +1661 +1662 +1663 +1664 +1665 +1666 +1667 +1668 +1669 +1670 +1671 +1672 +1673 +1674 +1675 +1676 +1677 +1678 +1679 +1680 +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688 +1689 +1690 +1691 +1692 +1693 +1694 +1695 +1696 +1697 +1698 +1699 +1700 +1701 +1702 +1703 +1704 +1705 +1706 +1707 +1708 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +1720 +1721 +1722 +1723 +1724 +1725 +1726 +1727 +1728 +1729 +1730 +1731 +1732 +1733 +1734 +1735 +1736 +1737 +1738 +1739 +1740 +1741 +1742 +1743 +1744 +1745 +1746 +1747 +1748 +1749 +1750 +1751 +1752 +1753 +1754 +1755 +1756 +1757 +1758 +1759 +1760 +1761 +1762 +1763 +1764 +1765 +1766 +1767 +1768 +1769 +1770 +1771 +1772 +1773 +1774 +1775 +1776 +1777 +1778 +1779 +1780 +1781 +1782 +1783 +1784 +1785 +1786 +1787 +1788 +1789 +1790 +1791 +1792 +1793 +1794 +1795 +1796 +1797 +1798 +1799 +1800 +1801 +1802 +1803 +1804 +1805 +1806 +1807 +1808 +1809 +1810 +1811 +1812 +1813 +1814 +1815 +1816 +1817 +1818 +1819 +1820 +1821 +1822 +1823 +1824 +1825 +1826 +1827 +1828 +1829 +1830 +1831 +1832 +1833 +1834 +1835 +1836 +1837 +1838 +1839 +1840 +1841 +1842 +1843 +1844 +1845 +1846 +1847 +1848 +1849 +1850 +1851 +1852 +1853 +1854 +1855 +1856 +1857 +1858 +1859 +1860 +1861 +1862 +1863 +1864  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +55× +55× +55× +  +  +55× +46× +  +  +  +  +  +  +  +  +  +  +  +201× +201× +192× +  +  +192× +165× +  +  +27× +  +  +  +  +  +  +  +42× + +  +38× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +150× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +  +  +  +28× +  +  +27× +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  + + +  +  +  + +  +  + +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +154× +154× +154× +  +154× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +48× +  +48× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +  +29× +  +29× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +27× +27× +27× +  +  +  +27× +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +172× +  +  +  +  + +  +  +  +171× +  +  +  +  +169× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +196× +196× +  +  +  +  +  +196× +196× +196× +  +  +  +  +  +  +  +196× +  +  +  +  +  +196× +  +  +  +196× +  +  +  +196× +23× +  +  +  +  +  +  +  +  +  +23× + +  +  +  +  +  +18× +  +  +  +  +  +14× +  +  +  +  +18× +  +  +  +10× +  + +  +  +  +  +  +  +  +18× +  +  +  +191× +  +191× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +27× +  +  +27× +  +27× +  +  +10× +10× +10× +10× +  +  +  +  +  +  +  +10× +  +  +  +  +17× +17× + +  +  +  +  +  +  +  +  +  +  +16× +  +  +  +  +  +  +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +29× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +57× +57× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +369× +367× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +17× +17× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +55× +55× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +535× +  +  +  +  +535× + +  +  +  +  +533× +  +  +  +  +  +533× +144× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +53× +  +  +  +53× +  +  +  +  +  +53× +47× +47× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +62× +  +  +  +  +  +  +62× +  +  +  +  +  +62× +  +  +  +  +  +62× +46× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  + +  +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +20× + +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× + +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +196× +  +  +  +  +  +  +  +  +  +  +  +  +  +244× +  +  +  +244× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +392× +202× +  +  +  +392× +308× +  +  +  +392× +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +27× +27× +27× +  +27× +  +27× +27× +27× +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
+import { Lib_ErrorUtils } from "../../libraries/utils/Lib_ErrorUtils.sol";
+ 
+/* Interface Imports */
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
+ 
+/* Contract Imports */
+import { OVM_ECDSAContractAccount } from "../accounts/OVM_ECDSAContractAccount.sol";
+import { OVM_ProxyEOA } from "../accounts/OVM_ProxyEOA.sol";
+import { OVM_DeployerWhitelist } from "../predeploys/OVM_DeployerWhitelist.sol";
+ 
+/**
+ * @title OVM_ExecutionManager
+ * @dev The Execution Manager (EM) is the core of our OVM implementation, and provides a sandboxed
+ * environment allowing us to execute OVM transactions deterministically on either Layer 1 or
+ * Layer 2.
+ * The EM's run() function is the first function called during the execution of any
+ * transaction on L2.
+ * For each context-dependent EVM operation the EM has a function which implements a corresponding
+ * OVM operation, which will read state from the State Manager contract.
+ * The EM relies on the Safety Checker to verify that code deployed to Layer 2 does not contain any
+ * context-dependent operations.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    iOVM_SafetyChecker internal ovmSafetyChecker;
+    iOVM_StateManager internal ovmStateManager;
+ 
+ 
+    /*******************************
+     * Execution Context Variables *
+     *******************************/
+ 
+    GasMeterConfig internal gasMeterConfig;
+    GlobalContext internal globalContext;
+    TransactionContext internal transactionContext;
+    MessageContext internal messageContext;
+    TransactionRecord internal transactionRecord;
+    MessageRecord internal messageRecord;
+ 
+ 
+    /**************************
+     * Gas Metering Constants *
+     **************************/
+ 
+    address constant GAS_METADATA_ADDRESS = 0x06a506A506a506A506a506a506A506A506A506A5;
+    uint256 constant NUISANCE_GAS_SLOAD = 20000;
+    uint256 constant NUISANCE_GAS_SSTORE = 20000;
+    uint256 constant MIN_NUISANCE_GAS_PER_CONTRACT = 30000;
+    uint256 constant NUISANCE_GAS_PER_CONTRACT_BYTE = 100;
+    uint256 constant MIN_GAS_FOR_INVALID_STATE_ACCESS = 30000;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager,
+        GasMeterConfig memory _gasMeterConfig,
+        GlobalContext memory _globalContext
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        ovmSafetyChecker = iOVM_SafetyChecker(resolve("OVM_SafetyChecker"));
+        gasMeterConfig = _gasMeterConfig;
+        globalContext = _globalContext;
+        _resetContext();
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Applies dynamically-sized refund to a transaction to account for the difference in execution
+     * between L1 and L2, so that the overall cost of the ovmOPCODE is fixed.
+     * @param _cost Desired gas cost for the function after the refund.
+     */
+    modifier netGasCost(
+        uint256 _cost
+    ) {
+        uint256 gasProvided = gasleft();
+        _;
+        uint256 gasUsed = gasProvided - gasleft();
+ 
+        // We want to refund everything *except* the specified cost.
+        if (_cost < gasUsed) {
+            transactionRecord.ovmGasRefund += gasUsed - _cost;
+        }
+    }
+ 
+    /**
+     * Applies a fixed-size gas refund to a transaction to account for the difference in execution
+     * between L1 and L2, so that the overall cost of an ovmOPCODE can be lowered.
+     * @param _discount Amount of gas cost to refund for the ovmOPCODE.
+     */
+    modifier fixedGasDiscount(
+        uint256 _discount
+    ) {
+        uint256 gasProvided = gasleft();
+        _;
+        uint256 gasUsed = gasProvided - gasleft();
+ 
+        // We want to refund the specified _discount, unless this risks underflow.
+        if (_discount < gasUsed) {
+            transactionRecord.ovmGasRefund += _discount;
+        } else {
+            // refund all we can without risking underflow.
+            transactionRecord.ovmGasRefund += gasUsed;
+        }
+    }
+ 
+    /**
+     * Makes sure we're not inside a static context.
+     */
+    modifier notStatic() {
+        if (messageContext.isStatic == true) {
+            _revertWithFlag(RevertFlag.STATIC_VIOLATION);
+        }
+        _;
+    }
+ 
+ 
+    /************************************
+     * Transaction Execution Entrypoint *
+     ************************************/
+ 
+    /**
+     * Starts the execution of a transaction via the OVM_ExecutionManager.
+     * @param _transaction Transaction data to be executed.
+     * @param _ovmStateManager iOVM_StateManager implementation providing account state.
+     */
+    function run(
+        Lib_OVMCodec.Transaction memory _transaction,
+        address _ovmStateManager
+    )
+        override
+        public
+    {
+        require(transactionContext.ovmNUMBER == 0, "Only be callable at the start of a transaction");
+        // Store our OVM_StateManager instance (significantly easier than attempting to pass the
+        // address around in calldata).
+        ovmStateManager = iOVM_StateManager(_ovmStateManager);
+ 
+        // Make sure this function can't be called by anyone except the owner of the
+        // OVM_StateManager (expected to be an OVM_StateTransitioner). We can revert here because
+        // this would make the `run` itself invalid.
+        require(
+            // This method may return false during fraud proofs, but always returns true in L2 nodes' State Manager precompile.
+            ovmStateManager.isAuthenticated(msg.sender),
+            "Only authenticated addresses in ovmStateManager can call this function"
+        );
+ 
+        // Initialize the execution context, must be initialized before we perform any gas metering
+        // or we'll throw a nuisance gas error.
+        _initContext(_transaction);
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Check whether we need to start a new epoch, do so if necessary.
+        // _checkNeedsNewEpoch(_transaction.timestamp);
+ 
+        // Make sure the transaction's gas limit is valid. We don't revert here because we reserve
+        // reverts for INVALID_STATE_ACCESS.
+        if (_isValidGasLimit(_transaction.gasLimit, _transaction.l1QueueOrigin) == false) {
+            _resetContext();
+            return;
+        }
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Check gas right before the call to get total gas consumed by OVM transaction.
+        // uint256 gasProvided = gasleft();
+ 
+        // Run the transaction, make sure to meter the gas usage.
+        ovmCALL(
+            _transaction.gasLimit - gasMeterConfig.minTransactionGasLimit,
+            _transaction.entrypoint,
+            _transaction.data
+        );
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Update the cumulative gas based on the amount of gas used.
+        // uint256 gasUsed = gasProvided - gasleft();
+        // _updateCumulativeGas(gasUsed, _transaction.l1QueueOrigin);
+ 
+        // Wipe the execution context.
+        _resetContext();
+ 
+        // Reset the ovmStateManager.
+        ovmStateManager = iOVM_StateManager(address(0));
+    }
+ 
+ 
+    /******************************
+     * Opcodes: Execution Context *
+     ******************************/
+ 
+    /**
+     * @notice Overrides CALLER.
+     * @return _CALLER Address of the CALLER within the current message context.
+     */
+    function ovmCALLER()
+        override
+        public
+        view
+        returns (
+            address _CALLER
+        )
+    {
+        return messageContext.ovmCALLER;
+    }
+ 
+    /**
+     * @notice Overrides ADDRESS.
+     * @return _ADDRESS Active ADDRESS within the current message context.
+     */
+    function ovmADDRESS()
+        override
+        public
+        view
+        returns (
+            address _ADDRESS
+        )
+    {
+        return messageContext.ovmADDRESS;
+    }
+ 
+    /**
+     * @notice Overrides TIMESTAMP.
+     * @return _TIMESTAMP Value of the TIMESTAMP within the transaction context.
+     */
+    function ovmTIMESTAMP()
+        override
+        public
+        view
+        returns (
+            uint256 _TIMESTAMP
+        )
+    {
+        return transactionContext.ovmTIMESTAMP;
+    }
+ 
+    /**
+     * @notice Overrides NUMBER.
+     * @return _NUMBER Value of the NUMBER within the transaction context.
+     */
+    function ovmNUMBER()
+        override
+        public
+        view
+        returns (
+            uint256 _NUMBER
+        )
+    {
+        return transactionContext.ovmNUMBER;
+    }
+ 
+    /**
+     * @notice Overrides GASLIMIT.
+     * @return _GASLIMIT Value of the block's GASLIMIT within the transaction context.
+     */
+    function ovmGASLIMIT()
+        override
+        public
+        view
+        returns (
+            uint256 _GASLIMIT
+        )
+    {
+        return transactionContext.ovmGASLIMIT;
+    }
+ 
+    /**
+     * @notice Overrides CHAINID.
+     * @return _CHAINID Value of the chain's CHAINID within the global context.
+     */
+    function ovmCHAINID()
+        override
+        public
+        view
+        returns (
+            uint256 _CHAINID
+        )
+    {
+        return globalContext.ovmCHAINID;
+    }
+ 
+    /*********************************
+     * Opcodes: L2 Execution Context *
+     *********************************/
+ 
+    /**
+     * @notice Specifies from which L1 rollup queue this transaction originated from.
+     * @return _queueOrigin Address of the ovmL1QUEUEORIGIN within the current message context.
+     */
+    function ovmL1QUEUEORIGIN()
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.QueueOrigin _queueOrigin
+        )
+    {
+        return transactionContext.ovmL1QUEUEORIGIN;
+    }
+ 
+    /**
+     * @notice Specifies which L1 account, if any, sent this transaction by calling enqueue().
+     * @return _l1TxOrigin Address of the account which sent the tx into L2 from L1.
+     */
+    function ovmL1TXORIGIN()
+        override
+        public
+        view
+        returns (
+            address _l1TxOrigin
+        )
+    {
+        return transactionContext.ovmL1TXORIGIN;
+    }
+ 
+    /********************
+     * Opcodes: Halting *
+     ********************/
+ 
+    /**
+     * @notice Overrides REVERT.
+     * @param _data Bytes data to pass along with the REVERT.
+     */
+    function ovmREVERT(
+        bytes memory _data
+    )
+        override
+        public
+    {
+        _revertWithFlag(RevertFlag.INTENTIONAL_REVERT, _data);
+    }
+ 
+ 
+    /******************************
+     * Opcodes: Contract Creation *
+     ******************************/
+ 
+    /**
+     * @notice Overrides CREATE.
+     * @param _bytecode Code to be used to CREATE a new contract.
+     * @return Address of the created contract.
+     * @return Revert data, if and only if the creation threw an exception.
+     */
+    function ovmCREATE(
+        bytes memory _bytecode
+    )
+        override
+        public
+        notStatic
+        fixedGasDiscount(40000)
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // Creator is always the current ADDRESS.
+        address creator = ovmADDRESS();
+ 
+        // Check that the deployer is whitelisted, or
+        // that arbitrary contract deployment has been enabled.
+        _checkDeployerAllowed(creator);
+ 
+        // Generate the correct CREATE address.
+        address contractAddress = Lib_EthUtils.getAddressForCREATE(
+            creator,
+            _getAccountNonce(creator)
+        );
+ 
+        return _createContract(
+            contractAddress,
+            _bytecode
+        );
+    }
+ 
+    /**
+     * @notice Overrides CREATE2.
+     * @param _bytecode Code to be used to CREATE2 a new contract.
+     * @param _salt Value used to determine the contract's address.
+     * @return Address of the created contract.
+     * @return Revert data, if and only if the creation threw an exception.
+     */
+    function ovmCREATE2(
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        override
+        public
+        notStatic
+        fixedGasDiscount(40000)
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // Creator is always the current ADDRESS.
+        address creator = ovmADDRESS();
+ 
+        // Check that the deployer is whitelisted, or
+        // that arbitrary contract deployment has been enabled.
+        _checkDeployerAllowed(creator);
+ 
+        // Generate the correct CREATE2 address.
+        address contractAddress = Lib_EthUtils.getAddressForCREATE2(
+            creator,
+            _bytecode,
+            _salt
+        );
+ 
+        return _createContract(
+            contractAddress,
+            _bytecode
+        );
+    }
+ 
+ 
+    /*******************************
+     * Account Abstraction Opcodes *
+     ******************************/
+ 
+    /**
+     * Retrieves the nonce of the current ovmADDRESS.
+     * @return _nonce Nonce of the current contract.
+     */
+    function ovmGETNONCE()
+        override
+        public
+        returns (
+            uint256 _nonce
+        )
+    {
+        return _getAccountNonce(ovmADDRESS());
+    }
+ 
+    /**
+     * Sets the nonce of the current ovmADDRESS.
+     * @param _nonce New nonce for the current contract.
+     */
+    function ovmSETNONCE(
+        uint256 _nonce
+    )
+        override
+        public
+        notStatic
+    {
+        _setAccountNonce(ovmADDRESS(), _nonce);
+    }
+ 
+    /**
+     * Creates a new EOA contract account, for account abstraction.
+     * @dev Essentially functions like ovmCREATE or ovmCREATE2, but we can bypass a lot of checks
+     *      because the contract we're creating is trusted (no need to do safety checking or to
+     *      handle unexpected reverts). Doesn't need to return an address because the address is
+     *      assumed to be the user's actual address.
+     * @param _messageHash Hash of a message signed by some user, for verification.
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     */
+    function ovmCREATEEOA(
+        bytes32 _messageHash,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        override
+        public
+        notStatic
+    {
+        // Recover the EOA address from the message hash and signature parameters. Since we do the
+        // hashing in advance, we don't have handle different message hashing schemes. Even if this
+        // function were to return the wrong address (rather than explicitly returning the zero
+        // address), the rest of the transaction would simply fail (since there's no EOA account to
+        // actually execute the transaction).
+        address eoa = ecrecover(
+            _messageHash,
+            _v + 27,
+            _r,
+            _s
+        );
+ 
+        // Invalid signature is a case we proactively handle with a revert. We could alternatively
+        // have this function return a `success` boolean, but this is just easier.
+        Iif (eoa == address(0)) {
+            ovmREVERT(bytes("Signature provided for EOA contract creation is invalid."));
+        }
+ 
+        // If the user already has an EOA account, then there's no need to perform this operation.
+        Iif (_hasEmptyAccount(eoa) == false) {
+            return;
+        }
+ 
+        // We always need to initialize the contract with the default account values.
+        _initPendingAccount(eoa);
+ 
+        // Temporarily set the current address so it's easier to access on L2.
+        address prevADDRESS = messageContext.ovmADDRESS;
+        messageContext.ovmADDRESS = eoa;
+ 
+        // Now actually create the account and get its bytecode. We're not worried about reverts
+        // (other than out of gas, which we can't capture anyway) because this contract is trusted.
+        OVM_ProxyEOA proxyEOA = new OVM_ProxyEOA(0x4200000000000000000000000000000000000003);
+ 
+        // Reset the address now that we're done deploying.
+        messageContext.ovmADDRESS = prevADDRESS;
+ 
+        // Commit the account with its final values.
+        _commitPendingAccount(
+            eoa,
+            address(proxyEOA),
+            keccak256(Lib_EthUtils.getCode(address(proxyEOA)))
+        );
+ 
+        _setAccountNonce(eoa, 0);
+    }
+ 
+ 
+    /*********************************
+     * Opcodes: Contract Interaction *
+     *********************************/
+ 
+    /**
+     * @notice Overrides CALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmCALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(100000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // CALL updates the CALLER and ADDRESS.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _address;
+ 
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+    /**
+     * @notice Overrides STATICCALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmSTATICCALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(80000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // STATICCALL updates the CALLER, updates the ADDRESS, and runs in a static context.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _address;
+        nextMessageContext.isStatic = true;
+ 
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+    /**
+     * @notice Overrides DELEGATECALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmDELEGATECALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(40000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // DELEGATECALL does not change anything about the message context.
+        MessageContext memory nextMessageContext = messageContext;
+        
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+ 
+    /************************************
+     * Opcodes: Contract Storage Access *
+     ************************************/
+ 
+    /**
+     * @notice Overrides SLOAD.
+     * @param _key 32 byte key of the storage slot to load.
+     * @return _value 32 byte value of the requested storage slot.
+     */
+    function ovmSLOAD(
+        bytes32 _key
+    )
+        override
+        public
+        netGasCost(40000)
+        returns (
+            bytes32 _value
+        )
+    {
+        // We always SLOAD from the storage of ADDRESS.
+        address contractAddress = ovmADDRESS();
+ 
+        return _getContractStorage(
+            contractAddress,
+            _key
+        );
+    }
+ 
+    /**
+     * @notice Overrides SSTORE.
+     * @param _key 32 byte key of the storage slot to set.
+     * @param _value 32 byte value for the storage slot.
+     */
+    function ovmSSTORE(
+        bytes32 _key,
+        bytes32 _value
+    )
+        override
+        public
+        notStatic
+        netGasCost(60000)
+    {
+        // We always SSTORE to the storage of ADDRESS.
+        address contractAddress = ovmADDRESS();
+ 
+        _putContractStorage(
+            contractAddress,
+            _key,
+            _value
+        );
+    }
+ 
+ 
+    /*********************************
+     * Opcodes: Contract Code Access *
+     *********************************/
+ 
+    /**
+     * @notice Overrides EXTCODECOPY.
+     * @param _contract Address of the contract to copy code from.
+     * @param _offset Offset in bytes from the start of contract code to copy beyond.
+     * @param _length Total number of bytes to copy from the contract's code.
+     * @return _code Bytes of code copied from the requested contract.
+     */
+    function ovmEXTCODECOPY(
+        address _contract,
+        uint256 _offset,
+        uint256 _length
+    )
+        override
+        public
+        returns (
+            bytes memory _code
+        )
+    {
+        // `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of
+        // return data. By blocking reads of one byte, we're able to use the condition that an
+        // OVM_ExecutionManager function return value having a length of exactly one byte indicates
+        // an error without an explicit revert. If users were able to read a single byte, they
+        // could forcibly trigger behavior that should only be available to this contract.
+        uint256 length = _length == 1 ? 2 : _length;
+ 
+        return Lib_EthUtils.getCode(
+            _getAccountEthAddress(_contract),
+            _offset,
+            length
+        );
+    }
+ 
+    /**
+     * @notice Overrides EXTCODESIZE.
+     * @param _contract Address of the contract to query the size of.
+     * @return _EXTCODESIZE Size of the requested contract in bytes.
+     */
+    function ovmEXTCODESIZE(
+        address _contract
+    )
+        override
+        public
+        returns (
+            uint256 _EXTCODESIZE
+        )
+    {
+        return Lib_EthUtils.getCodeSize(
+            _getAccountEthAddress(_contract)
+        );
+    }
+ 
+    /**
+     * @notice Overrides EXTCODEHASH.
+     * @param _contract Address of the contract to query the hash of.
+     * @return _EXTCODEHASH Hash of the requested contract.
+     */
+    function ovmEXTCODEHASH(
+        address _contract
+    )
+        override
+        public
+        returns (
+            bytes32 _EXTCODEHASH
+        )
+    {
+        return Lib_EthUtils.getCodeHash(
+            _getAccountEthAddress(_contract)
+        );
+    }
+ 
+    /***************************************
+     * Public Functions: Execution Context *
+     ***************************************/
+ 
+    function getMaxTransactionGasLimit()
+        external
+        view
+        override
+        returns (
+            uint256 _maxTransactionGasLimit
+        )
+    {
+        return gasMeterConfig.maxTransactionGasLimit;
+    }
+ 
+    /********************************************
+     * Public Functions: Deployment Whitelisting *
+     ********************************************/
+ 
+    /**
+     * Checks whether the given address is on the whitelist to ovmCREATE/ovmCREATE2, and reverts if not.
+     * @param _deployerAddress Address attempting to deploy a contract.
+     */
+    function _checkDeployerAllowed(
+        address _deployerAddress
+    )
+        internal
+    {
+        // From an OVM semantics perspective, this will appear identical to
+        // the deployer ovmCALLing the whitelist.  This is fine--in a sense, we are forcing them to.
+        (bool success, bytes memory data) = ovmCALL(
+            gasleft(),
+            0x4200000000000000000000000000000000000002,
+            abi.encodeWithSignature("isDeployerAllowed(address)", _deployerAddress)
+        );
+        bool isAllowed = abi.decode(data, (bool));
+ 
+        if (!isAllowed || !success) {
+            _revertWithFlag(RevertFlag.CREATOR_NOT_ALLOWED);
+        }
+    }
+ 
+    /********************************************
+     * Internal Functions: Contract Interaction *
+     ********************************************/
+ 
+    /**
+     * Creates a new contract and associates it with some contract address.
+     * @param _contractAddress Address to associate the created contract with.
+     * @param _bytecode Bytecode to be used to create the contract.
+     * @return Final OVM contract address.
+     * @return Revertdata, if and only if the creation threw an exception.
+     */
+    function _createContract(
+        address _contractAddress,
+        bytes memory _bytecode
+    )
+        internal
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // We always update the nonce of the creating account, even if the creation fails.
+        _setAccountNonce(ovmADDRESS(), _getAccountNonce(ovmADDRESS()) + 1);
+ 
+        // We're stepping into a CREATE or CREATE2, so we need to update ADDRESS to point
+        // to the contract's associated address and CALLER to point to the previous ADDRESS.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = messageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _contractAddress;
+ 
+        // Run the common logic which occurs between call-type and create-type messages,
+        // passing in the creation bytecode and `true` to trigger create-specific logic.
+        (bool success, bytes memory data) = _handleExternalMessage(
+            nextMessageContext,
+            gasleft(),
+            _contractAddress,
+            _bytecode,
+            true
+        );
+ 
+        // Yellow paper requires that address returned is zero if the contract deployment fails.
+        return (
+            success ? _contractAddress : address(0),
+            data
+        );
+    }
+ 
+    /**
+     * Calls the deployed contract associated with a given address.
+     * @param _nextMessageContext Message context to be used for the call.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _contract OVM address to be called.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function _callContract(
+        MessageContext memory _nextMessageContext,
+        uint256 _gasLimit,
+        address _contract,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // We reserve addresses of the form 0xdeaddeaddead...NNNN for the container contracts in L2 geth.
+        // So, we block calls to these addresses since they are not safe to run as an OVM contract itself.
+        if (
+            (uint256(_contract) & uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000))
+            == uint256(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000)
+        ) {
+            // EVM does not return data in the success case, see: https://github.com/ethereum/go-ethereum/blob/aae7660410f0ef90279e14afaaf2f429fdc2a186/core/vm/instructions.go#L600-L604
+            return (true, hex'');
+        }
+ 
+        // Both 0x0000... and the EVM precompiles have the same address on L1 and L2 --> no trie lookup needed.
+        address codeContractAddress =
+            uint(_contract) < 100
+            ? _contract
+            : _getAccountEthAddress(_contract);
+ 
+        return _handleExternalMessage(
+            _nextMessageContext,
+            _gasLimit,
+            codeContractAddress,
+            _calldata,
+            false
+        );
+    }
+ 
+    /**
+     * Handles all interactions which involve the execution manager calling out to untrusted code (both calls and creates).
+     * Ensures that OVM-related measures are enforced, including L2 gas refunds, nuisance gas, and flagged reversions.
+     * 
+     * @param _nextMessageContext Message context to be used for the external message.
+     * @param _gasLimit Amount of gas to be passed into this message.
+     * @param _contract OVM address being called or deployed to
+     * @param _data Data for the message (either calldata or creation code)
+     * @param _isCreate Whether this is a create-type message.
+     * @return Whether or not the message (either a call or deployment) succeeded.
+     * @return Data returned by the message.
+     */
+    function _handleExternalMessage(
+        MessageContext memory _nextMessageContext,
+        uint256 _gasLimit,
+        address _contract,
+        bytes memory _data,
+        bool _isCreate
+    )
+        internal
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        // We need to switch over to our next message context for the duration of this call.
+        MessageContext memory prevMessageContext = messageContext;
+        _switchMessageContext(prevMessageContext, _nextMessageContext);
+ 
+        // Nuisance gas is a system used to bound the ability for an attacker to make fraud proofs
+        // expensive by touching a lot of different accounts or storage slots. Since most contracts
+        // only use a few storage slots during any given transaction, this shouldn't be a limiting
+        // factor.
+        uint256 prevNuisanceGasLeft = messageRecord.nuisanceGasLeft;
+        uint256 nuisanceGasLimit = _getNuisanceGasLimit(_gasLimit);
+        messageRecord.nuisanceGasLeft = nuisanceGasLimit;
+ 
+        // Make the call and make sure to pass in the gas limit. Another instance of hidden
+        // complexity. `_contract` is guaranteed to be a safe contract, meaning its return/revert
+        // behavior can be controlled. In particular, we enforce that flags are passed through
+        // revert data as to retrieve execution metadata that would normally be reverted out of
+        // existence.
+ 
+        (bool success, bytes memory returndata) =
+            _isCreate
+            ? _handleContractCreation(_gasLimit, _data, _contract)
+            : _contract.call{gas: _gasLimit}(_data);
+ 
+        // Switch back to the original message context now that we're out of the call.
+        _switchMessageContext(_nextMessageContext, prevMessageContext);
+ 
+        // Assuming there were no reverts, the message record should be accurate here. We'll update
+        // this value in the case of a revert.
+        uint256 nuisanceGasLeft = messageRecord.nuisanceGasLeft;
+ 
+        // Reverts at this point are completely OK, but we need to make a few updates based on the
+        // information passed through the revert.
+        if (success == false) {
+            (
+                RevertFlag flag,
+                uint256 nuisanceGasLeftPostRevert,
+                uint256 ovmGasRefund,
+                bytes memory returndataFromFlag
+            ) = _decodeRevertData(returndata);
+ 
+            // INVALID_STATE_ACCESS is the only flag that triggers an immediate abort of the
+            // parent EVM message. This behavior is necessary because INVALID_STATE_ACCESS must
+            // halt any further transaction execution that could impact the execution result.
+            if (flag == RevertFlag.INVALID_STATE_ACCESS) {
+                _revertWithFlag(flag);
+            }
+ 
+            // INTENTIONAL_REVERT, UNSAFE_BYTECODE, STATIC_VIOLATION, and CREATOR_NOT_ALLOWED aren't
+            // dependent on the input state, so we can just handle them like standard reverts. Our only change here
+            // is to record the gas refund reported by the call (enforced by safety checking).
+            if (
+                flag == RevertFlag.INTENTIONAL_REVERT
+                || flag == RevertFlag.UNSAFE_BYTECODE
+                || flag == RevertFlag.STATIC_VIOLATION
+                || flag == RevertFlag.CREATOR_NOT_ALLOWED
+            ) {
+                transactionRecord.ovmGasRefund = ovmGasRefund;
+            }
+ 
+            // INTENTIONAL_REVERT needs to pass up the user-provided return data encoded into the
+            // flag, *not* the full encoded flag. All other revert types return no data.
+            if (
+                flag == RevertFlag.INTENTIONAL_REVERT
+                || _isCreate
+            ) {
+                returndata = returndataFromFlag;
+            } else {
+                returndata = hex'';
+            }
+ 
+            // Reverts mean we need to use up whatever "nuisance gas" was used by the call.
+            // EXCEEDS_NUISANCE_GAS explicitly reduces the remaining nuisance gas for this message
+            // to zero. OUT_OF_GAS is a "pseudo" flag given that messages return no data when they
+            // run out of gas, so we have to treat this like EXCEEDS_NUISANCE_GAS. All other flags
+            // will simply pass up the remaining nuisance gas.
+            nuisanceGasLeft = nuisanceGasLeftPostRevert;
+        }
+ 
+        // We need to reset the nuisance gas back to its original value minus the amount used here.
+        messageRecord.nuisanceGasLeft = prevNuisanceGasLeft - (nuisanceGasLimit - nuisanceGasLeft);
+ 
+        return (
+            success,
+            returndata
+        );
+    }
+ 
+    /**
+     * Handles the creation-specific safety measures required for OVM contract deployment.
+     * This function sanitizes the return types for creation messages to match calls (bool, bytes).
+     * This allows for consistent handling of both types of messages in _handleExternalMessage().
+     * 
+     * @param _gasLimit Amount of gas to be passed into this creation.
+     * @param _creationCode Code to pass into CREATE for deployment.
+     * @param _address OVM address being deployed to.
+     * @return Whether or not the call succeeded.
+     * @return If creation fails: revert data. Otherwise: empty.
+     */
+    function _handleContractCreation(
+        uint _gasLimit,
+        bytes memory _creationCode,
+        address _address
+    )
+        internal
+        returns(
+            bool,
+            bytes memory
+        )
+    {
+        // Check that there is not already code at this address.
+        Iif (_hasEmptyAccount(_address) == false) {
+            // Note: in the EVM, this case burns all allotted gas.  For improved
+            // developer experience, we do return the remaining ones.
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.CREATE_COLLISION,
+                    Lib_ErrorUtils.encodeRevertString("A contract has already been deployed to this address")
+                )
+            );
+        }
+ 
+        // Check the creation bytecode against the OVM_SafetyChecker.
+        Iif (ovmSafetyChecker.isBytecodeSafe(_creationCode) == false) {
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.UNSAFE_BYTECODE,
+                    Lib_ErrorUtils.encodeRevertString("Contract creation code contains unsafe opcodes. Did you use the right compiler or pass an unsafe constructor argument?")
+                )
+            );
+        }
+ 
+        // We always need to initialize the contract with the default account values.
+        _initPendingAccount(_address);
+ 
+        // Actually execute the EVM create message,
+        address ethAddress = Lib_EthUtils.createContract(_creationCode);
+        
+        if (ethAddress == address(0)) {
+            // If the creation fails, the EVM lets us grab its revert data. This may contain a revert flag
+            // to be used above in _handleExternalMessage.
+            uint256 revertDataSize;
+            assembly { revertDataSize := returndatasize() }
+            bytes memory revertdata = new bytes(revertDataSize);
+            assembly {
+                returndatacopy(
+                    add(revertdata, 0x20),
+                    0,
+                    revertDataSize
+                )
+            }
+            // Return that the creation failed, and the data it reverted with.
+            return (false, revertdata);
+        }
+ 
+        // Again simply checking that the deployed code is safe too. Contracts can generate
+        // arbitrary deployment code, so there's no easy way to analyze this beforehand.
+        bytes memory deployedCode = Lib_EthUtils.getCode(ethAddress);
+        if (ovmSafetyChecker.isBytecodeSafe(deployedCode) == false) {
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.UNSAFE_BYTECODE,
+                    Lib_ErrorUtils.encodeRevertString("Constructor attempted to deploy unsafe bytecode.")
+                )
+            );
+        }
+ 
+        // Contract creation didn't need to be reverted and the bytecode is safe. We finish up by
+        // associating the desired address with the newly created contract's code hash and address.
+        _commitPendingAccount(
+            _address,
+            ethAddress,
+            Lib_EthUtils.getCodeHash(ethAddress)
+        );
+ 
+        // Successful deployments will not give access to returndata, in both the EVM and the OVM.
+        return (true, hex'');
+    }
+ 
+    /******************************************
+     * Internal Functions: State Manipulation *
+     ******************************************/
+ 
+    /**
+     * Checks whether an account exists within the OVM_StateManager.
+     * @param _address Address of the account to check.
+     * @return _exists Whether or not the account exists.
+     */
+    function _hasAccount(
+        address _address
+    )
+        internal
+        returns (
+            bool _exists
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.hasAccount(_address);
+    }
+ 
+    /**
+     * Checks whether a known empty account exists within the OVM_StateManager.
+     * @param _address Address of the account to check.
+     * @return _exists Whether or not the account empty exists.
+     */
+    function _hasEmptyAccount(
+        address _address
+    )
+        internal
+        returns (
+            bool _exists
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.hasEmptyAccount(_address);
+    }
+ 
+    /**
+     * Sets the nonce of an account.
+     * @param _address Address of the account to modify.
+     * @param _nonce New account nonce.
+     */
+    function _setAccountNonce(
+        address _address,
+        uint256 _nonce
+    )
+        internal
+    {
+        _checkAccountChange(_address);
+        ovmStateManager.setAccountNonce(_address, _nonce);
+    }
+ 
+    /**
+     * Gets the nonce of an account.
+     * @param _address Address of the account to access.
+     * @return _nonce Nonce of the account.
+     */
+    function _getAccountNonce(
+        address _address
+    )
+        internal
+        returns (
+            uint256 _nonce
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.getAccountNonce(_address);
+    }
+ 
+    /**
+     * Retrieves the Ethereum address of an account.
+     * @param _address Address of the account to access.
+     * @return _ethAddress Corresponding Ethereum address.
+     */
+    function _getAccountEthAddress(
+        address _address
+    )
+        internal
+        returns (
+            address _ethAddress
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.getAccountEthAddress(_address);
+    }
+ 
+    /**
+     * Creates the default account object for the given address.
+     * @param _address Address of the account create.
+     */
+    function _initPendingAccount(
+        address _address
+    )
+        internal
+    {
+        // Although it seems like `_checkAccountChange` would be more appropriate here, we don't
+        // actually consider an account "changed" until it's inserted into the state (in this case
+        // by `_commitPendingAccount`).
+        _checkAccountLoad(_address);
+        ovmStateManager.initPendingAccount(_address);
+    }
+ 
+    /**
+     * Stores additional relevant data for a new account, thereby "committing" it to the state.
+     * This function is only called during `ovmCREATE` and `ovmCREATE2` after a successful contract
+     * creation.
+     * @param _address Address of the account to commit.
+     * @param _ethAddress Address of the associated deployed contract.
+     * @param _codeHash Hash of the code stored at the address.
+     */
+    function _commitPendingAccount(
+        address _address,
+        address _ethAddress,
+        bytes32 _codeHash
+    )
+        internal
+    {
+        _checkAccountChange(_address);
+        ovmStateManager.commitPendingAccount(
+            _address,
+            _ethAddress,
+            _codeHash
+        );
+    }
+ 
+    /**
+     * Retrieves the value of a storage slot.
+     * @param _contract Address of the contract to query.
+     * @param _key 32 byte key of the storage slot.
+     * @return _value 32 byte storage slot value.
+     */
+    function _getContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+        returns (
+            bytes32 _value
+        )
+    {
+        _checkContractStorageLoad(_contract, _key);
+        return ovmStateManager.getContractStorage(_contract, _key);
+    }
+ 
+    /**
+     * Sets the value of a storage slot.
+     * @param _contract Address of the contract to modify.
+     * @param _key 32 byte key of the storage slot.
+     * @param _value 32 byte storage slot value.
+     */
+    function _putContractStorage(
+        address _contract,
+        bytes32 _key,
+        bytes32 _value
+    )
+        internal
+    {
+        // We don't set storage if the value didn't change. Although this acts as a convenient
+        // optimization, it's also necessary to avoid the case in which a contract with no storage
+        // attempts to store the value "0" at any key. Putting this value (and therefore requiring
+        // that the value be committed into the storage trie after execution) would incorrectly
+        // modify the storage root.
+        Iif (_getContractStorage(_contract, _key) == _value) {
+            return;
+        }
+ 
+        _checkContractStorageChange(_contract, _key);
+        ovmStateManager.putContractStorage(_contract, _key, _value);
+    }
+ 
+    /**
+     * Validation whenever a contract needs to be loaded. Checks that the account exists, charges
+     * nuisance gas if the account hasn't been loaded before.
+     * @param _address Address of the account to load.
+     */
+    function _checkAccountLoad(
+        address _address
+    )
+        internal
+    {
+        // See `_checkContractStorageLoad` for more information.
+        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
+            _revertWithFlag(RevertFlag.OUT_OF_GAS);
+        }
+ 
+        // See `_checkContractStorageLoad` for more information.
+        if (ovmStateManager.hasAccount(_address) == false) {
+            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
+        }
+ 
+        // Check whether the account has been loaded before and mark it as loaded if not. We need
+        // this because "nuisance gas" only applies to the first time that an account is loaded.
+        (
+            bool _wasAccountAlreadyLoaded
+        ) = ovmStateManager.testAndSetAccountLoaded(_address);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
+        // on the size of the contract code.
+        if (_wasAccountAlreadyLoaded == false) {
+            _useNuisanceGas(
+                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
+            );
+        }
+    }
+ 
+    /**
+     * Validation whenever a contract needs to be changed. Checks that the account exists, charges
+     * nuisance gas if the account hasn't been changed before.
+     * @param _address Address of the account to change.
+     */
+    function _checkAccountChange(
+        address _address
+    )
+        internal
+    {
+        // Start by checking for a load as we only want to charge nuisance gas proportional to
+        // contract size once.
+        _checkAccountLoad(_address);
+ 
+        // Check whether the account has been changed before and mark it as changed if not. We need
+        // this because "nuisance gas" only applies to the first time that an account is changed.
+        (
+            bool _wasAccountAlreadyChanged
+        ) = ovmStateManager.testAndSetAccountChanged(_address);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
+        // on the size of the contract code.
+        if (_wasAccountAlreadyChanged == false) {
+            ovmStateManager.incrementTotalUncommittedAccounts();
+            _useNuisanceGas(
+                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
+            );
+        }
+    }
+ 
+    /**
+     * Validation whenever a slot needs to be loaded. Checks that the account exists, charges
+     * nuisance gas if the slot hasn't been loaded before.
+     * @param _contract Address of the account to load from.
+     * @param _key 32 byte key to load.
+     */
+    function _checkContractStorageLoad(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+    {
+        // Another case of hidden complexity. If we didn't enforce this requirement, then a
+        // contract could pass in just enough gas to cause the INVALID_STATE_ACCESS check to fail
+        // on L1 but not on L2. A contract could use this behavior to prevent the
+        // OVM_ExecutionManager from detecting an invalid state access. Reverting with OUT_OF_GAS
+        // allows us to also charge for the full message nuisance gas, because you deserve that for
+        // trying to break the contract in this way.
+        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
+            _revertWithFlag(RevertFlag.OUT_OF_GAS);
+        }
+ 
+        // We need to make sure that the transaction isn't trying to access storage that hasn't
+        // been provided to the OVM_StateManager. We'll immediately abort if this is the case.
+        // We know that we have enough gas to do this check because of the above test.
+        Iif (ovmStateManager.hasContractStorage(_contract, _key) == false) {
+            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
+        }
+ 
+        // Check whether the slot has been loaded before and mark it as loaded if not. We need
+        // this because "nuisance gas" only applies to the first time that a slot is loaded.
+        (
+            bool _wasContractStorageAlreadyLoaded
+        ) = ovmStateManager.testAndSetContractStorageLoaded(_contract, _key);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge some fixed amount of
+        // "nuisance gas".
+        if (_wasContractStorageAlreadyLoaded == false) {
+            _useNuisanceGas(NUISANCE_GAS_SLOAD);
+        }
+    }
+ 
+    /**
+     * Validation whenever a slot needs to be changed. Checks that the account exists, charges
+     * nuisance gas if the slot hasn't been changed before.
+     * @param _contract Address of the account to change.
+     * @param _key 32 byte key to change.
+     */
+    function _checkContractStorageChange(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+    {
+        // Start by checking for load to make sure we have the storage slot and that we charge the
+        // "nuisance gas" necessary to prove the storage slot state.
+        _checkContractStorageLoad(_contract, _key);
+ 
+        // Check whether the slot has been changed before and mark it as changed if not. We need
+        // this because "nuisance gas" only applies to the first time that a slot is changed.
+        (
+            bool _wasContractStorageAlreadyChanged
+        ) = ovmStateManager.testAndSetContractStorageChanged(_contract, _key);
+ 
+        // If we hadn't already changed the account, then we'll need to charge some fixed amount of
+        // "nuisance gas".
+        Eif (_wasContractStorageAlreadyChanged == false) {
+            // Changing a storage slot means that we're also going to have to change the
+            // corresponding account, so do an account change check.
+            _checkAccountChange(_contract);
+ 
+            ovmStateManager.incrementTotalUncommittedContractStorage();
+            _useNuisanceGas(NUISANCE_GAS_SSTORE);
+        }
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Revert Logic *
+     ************************************/
+ 
+    /**
+     * Simple encoding for revert data.
+     * @param _flag Flag to revert with.
+     * @param _data Additional user-provided revert data.
+     * @return _revertdata Encoded revert data.
+     */
+    function _encodeRevertData(
+        RevertFlag _flag,
+        bytes memory _data
+    )
+        internal
+        view
+        returns (
+            bytes memory _revertdata
+        )
+    {
+        // Out of gas and create exceptions will fundamentally return no data, so simulating it shouldn't either.
+        Iif (
+            _flag == RevertFlag.OUT_OF_GAS
+        ) {
+            return bytes('');
+        }
+ 
+        // INVALID_STATE_ACCESS doesn't need to return any data other than the flag.
+        if (_flag == RevertFlag.INVALID_STATE_ACCESS) {
+            return abi.encode(
+                _flag,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        // Just ABI encode the rest of the parameters.
+        return abi.encode(
+            _flag,
+            messageRecord.nuisanceGasLeft,
+            transactionRecord.ovmGasRefund,
+            _data
+        );
+    }
+ 
+    /**
+     * Simple decoding for revert data.
+     * @param _revertdata Revert data to decode.
+     * @return _flag Flag used to revert.
+     * @return _nuisanceGasLeft Amount of nuisance gas unused by the message.
+     * @return _ovmGasRefund Amount of gas refunded during the message.
+     * @return _data Additional user-provided revert data.
+     */
+    function _decodeRevertData(
+        bytes memory _revertdata
+    )
+        internal
+        pure
+        returns (
+            RevertFlag _flag,
+            uint256 _nuisanceGasLeft,
+            uint256 _ovmGasRefund,
+            bytes memory _data
+        )
+    {
+        // A length of zero means the call ran out of gas, just return empty data.
+        if (_revertdata.length == 0) {
+            return (
+                RevertFlag.OUT_OF_GAS,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        // ABI decode the incoming data.
+        return abi.decode(_revertdata, (RevertFlag, uint256, uint256, bytes));
+    }
+ 
+    /**
+     * Causes a message to revert or abort.
+     * @param _flag Flag to revert with.
+     * @param _data Additional user-provided data.
+     */
+    function _revertWithFlag(
+        RevertFlag _flag,
+        bytes memory _data
+    )
+        internal
+        view
+    {
+        bytes memory revertdata = _encodeRevertData(
+            _flag,
+            _data
+        );
+ 
+        assembly {
+            revert(add(revertdata, 0x20), mload(revertdata))
+        }
+    }
+ 
+    /**
+     * Causes a message to revert or abort.
+     * @param _flag Flag to revert with.
+     */
+    function _revertWithFlag(
+        RevertFlag _flag
+    )
+        internal
+    {
+        _revertWithFlag(_flag, bytes(''));
+    }
+ 
+ 
+    /******************************************
+     * Internal Functions: Nuisance Gas Logic *
+     ******************************************/
+ 
+    /**
+     * Computes the nuisance gas limit from the gas limit.
+     * @dev This function is currently using a naive implementation whereby the nuisance gas limit
+     *      is set to exactly equal the lesser of the gas limit or remaining gas. It's likely that
+     *      this implementation is perfectly fine, but we may change this formula later.
+     * @param _gasLimit Gas limit to compute from.
+     * @return _nuisanceGasLimit Computed nuisance gas limit.
+     */
+    function _getNuisanceGasLimit(
+        uint256 _gasLimit
+    )
+        internal
+        view
+        returns (
+            uint256 _nuisanceGasLimit
+        )
+    {
+        return _gasLimit < gasleft() ? _gasLimit : gasleft();
+    }
+ 
+    /**
+     * Uses a certain amount of nuisance gas.
+     * @param _amount Amount of nuisance gas to use.
+     */
+    function _useNuisanceGas(
+        uint256 _amount
+    )
+        internal
+    {
+        // Essentially the same as a standard OUT_OF_GAS, except we also retain a record of the gas
+        // refund to be given at the end of the transaction.
+        Iif (messageRecord.nuisanceGasLeft < _amount) {
+            _revertWithFlag(RevertFlag.EXCEEDS_NUISANCE_GAS);
+        }
+ 
+        messageRecord.nuisanceGasLeft -= _amount;
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Gas Metering *
+     ************************************/
+ 
+    /**
+     * Checks whether a transaction needs to start a new epoch and does so if necessary.
+     * @param _timestamp Transaction timestamp.
+     */
+    function _checkNeedsNewEpoch(
+        uint256 _timestamp
+    )
+        internal
+    {
+        if (
+            _timestamp >= (
+                _getGasMetadata(GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP)
+                + gasMeterConfig.secondsPerEpoch
+            )
+        ) {
+            _putGasMetadata(
+                GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP,
+                _timestamp
+            );
+ 
+            _putGasMetadata(
+                GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS,
+                _getGasMetadata(
+                    GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS
+                )
+            );
+ 
+            _putGasMetadata(
+                GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS,
+                _getGasMetadata(
+                    GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS
+                )
+            );
+        }
+    }
+ 
+    /**
+     * Validates the gas limit for a given transaction.
+     * @param _gasLimit Gas limit provided by the transaction.
+     * param _queueOrigin Queue from which the transaction originated.
+     * @return _valid Whether or not the gas limit is valid.
+     */
+    function _isValidGasLimit(
+        uint256 _gasLimit,
+        Lib_OVMCodec.QueueOrigin // _queueOrigin
+    )
+        view
+        internal
+        returns (
+            bool _valid
+        )
+    {
+        // Always have to be below the maximum gas limit.
+        if (_gasLimit > gasMeterConfig.maxTransactionGasLimit) {
+            return false;
+        }
+ 
+        // Always have to be above the minimum gas limit.
+        if (_gasLimit < gasMeterConfig.minTransactionGasLimit) {
+            return false;
+        }
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        return true;
+        // GasMetadataKey cumulativeGasKey;
+        // GasMetadataKey prevEpochGasKey;
+        // if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
+        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
+        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS;
+        // } else {
+        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
+        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS;
+        // }
+ 
+        // return (
+        //     (
+        //         _getGasMetadata(cumulativeGasKey)
+        //         - _getGasMetadata(prevEpochGasKey)
+        //         + _gasLimit
+        //     ) < gasMeterConfig.maxGasPerQueuePerEpoch
+        // );
+    }
+ 
+    /**
+     * Updates the cumulative gas after a transaction.
+     * @param _gasUsed Gas used by the transaction.
+     * @param _queueOrigin Queue from which the transaction originated.
+     */
+    function _updateCumulativeGas(
+        uint256 _gasUsed,
+        Lib_OVMCodec.QueueOrigin _queueOrigin
+    )
+        internal
+    {
+        GasMetadataKey cumulativeGasKey;
+        if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
+            cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
+        } else {
+            cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
+        }
+ 
+        _putGasMetadata(
+            cumulativeGasKey,
+            (
+                _getGasMetadata(cumulativeGasKey)
+                + gasMeterConfig.minTransactionGasLimit
+                + _gasUsed
+                - transactionRecord.ovmGasRefund
+            )
+        );
+    }
+ 
+    /**
+     * Retrieves the value of a gas metadata key.
+     * @param _key Gas metadata key to retrieve.
+     * @return _value Value stored at the given key.
+     */
+    function _getGasMetadata(
+        GasMetadataKey _key
+    )
+        internal
+        returns (
+            uint256 _value
+        )
+    {
+        return uint256(_getContractStorage(
+            GAS_METADATA_ADDRESS,
+            bytes32(uint256(_key))
+        ));
+    }
+ 
+    /**
+     * Sets the value of a gas metadata key.
+     * @param _key Gas metadata key to set.
+     * @param _value Value to store at the given key.
+     */
+    function _putGasMetadata(
+        GasMetadataKey _key,
+        uint256 _value
+    )
+        internal
+    {
+        _putContractStorage(
+            GAS_METADATA_ADDRESS,
+            bytes32(uint256(_key)),
+            bytes32(uint256(_value))
+        );
+    }
+ 
+ 
+    /*****************************************
+     * Internal Functions: Execution Context *
+     *****************************************/
+ 
+    /**
+     * Swaps over to a new message context.
+     * @param _prevMessageContext Context we're switching from.
+     * @param _nextMessageContext Context we're switching to.
+     */
+    function _switchMessageContext(
+        MessageContext memory _prevMessageContext,
+        MessageContext memory _nextMessageContext
+    )
+        internal
+    {
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.ovmCALLER != _nextMessageContext.ovmCALLER) {
+            messageContext.ovmCALLER = _nextMessageContext.ovmCALLER;
+        }
+ 
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.ovmADDRESS != _nextMessageContext.ovmADDRESS) {
+            messageContext.ovmADDRESS = _nextMessageContext.ovmADDRESS;
+        }
+ 
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.isStatic != _nextMessageContext.isStatic) {
+            messageContext.isStatic = _nextMessageContext.isStatic;
+        }
+    }
+ 
+    /**
+     * Initializes the execution context.
+     * @param _transaction OVM transaction being executed.
+     */
+    function _initContext(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        internal
+    {
+        transactionContext.ovmTIMESTAMP = _transaction.timestamp;
+        transactionContext.ovmNUMBER = _transaction.blockNumber;
+        transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
+        transactionContext.ovmL1QUEUEORIGIN = _transaction.l1QueueOrigin;
+        transactionContext.ovmL1TXORIGIN = _transaction.l1TxOrigin;
+        transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
+ 
+        messageRecord.nuisanceGasLeft = _getNuisanceGasLimit(_transaction.gasLimit);
+    }
+ 
+    /**
+     * Resets the transaction and message context.
+     */
+    function _resetContext()
+        internal
+    {
+        transactionContext.ovmL1TXORIGIN = address(0);
+        transactionContext.ovmTIMESTAMP = 0;
+        transactionContext.ovmNUMBER = 0;
+        transactionContext.ovmGASLIMIT = 0;
+        transactionContext.ovmTXGASLIMIT = 0;
+        transactionContext.ovmL1QUEUEORIGIN = Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE;
+ 
+        transactionRecord.ovmGasRefund = 0;
+ 
+        messageContext.ovmCALLER = address(0);
+        messageContext.ovmADDRESS = address(0);
+        messageContext.isStatic = false;
+ 
+        messageRecord.nuisanceGasLeft = 0;
+    }
+ 
+    /*****************************
+     * L2-only Helper Functions *
+     *****************************/
+ 
+    /**
+     * Unreachable helper function for simulating eth_calls with an OVM message context.
+     * This function will throw an exception in all cases other than when used as a custom entrypoint in L2 Geth to simulate eth_call.
+     * @param _transaction the message transaction to simulate.
+     * @param _from the OVM account the simulated call should be from.
+     */
+    function simulateMessage(
+        Lib_OVMCodec.Transaction memory _transaction,
+        address _from,
+        iOVM_StateManager _ovmStateManager
+    )
+        external
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        // Prevent this call from having any effect unless in a custom-set VM frame
+        require(msg.sender == address(0));
+ 
+        ovmStateManager = _ovmStateManager;
+        _initContext(_transaction);
+        messageRecord.nuisanceGasLeft = uint(-1);
+ 
+        messageContext.ovmADDRESS = _from;
+ 
+        bool isCreate = _transaction.entrypoint == address(0);
+        if (isCreate) {
+            (address created, bytes memory revertData) = ovmCREATE(_transaction.data);
+            if (created == address(0)) {
+                return (false, revertData);
+            } else {
+                // The eth_call RPC endpoint for to = undefined will return the deployed bytecode 
+                // in the success case, differing from standard create messages.
+                return (true, Lib_EthUtils.getCode(created));
+            }
+        } else {
+            return ovmCALL(
+                _transaction.gasLimit,
+                _transaction.entrypoint,
+                _transaction.data
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/execution/OVM_SafetyChecker.sol.html b/coverage/lcov-report/OVM/execution/OVM_SafetyChecker.sol.html new file mode 100644 index 000000000..7c3a8f6b4 --- /dev/null +++ b/coverage/lcov-report/OVM/execution/OVM_SafetyChecker.sol.html @@ -0,0 +1,509 @@ + + + + Code coverage report for OVM/execution/OVM_SafetyChecker.sol + + + + + + + +
+
+

+ all files / OVM/execution/ OVM_SafetyChecker.sol +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +277× +  +  +  +  +  +  +  +  +  +  +277× +  +277× +  +277× +  +277× +277× +277× +  +  +277× +277× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +152× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
+ 
+/**
+ * @title OVM_SafetyChecker
+ * @dev  The Safety Checker verifies that contracts deployed on L2 do not contain any
+ * "unsafe" operations. An operation is considered unsafe if it would access state variables which
+ * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used
+ * to "escape the sandbox" of the OVM, resulting in non-deterministic fraud proofs. 
+ * That is, an attacker would be able to "prove fraud" on an honestly applied transaction.
+ * Note that a "safe" contract requires opcodes to appear in a particular pattern;
+ * omission of "unsafe" opcodes is necessary, but not sufficient.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_SafetyChecker is iOVM_SafetyChecker {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Returns whether or not all of the provided bytecode is safe.
+     * @param _bytecode The bytecode to safety check.
+     * @return `true` if the bytecode is safe, `false` otherwise.
+     */
+    function isBytecodeSafe(
+        bytes memory _bytecode
+    )
+        override
+        external
+        pure
+        returns (
+            bool
+        )
+    {
+        // autogenerated by gen_safety_checker_constants.py
+        // number of bytes to skip for each opcode
+        uint256[8] memory opcodeSkippableBytes = [
+            uint256(0x0001010101010101010101010000000001010101010101010101010101010000),
+            uint256(0x0100000000000000000000000000000000000000010101010101000000010100),
+            uint256(0x0000000000000000000000000000000001010101000000010101010100000000),
+            uint256(0x0203040500000000000000000000000000000000000000000000000000000000),
+            uint256(0x0101010101010101010101010101010101010101010101010101010101010101),
+            uint256(0x0101010101000000000000000000000000000000000000000000000000000000),
+            uint256(0x0000000000000000000000000000000000000000000000000000000000000000),
+            uint256(0x0000000000000000000000000000000000000000000000000000000000000000)
+        ];
+        // Mask to gate opcode specific cases
+        uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);
+        // Halting opcodes
+        uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);
+        // PUSH opcodes
+        uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);
+ 
+        uint256 codeLength;
+        uint256 _pc;
+        assembly {
+            _pc := add(_bytecode, 0x20)
+        }
+        codeLength = _pc + _bytecode.length;
+        do {
+            // current opcode: 0x00...0xff
+            uint256 opNum;
+ 
+            // inline assembly removes the extra add + bounds check
+            assembly {
+                let word := mload(_pc) //load the next 32 bytes at pc into word
+ 
+                // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord
+                // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4
+                // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).
+                // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,
+                // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.
+                let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                _pc := add(_pc, indexInWord)
+ 
+                opNum := byte(indexInWord, word)
+            }
+ 
+            // + push opcodes
+            // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]
+            // + caller opcode CALLER(0x33)
+            // + blacklisted opcodes
+            uint256 opBit = 1 << opNum;
+            if (opBit & opcodeGateMask == 0) {
+                if (opBit & opcodePushMask == 0) {
+                    // all pushes are valid opcodes
+                    // subsequent bytes are not opcodes. Skip them.
+                    _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to
+                    // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)
+                    continue;
+                } else if (opBit & opcodeHaltingMask == 0) {
+                    // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)
+                    // We are now inside unreachable code until we hit a JUMPDEST!
+                    do {
+                        _pc++;
+                        assembly {
+                            opNum := byte(0, mload(_pc))
+                        }
+                        // encountered a JUMPDEST
+                        if (opNum == 0x5b) break;
+                        // skip PUSHed bytes
+                        if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)
+                    } while (_pc < codeLength);
+                    // opNum is 0x5b, so we don't continue here since the pc++ is fine
+                } else if (opNum == 0x33) { // Caller opcode
+                    uint256 firstOps; // next 32 bytes of bytecode
+                    uint256 secondOps; // following 32 bytes of bytecode
+ 
+                    assembly {
+                        firstOps := mload(_pc)
+                        // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits
+                        secondOps := shr(216, mload(add(_pc, 0x20)))
+                    }
+ 
+                    // Call identity precompile
+                    // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL
+                    // 32 - 8 bytes = 24 bytes = 192
+                    if ((firstOps >> 192) == 0x3350600060045af1) {
+                        _pc += 8;
+                    // Call EM and abort execution if instructed
+                    // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST 
+                    } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {
+                        _pc += 37;
+                    } else {
+                        return false;
+                    }
+                    continue;
+                } else {
+                    // encountered a non-whitelisted opcode!
+                    return false;
+                }
+            }
+            _pc++;
+        } while (_pc < codeLength);
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/execution/OVM_StateManager.sol.html b/coverage/lcov-report/OVM/execution/OVM_StateManager.sol.html new file mode 100644 index 000000000..43f0df6b4 --- /dev/null +++ b/coverage/lcov-report/OVM/execution/OVM_StateManager.sol.html @@ -0,0 +1,2279 @@ + + + + Code coverage report for OVM/execution/OVM_StateManager.sol + + + + + + + +
+
+

+ all files / OVM/execution/ OVM_StateManager.sol +

+
+
+ 79.69% + Statements + 51/64 +
+
+ 100% + Branches + 12/12 +
+
+ 80% + Functions + 28/35 +
+
+ 80% + Lines + 52/65 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +207× +  +  +  +  +  +  +  +  +  +  +  +  +  +921× +  +  +  +920× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +537× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +60× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +369× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +30× +30× +30× +30× +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +18× +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +61× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +70× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +  +  +  +  +14× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +57× +  +  +  + +  +  +  +51× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +74× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +69× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +606× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +97× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +687× +  +687× +268× +  +  +687× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+ 
+/**
+ * @title OVM_StateManager
+ * @dev The State Manager contract holds all storage values for contracts in the OVM. It can only be written to by the
+ * the Execution Manager and State Transitioner. It runs on L1 during the setup and execution of a fraud proof.
+ * The same logic runs on L2, but has been implemented as a precompile in the L2 go-ethereum client
+ * (see https://github.com/ethereum-optimism/go-ethereum/blob/master/core/vm/ovm_state_manager.go).
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateManager is iOVM_StateManager {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 constant internal EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
+    bytes32 constant internal EMPTY_ACCOUNT_CODE_HASH =    0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
+    bytes32 constant internal STORAGE_XOR_VALUE =          0xFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEF;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    address override public owner;
+    address override public ovmExecutionManager;
+    mapping (address => Lib_OVMCodec.Account) internal accounts;
+    mapping (address => mapping (bytes32 => bytes32)) internal contractStorage;
+    mapping (address => mapping (bytes32 => bool)) internal verifiedContractStorage;
+    mapping (bytes32 => ItemState) internal itemStates;
+    uint256 internal totalUncommittedAccounts;
+    uint256 internal totalUncommittedContractStorage;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _owner Address of the owner of this contract.
+     */
+    constructor(
+        address _owner
+    )
+    {
+        owner = _owner;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Simple authentication, this contract should only be accessible to the owner (which is expected to be the State Transitioner during `PRE_EXECUTION` 
+     * or the OVM_ExecutionManager during transaction execution.
+     */
+    modifier authenticated() {
+        // owner is the State Transitioner
+        require(
+            msg.sender == owner || msg.sender == ovmExecutionManager,
+            "Function can only be called by authenticated addresses"
+        );
+        _;
+    }
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Checks whether a given address is allowed to modify this contract.
+     * @param _address Address to check.
+     * @return Whether or not the address can modify this contract.
+     */
+    function isAuthenticated(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return (_address == owner || _address == ovmExecutionManager);
+    }
+ 
+    /**
+     * Sets the address of the OVM_ExecutionManager.
+     * @param _ovmExecutionManager Address of the OVM_ExecutionManager.
+     */
+    function setExecutionManager(
+        address _ovmExecutionManager
+    )
+        override
+        public
+        authenticated
+    {
+        ovmExecutionManager = _ovmExecutionManager;
+    }
+ 
+    /**
+     * Inserts an account into the state.
+     * @param _address Address of the account to insert.
+     * @param _account Account to insert for the given address.
+     */
+    function putAccount(
+        address _address,
+        Lib_OVMCodec.Account memory _account
+    )
+        override
+        public
+        authenticated
+    {
+        accounts[_address] = _account;
+    }
+ 
+    /**
+     * Marks an account as empty.
+     * @param _address Address of the account to mark.
+     */
+    function putEmptyAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
+        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
+    }
+ 
+    /**
+     * Retrieves an account from the state.
+     * @param _address Address of the account to retrieve.
+     * @return Account for the given address.
+     */
+    function getAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.Account memory
+        )
+    {
+        return accounts[_address];
+    }
+ 
+    /**
+     * Checks whether the state has a given account.
+     * @param _address Address of the account to check.
+     * @return Whether or not the state has the account.
+     */
+    function hasAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return accounts[_address].codeHash != bytes32(0);
+    }
+ 
+    /**
+     * Checks whether the state has a given known empty account.
+     * @param _address Address of the account to check.
+     * @return Whether or not the state has the empty account.
+     */
+    function hasEmptyAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return (
+            accounts[_address].codeHash == EMPTY_ACCOUNT_CODE_HASH
+            && accounts[_address].nonce == 0
+        );
+    }
+ 
+    /**
+     * Sets the nonce of an account.
+     * @param _address Address of the account to modify.
+     * @param _nonce New account nonce.
+     */
+    function setAccountNonce(
+        address _address,
+        uint256 _nonce
+    )
+        override
+        public
+        authenticated
+    {
+        accounts[_address].nonce = _nonce;
+    }
+ 
+    /**
+     * Gets the nonce of an account.
+     * @param _address Address of the account to access.
+     * @return Nonce of the account.
+     */
+    function getAccountNonce(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return accounts[_address].nonce;
+    }
+ 
+    /**
+     * Retrieves the Ethereum address of an account.
+     * @param _address Address of the account to access.
+     * @return Corresponding Ethereum address.
+     */
+    function getAccountEthAddress(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            address
+        )
+    {
+        return accounts[_address].ethAddress;
+    }
+ 
+    /**
+     * Retrieves the storage root of an account.
+     * @param _address Address of the account to access.
+     * @return Corresponding storage root.
+     */
+    function getAccountStorageRoot(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        return accounts[_address].storageRoot;
+    }
+ 
+    /**
+     * Initializes a pending account (during CREATE or CREATE2) with the default values.
+     * @param _address Address of the account to initialize.
+     */
+    function initPendingAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.nonce = 1;
+        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
+        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
+        account.isFresh = true;
+    }
+ 
+    /**
+     * Finalizes the creation of a pending account (during CREATE or CREATE2).
+     * @param _address Address of the account to finalize.
+     * @param _ethAddress Address of the account's associated contract on Ethereum.
+     * @param _codeHash Hash of the account's code.
+     */
+    function commitPendingAccount(
+        address _address,
+        address _ethAddress,
+        bytes32 _codeHash
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.ethAddress = _ethAddress;
+        account.codeHash = _codeHash;
+    }
+ 
+    /**
+     * Checks whether an account has already been retrieved, and marks it as retrieved if not.
+     * @param _address Address of the account to check.
+     * @return Whether or not the account was already loaded.
+     */
+    function testAndSetAccountLoaded(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_address),
+            ItemState.ITEM_LOADED
+        );
+    }
+ 
+    /**
+     * Checks whether an account has already been modified, and marks it as modified if not.
+     * @param _address Address of the account to check.
+     * @return Whether or not the account was already modified.
+     */
+    function testAndSetAccountChanged(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_address),
+            ItemState.ITEM_CHANGED
+        );
+    }
+ 
+    /**
+     * Attempts to mark an account as committed.
+     * @param _address Address of the account to commit.
+     * @return Whether or not the account was committed.
+     */
+    function commitAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        if (itemStates[item] != ItemState.ITEM_CHANGED) {
+            return false;
+        }
+ 
+        itemStates[item] = ItemState.ITEM_COMMITTED;
+        totalUncommittedAccounts -= 1;
+ 
+        return true;
+    }
+ 
+    /**
+     * Increments the total number of uncommitted accounts.
+     */
+    function incrementTotalUncommittedAccounts()
+        override
+        public
+        authenticated
+    {
+        totalUncommittedAccounts += 1;
+    }
+ 
+    /**
+     * Gets the total number of uncommitted accounts.
+     * @return Total uncommitted accounts.
+     */
+    function getTotalUncommittedAccounts()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return totalUncommittedAccounts;
+    }
+ 
+    /**
+     * Checks whether a given account was changed during execution.
+     * @param _address Address to check.
+     * @return Whether or not the account was changed.
+     */
+    function wasAccountChanged(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        return itemStates[item] >= ItemState.ITEM_CHANGED;
+    }
+ 
+    /**
+     * Checks whether a given account was committed after execution.
+     * @param _address Address to check.
+     * @return Whether or not the account was committed.
+     */
+    function wasAccountCommitted(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        return itemStates[item] >= ItemState.ITEM_COMMITTED;
+    }
+ 
+ 
+    /************************************
+     * Public Functions: Storage Access *
+     ************************************/
+ 
+    /**
+     * Changes a contract storage slot value.
+     * @param _contract Address of the contract to modify.
+     * @param _key 32 byte storage slot key.
+     * @param _value 32 byte storage slot value.
+     */
+    function putContractStorage(
+        address _contract,
+        bytes32 _key,
+        bytes32 _value
+    )
+        override
+        public
+        authenticated
+    {
+        // A hilarious optimization. `SSTORE`ing a value of `bytes32(0)` is common enough that it's
+        // worth populating this with a non-zero value in advance (during the fraud proof
+        // initialization phase) to cut the execution-time cost down to 5000 gas.
+        contractStorage[_contract][_key] = _value ^ STORAGE_XOR_VALUE;
+ 
+        // Only used when initially populating the contract storage. OVM_ExecutionManager will
+        // perform a `hasContractStorage` INVALID_STATE_ACCESS check before putting any contract
+        // storage because writing to zero when the actual value is nonzero causes a gas
+        // discrepancy. Could be moved into a new `putVerifiedContractStorage` function, or
+        // something along those lines.
+        if (verifiedContractStorage[_contract][_key] == false) {
+            verifiedContractStorage[_contract][_key] = true;
+        }
+    }
+ 
+    /**
+     * Retrieves a contract storage slot value.
+     * @param _contract Address of the contract to access.
+     * @param _key 32 byte storage slot key.
+     * @return 32 byte storage slot value.
+     */
+    function getContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        // Storage XOR system doesn't work for newly created contracts that haven't set this
+        // storage slot value yet.
+        if (
+            verifiedContractStorage[_contract][_key] == false
+            && accounts[_contract].isFresh
+        ) {
+            return bytes32(0);
+        }
+ 
+        // See `putContractStorage` for more information about the XOR here.
+        return contractStorage[_contract][_key] ^ STORAGE_XOR_VALUE;
+    }
+ 
+    /**
+     * Checks whether a contract storage slot exists in the state.
+     * @param _contract Address of the contract to access.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the key was set in the state.
+     */
+    function hasContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return verifiedContractStorage[_contract][_key] || accounts[_contract].isFresh;
+    }
+ 
+    /**
+     * Checks whether a storage slot has already been retrieved, and marks it as retrieved if not.
+     * @param _contract Address of the contract to check.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the slot was already loaded.
+     */
+    function testAndSetContractStorageLoaded(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_contract, _key),
+            ItemState.ITEM_LOADED
+        );
+    }
+ 
+    /**
+     * Checks whether a storage slot has already been modified, and marks it as modified if not.
+     * @param _contract Address of the contract to check.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the slot was already modified.
+     */
+    function testAndSetContractStorageChanged(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_contract, _key),
+            ItemState.ITEM_CHANGED
+        );
+    }
+ 
+    /**
+     * Attempts to mark a storage slot as committed.
+     * @param _contract Address of the account to commit.
+     * @param _key 32 byte slot key to commit.
+     * @return Whether or not the slot was committed.
+     */
+    function commitContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        if (itemStates[item] != ItemState.ITEM_CHANGED) {
+            return false;
+        }
+ 
+        itemStates[item] = ItemState.ITEM_COMMITTED;
+        totalUncommittedContractStorage -= 1;
+ 
+        return true;
+    }
+ 
+    /**
+     * Increments the total number of uncommitted storage slots.
+     */
+    function incrementTotalUncommittedContractStorage()
+        override
+        public
+        authenticated
+    {
+        totalUncommittedContractStorage += 1;
+    }
+ 
+    /**
+     * Gets the total number of uncommitted storage slots.
+     * @return Total uncommitted storage slots.
+     */
+    function getTotalUncommittedContractStorage()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return totalUncommittedContractStorage;
+    }
+ 
+    /**
+     * Checks whether a given storage slot was changed during execution.
+     * @param _contract Address to check.
+     * @param _key Key of the storage slot to check.
+     * @return Whether or not the storage slot was changed.
+     */
+    function wasContractStorageChanged(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        return itemStates[item] >= ItemState.ITEM_CHANGED;
+    }
+ 
+    /**
+     * Checks whether a given storage slot was committed after execution.
+     * @param _contract Address to check.
+     * @param _key Key of the storage slot to check.
+     * @return Whether or not the storage slot was committed.
+     */
+    function wasContractStorageCommitted(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        return itemStates[item] >= ItemState.ITEM_COMMITTED;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Generates a unique hash for an address.
+     * @param _address Address to generate a hash for.
+     * @return Unique hash for the given address.
+     */
+    function _getItemHash(
+        address _address
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(abi.encodePacked(_address));
+    }
+ 
+    /**
+     * Generates a unique hash for an address/key pair.
+     * @param _contract Address to generate a hash for.
+     * @param _key Key to generate a hash for.
+     * @return Unique hash for the given pair.
+     */
+    function _getItemHash(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(abi.encodePacked(
+            _contract,
+            _key
+        ));
+    }
+ 
+    /**
+     * Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets the
+     * item to the provided state if not.
+     * @param _item 32 byte item ID to check.
+     * @param _minItemState Minimum state that must be satisfied by the item.
+     * @return Whether or not the item was already in the state.
+     */
+    function _testAndSetItemState(
+        bytes32 _item,
+        ItemState _minItemState
+    )
+        internal
+        returns (
+            bool
+        )
+    {
+        bool wasItemState = itemStates[_item] >= _minItemState;
+ 
+        if (wasItemState == false) {
+            itemStates[_item] = _minItemState;
+        }
+ 
+        return wasItemState;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/execution/OVM_StateManagerFactory.sol.html b/coverage/lcov-report/OVM/execution/OVM_StateManagerFactory.sol.html new file mode 100644 index 000000000..571e900b2 --- /dev/null +++ b/coverage/lcov-report/OVM/execution/OVM_StateManagerFactory.sol.html @@ -0,0 +1,188 @@ + + + + Code coverage report for OVM/execution/OVM_StateManagerFactory.sol + + + + + + + +
+
+

+ all files / OVM/execution/ OVM_StateManagerFactory.sol +

+
+
+ 0% + Statements + 0/1 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
+ 
+/* Contract Imports */
+import { OVM_StateManager } from "./OVM_StateManager.sol";
+ 
+/**
+ * @title OVM_StateManagerFactory
+ * @dev The State Manager Factory is called by a State Transitioner's init code, to create a new
+ * State Manager for use in the Fraud Verification process.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateManagerFactory is iOVM_StateManagerFactory {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Creates a new OVM_StateManager
+     * @param _owner Owner of the created contract.
+     * @return New OVM_StateManager instance.
+     */
+    function create(
+        address _owner
+    )
+        override
+        public
+        returns (
+            iOVM_StateManager
+        )
+    {
+        return new OVM_StateManager(_owner);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/execution/index.html b/coverage/lcov-report/OVM/execution/index.html new file mode 100644 index 000000000..ede1cb77a --- /dev/null +++ b/coverage/lcov-report/OVM/execution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for OVM/execution/ + + + + + + + +
+
+

+ all files OVM/execution/ +

+
+
+ 76.05% + Statements + 235/309 +
+
+ 67.02% + Branches + 63/94 +
+
+ 81.63% + Functions + 80/98 +
+
+ 76.73% + Lines + 244/318 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_ExecutionManager.sol
74.58%176/23662.2%51/8283.61%51/6175.21%182/242
OVM_SafetyChecker.sol
100%8/8100%0/0100%1/1100%10/10
OVM_StateManager.sol
79.69%51/64100%12/1280%28/3580%52/65
OVM_StateManagerFactory.sol
0%0/1100%0/00%0/10%0/1
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/predeploys/ERC1820Registry.sol.html b/coverage/lcov-report/OVM/predeploys/ERC1820Registry.sol.html new file mode 100644 index 000000000..e49e79f7c --- /dev/null +++ b/coverage/lcov-report/OVM/predeploys/ERC1820Registry.sol.html @@ -0,0 +1,662 @@ + + + + Code coverage report for OVM/predeploys/ERC1820Registry.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ ERC1820Registry.sol +

+
+
+ 0% + Statements + 0/38 +
+
+ 0% + Branches + 0/22 +
+
+ 0% + Functions + 0/10 +
+
+ 0% + Lines + 0/39 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: CC0-1.0
+/* ERC1820 Pseudo-introspection Registry Contract
+ * This standard defines a universal registry smart contract where any address (contract or regular account) can
+ * register which interface it supports and which smart contract is responsible for its implementation.
+ *
+ * Written in 2019 by Jordi Baylina and Jacques Dafflon
+ *
+ * To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to
+ * this software to the public domain worldwide. This software is distributed without any warranty.
+ *
+ * You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
+ * <http://creativecommons.org/publicdomain/zero/1.0/>.
+ */
+pragma solidity >0.5.0 <0.8.0;
+ 
+/// @dev The interface a contract MUST implement if it is the implementer of
+/// some (other) interface for any address other than itself.
+interface ERC1820ImplementerInterface {
+    /// @notice Indicates whether the contract implements the interface 'interfaceHash' for the address 'addr' or not.
+    /// @param interfaceHash keccak256 hash of the name of the interface
+    /// @param addr Address for which the contract will implement the interface
+    /// @return ERC1820_ACCEPT_MAGIC only if the contract implements 'interfaceHash' for the address 'addr'.
+    function canImplementInterfaceForAddress(bytes32 interfaceHash, address addr) external view returns(bytes32);
+}
+ 
+/**
+ * @title ERC1820 Pseudo-introspection Registry Contract
+ * @author Jordi Baylina and Jacques Dafflon
+ * @dev This contract is the official implementation of the ERC1820 Registry 
+ * For more details, see https://eips.ethereum.org/EIPS/eip-1820
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract ERC1820Registry {
+    bytes4 constant internal INVALID_ID = 0xffffffff;
+    bytes4 constant internal ERC165ID = 0x01ffc9a7;
+    bytes32 constant internal ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
+ 
+    mapping(address => mapping(bytes32 => address)) internal interfaces;
+    mapping(address => address) internal managers;
+    mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
+ 
+    /// @notice Indicates a contract is the 'implementer' of 'interfaceHash' for 'addr'.
+    event InterfaceImplementerSet(address indexed addr, bytes32 indexed interfaceHash, address indexed implementer);
+    /// @notice Indicates 'newManager' is the address of the new manager for 'addr'.
+    event ManagerChanged(address indexed addr, address indexed newManager);
+ 
+    /// @notice Query if an address implements an interface and through which contract.
+    /// @param _addr Address being queried for the implementer of an interface.
+    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
+    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
+    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
+    /// @return The address of the contract which implements the interface '_interfaceHash' for '_addr'
+    /// or '0' if '_addr' did not register an implementer for this interface.
+    function getInterfaceImplementer(address _addr, bytes32 _interfaceHash) external view returns (address) {
+        address addr = _addr == address(0) ? msg.sender : _addr;
+        if (isERC165Interface(_interfaceHash)) {
+            bytes4 erc165InterfaceHash = bytes4(_interfaceHash);
+            return implementsERC165Interface(addr, erc165InterfaceHash) ? addr : address(0);
+        }
+        return interfaces[addr][_interfaceHash];
+    }
+ 
+    /// @notice Sets the contract which implements a specific interface for an address.
+    /// Only the manager defined for that address can set it.
+    /// (Each address is the manager for itself until it sets a new manager.)
+    /// @param _addr Address for which to set the interface.
+    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
+    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
+    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
+    /// @param _implementer Contract address implementing '_interfaceHash' for '_addr'.
+    function setInterfaceImplementer(address _addr, bytes32 _interfaceHash, address _implementer) external {
+        address addr = _addr == address(0) ? msg.sender : _addr;
+        require(getManager(addr) == msg.sender, "Not the manager");
+ 
+        require(!isERC165Interface(_interfaceHash), "Must not be an ERC165 hash");
+        if (_implementer != address(0) && _implementer != msg.sender) {
+            require(
+                ERC1820ImplementerInterface(_implementer)
+                    .canImplementInterfaceForAddress(_interfaceHash, addr) == ERC1820_ACCEPT_MAGIC,
+                "Does not implement the interface"
+            );
+        }
+        interfaces[addr][_interfaceHash] = _implementer;
+        emit InterfaceImplementerSet(addr, _interfaceHash, _implementer);
+    }
+ 
+    /// @notice Sets '_newManager' as manager for '_addr'.
+    /// The new manager will be able to call 'setInterfaceImplementer' for '_addr'.
+    /// @param _addr Address for which to set the new manager.
+    /// @param _newManager Address of the new manager for 'addr'. (Pass '0x0' to reset the manager to '_addr'.)
+    function setManager(address _addr, address _newManager) external {
+        require(getManager(_addr) == msg.sender, "Not the manager");
+        managers[_addr] = _newManager == _addr ? address(0) : _newManager;
+        emit ManagerChanged(_addr, _newManager);
+    }
+ 
+    /// @notice Get the manager of an address.
+    /// @param _addr Address for which to return the manager.
+    /// @return Address of the manager for a given address.
+    function getManager(address _addr) public view returns(address) {
+        // By default the manager of an address is the same address
+        if (managers[_addr] == address(0)) {
+            return _addr;
+        } else {
+            return managers[_addr];
+        }
+    }
+ 
+    /// @notice Compute the keccak256 hash of an interface given its name.
+    /// @param _interfaceName Name of the interface.
+    /// @return The keccak256 hash of an interface name.
+    function interfaceHash(string calldata _interfaceName) external pure returns(bytes32) {
+        return keccak256(abi.encodePacked(_interfaceName));
+    }
+ 
+    /* --- ERC165 Related Functions --- */
+    /* --- Developed in collaboration with William Entriken. --- */
+ 
+    /// @notice Updates the cache with whether the contract implements an ERC165 interface or not.
+    /// @param _contract Address of the contract for which to update the cache.
+    /// @param _interfaceId ERC165 interface for which to update the cache.
+    function updateERC165Cache(address _contract, bytes4 _interfaceId) external {
+        interfaces[_contract][_interfaceId] = implementsERC165InterfaceNoCache(
+            _contract, _interfaceId) ? _contract : address(0);
+        erc165Cached[_contract][_interfaceId] = true;
+    }
+ 
+    /// @notice Checks whether a contract implements an ERC165 interface or not.
+    //  If the result is not cached a direct lookup on the contract address is performed.
+    //  If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
+    //  'updateERC165Cache' with the contract address.
+    /// @param _contract Address of the contract to check.
+    /// @param _interfaceId ERC165 interface to check.
+    /// @return True if '_contract' implements '_interfaceId', false otherwise.
+    function implementsERC165Interface(address _contract, bytes4 _interfaceId) public view returns (bool) {
+        if (!erc165Cached[_contract][_interfaceId]) {
+            return implementsERC165InterfaceNoCache(_contract, _interfaceId);
+        }
+        return interfaces[_contract][_interfaceId] == _contract;
+    }
+ 
+    /// @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
+    /// @param _contract Address of the contract to check.
+    /// @param _interfaceId ERC165 interface to check.
+    /// @return True if '_contract' implements '_interfaceId', false otherwise.
+    function implementsERC165InterfaceNoCache(address _contract, bytes4 _interfaceId) public view returns (bool) {
+        uint256 success;
+        uint256 result;
+ 
+        (success, result) = noThrowCall(_contract, ERC165ID);
+        if (success == 0 || result == 0) {
+            return false;
+        }
+ 
+        (success, result) = noThrowCall(_contract, INVALID_ID);
+        if (success == 0 || result != 0) {
+            return false;
+        }
+ 
+        (success, result) = noThrowCall(_contract, _interfaceId);
+        if (success == 1 && result == 1) {
+            return true;
+        }
+        return false;
+    }
+ 
+    /// @notice Checks whether the hash is a ERC165 interface (ending with 28 zeroes) or not.
+    /// @param _interfaceHash The hash to check.
+    /// @return True if '_interfaceHash' is an ERC165 interface (ending with 28 zeroes), false otherwise.
+    function isERC165Interface(bytes32 _interfaceHash) internal pure returns (bool) {
+        return _interfaceHash & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0;
+    }
+ 
+    /// @dev Make a call on a contract without throwing if the function does not exist.
+    function noThrowCall(address _contract, bytes4 _interfaceId)
+        internal view returns (uint256 success, uint256 result)
+    {
+        bytes4 erc165ID = ERC165ID;
+ 
+        assembly {
+            let x := mload(0x40)               // Find empty storage location using "free memory pointer"
+            mstore(x, erc165ID)                // Place signature at beginning of empty storage
+            mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
+ 
+            success := staticcall(
+                30000,                         // 30k gas
+                _contract,                     // To addr
+                x,                             // Inputs are stored at location x
+                0x24,                          // Inputs are 36 (4 + 32) bytes long
+                x,                             // Store output over input (saves space)
+                0x20                           // Outputs are 32 bytes long
+            )
+ 
+            result := mload(x)                 // Load the result
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/predeploys/OVM_DeployerWhitelist.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_DeployerWhitelist.sol.html new file mode 100644 index 000000000..fb432861c --- /dev/null +++ b/coverage/lcov-report/OVM/predeploys/OVM_DeployerWhitelist.sol.html @@ -0,0 +1,701 @@ + + + + Code coverage report for OVM/predeploys/OVM_DeployerWhitelist.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_DeployerWhitelist.sol +

+
+
+ 36.36% + Statements + 8/22 +
+
+ 66.67% + Branches + 4/6 +
+
+ 12.5% + Functions + 1/8 +
+
+ 34.78% + Lines + 8/23 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +29× +25× +  +  + +  +  +  + + +  +  + +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+ 
+/* Interface Imports */
+import { iOVM_DeployerWhitelist } from "../../iOVM/predeploys/iOVM_DeployerWhitelist.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_DeployerWhitelist
+ * @dev The Deployer Whitelist is a temporary predeploy used to provide additional safety during the
+ * initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts
+ * which are allowed to deploy contracts on Layer2. The Execution Manager will only allow an 
+ * ovmCREATE or ovmCREATE2 operation to proceed if the deployer's address whitelisted.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_DeployerWhitelist is iOVM_DeployerWhitelist {
+ 
+    /**********************
+     * Contract Constants *
+     **********************/
+ 
+    bytes32 internal constant KEY_INITIALIZED =                0x0000000000000000000000000000000000000000000000000000000000000010;
+    bytes32 internal constant KEY_OWNER =                      0x0000000000000000000000000000000000000000000000000000000000000011;
+    bytes32 internal constant KEY_ALLOW_ARBITRARY_DEPLOYMENT = 0x0000000000000000000000000000000000000000000000000000000000000012;
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+    
+    /**
+     * Blocks functions to anyone except the contract owner.
+     */
+    modifier onlyOwner() {
+        address owner = Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                KEY_OWNER
+            )
+        );
+ 
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_SafeExecutionManagerWrapper.safeCALLER() == owner,
+            "Function can only be called by the owner of this contract."
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+    
+    /**
+     * Initializes the whitelist.
+     * @param _owner Address of the owner for this contract.
+     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
+     */
+    function initialize(
+        address _owner,
+        bool _allowArbitraryDeployment
+    )
+        override
+        public
+    {
+        bool initialized = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
+        );
+ 
+        if (initialized == true) {
+            return;
+        }
+ 
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_INITIALIZED,
+            Lib_Bytes32Utils.fromBool(true)
+        );
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_OWNER,
+            Lib_Bytes32Utils.fromAddress(_owner)
+        );
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
+            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
+        );
+    }
+ 
+    /**
+     * Gets the owner of the whitelist.
+     */
+    function getOwner()
+        override
+        public
+        returns(
+            address
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                KEY_OWNER
+            )
+        );
+    }
+ 
+    /**
+     * Adds or removes an address from the deployment whitelist.
+     * @param _deployer Address to update permissions for.
+     * @param _isWhitelisted Whether or not the address is whitelisted.
+     */
+    function setWhitelistedDeployer(
+        address _deployer,
+        bool _isWhitelisted
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            Lib_Bytes32Utils.fromAddress(_deployer),
+            Lib_Bytes32Utils.fromBool(_isWhitelisted)
+        );
+    }
+ 
+    /**
+     * Updates the owner of this contract.
+     * @param _owner Address of the new owner.
+     */
+    function setOwner(
+        address _owner
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_OWNER,
+            Lib_Bytes32Utils.fromAddress(_owner)
+        );
+    }
+ 
+    /**
+     * Updates the arbitrary deployment flag.
+     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
+     */
+    function setAllowArbitraryDeployment(
+        bool _allowArbitraryDeployment
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
+            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
+        );
+    }
+ 
+    /**
+     * Permanently enables arbitrary contract deployment and deletes the owner.
+     */
+    function enableArbitraryContractDeployment()
+        override
+        public
+        onlyOwner
+    {
+        setAllowArbitraryDeployment(true);
+        setOwner(address(0));
+    }
+ 
+    /**
+     * Checks whether an address is allowed to deploy contracts.
+     * @param _deployer Address to check.
+     * @return _allowed Whether or not the address can deploy contracts.
+     */
+    function isDeployerAllowed(
+        address _deployer
+    )
+        override
+        public
+        returns (
+            bool _allowed
+        )
+    {
+        bool initialized = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
+        );
+ 
+        if (initialized == false) {
+            return true;
+        }
+ 
+        bool allowArbitraryDeployment = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_ALLOW_ARBITRARY_DEPLOYMENT)
+        );
+ 
+        if (allowArbitraryDeployment == true) {
+            return true;
+        }
+ 
+        bool isWhitelisted = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                Lib_Bytes32Utils.fromAddress(_deployer)
+            )
+        );
+ 
+        return isWhitelisted;        
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/predeploys/OVM_ETH.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_ETH.sol.html new file mode 100644 index 000000000..c72919992 --- /dev/null +++ b/coverage/lcov-report/OVM/predeploys/OVM_ETH.sol.html @@ -0,0 +1,167 @@ + + + + Code coverage report for OVM/predeploys/OVM_ETH.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_ETH.sol +

+
+
+ 0% + Statements + 0/1 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Contract Imports */
+import { OVM_L2DepositedERC20 } from "../bridge/tokens/OVM_L2DepositedERC20.sol";
+ 
+/**
+ * @title OVM_ETH
+ * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that 
+ * unlike on Layer 1, Layer 2 accounts do not have a balance field.
+ * 
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract OVM_ETH is OVM_L2DepositedERC20 {
+    constructor(
+        address _l2CrossDomainMessenger,
+        address _l1ETHGateway
+    ) 
+        OVM_L2DepositedERC20(
+            _l2CrossDomainMessenger,
+            "Ether",
+            "ETH"
+        )
+    {
+        init(iOVM_L1TokenGateway(_l1ETHGateway));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/predeploys/OVM_L1MessageSender.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_L1MessageSender.sol.html new file mode 100644 index 000000000..23974fcf0 --- /dev/null +++ b/coverage/lcov-report/OVM/predeploys/OVM_L1MessageSender.sol.html @@ -0,0 +1,194 @@ + + + + Code coverage report for OVM/predeploys/OVM_L1MessageSender.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_L1MessageSender.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_L1MessageSender } from "../../iOVM/predeploys/iOVM_L1MessageSender.sol";
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+ 
+/**
+ * @title OVM_L1MessageSender
+ * @dev The L1MessageSender is a predeploy contract running on L2. During the execution of cross 
+ * domain transaction from L1 to L2, it returns the address of the L1 account (either an EOA or
+ * contract) which sent the message to L2 via the Canonical Transaction Chain's `enqueue()` 
+ * function.
+ * 
+ * This contract exclusively serves as a getter for the ovmL1TXORIGIN operation. This is necessary 
+ * because there is no corresponding operation in the EVM which the the optimistic solidity compiler 
+ * can be replaced with a call to the ExecutionManager's ovmL1TXORIGIN() function.
+ *
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_L1MessageSender is iOVM_L1MessageSender {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @return _l1MessageSender L1 message sender address (msg.sender).
+     */
+    function getL1MessageSender()
+        override
+        public
+        view
+        returns (
+            address _l1MessageSender
+        )
+    {
+        // Note that on L2 msg.sender (ie. evmCALLER) will always be the Execution Manager 
+        return iOVM_ExecutionManager(msg.sender).ovmL1TXORIGIN();
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html new file mode 100644 index 000000000..78befb65e --- /dev/null +++ b/coverage/lcov-report/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html @@ -0,0 +1,215 @@ + + + + Code coverage report for OVM/predeploys/OVM_L2ToL1MessagePasser.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_L2ToL1MessagePasser.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_L2ToL1MessagePasser } from "../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
+ 
+/**
+ * @title OVM_L2ToL1MessagePasser
+ * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the 
+ * of a message on L2. The L1 Cross Domain Messenger performs this proof in its
+ * _verifyStorageProof function, which verifies the existence of the transaction hash in this 
+ * contract's `sentMessages` mapping.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    mapping (bytes32 => bool) public sentMessages;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Passes a message to L1.
+     * @param _message Message to pass to L1.
+     */
+    function passMessageToL1(
+        bytes memory _message
+    )
+        override
+        public
+    {
+        // Note: although this function is public, only messages sent from the OVM_L2CrossDomainMessenger 
+        // will be relayed by the OVM_L1CrossDomainMessenger. This is enforced by a check in 
+        // OVM_L1CrossDomainMessenger._verifyStorageProof().
+        sentMessages[keccak256(
+            abi.encodePacked(
+                _message,
+                msg.sender
+            )
+        )] = true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html new file mode 100644 index 000000000..26ebcbefe --- /dev/null +++ b/coverage/lcov-report/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html @@ -0,0 +1,413 @@ + + + + Code coverage report for OVM/predeploys/OVM_ProxySequencerEntrypoint.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_ProxySequencerEntrypoint.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 7/7 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_ProxySequencerEntrypoint 
+ * @dev The Proxy Sequencer Entrypoint is a predeployed proxy to the implementation of the 
+ * Sequencer Entrypoint. This will enable the Optimism team to upgrade the Sequencer Entrypoint 
+ * contract.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ProxySequencerEntrypoint {
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
+            gasleft(),
+            _getImplementation(),
+            msg.data
+        );
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function init(
+        address _implementation,
+        address _owner
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            _getOwner() == address(0),
+            "ProxySequencerEntrypoint has already been inited"
+        );
+        _setOwner(_owner);
+        _setImplementation(_implementation);
+    }
+ 
+    function upgrade(
+        address _implementation
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            _getOwner() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
+            "Only owner can upgrade the Entrypoint"
+        );
+ 
+        _setImplementation(_implementation);
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _setImplementation(
+        address _implementation
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            bytes32(uint256(0)),
+            bytes32(uint256(uint160(_implementation)))
+        );
+    }
+ 
+    function _getImplementation()
+        internal
+        returns (
+            address _implementation
+        )
+    {
+        return address(uint160(uint256(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                bytes32(uint256(0))
+            )
+        )));
+    }
+ 
+    function _setOwner(
+        address _owner
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            bytes32(uint256(1)),
+            bytes32(uint256(uint160(_owner)))
+        );
+    }
+ 
+    function _getOwner()
+        internal
+        returns (
+            address _owner
+        )
+    {
+        return address(uint160(uint256(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                bytes32(uint256(1))
+            )
+        )));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/predeploys/OVM_SequencerEntrypoint.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_SequencerEntrypoint.sol.html new file mode 100644 index 000000000..b6e8b5067 --- /dev/null +++ b/coverage/lcov-report/OVM/predeploys/OVM_SequencerEntrypoint.sol.html @@ -0,0 +1,446 @@ + + + + Code coverage report for OVM/predeploys/OVM_SequencerEntrypoint.sol + + + + + + + +
+
+

+ all files / OVM/predeploys/ OVM_SequencerEntrypoint.sol +

+
+
+ 100% + Statements + 18/18 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 17/17 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + + +  +  + + +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  + + +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_SequencerEntrypoint
+ * @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by 
+ * any account. It accepts a more efficient compressed calldata format, which it decompresses and 
+ * encodes to the standard EIP155 transaction format.
+ * This contract is the implementation referenced by the Proxy Sequencer Entrypoint, thus enabling
+ * the Optimism team to upgrade the decompression of calldata from the Sequencer.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_SequencerEntrypoint {
+ 
+    /*********
+     * Enums *
+     *********/
+    
+    enum TransactionType {
+        NATIVE_ETH_TRANSACTION,
+        ETH_SIGNED_MESSAGE
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    /**
+     * Uses a custom "compressed" format to save on calldata gas:
+     * calldata[00:01]: transaction type (0 == EIP 155, 2 == Eth Sign Message)
+     * calldata[01:33]: signature "r" parameter
+     * calldata[33:65]: signature "s" parameter
+     * calldata[65:66]: signature "v" parameter
+     * calldata[66:69]: transaction gas limit
+     * calldata[69:72]: transaction gas price
+     * calldata[72:75]: transaction nonce
+     * calldata[75:95]: transaction target address
+     * calldata[95:XX]: transaction data
+     */
+    fallback()
+        external
+    {
+        TransactionType transactionType = _getTransactionType(Lib_BytesUtils.toUint8(msg.data, 0));
+ 
+        bytes32 r = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 1, 32));
+        bytes32 s = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 33, 32));
+        uint8 v = Lib_BytesUtils.toUint8(msg.data, 65);
+ 
+        // Remainder is the transaction to execute.
+        bytes memory compressedTx = Lib_BytesUtils.slice(msg.data, 66);
+        bool isEthSignedMessage = transactionType == TransactionType.ETH_SIGNED_MESSAGE;
+ 
+        // Need to decompress and then re-encode the transaction based on the original encoding.
+        bytes memory encodedTx = Lib_OVMCodec.encodeEIP155Transaction(
+            Lib_OVMCodec.decompressEIP155Transaction(compressedTx),
+            isEthSignedMessage
+        );
+ 
+        address target = Lib_ECDSAUtils.recover(
+            encodedTx,
+            isEthSignedMessage,
+            uint8(v),
+            r,
+            s
+        );
+ 
+        if (Lib_SafeExecutionManagerWrapper.safeEXTCODESIZE(target) == 0) {
+            // ProxyEOA has not yet been deployed for this EOA.
+            bytes32 messageHash = Lib_ECDSAUtils.getMessageHash(encodedTx, isEthSignedMessage);
+            Lib_SafeExecutionManagerWrapper.safeCREATEEOA(messageHash, uint8(v), r, s);
+        }
+ 
+        // ProxyEOA has been deployed for this EOA, continue to CALL.
+        bytes memory callbytes = abi.encodeWithSignature(
+            "execute(bytes,uint8,uint8,bytes32,bytes32)",
+            encodedTx,
+            isEthSignedMessage,
+            uint8(v),
+            r,
+            s
+        );
+ 
+        Lib_SafeExecutionManagerWrapper.safeCALL(
+            gasleft(),
+            target,
+            callbytes
+        );
+    }
+    
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Converts a uint256 into a TransactionType enum.
+     * @param _transactionType Transaction type index.
+     * @return _txType Transaction type enum value.
+     */
+    function _getTransactionType(
+        uint8 _transactionType
+    )
+        internal
+        returns (
+            TransactionType _txType
+        )
+    {
+        if (_transactionType == 0) {
+            return TransactionType.NATIVE_ETH_TRANSACTION;
+        } if (_transactionType == 2) {
+            return TransactionType.ETH_SIGNED_MESSAGE;
+        } else {
+            Lib_SafeExecutionManagerWrapper.safeREVERT(
+                "Transaction type must be 0 or 2"
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/predeploys/index.html b/coverage/lcov-report/OVM/predeploys/index.html new file mode 100644 index 000000000..fab910cad --- /dev/null +++ b/coverage/lcov-report/OVM/predeploys/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for OVM/predeploys/ + + + + + + + +
+
+

+ all files OVM/predeploys/ +

+
+
+ 41.76% + Statements + 38/91 +
+
+ 29.41% + Branches + 10/34 +
+
+ 40% + Functions + 12/30 +
+
+ 40.22% + Lines + 37/92 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ERC1820Registry.sol
0%0/380%0/220%0/100%0/39
OVM_DeployerWhitelist.sol
36.36%8/2266.67%4/612.5%1/834.78%8/23
OVM_ETH.sol
0%0/1100%0/00%0/10%0/1
OVM_L1MessageSender.sol
100%1/1100%0/0100%1/1100%1/1
OVM_L2ToL1MessagePasser.sol
100%1/1100%0/0100%1/1100%1/1
OVM_ProxySequencerEntrypoint.sol
100%10/10100%0/0100%7/7100%10/10
OVM_SequencerEntrypoint.sol
100%18/18100%6/6100%2/2100%17/17
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/verification/Abs_FraudContributor.sol.html b/coverage/lcov-report/OVM/verification/Abs_FraudContributor.sol.html new file mode 100644 index 000000000..cb75b1904 --- /dev/null +++ b/coverage/lcov-report/OVM/verification/Abs_FraudContributor.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for OVM/verification/Abs_FraudContributor.sol + + + + + + + +
+
+

+ all files / OVM/verification/ Abs_FraudContributor.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +14× +14× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/// Minimal contract to be inherited by contracts consumed by users that provide
+/// data for fraud proofs
+abstract contract Abs_FraudContributor is Lib_AddressResolver {
+    /// Decorate your functions with this modifier to store how much total gas was
+    /// consumed by the sender, to reward users fairly
+    modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
+        uint256 startGas = gasleft();
+        _;
+        uint256 gasSpent = startGas - gasleft();
+        iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/verification/OVM_BondManager.sol.html b/coverage/lcov-report/OVM/verification/OVM_BondManager.sol.html new file mode 100644 index 000000000..d90409cfe --- /dev/null +++ b/coverage/lcov-report/OVM/verification/OVM_BondManager.sol.html @@ -0,0 +1,689 @@ + + + + Code coverage report for OVM/verification/OVM_BondManager.sol + + + + + + + +
+
+

+ all files / OVM/verification/ OVM_BondManager.sol +

+
+
+ 100% + Statements + 42/42 +
+
+ 86.67% + Branches + 26/30 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 41/41 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +63× +  +  +  +  +  +  +  +  +  +  +46× +46× +  +45× +45× +  +  +  +  +  +13× +12× +  +  +  +11× +  +11× +11× + + + +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +11× +  +  +  +  + +  +  +  +10× +  +  +  +  +  +18× +  +  +  +  +  +18× +  +  +  +  + + + +  + + +  +  +  +  + +  + +  +  +  + +  +  + + +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  + + +  +  + +  +  +  + +  +  + +  +  + +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_BondManager, Errors, ERC20 } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+ 
+/**
+ * @title OVM_BondManager
+ * @dev The Bond Manager contract handles deposits in the form of an ERC20 token from bonded 
+ * Proposers. It also handles the accounting of gas costs spent by a Verifier during the course of a
+ * fraud proof. In the event of a successful fraud proof, the fraudulent Proposer's bond is slashed, 
+ * and the Verifier's gas costs are refunded.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
+ 
+    /****************************
+     * Constants and Parameters *
+     ****************************/
+ 
+    /// The period to find the earliest fraud proof for a publisher
+    uint256 public constant multiFraudProofPeriod = 7 days;
+ 
+    /// The dispute period
+    uint256 public constant disputePeriodSeconds = 7 days;
+ 
+    /// The minimum collateral a sequencer must post
+    uint256 public constant requiredCollateral = 1 ether;
+ 
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    /// The bond token
+    ERC20 immutable public token;
+ 
+ 
+    /********************************************
+     * Contract Variables: Internal Accounting  *
+     *******************************************/
+ 
+    /// The bonds posted by each proposer
+    mapping(address => Bond) public bonds;
+ 
+    /// For each pre-state root, there's an array of witnessProviders that must be rewarded
+    /// for posting witnesses
+    mapping(bytes32 => Rewards) public witnessProviders;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /// Initializes with a ERC20 token to be used for the fidelity bonds
+    /// and with the Address Manager
+    constructor(
+        ERC20 _token,
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        token = _token;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /// Adds `who` to the list of witnessProviders for the provided `preStateRoot`.
+    function recordGasSpent(bytes32 _preStateRoot, bytes32 _txHash, address who, uint256 gasSpent) override public {
+        // The sender must be the transitioner that corresponds to the claimed pre-state root
+        address transitioner = address(iOVM_FraudVerifier(resolve("OVM_FraudVerifier")).getStateTransitioner(_preStateRoot, _txHash));
+        require(transitioner == msg.sender, Errors.ONLY_TRANSITIONER);
+ 
+        witnessProviders[_preStateRoot].total += gasSpent;
+        witnessProviders[_preStateRoot].gasSpent[who] += gasSpent;
+    }
+ 
+    /// Slashes + distributes rewards or frees up the sequencer's bond, only called by
+    /// `FraudVerifier.finalizeFraudVerification`
+    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) override public {
+        require(msg.sender == resolve("OVM_FraudVerifier"), Errors.ONLY_FRAUD_VERIFIER);
+        require(witnessProviders[_preStateRoot].canClaim == false, Errors.ALREADY_FINALIZED);
+ 
+        // allow users to claim from that state root's
+        // pool of collateral (effectively slashing the sequencer)
+        witnessProviders[_preStateRoot].canClaim = true;
+ 
+        Bond storage bond = bonds[publisher];
+        if (bond.firstDisputeAt == 0) {
+            bond.firstDisputeAt = block.timestamp;
+            bond.earliestDisputedStateRoot = _preStateRoot;
+            bond.earliestTimestamp = timestamp;
+        } else if (
+            // only update the disputed state root for the publisher if it's within
+            // the dispute period _and_ if it's before the previous one
+            block.timestamp < bond.firstDisputeAt + multiFraudProofPeriod &&
+            timestamp < bond.earliestTimestamp
+        ) {
+            bond.earliestDisputedStateRoot = _preStateRoot;
+            bond.earliestTimestamp = timestamp;
+        }
+ 
+        // if the fraud proof's dispute period does not intersect with the 
+        // withdrawal's timestamp, then the user should not be slashed
+        // e.g if a user at day 10 submits a withdrawal, and a fraud proof
+        // from day 1 gets published, the user won't be slashed since day 8 (1d + 7d)
+        // is before the user started their withdrawal. on the contrary, if the user
+        // had started their withdrawal at, say, day 6, they would be slashed
+        if (
+            bond.withdrawalTimestamp != 0 && 
+            uint256(bond.withdrawalTimestamp) > timestamp + disputePeriodSeconds &&
+            bond.state == State.WITHDRAWING
+        ) {
+            return;
+        }
+ 
+        // slash!
+        bond.state = State.NOT_COLLATERALIZED;
+    }
+ 
+    /// Sequencers call this function to post collateral which will be used for
+    /// the `appendBatch` call
+    function deposit() override public {
+        Erequire(
+            token.transferFrom(msg.sender, address(this), requiredCollateral),
+            Errors.ERC20_ERR
+        );
+ 
+        // This cannot overflow
+        bonds[msg.sender].state = State.COLLATERALIZED;
+    }
+ 
+    /// Starts the withdrawal for a publisher
+    function startWithdrawal() override public {
+        Bond storage bond = bonds[msg.sender];
+        Erequire(bond.withdrawalTimestamp == 0, Errors.WITHDRAWAL_PENDING);
+        require(bond.state == State.COLLATERALIZED, Errors.WRONG_STATE);
+ 
+        bond.state = State.WITHDRAWING;
+        bond.withdrawalTimestamp = uint32(block.timestamp);
+    }
+ 
+    /// Finalizes a pending withdrawal from a publisher
+    function finalizeWithdrawal() override public {
+        Bond storage bond = bonds[msg.sender];
+ 
+        require(
+            block.timestamp >= uint256(bond.withdrawalTimestamp) + disputePeriodSeconds, 
+            Errors.TOO_EARLY
+        );
+        require(bond.state == State.WITHDRAWING, Errors.SLASHED);
+        
+        // refunds!
+        bond.state = State.NOT_COLLATERALIZED;
+        bond.withdrawalTimestamp = 0;
+        
+        Erequire(
+            token.transfer(msg.sender, requiredCollateral),
+            Errors.ERC20_ERR
+        );
+    }
+ 
+    /// Claims the user's reward for the witnesses they provided for the earliest
+    /// disputed state root of the designated publisher
+    function claim(address who) override public {
+        Bond storage bond = bonds[who];
+        require(
+            block.timestamp >= bond.firstDisputeAt + multiFraudProofPeriod,
+            Errors.WAIT_FOR_DISPUTES
+        );
+ 
+        // reward the earliest state root for this publisher
+        bytes32 _preStateRoot = bond.earliestDisputedStateRoot;
+        Rewards storage rewards = witnessProviders[_preStateRoot];
+ 
+        // only allow claiming if fraud was proven in `finalize`
+        require(rewards.canClaim, Errors.CANNOT_CLAIM);
+ 
+        // proportional allocation - only reward 50% (rest gets locked in the
+        // contract forever
+        uint256 amount = (requiredCollateral * rewards.gasSpent[msg.sender]) / (2 * rewards.total);
+ 
+        // reset the user's spent gas so they cannot double claim
+        rewards.gasSpent[msg.sender] = 0;
+ 
+        // transfer
+        Erequire(token.transfer(msg.sender, amount), Errors.ERC20_ERR);
+    }
+ 
+    /// Checks if the user is collateralized
+    function isCollateralized(address who) override public view returns (bool) {
+        return bonds[who].state == State.COLLATERALIZED;
+    }
+ 
+    /// Gets how many witnesses the user has provided for the state root
+    function getGasSpent(bytes32 preStateRoot, address who) override public view returns (uint256) {
+        return witnessProviders[preStateRoot].gasSpent[who];
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/verification/OVM_FraudVerifier.sol.html b/coverage/lcov-report/OVM/verification/OVM_FraudVerifier.sol.html new file mode 100644 index 000000000..23d1fbb73 --- /dev/null +++ b/coverage/lcov-report/OVM/verification/OVM_FraudVerifier.sol.html @@ -0,0 +1,953 @@ + + + + Code coverage report for OVM/verification/OVM_FraudVerifier.sol + + + + + + + +
+
+

+ all files / OVM/verification/ OVM_FraudVerifier.sol +

+
+
+ 96.43% + Statements + 27/28 +
+
+ 94.44% + Branches + 17/18 +
+
+ 100% + Functions + 7/7 +
+
+ 96.43% + Lines + 27/28 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +12× +  +  +  +12× +12× +  +12× +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +10× +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  +  + +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+ 
+/* Contract Imports */
+import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
+ 
+ 
+ 
+/**
+ * @title OVM_FraudVerifier
+ * @dev The Fraud Verifier contract coordinates the entire fraud proof verification process. 
+ * If the fraud proof was successful it prunes any state batches from State Commitment Chain
+ * which were published after the fraudulent state root.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_FraudVerifier is Lib_AddressResolver, Abs_FraudContributor, iOVM_FraudVerifier {
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    mapping (bytes32 => iOVM_StateTransitioner) internal transitioners;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+ 
+    /***************************************
+     * Public Functions: Transition Status *
+     ***************************************/
+ 
+    /**
+     * Retrieves the state transitioner for a given root.
+     * @param _preStateRoot State root to query a transitioner for.
+     * @return _transitioner Corresponding state transitioner contract.
+     */
+    function getStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        override
+        public
+        view
+        returns (
+            iOVM_StateTransitioner _transitioner
+        )
+    {
+        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
+    }
+ 
+ 
+    /****************************************
+     * Public Functions: Fraud Verification *
+     ****************************************/
+ 
+    /**
+     * Begins the fraud verification process.
+     * @param _preStateRoot State root before the fraudulent transaction.
+     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
+     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
+     * @param _transaction OVM transaction claimed to be fraudulent.
+     * @param _txChainElement OVM transaction chain element.
+     * @param _transactionBatchHeader Batch header for the provided transaction.
+     * @param _transactionProof Inclusion proof for the provided transaction.
+     */
+    function initializeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _transactionBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _transactionProof
+    )
+        override
+        public
+        contributesToFraudProof(_preStateRoot, Lib_OVMCodec.hashTransaction(_transaction))
+    {
+        bytes32 _txHash = Lib_OVMCodec.hashTransaction(_transaction);
+ 
+        Iif (_hasStateTransitioner(_preStateRoot, _txHash)) {
+            return;
+        }
+ 
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+        iOVM_CanonicalTransactionChain ovmCanonicalTransactionChain = iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain"));
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _preStateRoot,
+                _preStateRootBatchHeader,
+                _preStateRootProof
+            ),
+            "Invalid pre-state root inclusion proof."
+        );
+ 
+        require(
+            ovmCanonicalTransactionChain.verifyTransaction(
+                _transaction,
+                _txChainElement,
+                _transactionBatchHeader,
+                _transactionProof
+            ),
+            "Invalid transaction inclusion proof."
+        );
+ 
+        require (
+            _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1 == _transactionBatchHeader.prevTotalElements + _transactionProof.index,
+            "Pre-state root global index must equal to the transaction root global index."
+        );
+ 
+        _deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index);
+ 
+        emit FraudProofInitialized(
+            _preStateRoot,
+            _preStateRootProof.index,
+            _txHash,
+            msg.sender
+        );
+    }
+ 
+    /**
+     * Finalizes the fraud verification process.
+     * @param _preStateRoot State root before the fraudulent transaction.
+     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
+     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
+     * @param _txHash The transaction for the state root
+     * @param _postStateRoot State root after the fraudulent transaction.
+     * @param _postStateRootBatchHeader Batch header for the provided post-state root.
+     * @param _postStateRootProof Inclusion proof for the provided post-state root.
+     */
+    function finalizeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
+        bytes32 _txHash,
+        bytes32 _postStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _postStateRootProof
+    )
+        override
+        public
+        contributesToFraudProof(_preStateRoot, _txHash)
+    {
+        iOVM_StateTransitioner transitioner = getStateTransitioner(_preStateRoot, _txHash);
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+ 
+        require(
+            transitioner.isComplete() == true,
+            "State transition process must be completed prior to finalization."
+        );
+ 
+        require (
+            _postStateRootBatchHeader.prevTotalElements + _postStateRootProof.index == _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1,
+            "Post-state root global index must equal to the pre state root global index plus one."
+        );
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _preStateRoot,
+                _preStateRootBatchHeader,
+                _preStateRootProof
+            ),
+            "Invalid pre-state root inclusion proof."
+        );
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _postStateRoot,
+                _postStateRootBatchHeader,
+                _postStateRootProof
+            ),
+            "Invalid post-state root inclusion proof."
+        );
+ 
+        // If the post state root did not match, then there was fraud and we should delete the batch
+        require(
+            _postStateRoot != transitioner.getPostStateRoot(),
+            "State transition has not been proven fraudulent."
+        );
+        
+        _cancelStateTransition(_postStateRootBatchHeader, _preStateRoot);
+ 
+        // TEMPORARY: Remove the transitioner; for minnet.
+        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitioner(0x0000000000000000000000000000000000000000);
+ 
+        emit FraudProofFinalized(
+            _preStateRoot,
+            _preStateRootProof.index,
+            _txHash,
+            msg.sender
+        );
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Verification *
+     ************************************/
+ 
+    /**
+     * Checks whether a transitioner already exists for a given pre-state root.
+     * @param _preStateRoot Pre-state root to check.
+     * @return _exists Whether or not we already have a transitioner for the root.
+     */
+    function _hasStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        internal
+        view
+        returns (
+            bool _exists
+        )
+    {
+        return address(getStateTransitioner(_preStateRoot, _txHash)) != address(0);
+    }
+ 
+    /**
+     * Deploys a new state transitioner.
+     * @param _preStateRoot Pre-state root to initialize the transitioner with.
+     * @param _txHash Hash of the transaction this transitioner will execute.
+     * @param _stateTransitionIndex Index of the transaction in the chain.
+     */
+    function _deployTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        uint256 _stateTransitionIndex
+    )
+        internal
+    {
+        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitionerFactory(
+            resolve("OVM_StateTransitionerFactory")
+        ).create(
+            address(libAddressManager),
+            _stateTransitionIndex,
+            _preStateRoot,
+            _txHash
+        );
+    }
+ 
+    /**
+     * Removes a state transition from the state commitment chain.
+     * @param _postStateRootBatchHeader Header for the post-state root.
+     * @param _preStateRoot Pre-state root hash.
+     */
+    function _cancelStateTransition(
+        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
+        bytes32 _preStateRoot
+    )
+        internal
+    {
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+        iOVM_BondManager ovmBondManager = iOVM_BondManager(resolve("OVM_BondManager"));
+ 
+        // Delete the state batch.
+        ovmStateCommitmentChain.deleteStateBatch(
+            _postStateRootBatchHeader
+        );
+ 
+        // Get the timestamp and publisher for that block.
+        (uint256 timestamp, address publisher) = abi.decode(_postStateRootBatchHeader.extraData, (uint256, address));
+ 
+        // Slash the bonds at the bond manager.
+        ovmBondManager.finalize(
+            _preStateRoot,
+            publisher,
+            timestamp
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/verification/OVM_StateTransitioner.sol.html b/coverage/lcov-report/OVM/verification/OVM_StateTransitioner.sol.html new file mode 100644 index 000000000..e163ff151 --- /dev/null +++ b/coverage/lcov-report/OVM/verification/OVM_StateTransitioner.sol.html @@ -0,0 +1,1484 @@ + + + + Code coverage report for OVM/verification/OVM_StateTransitioner.sol + + + + + + + +
+
+

+ all files / OVM/verification/ OVM_StateTransitioner.sol +

+
+
+ 80% + Statements + 40/50 +
+
+ 62.5% + Branches + 20/32 +
+
+ 90.91% + Functions + 10/11 +
+
+ 80.39% + Lines + 41/51 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +42× +42× +  +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  + +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
+import { Lib_SecureMerkleTrie } from "../../libraries/trie/Lib_SecureMerkleTrie.sol";
+import { Lib_RLPWriter } from "../../libraries/rlp/Lib_RLPWriter.sol";
+import { Lib_RLPReader } from "../../libraries/rlp/Lib_RLPReader.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
+ 
+/* Contract Imports */
+import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
+ 
+/**
+ * @title OVM_StateTransitioner
+ * @dev The State Transitioner coordinates the execution of a state transition during the evaluation of a
+ * fraud proof. It feeds verified input to the Execution Manager's run(), and controls a State Manager (which is
+ * uniquely created for each fraud proof).
+ * Once a fraud proof has been initialized, this contract is provided with the pre-state root and verifies
+ * that the OVM storage slots committed to the State Mangager are contained in that state
+ * This contract controls the State Manager and Execution Manager, and uses them to calculate the
+ * post-state root by applying the transaction. The Fraud Verifier can then check for fraud by comparing
+ * the calculated post-state root with the proposed post-state root.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateTransitioner is Lib_AddressResolver, Abs_FraudContributor, iOVM_StateTransitioner {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum TransitionPhase {
+        PRE_EXECUTION,
+        POST_EXECUTION,
+        COMPLETE
+    }
+ 
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    iOVM_StateManager public ovmStateManager;
+ 
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    bytes32 internal preStateRoot;
+    bytes32 internal postStateRoot;
+    TransitionPhase public phase;
+    uint256 internal stateTransitionIndex;
+    bytes32 internal transactionHash;
+ 
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 internal constant EMPTY_ACCOUNT_CODE_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
+    bytes32 internal constant EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _stateTransitionIndex Index of the state transition being verified.
+     * @param _preStateRoot State root before the transition was executed.
+     * @param _transactionHash Hash of the executed transaction.
+     */
+    constructor(
+        address _libAddressManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        stateTransitionIndex = _stateTransitionIndex;
+        preStateRoot = _preStateRoot;
+        postStateRoot = _preStateRoot;
+        transactionHash = _transactionHash;
+ 
+        ovmStateManager = iOVM_StateManagerFactory(resolve("OVM_StateManagerFactory")).create(address(this));
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Checks that a function is only run during a specific phase.
+     * @param _phase Phase the function must run within.
+     */
+    modifier onlyDuringPhase(
+        TransitionPhase _phase
+    ) {
+        Erequire(
+            phase == _phase,
+            "Function must be called during the correct phase."
+        );
+        _;
+    }
+ 
+ 
+    /**********************************
+     * Public Functions: State Access *
+     **********************************/
+ 
+    /**
+     * Retrieves the state root before execution.
+     * @return _preStateRoot State root before execution.
+     */
+    function getPreStateRoot()
+        override
+        public
+        view
+        returns (
+            bytes32 _preStateRoot
+        )
+    {
+        return preStateRoot;
+    }
+ 
+    /**
+     * Retrieves the state root after execution.
+     * @return _postStateRoot State root after execution.
+     */
+    function getPostStateRoot()
+        override
+        public
+        view
+        returns (
+            bytes32 _postStateRoot
+        )
+    {
+        return postStateRoot;
+    }
+ 
+    /**
+     * Checks whether the transitioner is complete.
+     * @return _complete Whether or not the transition process is finished.
+     */
+    function isComplete()
+        override
+        public
+        view
+        returns (
+            bool _complete
+        )
+    {
+        return phase == TransitionPhase.COMPLETE;
+    }
+    
+ 
+    /***********************************
+     * Public Functions: Pre-Execution *
+     ***********************************/
+ 
+    /**
+     * Allows a user to prove the initial state of a contract.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _ethContractAddress Address of the corresponding contract on L1.
+     * @param _stateTrieWitness Proof of the account state.
+     */
+    function proveContractState(
+        address _ovmContractAddress,
+        address _ethContractAddress,
+        bytes memory _stateTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        // Exit quickly to avoid unnecessary work.
+        Erequire(
+            (
+                ovmStateManager.hasAccount(_ovmContractAddress) == false
+                && ovmStateManager.hasEmptyAccount(_ovmContractAddress) == false
+            ),
+            "Account state has already been proven."
+        );
+ 
+        // Function will fail if the proof is not a valid inclusion or exclusion proof.
+        (
+            bool exists,
+            bytes memory encodedAccount
+        ) = Lib_SecureMerkleTrie.get(
+            abi.encodePacked(_ovmContractAddress),
+            _stateTrieWitness,
+            preStateRoot
+        );
+ 
+        Eif (exists == true) {
+            // Account exists, this was an inclusion proof.
+            Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
+                encodedAccount
+            );
+ 
+            address ethContractAddress = _ethContractAddress;
+            Iif (account.codeHash == EMPTY_ACCOUNT_CODE_HASH) {
+                // Use a known empty contract to prevent an attack in which a user provides a
+                // contract address here and then later deploys code to it.
+                ethContractAddress = 0x0000000000000000000000000000000000000000;
+            } else {
+                // Otherwise, make sure that the code at the provided eth address matches the hash
+                // of the code stored on L2.
+                Erequire(
+                    Lib_EthUtils.getCodeHash(ethContractAddress) == account.codeHash,
+                    "OVM_StateTransitioner: Provided L1 contract code hash does not match L2 contract code hash."
+                );
+            }
+ 
+            ovmStateManager.putAccount(
+                _ovmContractAddress,
+                Lib_OVMCodec.Account({
+                    nonce: account.nonce,
+                    balance: account.balance,
+                    storageRoot: account.storageRoot,
+                    codeHash: account.codeHash,
+                    ethAddress: ethContractAddress,
+                    isFresh: false
+                })
+            );
+        } else {
+            // Account does not exist, this was an exclusion proof.
+            ovmStateManager.putEmptyAccount(_ovmContractAddress);
+        }
+    }
+ 
+    /**
+     * Allows a user to prove the initial state of a contract storage slot.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _key Claimed account slot key.
+     * @param _storageTrieWitness Proof of the storage slot.
+     */
+    function proveStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes memory _storageTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        // Exit quickly to avoid unnecessary work.
+        Erequire(
+            ovmStateManager.hasContractStorage(_ovmContractAddress, _key) == false,
+            "Storage slot has already been proven."
+        );
+ 
+        require(
+            ovmStateManager.hasAccount(_ovmContractAddress) == true,
+            "Contract must be verified before proving a storage slot."
+        );
+ 
+        bytes32 storageRoot = ovmStateManager.getAccountStorageRoot(_ovmContractAddress);
+        bytes32 value;
+ 
+        Iif (storageRoot == EMPTY_ACCOUNT_STORAGE_ROOT) {
+            // Storage trie was empty, so the user is always allowed to insert zero-byte values.
+            value = bytes32(0);
+        } else {
+            // Function will fail if the proof is not a valid inclusion or exclusion proof.
+            (
+                bool exists,
+                bytes memory encodedValue
+            ) = Lib_SecureMerkleTrie.get(
+                abi.encodePacked(_key),
+                _storageTrieWitness,
+                storageRoot
+            );
+ 
+            Eif (exists == true) {
+                // Inclusion proof.
+                // Stored values are RLP encoded, with leading zeros removed.
+                value = Lib_BytesUtils.toBytes32PadLeft(
+                    Lib_RLPReader.readBytes(encodedValue)
+                );
+            } else {
+                // Exclusion proof, can only be zero bytes.
+                value = bytes32(0);
+            }
+        }
+ 
+        ovmStateManager.putContractStorage(
+            _ovmContractAddress,
+            _key,
+            value
+        );
+    }
+ 
+ 
+    /*******************************
+     * Public Functions: Execution *
+     *******************************/
+ 
+    /**
+     * Executes the state transition.
+     * @param _transaction OVM transaction to execute.
+     */
+    function applyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        Irequire(
+            Lib_OVMCodec.hashTransaction(_transaction) == transactionHash,
+            "Invalid transaction provided."
+        );
+ 
+        // We require gas to complete the logic here in run() before/after execution,
+        // But must ensure the full _tx.gasLimit can be given to the ovmCALL (determinism)
+        // This includes 1/64 of the gas getting lost because of EIP-150 (lost twice--first 
+        // going into EM, then going into the code contract).
+        require(
+            gasleft() >= 100000 + _transaction.gasLimit * 1032 / 1000, // 1032/1000 = 1.032 = (64/63)^2 rounded up
+            "Not enough gas to execute transaction deterministically."
+        );
+ 
+        iOVM_ExecutionManager ovmExecutionManager = iOVM_ExecutionManager(resolve("OVM_ExecutionManager"));
+ 
+        // We call `setExecutionManager` right before `run` (and not earlier) just in case the
+        // OVM_ExecutionManager address was updated between the time when this contract was created
+        // and when `applyTransaction` was called.
+        ovmStateManager.setExecutionManager(address(ovmExecutionManager));
+ 
+        // `run` always succeeds *unless* the user hasn't provided enough gas to `applyTransaction`
+        // or an INVALID_STATE_ACCESS flag was triggered. Either way, we won't get beyond this line
+        // if that's the case.
+        ovmExecutionManager.run(_transaction, address(ovmStateManager));
+ 
+        phase = TransitionPhase.POST_EXECUTION;
+    }
+ 
+ 
+    /************************************
+     * Public Functions: Post-Execution *
+     ************************************/
+ 
+    /**
+     * Allows a user to commit the final state of a contract.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _stateTrieWitness Proof of the account state.
+     */
+    function commitContractState(
+        address _ovmContractAddress,
+        bytes memory _stateTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        Erequire(
+            ovmStateManager.getTotalUncommittedContractStorage() == 0,
+            "All storage must be committed before committing account states."
+        );
+ 
+        require (
+            ovmStateManager.commitAccount(_ovmContractAddress) == true,
+            "Account state wasn't changed or has already been committed."
+        );
+ 
+        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
+ 
+        postStateRoot = Lib_SecureMerkleTrie.update(
+            abi.encodePacked(_ovmContractAddress),
+            Lib_OVMCodec.encodeEVMAccount(
+                Lib_OVMCodec.toEVMAccount(account)
+            ),
+            _stateTrieWitness,
+            postStateRoot
+        );
+ 
+        // Emit an event to help clients figure out the proof ordering.
+        emit AccountCommitted(
+            _ovmContractAddress
+        );
+    }
+ 
+    /**
+     * Allows a user to commit the final state of a contract storage slot.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _key Claimed account slot key.
+     * @param _storageTrieWitness Proof of the storage slot.
+     */
+    function commitStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes memory _storageTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        require(
+            ovmStateManager.commitContractStorage(_ovmContractAddress, _key) == true,
+            "Storage slot value wasn't changed or has already been committed."
+        );
+ 
+        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
+        bytes32 value = ovmStateManager.getContractStorage(_ovmContractAddress, _key);
+ 
+        account.storageRoot = Lib_SecureMerkleTrie.update(
+            abi.encodePacked(_key),
+            Lib_RLPWriter.writeBytes(
+                Lib_Bytes32Utils.removeLeadingZeros(value)
+            ),
+            _storageTrieWitness,
+            account.storageRoot
+        );
+ 
+        ovmStateManager.putAccount(_ovmContractAddress, account);
+ 
+        // Emit an event to help clients figure out the proof ordering.
+        emit ContractStorageCommitted(
+            _ovmContractAddress,
+            _key
+        );
+    }
+ 
+ 
+    /**********************************
+     * Public Functions: Finalization *
+     **********************************/
+ 
+    /**
+     * Finalizes the transition process.
+     */
+    function completeTransition()
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+    {
+        require(
+            ovmStateManager.getTotalUncommittedAccounts() == 0,
+            "All accounts must be committed before completing a transition."
+        );
+ 
+        require(
+            ovmStateManager.getTotalUncommittedContractStorage() == 0,
+            "All storage must be committed before completing a transition."
+        );
+ 
+        phase = TransitionPhase.COMPLETE;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/verification/OVM_StateTransitionerFactory.sol.html b/coverage/lcov-report/OVM/verification/OVM_StateTransitionerFactory.sol.html new file mode 100644 index 000000000..d817cc23b --- /dev/null +++ b/coverage/lcov-report/OVM/verification/OVM_StateTransitionerFactory.sol.html @@ -0,0 +1,266 @@ + + + + Code coverage report for OVM/verification/OVM_StateTransitionerFactory.sol + + + + + + + +
+
+

+ all files / OVM/verification/ OVM_StateTransitionerFactory.sol +

+
+
+ 50% + Statements + 1/2 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 2/2 +
+
+ 50% + Lines + 1/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+ 
+/* Contract Imports */
+import { OVM_StateTransitioner } from "./OVM_StateTransitioner.sol";
+ 
+/**
+ * @title OVM_StateTransitionerFactory
+ * @dev The State Transitioner Factory is used by the Fraud Verifier to create a new State 
+ * Transitioner during the initialization of a fraud proof.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateTransitionerFactory is iOVM_StateTransitionerFactory, Lib_AddressResolver {
+ 
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    /**
+     * Creates a new OVM_StateTransitioner
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _stateTransitionIndex Index of the state transition being verified.
+     * @param _preStateRoot State root before the transition was executed.
+     * @param _transactionHash Hash of the executed transaction.
+     * @return _ovmStateTransitioner New OVM_StateTransitioner instance.
+     */
+    function create(
+        address _libAddressManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        override
+        public
+        returns (
+            iOVM_StateTransitioner _ovmStateTransitioner
+        )
+    {
+        Irequire(
+            msg.sender == resolve("OVM_FraudVerifier"),
+            "Create can only be done by the OVM_FraudVerifier."
+        );
+        return new OVM_StateTransitioner(
+            _libAddressManager,
+            _stateTransitionIndex,
+            _preStateRoot,
+            _transactionHash
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/OVM/verification/index.html b/coverage/lcov-report/OVM/verification/index.html new file mode 100644 index 000000000..ddf93ed3b --- /dev/null +++ b/coverage/lcov-report/OVM/verification/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for OVM/verification/ + + + + + + + +
+
+

+ all files OVM/verification/ +

+
+
+ 90.4% + Statements + 113/125 +
+
+ 78.05% + Branches + 64/82 +
+
+ 96.67% + Functions + 29/30 +
+
+ 90.48% + Lines + 114/126 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_FraudContributor.sol
100%3/3100%0/0100%1/1100%4/4
OVM_BondManager.sol
100%42/4286.67%26/30100%9/9100%41/41
OVM_FraudVerifier.sol
96.43%27/2894.44%17/18100%7/796.43%27/28
OVM_StateTransitioner.sol
80%40/5062.5%20/3290.91%10/1180.39%41/51
OVM_StateTransitionerFactory.sol
50%1/250%1/2100%2/250%1/2
+
+
+ + + + + + + diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css new file mode 100644 index 000000000..29737bcb0 --- /dev/null +++ b/coverage/lcov-report/base.css @@ -0,0 +1,213 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.medium .chart { border:1px solid #f9cd0b; } +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } +/* light gray */ +span.cline-neutral { background: #eaeaea; } + +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/lcov-report/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..5fa3e67a7 --- /dev/null +++ b/coverage/lcov-report/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for iOVM/accounts/iOVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / iOVM/accounts/ iOVM_ECDSAContractAccount.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_ECDSAContractAccount
+ */
+interface iOVM_ECDSAContractAccount {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    ) external returns (bool _success, bytes memory _returndata);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/accounts/index.html b/coverage/lcov-report/iOVM/accounts/index.html new file mode 100644 index 000000000..62cb35f7b --- /dev/null +++ b/coverage/lcov-report/iOVM/accounts/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for iOVM/accounts/ + + + + + + + +
+
+

+ all files iOVM/accounts/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_ECDSAContractAccount.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html b/coverage/lcov-report/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html new file mode 100644 index 000000000..4426f72ea --- /dev/null +++ b/coverage/lcov-report/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html @@ -0,0 +1,173 @@ + + + + Code coverage report for iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/messaging/ iAbs_BaseCrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iAbs_BaseCrossDomainMessenger
+ */
+interface iAbs_BaseCrossDomainMessenger {
+ 
+    /**********
+     * Events *
+     **********/
+    event SentMessage(bytes message);
+    event RelayedMessage(bytes32 msgHash);
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+    function xDomainMessageSender() external view returns (address);
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sends a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _message Message to send to the target.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function sendMessage(
+        address _target,
+        bytes calldata _message,
+        uint32 _gasLimit
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html b/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html new file mode 100644 index 000000000..7e00c950c --- /dev/null +++ b/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html @@ -0,0 +1,257 @@ + + + + Code coverage report for iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/messaging/ iOVM_L1CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title iOVM_L1CrossDomainMessenger
+ */
+interface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    struct L2MessageInclusionProof {
+        bytes32 stateRoot;
+        Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;
+        Lib_OVMCodec.ChainInclusionProof stateRootProof;
+        bytes stateTrieWitness;
+        bytes storageTrieWitness;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @param _proof Inclusion proof for the given message.
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        L2MessageInclusionProof memory _proof
+    ) external;
+ 
+    /**
+     * Replays a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _sender Original sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function replayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        uint32 _gasLimit
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html b/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html new file mode 100644 index 000000000..b32e59d35 --- /dev/null +++ b/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/messaging/ iOVM_L1MultiMessageRelayer.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+interface iOVM_L1MultiMessageRelayer {
+ 
+    struct L2ToL1Message {
+        address target;
+        address sender;
+        bytes message;
+        uint256 messageNonce;
+        iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;
+    }
+ 
+    function batchRelayMessages(L2ToL1Message[] calldata _messages) external; 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html b/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html new file mode 100644 index 000000000..cf02333cc --- /dev/null +++ b/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html @@ -0,0 +1,155 @@ + + + + Code coverage report for iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/messaging/ iOVM_L2CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title iOVM_L2CrossDomainMessenger
+ */
+interface iOVM_L2CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/bridge/messaging/index.html b/coverage/lcov-report/iOVM/bridge/messaging/index.html new file mode 100644 index 000000000..58a002500 --- /dev/null +++ b/coverage/lcov-report/iOVM/bridge/messaging/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for iOVM/bridge/messaging/ + + + + + + + +
+
+

+ all files iOVM/bridge/messaging/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iAbs_BaseCrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MultiMessageRelayer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html b/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html new file mode 100644 index 000000000..84ad6f409 --- /dev/null +++ b/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html @@ -0,0 +1,230 @@ + + + + Code coverage report for iOVM/bridge/tokens/iOVM_L1ETHGateway.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/tokens/ iOVM_L1ETHGateway.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L1ETHGateway
+ */
+interface iOVM_L1ETHGateway {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event DepositInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+ 
+    event WithdrawalFinalized(
+        address indexed _to,
+        uint256 _amount
+    );
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function deposit()
+        external
+        payable;
+ 
+    function depositTo(
+        address _to
+    )
+        external
+        payable;
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+    function getFinalizeDepositL2Gas()
+        external
+        view
+        returns(
+            uint32
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html b/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html new file mode 100644 index 000000000..1a088713e --- /dev/null +++ b/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html @@ -0,0 +1,218 @@ + + + + Code coverage report for iOVM/bridge/tokens/iOVM_L1TokenGateway.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/tokens/ iOVM_L1TokenGateway.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L1TokenGateway
+ */
+interface iOVM_L1TokenGateway {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event DepositInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+  
+    event WithdrawalFinalized(
+        address indexed _to,
+        uint256 _amount
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function deposit(
+        uint _amount
+    )
+        external;
+ 
+    function depositTo(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html b/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html new file mode 100644 index 000000000..8c248edb0 --- /dev/null +++ b/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html @@ -0,0 +1,218 @@ + + + + Code coverage report for iOVM/bridge/tokens/iOVM_L2DepositedToken.sol + + + + + + + +
+
+

+ all files / iOVM/bridge/tokens/ iOVM_L2DepositedToken.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L2DepositedToken
+ */
+interface iOVM_L2DepositedToken {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event WithdrawalInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+ 
+    event DepositFinalized(
+        address indexed _to,
+        uint256 _amount
+    );    
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function withdraw(
+        uint _amount
+    )
+        external;
+ 
+    function withdrawTo(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/bridge/tokens/index.html b/coverage/lcov-report/iOVM/bridge/tokens/index.html new file mode 100644 index 000000000..1ad5e98f3 --- /dev/null +++ b/coverage/lcov-report/iOVM/bridge/tokens/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for iOVM/bridge/tokens/ + + + + + + + +
+
+

+ all files iOVM/bridge/tokens/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_L1ETHGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1TokenGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2DepositedToken.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html b/coverage/lcov-report/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html new file mode 100644 index 000000000..03738305b --- /dev/null +++ b/coverage/lcov-report/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html @@ -0,0 +1,782 @@ + + + + Code coverage report for iOVM/chain/iOVM_CanonicalTransactionChain.sol + + + + + + + +
+
+

+ all files / iOVM/chain/ iOVM_CanonicalTransactionChain.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_ChainStorageContainer } from "./iOVM_ChainStorageContainer.sol";
+ 
+/**
+ * @title iOVM_CanonicalTransactionChain
+ */
+interface iOVM_CanonicalTransactionChain {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event TransactionEnqueued(
+        address _l1TxOrigin,
+        address _target,
+        uint256 _gasLimit,
+        bytes _data,
+        uint256 _queueIndex,
+        uint256 _timestamp
+    );
+ 
+    event QueueBatchAppended(
+        uint256 _startingQueueIndex,
+        uint256 _numQueueElements,
+        uint256 _totalElements
+    );
+ 
+    event SequencerBatchAppended(
+        uint256 _startingQueueIndex,
+        uint256 _numQueueElements,
+        uint256 _totalElements
+    );
+ 
+    event TransactionBatchAppended(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot,
+        uint256 _batchSize,
+        uint256 _prevTotalElements,
+        bytes _extraData
+    );
+ 
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct BatchContext {
+        uint256 numSequencedTransactions;
+        uint256 numSubsequentQueueTransactions;
+        uint256 timestamp;
+        uint256 blockNumber;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        external
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        );
+ 
+    /**
+     * Accesses the queue storage container.
+     * @return Reference to the queue storage container.
+     */
+    function queue()
+        external
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        );
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        external
+        view
+        returns (
+            uint256 _totalElements
+        );
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        external
+        view
+        returns (
+            uint256 _totalBatches
+        );
+ 
+    /**
+     * Returns the index of the next element to be enqueued.
+     * @return Index for the next queue element.
+     */
+    function getNextQueueIndex()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function getQueueElement(
+        uint256 _index
+    )
+        external
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        );
+ 
+    /**
+     * Returns the timestamp of the last transaction.
+     * @return Timestamp for the last transaction.
+     */
+    function getLastTimestamp()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Returns the blocknumber of the last transaction.
+     * @return Blocknumber for the last transaction.
+     */
+    function getLastBlockNumber()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Get the number of queue elements which have not yet been included.
+     * @return Number of pending queue elements.
+     */
+    function getNumPendingQueueElements()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Retrieves the length of the queue, including
+     * both pending and canonical transactions.
+     * @return Length of the queue.
+     */
+    function getQueueLength()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+ 
+    /**
+     * Adds a transaction to the queue.
+     * @param _target Target contract to send the transaction to.
+     * @param _gasLimit Gas limit for the given transaction.
+     * @param _data Transaction data.
+     */
+    function enqueue(
+        address _target,
+        uint256 _gasLimit,
+        bytes memory _data
+    )
+        external;
+ 
+    /**
+     * Appends a given number of queued transactions as a single batch.
+     * @param _numQueuedTransactions Number of transactions to append.
+     */
+    function appendQueueBatch(
+        uint256 _numQueuedTransactions
+    )
+        external;
+ 
+    /**
+     * Allows the sequencer to append a batch of transactions.
+     * @dev This function uses a custom encoding scheme for efficiency reasons.
+     * .param _shouldStartAtElement Specific batch we expect to start appending to.
+     * .param _totalElementsToAppend Total number of batch elements we expect to append.
+     * .param _contexts Array of batch contexts.
+     * .param _transactionDataFields Array of raw transaction data.
+     */
+    function appendSequencerBatch(
+        // uint40 _shouldStartAtElement,
+        // uint24 _totalElementsToAppend,
+        // BatchContext[] _contexts,
+        // bytes[] _transactionDataFields
+    )
+        external;
+ 
+    /**
+     * Verifies whether a transaction is included in the chain.
+     * @param _transaction Transaction to verify.
+     * @param _txChainElement Transaction chain element corresponding to the transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
+     * @return True if the transaction exists in the CTC, false if not.
+     */
+    function verifyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        external
+        view
+        returns (
+            bool
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/chain/iOVM_ChainStorageContainer.sol.html b/coverage/lcov-report/iOVM/chain/iOVM_ChainStorageContainer.sol.html new file mode 100644 index 000000000..382c309c4 --- /dev/null +++ b/coverage/lcov-report/iOVM/chain/iOVM_ChainStorageContainer.sol.html @@ -0,0 +1,398 @@ + + + + Code coverage report for iOVM/chain/iOVM_ChainStorageContainer.sol + + + + + + + +
+
+

+ all files / iOVM/chain/ iOVM_ChainStorageContainer.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_ChainStorageContainer
+ */
+interface iOVM_ChainStorageContainer {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sets the container's global metadata field. We're using `bytes27` here because we use five
+     * bytes to maintain the length of the underlying data structure, meaning we have an extra
+     * 27 bytes to store arbitrary data.
+     * @param _globalMetadata New global metadata to set.
+     */
+    function setGlobalMetadata(
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Retrieves the container's global metadata field.
+     * @return Container global metadata field.
+     */
+    function getGlobalMetadata()
+        external
+        view
+        returns (
+            bytes27
+        );
+ 
+    /**
+     * Retrieves the number of objects stored in the container.
+     * @return Number of objects in the container.
+     */
+    function length()
+        external
+        view
+        returns (
+            uint256
+        );
+ 
+    /**
+     * Pushes an object into the container.
+     * @param _object A 32 byte value to insert into the container.
+     */
+    function push(
+        bytes32 _object
+    )
+        external;
+ 
+    /**
+     * Pushes an object into the container. Function allows setting the global metadata since
+     * we'll need to touch the "length" storage slot anyway, which also contains the global
+     * metadata (it's an optimization).
+     * @param _object A 32 byte value to insert into the container.
+     * @param _globalMetadata New global metadata for the container.
+     */
+    function push(
+        bytes32 _object,
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Retrieves an object from the container.
+     * @param _index Index of the particular object to access.
+     * @return 32 byte object value.
+     */
+    function get(
+        uint256 _index
+    )
+        external
+        view
+        returns (
+            bytes32
+        );
+ 
+    /**
+     * Removes all objects after and including a given index.
+     * @param _index Object index to delete from.
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index
+    )
+        external;
+ 
+    /**
+     * Removes all objects after and including a given index. Also allows setting the global
+     * metadata field.
+     * @param _index Object index to delete from.
+     * @param _globalMetadata New global metadata for the container.
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index,
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Marks an index as overwritable, meaing the underlying buffer can start to write values over
+     * any objects before and including the given index.
+     */
+    function setNextOverwritableIndex(
+        uint256 _index
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/chain/iOVM_StateCommitmentChain.sol.html b/coverage/lcov-report/iOVM/chain/iOVM_StateCommitmentChain.sol.html new file mode 100644 index 000000000..713fcd358 --- /dev/null +++ b/coverage/lcov-report/iOVM/chain/iOVM_StateCommitmentChain.sol.html @@ -0,0 +1,419 @@ + + + + Code coverage report for iOVM/chain/iOVM_StateCommitmentChain.sol + + + + + + + +
+
+

+ all files / iOVM/chain/ iOVM_StateCommitmentChain.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateCommitmentChain
+ */
+interface iOVM_StateCommitmentChain {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event StateBatchAppended(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot,
+        uint256 _batchSize,
+        uint256 _prevTotalElements,
+        bytes _extraData
+    );
+ 
+    event StateBatchDeleted(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        external
+        view
+        returns (
+            uint256 _totalElements
+        );
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        external
+        view
+        returns (
+            uint256 _totalBatches
+        );
+ 
+    /**
+     * Retrieves the timestamp of the last batch submitted by the sequencer.
+     * @return _lastSequencerTimestamp Last sequencer batch timestamp.
+     */
+    function getLastSequencerTimestamp()
+        external
+        view
+        returns (
+            uint256 _lastSequencerTimestamp
+        );
+ 
+    /**
+     * Appends a batch of state roots to the chain.
+     * @param _batch Batch of state roots.
+     * @param _shouldStartAtElement Index of the element at which this batch should start.
+     */
+    function appendStateBatch(
+        bytes32[] calldata _batch,
+        uint256 _shouldStartAtElement
+    )
+        external;
+ 
+    /**
+     * Deletes all state roots after (and including) a given batch.
+     * @param _batchHeader Header of the batch to start deleting from.
+     */
+    function deleteStateBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        external;
+ 
+    /**
+     * Verifies a batch inclusion proof.
+     * @param _element Hash of the element to verify a proof for.
+     * @param _batchHeader Header of the batch in which the element was included.
+     * @param _proof Merkle inclusion proof for the element.
+     */
+    function verifyStateCommitment(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        external
+        view
+        returns (
+            bool _verified
+        );
+ 
+    /**
+     * Checks whether a given batch is still inside its fraud proof window.
+     * @param _batchHeader Header of the batch to check.
+     * @return _inside Whether or not the batch is inside the fraud proof window.
+     */
+    function insideFraudProofWindow(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        external
+        view
+        returns (
+            bool _inside
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/chain/index.html b/coverage/lcov-report/iOVM/chain/index.html new file mode 100644 index 000000000..bba16e950 --- /dev/null +++ b/coverage/lcov-report/iOVM/chain/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for iOVM/chain/ + + + + + + + +
+
+

+ all files iOVM/chain/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_CanonicalTransactionChain.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ChainStorageContainer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateCommitmentChain.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/execution/iOVM_ExecutionManager.sol.html b/coverage/lcov-report/iOVM/execution/iOVM_ExecutionManager.sol.html new file mode 100644 index 000000000..18c089ea7 --- /dev/null +++ b/coverage/lcov-report/iOVM/execution/iOVM_ExecutionManager.sol.html @@ -0,0 +1,533 @@ + + + + Code coverage report for iOVM/execution/iOVM_ExecutionManager.sol + + + + + + + +
+
+

+ all files / iOVM/execution/ iOVM_ExecutionManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+interface iOVM_ExecutionManager {
+    /**********
+     * Enums *
+     *********/
+ 
+    enum RevertFlag {
+        OUT_OF_GAS,
+        INTENTIONAL_REVERT,
+        EXCEEDS_NUISANCE_GAS,
+        INVALID_STATE_ACCESS,
+        UNSAFE_BYTECODE,
+        CREATE_COLLISION,
+        STATIC_VIOLATION,
+        CREATOR_NOT_ALLOWED
+    }
+ 
+    enum GasMetadataKey {
+        CURRENT_EPOCH_START_TIMESTAMP,
+        CUMULATIVE_SEQUENCER_QUEUE_GAS,
+        CUMULATIVE_L1TOL2_QUEUE_GAS,
+        PREV_EPOCH_SEQUENCER_QUEUE_GAS,
+        PREV_EPOCH_L1TOL2_QUEUE_GAS
+    }
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct GasMeterConfig {
+        uint256 minTransactionGasLimit;
+        uint256 maxTransactionGasLimit;
+        uint256 maxGasPerQueuePerEpoch;
+        uint256 secondsPerEpoch;
+    }
+ 
+    struct GlobalContext {
+        uint256 ovmCHAINID;
+    }
+ 
+    struct TransactionContext {
+        Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;
+        uint256 ovmTIMESTAMP;
+        uint256 ovmNUMBER;
+        uint256 ovmGASLIMIT;
+        uint256 ovmTXGASLIMIT;
+        address ovmL1TXORIGIN;
+    }
+ 
+    struct TransactionRecord {
+        uint256 ovmGasRefund;
+    }
+ 
+    struct MessageContext {
+        address ovmCALLER;
+        address ovmADDRESS;
+        bool isStatic;
+    }
+ 
+    struct MessageRecord {
+        uint256 nuisanceGasLeft;
+    }
+ 
+ 
+    /************************************
+     * Transaction Execution Entrypoint *
+     ************************************/
+ 
+    function run(
+        Lib_OVMCodec.Transaction calldata _transaction,
+        address _txStateManager
+    ) external;
+ 
+ 
+    /*******************
+     * Context Opcodes *
+     *******************/
+ 
+    function ovmCALLER() external view returns (address _caller);
+    function ovmADDRESS() external view returns (address _address);
+    function ovmTIMESTAMP() external view returns (uint256 _timestamp);
+    function ovmNUMBER() external view returns (uint256 _number);
+    function ovmGASLIMIT() external view returns (uint256 _gasLimit);
+    function ovmCHAINID() external view returns (uint256 _chainId);
+ 
+ 
+    /**********************
+     * L2 Context Opcodes *
+     **********************/
+ 
+    function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
+    function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
+ 
+ 
+    /*******************
+     * Halting Opcodes *
+     *******************/
+ 
+    function ovmREVERT(bytes memory _data) external;
+ 
+ 
+    /*****************************
+     * Contract Creation Opcodes *
+     *****************************/
+ 
+    function ovmCREATE(bytes memory _bytecode) external returns (address _contract, bytes memory _revertdata);
+    function ovmCREATE2(bytes memory _bytecode, bytes32 _salt) external returns (address _contract, bytes memory _revertdata);
+ 
+ 
+    /*******************************
+     * Account Abstraction Opcodes *
+     ******************************/
+ 
+    function ovmGETNONCE() external returns (uint256 _nonce);
+    function ovmSETNONCE(uint256 _nonce) external;
+    function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
+ 
+ 
+    /****************************
+     * Contract Calling Opcodes *
+     ****************************/
+ 
+    function ovmCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+    function ovmSTATICCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+    function ovmDELEGATECALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+ 
+ 
+    /****************************
+     * Contract Storage Opcodes *
+     ****************************/
+ 
+    function ovmSLOAD(bytes32 _key) external returns (bytes32 _value);
+    function ovmSSTORE(bytes32 _key, bytes32 _value) external;
+ 
+ 
+    /*************************
+     * Contract Code Opcodes *
+     *************************/
+ 
+    function ovmEXTCODECOPY(address _contract, uint256 _offset, uint256 _length) external returns (bytes memory _code);
+    function ovmEXTCODESIZE(address _contract) external returns (uint256 _size);
+    function ovmEXTCODEHASH(address _contract) external returns (bytes32 _hash);
+ 
+ 
+    /***************************************
+     * Public Functions: Execution Context *
+     ***************************************/
+ 
+    function getMaxTransactionGasLimit() external view returns (uint _maxTransactionGasLimit);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/execution/iOVM_SafetyChecker.sol.html b/coverage/lcov-report/iOVM/execution/iOVM_SafetyChecker.sol.html new file mode 100644 index 000000000..32921e244 --- /dev/null +++ b/coverage/lcov-report/iOVM/execution/iOVM_SafetyChecker.sol.html @@ -0,0 +1,107 @@ + + + + Code coverage report for iOVM/execution/iOVM_SafetyChecker.sol + + + + + + + +
+
+

+ all files / iOVM/execution/ iOVM_SafetyChecker.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_SafetyChecker
+ */
+interface iOVM_SafetyChecker {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/execution/iOVM_StateManager.sol.html b/coverage/lcov-report/iOVM/execution/iOVM_StateManager.sol.html new file mode 100644 index 000000000..10e5b015f --- /dev/null +++ b/coverage/lcov-report/iOVM/execution/iOVM_StateManager.sol.html @@ -0,0 +1,296 @@ + + + + Code coverage report for iOVM/execution/iOVM_StateManager.sol + + + + + + + +
+
+

+ all files / iOVM/execution/ iOVM_StateManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateManager
+ */
+interface iOVM_StateManager {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum ItemState {
+        ITEM_UNTOUCHED,
+        ITEM_LOADED,
+        ITEM_CHANGED,
+        ITEM_COMMITTED
+    }
+ 
+    /***************************
+     * Public Functions: Misc *
+     ***************************/
+ 
+    function isAuthenticated(address _address) external view returns (bool);
+ 
+    /***************************
+     * Public Functions: Setup *
+     ***************************/
+ 
+    function owner() external view returns (address _owner);
+    function ovmExecutionManager() external view returns (address _ovmExecutionManager);
+    function setExecutionManager(address _ovmExecutionManager) external;
+ 
+ 
+    /************************************
+     * Public Functions: Account Access *
+     ************************************/
+ 
+    function putAccount(address _address, Lib_OVMCodec.Account memory _account) external;
+    function putEmptyAccount(address _address) external;
+    function getAccount(address _address) external view returns (Lib_OVMCodec.Account memory _account);
+    function hasAccount(address _address) external view returns (bool _exists);
+    function hasEmptyAccount(address _address) external view returns (bool _exists);
+    function setAccountNonce(address _address, uint256 _nonce) external;
+    function getAccountNonce(address _address) external view returns (uint256 _nonce);
+    function getAccountEthAddress(address _address) external view returns (address _ethAddress);
+    function getAccountStorageRoot(address _address) external view returns (bytes32 _storageRoot);
+    function initPendingAccount(address _address) external;
+    function commitPendingAccount(address _address, address _ethAddress, bytes32 _codeHash) external;
+    function testAndSetAccountLoaded(address _address) external returns (bool _wasAccountAlreadyLoaded);
+    function testAndSetAccountChanged(address _address) external returns (bool _wasAccountAlreadyChanged);
+    function commitAccount(address _address) external returns (bool _wasAccountCommitted);
+    function incrementTotalUncommittedAccounts() external;
+    function getTotalUncommittedAccounts() external view returns (uint256 _total);
+    function wasAccountChanged(address _address) external view returns (bool);
+    function wasAccountCommitted(address _address) external view returns (bool);
+ 
+ 
+    /************************************
+     * Public Functions: Storage Access *
+     ************************************/
+ 
+    function putContractStorage(address _contract, bytes32 _key, bytes32 _value) external;
+    function getContractStorage(address _contract, bytes32 _key) external view returns (bytes32 _value);
+    function hasContractStorage(address _contract, bytes32 _key) external view returns (bool _exists);
+    function testAndSetContractStorageLoaded(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyLoaded);
+    function testAndSetContractStorageChanged(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyChanged);
+    function commitContractStorage(address _contract, bytes32 _key) external returns (bool _wasContractStorageCommitted);
+    function incrementTotalUncommittedContractStorage() external;
+    function getTotalUncommittedContractStorage() external view returns (uint256 _total);
+    function wasContractStorageChanged(address _contract, bytes32 _key) external view returns (bool);
+    function wasContractStorageCommitted(address _contract, bytes32 _key) external view returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/execution/iOVM_StateManagerFactory.sol.html b/coverage/lcov-report/iOVM/execution/iOVM_StateManagerFactory.sol.html new file mode 100644 index 000000000..ccc0b1d51 --- /dev/null +++ b/coverage/lcov-report/iOVM/execution/iOVM_StateManagerFactory.sol.html @@ -0,0 +1,134 @@ + + + + Code coverage report for iOVM/execution/iOVM_StateManagerFactory.sol + + + + + + + +
+
+

+ all files / iOVM/execution/ iOVM_StateManagerFactory.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { iOVM_StateManager } from "./iOVM_StateManager.sol";
+ 
+/**
+ * @title iOVM_StateManagerFactory
+ */
+interface iOVM_StateManagerFactory {
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    function create(
+        address _owner
+    )
+        external
+        returns (
+            iOVM_StateManager _ovmStateManager
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/execution/index.html b/coverage/lcov-report/iOVM/execution/index.html new file mode 100644 index 000000000..920d0dec2 --- /dev/null +++ b/coverage/lcov-report/iOVM/execution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for iOVM/execution/ + + + + + + + +
+
+

+ all files iOVM/execution/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_ExecutionManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_SafetyChecker.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManagerFactory.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html b/coverage/lcov-report/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html new file mode 100644 index 000000000..32c1ad98b --- /dev/null +++ b/coverage/lcov-report/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html @@ -0,0 +1,125 @@ + + + + Code coverage report for iOVM/predeploys/iOVM_DeployerWhitelist.sol + + + + + + + +
+
+

+ all files / iOVM/predeploys/ iOVM_DeployerWhitelist.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_DeployerWhitelist
+ */
+interface iOVM_DeployerWhitelist {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function initialize(address _owner, bool _allowArbitraryDeployment) external;
+    function getOwner() external returns (address _owner);
+    function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;
+    function setOwner(address _newOwner) external;
+    function setAllowArbitraryDeployment(bool _allowArbitraryDeployment) external;
+    function enableArbitraryContractDeployment() external;
+    function isDeployerAllowed(address _deployer) external returns (bool _allowed);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/predeploys/iOVM_ERC20.sol.html b/coverage/lcov-report/iOVM/predeploys/iOVM_ERC20.sol.html new file mode 100644 index 000000000..b9619f473 --- /dev/null +++ b/coverage/lcov-report/iOVM/predeploys/iOVM_ERC20.sol.html @@ -0,0 +1,224 @@ + + + + Code coverage report for iOVM/predeploys/iOVM_ERC20.sol + + + + + + + +
+
+

+ all files / iOVM/predeploys/ iOVM_ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_ERC20
+ */
+interface iOVM_ERC20 {
+    /* This is a slight change to the ERC20 base standard.
+    function totalSupply() constant returns (uint256 supply);
+    is replaced with:
+    uint256 public totalSupply;
+    This automatically creates a getter function for the totalSupply.
+    This is moved to the base contract since public getter functions are not
+    currently recognised as an implementation of the matching abstract
+    function by the compiler.
+    */
+    /// total amount of tokens
+    function totalSupply() external view returns (uint256);
+ 
+    /// @param _owner The address from which the balance will be retrieved
+    /// @return balance The balance
+    function balanceOf(address _owner) external view returns (uint256 balance);
+ 
+    /// @notice send `_value` token to `_to` from `msg.sender`
+    /// @param _to The address of the recipient
+    /// @param _value The amount of token to be transferred
+    /// @return success Whether the transfer was successful or not
+    function transfer(address _to, uint256 _value) external returns (bool success);
+ 
+    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
+    /// @param _from The address of the sender
+    /// @param _to The address of the recipient
+    /// @param _value The amount of token to be transferred
+    /// @return success Whether the transfer was successful or not
+    function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
+ 
+    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
+    /// @param _spender The address of the account able to transfer the tokens
+    /// @param _value The amount of tokens to be approved for transfer
+    /// @return success Whether the approval was successful or not
+    function approve(address _spender, uint256 _value) external returns (bool success);
+ 
+    /// @param _owner The address of the account owning tokens
+    /// @param _spender The address of the account able to transfer the tokens
+    /// @return remaining Amount of remaining tokens allowed to spent
+    function allowance(address _owner, address _spender) external view returns (uint256 remaining);
+ 
+    // solhint-disable-next-line no-simple-event-func-name
+    event Transfer(address indexed _from, address indexed _to, uint256 _value);
+    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
+    event Mint(address indexed _account, uint256 _amount);
+    event Burn(address indexed _account, uint256 _amount);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/predeploys/iOVM_L1MessageSender.sol.html b/coverage/lcov-report/iOVM/predeploys/iOVM_L1MessageSender.sol.html new file mode 100644 index 000000000..1fb36e2dd --- /dev/null +++ b/coverage/lcov-report/iOVM/predeploys/iOVM_L1MessageSender.sol.html @@ -0,0 +1,107 @@ + + + + Code coverage report for iOVM/predeploys/iOVM_L1MessageSender.sol + + + + + + + +
+
+

+ all files / iOVM/predeploys/ iOVM_L1MessageSender.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_L1MessageSender
+ */
+interface iOVM_L1MessageSender {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function getL1MessageSender() external view returns (address _l1MessageSender);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html b/coverage/lcov-report/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html new file mode 100644 index 000000000..d43cbd99b --- /dev/null +++ b/coverage/lcov-report/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html @@ -0,0 +1,140 @@ + + + + Code coverage report for iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol + + + + + + + +
+
+

+ all files / iOVM/predeploys/ iOVM_L2ToL1MessagePasser.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_L2ToL1MessagePasser
+ */
+interface iOVM_L2ToL1MessagePasser {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event L2ToL1Message(
+        uint256 _nonce,
+        address _sender,
+        bytes _data
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function passMessageToL1(bytes calldata _message) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/predeploys/index.html b/coverage/lcov-report/iOVM/predeploys/index.html new file mode 100644 index 000000000..d766508c8 --- /dev/null +++ b/coverage/lcov-report/iOVM/predeploys/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for iOVM/predeploys/ + + + + + + + +
+
+

+ all files iOVM/predeploys/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_DeployerWhitelist.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ERC20.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MessageSender.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2ToL1MessagePasser.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/verification/iOVM_BondManager.sol.html b/coverage/lcov-report/iOVM/verification/iOVM_BondManager.sol.html new file mode 100644 index 000000000..8d7748deb --- /dev/null +++ b/coverage/lcov-report/iOVM/verification/iOVM_BondManager.sol.html @@ -0,0 +1,389 @@ + + + + Code coverage report for iOVM/verification/iOVM_BondManager.sol + + + + + + + +
+
+

+ all files / iOVM/verification/ iOVM_BondManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+interface ERC20 {
+    function transfer(address, uint256) external returns (bool);
+    function transferFrom(address, address, uint256) external returns (bool);
+}
+ 
+/// All the errors which may be encountered on the bond manager
+library Errors {
+    string constant ERC20_ERR = "BondManager: Could not post bond";
+    string constant ALREADY_FINALIZED = "BondManager: Fraud proof for this pre-state root has already been finalized";
+    string constant SLASHED = "BondManager: Cannot finalize withdrawal, you probably got slashed";
+    string constant WRONG_STATE = "BondManager: Wrong bond state for proposer";
+    string constant CANNOT_CLAIM = "BondManager: Cannot claim yet. Dispute must be finalized first";
+ 
+    string constant WITHDRAWAL_PENDING = "BondManager: Withdrawal already pending";
+    string constant TOO_EARLY = "BondManager: Too early to finalize your withdrawal";
+ 
+    string constant ONLY_TRANSITIONER = "BondManager: Only the transitioner for this pre-state root may call this function";
+    string constant ONLY_FRAUD_VERIFIER = "BondManager: Only the fraud verifier may call this function";
+    string constant ONLY_STATE_COMMITMENT_CHAIN = "BondManager: Only the state commitment chain may call this function";
+    string constant WAIT_FOR_DISPUTES = "BondManager: Wait for other potential disputes";
+}
+ 
+/**
+ * @title iOVM_BondManager
+ */
+interface iOVM_BondManager {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    /// The lifecycle of a proposer's bond
+    enum State {
+        // Before depositing or after getting slashed, a user is uncollateralized
+        NOT_COLLATERALIZED,
+        // After depositing, a user is collateralized
+        COLLATERALIZED,
+        // After a user has initiated a withdrawal
+        WITHDRAWING
+    }
+ 
+    /// A bond posted by a proposer
+    struct Bond {
+        // The user's state
+        State state;
+        // The timestamp at which a proposer issued their withdrawal request
+        uint32 withdrawalTimestamp;
+        // The time when the first disputed was initiated for this bond
+        uint256 firstDisputeAt;
+        // The earliest observed state root for this bond which has had fraud
+        bytes32 earliestDisputedStateRoot;
+        // The state root's timestamp
+        uint256 earliestTimestamp;
+    }
+ 
+    // Per pre-state root, store the number of state provisions that were made
+    // and how many of these calls were made by each user. Payouts will then be
+    // claimed by users proportionally for that dispute.
+    struct Rewards {
+        // Flag to check if rewards for a fraud proof are claimable
+        bool canClaim;
+        // Total number of `recordGasSpent` calls made
+        uint256 total;
+        // The gas spent by each user to provide witness data. The sum of all
+        // values inside this map MUST be equal to the value of `total`
+        mapping(address => uint256) gasSpent;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function recordGasSpent(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        address _who,
+        uint256 _gasSpent
+    ) external;
+ 
+    function finalize(
+        bytes32 _preStateRoot,
+        address _publisher,
+        uint256 _timestamp
+    ) external;
+ 
+    function deposit() external;
+ 
+    function startWithdrawal() external;
+ 
+    function finalizeWithdrawal() external;
+ 
+    function claim(
+        address _who
+    ) external;
+ 
+    function isCollateralized(
+        address _who
+    ) external view returns (bool);
+ 
+    function getGasSpent(
+        bytes32 _preStateRoot,
+        address _who
+    ) external view returns (uint256);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/verification/iOVM_FraudVerifier.sol.html b/coverage/lcov-report/iOVM/verification/iOVM_FraudVerifier.sol.html new file mode 100644 index 000000000..a3b2ed104 --- /dev/null +++ b/coverage/lcov-report/iOVM/verification/iOVM_FraudVerifier.sol.html @@ -0,0 +1,260 @@ + + + + Code coverage report for iOVM/verification/iOVM_FraudVerifier.sol + + + + + + + +
+
+

+ all files / iOVM/verification/ iOVM_FraudVerifier.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
+ 
+/**
+ * @title iOVM_FraudVerifier
+ */
+interface iOVM_FraudVerifier {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event FraudProofInitialized(
+        bytes32 _preStateRoot,
+        uint256 _preStateRootIndex,
+        bytes32 _transactionHash,
+        address _who
+    );
+ 
+    event FraudProofFinalized(
+        bytes32 _preStateRoot,
+        uint256 _preStateRootIndex,
+        bytes32 _transactionHash,
+        address _who
+    );
+ 
+ 
+    /***************************************
+     * Public Functions: Transition Status *
+     ***************************************/
+ 
+    function getStateTransitioner(bytes32 _preStateRoot, bytes32 _txHash) external view returns (iOVM_StateTransitioner _transitioner);
+ 
+ 
+    /****************************************
+     * Public Functions: Fraud Verification *
+     ****************************************/
+ 
+    function initializeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
+        Lib_OVMCodec.Transaction calldata _transaction,
+        Lib_OVMCodec.TransactionChainElement calldata _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader calldata _transactionBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _transactionProof
+    ) external;
+ 
+    function finalizeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
+        bytes32 _txHash,
+        bytes32 _postStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _postStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _postStateRootProof
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/verification/iOVM_StateTransitioner.sol.html b/coverage/lcov-report/iOVM/verification/iOVM_StateTransitioner.sol.html new file mode 100644 index 000000000..3a0d781b4 --- /dev/null +++ b/coverage/lcov-report/iOVM/verification/iOVM_StateTransitioner.sol.html @@ -0,0 +1,314 @@ + + + + Code coverage report for iOVM/verification/iOVM_StateTransitioner.sol + + + + + + + +
+
+

+ all files / iOVM/verification/ iOVM_StateTransitioner.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateTransitioner
+ */
+interface iOVM_StateTransitioner {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event AccountCommitted(
+        address _address
+    );
+ 
+    event ContractStorageCommitted(
+        address _address,
+        bytes32 _key
+    );
+ 
+ 
+    /**********************************
+     * Public Functions: State Access *
+     **********************************/
+ 
+    function getPreStateRoot() external view returns (bytes32 _preStateRoot);
+    function getPostStateRoot() external view returns (bytes32 _postStateRoot);
+    function isComplete() external view returns (bool _complete);
+ 
+ 
+    /***********************************
+     * Public Functions: Pre-Execution *
+     ***********************************/
+ 
+    function proveContractState(
+        address _ovmContractAddress,
+        address _ethContractAddress,
+        bytes calldata _stateTrieWitness
+    ) external;
+ 
+    function proveStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes calldata _storageTrieWitness
+    ) external;
+ 
+ 
+    /*******************************
+     * Public Functions: Execution *
+     *******************************/
+ 
+    function applyTransaction(
+        Lib_OVMCodec.Transaction calldata _transaction
+    ) external;
+ 
+ 
+    /************************************
+     * Public Functions: Post-Execution *
+     ************************************/
+ 
+    function commitContractState(
+        address _ovmContractAddress,
+        bytes calldata _stateTrieWitness
+    ) external;
+ 
+    function commitStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes calldata _storageTrieWitness
+    ) external;
+ 
+ 
+    /**********************************
+     * Public Functions: Finalization *
+     **********************************/
+ 
+    function completeTransition() external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/verification/iOVM_StateTransitionerFactory.sol.html b/coverage/lcov-report/iOVM/verification/iOVM_StateTransitionerFactory.sol.html new file mode 100644 index 000000000..a4498df98 --- /dev/null +++ b/coverage/lcov-report/iOVM/verification/iOVM_StateTransitionerFactory.sol.html @@ -0,0 +1,143 @@ + + + + Code coverage report for iOVM/verification/iOVM_StateTransitionerFactory.sol + + + + + + + +
+
+

+ all files / iOVM/verification/ iOVM_StateTransitionerFactory.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
+ 
+/**
+ * @title iOVM_StateTransitionerFactory
+ */
+interface iOVM_StateTransitionerFactory {
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    function create(
+        address _proxyManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        external
+        returns (
+            iOVM_StateTransitioner _ovmStateTransitioner
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/iOVM/verification/index.html b/coverage/lcov-report/iOVM/verification/index.html new file mode 100644 index 000000000..bc1507a4f --- /dev/null +++ b/coverage/lcov-report/iOVM/verification/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for iOVM/verification/ + + + + + + + +
+
+

+ all files iOVM/verification/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_BondManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_FraudVerifier.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitioner.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitionerFactory.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html new file mode 100644 index 000000000..ea6ba8e13 --- /dev/null +++ b/coverage/lcov-report/index.html @@ -0,0 +1,366 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 82.21% + Statements + 1248/1518 +
+
+ 67.99% + Branches + 393/578 +
+
+ 82.88% + Functions + 363/438 +
+
+ 82.63% + Lines + 1313/1589 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM/accounts/
91.67%22/2466.67%4/6100%6/692%23/25
OVM/bridge/messaging/
96.55%56/5876.92%20/2695.24%20/2196.67%58/60
OVM/bridge/tokens/
90.7%39/4350%3/686.67%26/3088.89%40/45
OVM/chain/
92.82%194/20981.37%83/10282.46%47/5793.36%211/226
OVM/execution/
76.05%235/30967.02%63/9481.63%80/9876.73%244/318
OVM/predeploys/
41.76%38/9129.41%10/3440%12/3040.22%37/92
OVM/verification/
90.4%113/12578.05%64/8296.67%29/3090.48%114/126
iOVM/accounts/
100%0/0100%0/0100%0/0100%0/0
iOVM/bridge/messaging/
100%0/0100%0/0100%0/0100%0/0
iOVM/bridge/tokens/
100%0/0100%0/0100%0/0100%0/0
iOVM/chain/
100%0/0100%0/0100%0/0100%0/0
iOVM/execution/
100%0/0100%0/0100%0/0100%0/0
iOVM/predeploys/
100%0/0100%0/0100%0/0100%0/0
iOVM/verification/
100%0/0100%0/0100%0/0100%0/0
libraries/bridge/
100%5/5100%4/4100%4/4100%6/6
libraries/codec/
100%33/33100%6/6100%9/9100%33/33
libraries/resolver/
75%15/2050%4/881.82%9/1178.26%18/23
libraries/rlp/
96.95%127/13172.92%35/4893.1%27/2997.22%140/144
libraries/standards/
80.65%25/3125%3/1283.33%10/1281.25%26/32
libraries/trie/
71.98%149/20755.88%38/6881.25%26/3271.57%146/204
libraries/utils/
89.07%163/18367.57%50/7491.11%41/4589.27%183/205
libraries/wrappers/
69.39%34/4975%6/870.83%17/2468%34/50
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/bridge/OVM_CrossDomainEnabled.sol.html b/coverage/lcov-report/libraries/bridge/OVM_CrossDomainEnabled.sol.html new file mode 100644 index 000000000..c4c3bfaff --- /dev/null +++ b/coverage/lcov-report/libraries/bridge/OVM_CrossDomainEnabled.sol.html @@ -0,0 +1,308 @@ + + + + Code coverage report for libraries/bridge/OVM_CrossDomainEnabled.sol + + + + + + + +
+
+

+ all files / libraries/bridge/ OVM_CrossDomainEnabled.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +78× +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_CrossDomainEnabled
+ * @dev Helper contract for contracts performing cross-domain communications
+ *
+ * Compiler used: defined by inheriting contract
+ * Runtime target: defined by inheriting contract
+ */
+contract OVM_CrossDomainEnabled {
+    // Messenger contract used to send and recieve messages from the other domain.
+    address public messenger;
+ 
+    /***************
+     * Constructor *
+     ***************/    
+    constructor(
+        address _messenger
+    ) {
+        messenger = _messenger;
+    }
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * @notice Enforces that the modified function is only callable by a specific cross-domain account.
+     * @param _sourceDomainAccount The only account on the originating domain which is authenticated to call this function.
+     */
+    modifier onlyFromCrossDomainAccount(
+        address _sourceDomainAccount
+    ) {
+        require(
+            msg.sender == address(getCrossDomainMessenger()),
+            "OVM_XCHAIN: messenger contract unauthenticated"
+        );
+ 
+        require(
+            getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,
+            "OVM_XCHAIN: wrong sender of cross-domain message"
+        );
+ 
+        _;
+    }
+    
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Gets the messenger, usually from storage.  This function is exposed in case a child contract needs to override.
+     * @return The address of the cross-domain messenger contract which should be used. 
+     */
+    function getCrossDomainMessenger()
+        internal
+        virtual
+        returns(
+            iAbs_BaseCrossDomainMessenger
+        )
+    {
+        return iAbs_BaseCrossDomainMessenger(messenger);
+    }
+ 
+    /**
+     * @notice Sends a message to an account on another domain
+     * @param _crossDomainTarget The intended recipient on the destination domain
+     * @param _data The data to send to the target (usually calldata to a function with `onlyFromCrossDomainAccount()`)
+     * @param _gasLimit The gasLimit for the receipt of the message on the target domain.
+     */
+    function sendCrossDomainMessage(
+        address _crossDomainTarget,
+        bytes memory _data,
+        uint32 _gasLimit
+    ) internal {
+        getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/bridge/index.html b/coverage/lcov-report/libraries/bridge/index.html new file mode 100644 index 000000000..0b17ee495 --- /dev/null +++ b/coverage/lcov-report/libraries/bridge/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for libraries/bridge/ + + + + + + + +
+
+

+ all files libraries/bridge/ +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 6/6 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_CrossDomainEnabled.sol
100%5/5100%4/4100%4/4100%6/6
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/codec/Lib_OVMCodec.sol.html b/coverage/lcov-report/libraries/codec/Lib_OVMCodec.sol.html new file mode 100644 index 000000000..925baaa05 --- /dev/null +++ b/coverage/lcov-report/libraries/codec/Lib_OVMCodec.sol.html @@ -0,0 +1,1178 @@ + + + + Code coverage report for libraries/codec/Lib_OVMCodec.sol + + + + + + + +
+
+

+ all files / libraries/codec/ Lib_OVMCodec.sol +

+
+
+ 100% + Statements + 33/33 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 33/33 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  + +  + + + + + +  + +  + + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +107× +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+import { Lib_Bytes32Utils } from "../utils/Lib_Bytes32Utils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title Lib_OVMCodec
+ */
+library Lib_OVMCodec {
+ 
+    /*********
+     * Enums *
+     *********/
+ 
+    enum EOASignatureType {
+        EIP155_TRANSACTON,
+        ETH_SIGNED_MESSAGE
+    }
+ 
+    enum QueueOrigin {
+        SEQUENCER_QUEUE,
+        L1TOL2_QUEUE
+    }
+ 
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct Account {
+        uint256 nonce;
+        uint256 balance;
+        bytes32 storageRoot;
+        bytes32 codeHash;
+        address ethAddress;
+        bool isFresh;
+    }
+ 
+    struct EVMAccount {
+        uint256 nonce;
+        uint256 balance;
+        bytes32 storageRoot;
+        bytes32 codeHash;
+    }
+ 
+    struct ChainBatchHeader {
+        uint256 batchIndex;
+        bytes32 batchRoot;
+        uint256 batchSize;
+        uint256 prevTotalElements;
+        bytes extraData;
+    }
+ 
+    struct ChainInclusionProof {
+        uint256 index;
+        bytes32[] siblings;
+    }
+ 
+    struct Transaction {
+        uint256 timestamp;
+        uint256 blockNumber;
+        QueueOrigin l1QueueOrigin;
+        address l1TxOrigin;
+        address entrypoint;
+        uint256 gasLimit;
+        bytes data;
+    }
+ 
+    struct TransactionChainElement {
+        bool isSequenced;
+        uint256 queueIndex;  // QUEUED TX ONLY
+        uint256 timestamp;   // SEQUENCER TX ONLY
+        uint256 blockNumber; // SEQUENCER TX ONLY
+        bytes txData;        // SEQUENCER TX ONLY
+    }
+ 
+    struct QueueElement {
+        bytes32 transactionHash;
+        uint40 timestamp;
+        uint40 blockNumber;
+    }
+ 
+    struct EIP155Transaction {
+        uint256 nonce;
+        uint256 gasPrice;
+        uint256 gasLimit;
+        address to;
+        uint256 value;
+        bytes data;
+        uint256 chainId;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Decodes an EOA transaction (i.e., native Ethereum RLP encoding).
+     * @param _transaction Encoded EOA transaction.
+     * @return Transaction decoded into a struct.
+     */
+    function decodeEIP155Transaction(
+        bytes memory _transaction,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (
+            EIP155Transaction memory
+        )
+    {
+        if (_isEthSignedMessage) {
+            (
+                uint256 _nonce,
+                uint256 _gasLimit,
+                uint256 _gasPrice,
+                uint256 _chainId,
+                address _to,
+                bytes memory _data
+            ) = abi.decode(
+                _transaction,
+                (uint256, uint256, uint256, uint256, address ,bytes)
+            );
+            return EIP155Transaction({
+                nonce: _nonce,
+                gasPrice: _gasPrice,
+                gasLimit: _gasLimit,
+                to: _to,
+                value: 0,
+                data: _data,
+                chainId: _chainId
+            });
+        } else {
+            Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);
+ 
+            return EIP155Transaction({
+                nonce: Lib_RLPReader.readUint256(decoded[0]),
+                gasPrice: Lib_RLPReader.readUint256(decoded[1]),
+                gasLimit: Lib_RLPReader.readUint256(decoded[2]),
+                to: Lib_RLPReader.readAddress(decoded[3]),
+                value: Lib_RLPReader.readUint256(decoded[4]),
+                data: Lib_RLPReader.readBytes(decoded[5]),
+                chainId:  Lib_RLPReader.readUint256(decoded[6])
+            });
+        }
+    }
+ 
+    /**
+     * Decompresses a compressed EIP155 transaction.
+     * @param _transaction Compressed EIP155 transaction bytes.
+     * @return Transaction parsed into a struct.
+     */
+    function decompressEIP155Transaction(
+        bytes memory _transaction
+    )
+        internal
+        returns (
+            EIP155Transaction memory
+        )
+    {
+        return EIP155Transaction({
+            gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),
+            gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,
+            nonce: Lib_BytesUtils.toUint24(_transaction, 6),
+            to: Lib_BytesUtils.toAddress(_transaction, 9),
+            data: Lib_BytesUtils.slice(_transaction, 29),
+            chainId: Lib_SafeExecutionManagerWrapper.safeCHAINID(),
+            value: 0
+        });
+    }
+ 
+    /**
+     * Encodes an EOA transaction back into the original transaction.
+     * @param _transaction EIP155transaction to encode.
+     * @param _isEthSignedMessage Whether or not this was an eth signed message.
+     * @return Encoded transaction.
+     */
+    function encodeEIP155Transaction(
+        EIP155Transaction memory _transaction,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        if (_isEthSignedMessage) {
+            return abi.encode(
+                _transaction.nonce,
+                _transaction.gasLimit,
+                _transaction.gasPrice,
+                _transaction.chainId,
+                _transaction.to,
+                _transaction.data
+            );
+        } else {
+            bytes[] memory raw = new bytes[](9);
+ 
+            raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
+            raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
+            raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
+            if (_transaction.to == address(0)) {
+                raw[3] = Lib_RLPWriter.writeBytes('');
+            } else {
+                raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
+            }
+            raw[4] = Lib_RLPWriter.writeUint(0);
+            raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
+            raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
+            raw[7] = Lib_RLPWriter.writeBytes(bytes(''));
+            raw[8] = Lib_RLPWriter.writeBytes(bytes(''));
+ 
+            return Lib_RLPWriter.writeList(raw);
+        }
+    }
+ 
+    /**
+     * Encodes a standard OVM transaction.
+     * @param _transaction OVM transaction to encode.
+     * @return Encoded transaction bytes.
+     */
+    function encodeTransaction(
+        Transaction memory _transaction
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodePacked(
+            _transaction.timestamp,
+            _transaction.blockNumber,
+            _transaction.l1QueueOrigin,
+            _transaction.l1TxOrigin,
+            _transaction.entrypoint,
+            _transaction.gasLimit,
+            _transaction.data
+        );
+    }
+ 
+    /**
+     * Hashes a standard OVM transaction.
+     * @param _transaction OVM transaction to encode.
+     * @return Hashed transaction
+     */
+    function hashTransaction(
+        Transaction memory _transaction
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(encodeTransaction(_transaction));
+    }
+ 
+    /**
+     * Converts an OVM account to an EVM account.
+     * @param _in OVM account to convert.
+     * @return Converted EVM account.
+     */
+    function toEVMAccount(
+        Account memory _in
+    )
+        internal
+        pure
+        returns (
+            EVMAccount memory
+        )
+    {
+        return EVMAccount({
+            nonce: _in.nonce,
+            balance: _in.balance,
+            storageRoot: _in.storageRoot,
+            codeHash: _in.codeHash
+        });
+    }
+ 
+    /**
+     * @notice RLP-encodes an account state struct.
+     * @param _account Account state struct.
+     * @return RLP-encoded account state.
+     */
+    function encodeEVMAccount(
+        EVMAccount memory _account
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes[] memory raw = new bytes[](4);
+ 
+        // Unfortunately we can't create this array outright because
+        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning
+        // index-by-index circumvents this issue.
+        raw[0] = Lib_RLPWriter.writeBytes(
+            Lib_Bytes32Utils.removeLeadingZeros(
+                bytes32(_account.nonce)
+            )
+        );
+        raw[1] = Lib_RLPWriter.writeBytes(
+            Lib_Bytes32Utils.removeLeadingZeros(
+                bytes32(_account.balance)
+            )
+        );
+        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));
+        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));
+ 
+        return Lib_RLPWriter.writeList(raw);
+    }
+ 
+    /**
+     * @notice Decodes an RLP-encoded account state into a useful struct.
+     * @param _encoded RLP-encoded account state.
+     * @return Account state struct.
+     */
+    function decodeEVMAccount(
+        bytes memory _encoded
+    )
+        internal
+        pure
+        returns (
+            EVMAccount memory
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);
+ 
+        return EVMAccount({
+            nonce: Lib_RLPReader.readUint256(accountState[0]),
+            balance: Lib_RLPReader.readUint256(accountState[1]),
+            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),
+            codeHash: Lib_RLPReader.readBytes32(accountState[3])
+        });
+    }
+ 
+    /**
+     * Calculates a hash for a given batch header.
+     * @param _batchHeader Header to hash.
+     * @return Hash of the header.
+     */
+    function hashBatchHeader(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(
+            abi.encode(
+                _batchHeader.batchRoot,
+                _batchHeader.batchSize,
+                _batchHeader.prevTotalElements,
+                _batchHeader.extraData
+            )
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/codec/index.html b/coverage/lcov-report/libraries/codec/index.html new file mode 100644 index 000000000..938f11b95 --- /dev/null +++ b/coverage/lcov-report/libraries/codec/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for libraries/codec/ + + + + + + + +
+
+

+ all files libraries/codec/ +

+
+
+ 100% + Statements + 33/33 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 33/33 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_OVMCodec.sol
100%33/33100%6/6100%9/9100%33/33
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/resolver/Lib_AddressManager.sol.html b/coverage/lcov-report/libraries/resolver/Lib_AddressManager.sol.html new file mode 100644 index 000000000..2a868eb60 --- /dev/null +++ b/coverage/lcov-report/libraries/resolver/Lib_AddressManager.sol.html @@ -0,0 +1,272 @@ + + + + Code coverage report for libraries/resolver/Lib_AddressManager.sol + + + + + + + +
+
+

+ all files / libraries/resolver/ Lib_AddressManager.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +379× +379× +  +  +  +  +  +  +  +  +  +2107× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2486× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { Ownable } from "./Lib_Ownable.sol";
+ 
+/**
+ * @title Lib_AddressManager
+ */
+contract Lib_AddressManager is Ownable {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event AddressSet(
+        string _name,
+        address _newAddress
+    );
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    mapping (bytes32 => address) private addresses;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function setAddress(
+        string memory _name,
+        address _address
+    )
+        public
+        onlyOwner
+    {
+        emit AddressSet(_name, _address);
+        addresses[_getNameHash(_name)] = _address;
+    }
+ 
+    function getAddress(
+        string memory _name
+    )
+        public
+        view
+        returns (address)
+    {
+        return addresses[_getNameHash(_name)];
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _getNameHash(
+        string memory _name
+    )
+        internal
+        pure
+        returns (
+            bytes32 _hash
+        )
+    {
+        return keccak256(abi.encodePacked(_name));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/resolver/Lib_AddressResolver.sol.html b/coverage/lcov-report/libraries/resolver/Lib_AddressResolver.sol.html new file mode 100644 index 000000000..c16b6c033 --- /dev/null +++ b/coverage/lcov-report/libraries/resolver/Lib_AddressResolver.sol.html @@ -0,0 +1,209 @@ + + + + Code coverage report for libraries/resolver/Lib_AddressResolver.sol + + + + + + + +
+
+

+ all files / libraries/resolver/ Lib_AddressResolver.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1041× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2076× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressManager } from "./Lib_AddressManager.sol";
+ 
+/**
+ * @title Lib_AddressResolver
+ */
+abstract contract Lib_AddressResolver {
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    Lib_AddressManager internal libAddressManager;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Lib_AddressManager.
+     */
+    constructor(
+        address _libAddressManager
+    )  {
+        libAddressManager = Lib_AddressManager(_libAddressManager);
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function resolve(
+        string memory _name
+    )
+        public
+        view
+        returns (
+            address _contract
+        )
+    {
+        return libAddressManager.getAddress(_name);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/resolver/Lib_Ownable.sol.html b/coverage/lcov-report/libraries/resolver/Lib_Ownable.sol.html new file mode 100644 index 000000000..8b947582e --- /dev/null +++ b/coverage/lcov-report/libraries/resolver/Lib_Ownable.sol.html @@ -0,0 +1,293 @@ + + + + Code coverage report for libraries/resolver/Lib_Ownable.sol + + + + + + + +
+
+

+ all files / libraries/resolver/ Lib_Ownable.sol +

+
+
+ 37.5% + Statements + 3/8 +
+
+ 25% + Branches + 1/4 +
+
+ 50% + Functions + 2/4 +
+
+ 44.44% + Lines + 4/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +120× +120× +  +  +  +  +  +  +  +  +379× +  +  +  +379× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Ownable
+ * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
+ */
+abstract contract Ownable {
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    address public owner;
+ 
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event OwnershipTransferred(
+        address indexed previousOwner,
+        address indexed newOwner
+    );
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    constructor() {
+        owner = msg.sender;
+        emit OwnershipTransferred(address(0), owner);
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyOwner() {
+        Erequire(
+            owner == msg.sender,
+            "Ownable: caller is not the owner"
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function renounceOwnership()
+        public
+        virtual
+        onlyOwner
+    {
+        emit OwnershipTransferred(owner, address(0));
+        owner = address(0);
+    }
+ 
+    function transferOwnership(address _newOwner)
+        public
+        virtual
+        onlyOwner
+    {
+        require(
+            _newOwner != address(0),
+            "Ownable: new owner cannot be the zero address"
+        );
+ 
+        emit OwnershipTransferred(owner, _newOwner);
+        owner = _newOwner;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html b/coverage/lcov-report/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html new file mode 100644 index 000000000..dfa334ef9 --- /dev/null +++ b/coverage/lcov-report/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html @@ -0,0 +1,281 @@ + + + + Code coverage report for libraries/resolver/Lib_ResolvedDelegateProxy.sol + + + + + + + +
+
+

+ all files / libraries/resolver/ Lib_ResolvedDelegateProxy.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 8/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +36× +36× +  +  +  +  +  +  +  +  +  +  +31× +31× +  +  +  +  +31× +  +31× +22× +  +  +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressManager } from "./Lib_AddressManager.sol";
+ 
+/**
+ * @title Lib_ResolvedDelegateProxy
+ */
+contract Lib_ResolvedDelegateProxy {
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+ 
+    // Using mappings to store fields to avoid overwriting storage slots in the
+    // implementation contract. For example, instead of storing these fields at
+    // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.
+    // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html
+    // NOTE: Do not use this code in your own contract system. 
+    //      There is a known flaw in this contract, and we will remove it from the repository
+    //      in the near future. Due to the very limited way that we are using it, this flaw is
+    //      not an issue in our system. 
+    mapping(address=>string) private implementationName;
+    mapping(address=>Lib_AddressManager) private addressManager;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Lib_AddressManager.
+     * @param _implementationName implementationName of the contract to proxy to.
+     */
+    constructor(
+        address _libAddressManager,
+        string memory _implementationName
+    )
+    {
+        addressManager[address(this)] = Lib_AddressManager(_libAddressManager);
+        implementationName[address(this)] = _implementationName;
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        address target = addressManager[address(this)].getAddress((implementationName[address(this)]));
+        Erequire(
+            target != address(0),
+            "Target address must be initialized."
+        );
+ 
+        (bool success, bytes memory returndata) = target.delegatecall(msg.data);
+ 
+        if (success == true) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/resolver/index.html b/coverage/lcov-report/libraries/resolver/index.html new file mode 100644 index 000000000..0b43123ea --- /dev/null +++ b/coverage/lcov-report/libraries/resolver/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for libraries/resolver/ + + + + + + + +
+
+

+ all files libraries/resolver/ +

+
+
+ 75% + Statements + 15/20 +
+
+ 50% + Branches + 4/8 +
+
+ 81.82% + Functions + 9/11 +
+
+ 78.26% + Lines + 18/23 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_AddressManager.sol
100%4/4100%0/0100%3/3100%4/4
Lib_AddressResolver.sol
100%2/2100%0/0100%2/2100%2/2
Lib_Ownable.sol
37.5%3/825%1/450%2/444.44%4/9
Lib_ResolvedDelegateProxy.sol
100%6/675%3/4100%2/2100%8/8
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/rlp/Lib_RLPReader.sol.html b/coverage/lcov-report/libraries/rlp/Lib_RLPReader.sol.html new file mode 100644 index 000000000..490fb050e --- /dev/null +++ b/coverage/lcov-report/libraries/rlp/Lib_RLPReader.sol.html @@ -0,0 +1,1925 @@ + + + + Code coverage report for libraries/rlp/Lib_RLPReader.sol + + + + + + + +
+
+

+ all files / libraries/rlp/ Lib_RLPReader.sol +

+
+
+ 98.68% + Statements + 75/76 +
+
+ 67.5% + Branches + 27/40 +
+
+ 94.74% + Functions + 18/19 +
+
+ 98.8% + Lines + 82/83 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +512× +512× +  +  +  +512× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +450× +  +  +  +  +  +446× +  +  +  +  +  +  +  +  +446× +  +446× +446× +446× +4230× +  +  +  +  +4230× +  +  +  +  +  +  +  +4230× +  +  +  +  +4230× +4230× +  +  +  +446× +  +  +  +446× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +450× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +651× +  +  +  +  +  +651× +  +  +  +  +651× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +68× +  +  +  +  +68× +  +  +  +  +  +68× +  +  +  +  +68× +68× +68× +  +  +  +  +  +  +  +  +68× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +56× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +776× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5399× +  +  +  +  +5395× +5395× +5395× +  +  +  +5395× +  +  +33× +  +  +  +4334× +  +4334× +  +  +  +  +4334× +  +  +536× +  +536× +  +  +  +  +536× +536× +  +  +  +  +  +  +  +536× +  +  +  +  +536× +  +  +89× +  +89× +  +  +  +  +89× +  +  +403× +  +403× +  +  +  +  +403× +403× +  +  +  +  +  +  +  +403× +  +  +  +  +403× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1427× +1427× + +  +  +1426× +1426× +1426× +  +  +  +  +1426× +2634× +  +  +  +2634× +2634× +  +  +  +1426× +1426× +  +  +  +  +  +  +  +  +  +1426× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +776× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_RLPReader
+ * @dev Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).
+ */
+library Lib_RLPReader {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 constant internal MAX_LIST_LENGTH = 32;
+ 
+ 
+    /*********
+     * Enums *
+     *********/
+ 
+    enum RLPItemType {
+        DATA_ITEM,
+        LIST_ITEM
+    }
+ 
+    
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct RLPItem {
+        uint256 length;
+        uint256 ptr;
+    }
+    
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+    
+    /**
+     * Converts bytes to a reference to memory position and length.
+     * @param _in Input bytes to convert.
+     * @return Output memory reference.
+     */
+    function toRLPItem(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem memory
+        )
+    {
+        uint256 ptr;
+        assembly {
+            ptr := add(_in, 32)
+        }
+ 
+        return RLPItem({
+            length: _in.length,
+            ptr: ptr
+        });
+    }
+ 
+    /**
+     * Reads an RLP list value into a list of RLP items.
+     * @param _in RLP list value.
+     * @return Decoded RLP list items.
+     */
+    function readList(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem[] memory
+        )
+    {
+        (
+            uint256 listOffset,
+            ,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.LIST_ITEM,
+            "Invalid RLP list value."
+        );
+ 
+        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by
+        // writing to the length. Since we can't know the number of RLP items without looping over
+        // the entire input, we'd have to loop twice to accurately size this array. It's easier to
+        // simply set a reasonable maximum list length and decrease the size before we finish.
+        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);
+ 
+        uint256 itemCount = 0;
+        uint256 offset = listOffset;
+        while (offset < _in.length) {
+            Erequire(
+                itemCount < MAX_LIST_LENGTH,
+                "Provided RLP list exceeds max list length."
+            );
+ 
+            (
+                uint256 itemOffset,
+                uint256 itemLength,
+            ) = _decodeLength(RLPItem({
+                length: _in.length - offset,
+                ptr: _in.ptr + offset
+            }));
+ 
+            out[itemCount] = RLPItem({
+                length: itemLength + itemOffset,
+                ptr: _in.ptr + offset
+            });
+ 
+            itemCount += 1;
+            offset += itemOffset + itemLength;
+        }
+ 
+        // Decrease the array size to match the actual item count.
+        assembly {
+            mstore(out, itemCount)
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Reads an RLP list value into a list of RLP items.
+     * @param _in RLP list value.
+     * @return Decoded RLP list items.
+     */
+    function readList(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem[] memory
+        )
+    {
+        return readList(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bytes value into bytes.
+     * @param _in RLP bytes value.
+     * @return Decoded bytes.
+     */
+    function readBytes(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        (
+            uint256 itemOffset,
+            uint256 itemLength,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.DATA_ITEM,
+            "Invalid RLP bytes value."
+        );
+ 
+        return _copy(_in.ptr, itemOffset, itemLength);
+    }
+ 
+    /**
+     * Reads an RLP bytes value into bytes.
+     * @param _in RLP bytes value.
+     * @return Decoded bytes.
+     */
+    function readBytes(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return readBytes(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP string value into a string.
+     * @param _in RLP string value.
+     * @return Decoded string.
+     */
+    function readString(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            string memory
+        )
+    {
+        return string(readBytes(_in));
+    }
+ 
+    /**
+     * Reads an RLP string value into a string.
+     * @param _in RLP string value.
+     * @return Decoded string.
+     */
+    function readString(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            string memory
+        )
+    {
+        return readString(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bytes32 value into a bytes32.
+     * @param _in RLP bytes32 value.
+     * @return Decoded bytes32.
+     */
+    function readBytes32(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        Erequire(
+            _in.length <= 33,
+            "Invalid RLP bytes32 value."
+        );
+ 
+        (
+            uint256 itemOffset,
+            uint256 itemLength,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.DATA_ITEM,
+            "Invalid RLP bytes32 value."
+        );
+ 
+        uint256 ptr = _in.ptr + itemOffset;
+        bytes32 out;
+        assembly {
+            out := mload(ptr)
+ 
+            // Shift the bytes over to match the item size.
+            if lt(itemLength, 32) {
+                out := div(out, exp(256, sub(32, itemLength)))
+            }
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Reads an RLP bytes32 value into a bytes32.
+     * @param _in RLP bytes32 value.
+     * @return Decoded bytes32.
+     */
+    function readBytes32(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return readBytes32(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP uint256 value into a uint256.
+     * @param _in RLP uint256 value.
+     * @return Decoded uint256.
+     */
+    function readUint256(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        return uint256(readBytes32(_in));
+    }
+ 
+    /**
+     * Reads an RLP uint256 value into a uint256.
+     * @param _in RLP uint256 value.
+     * @return Decoded uint256.
+     */
+    function readUint256(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        return readUint256(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bool value into a bool.
+     * @param _in RLP bool value.
+     * @return Decoded bool.
+     */
+    function readBool(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        Erequire(
+            _in.length == 1,
+            "Invalid RLP boolean value."
+        );
+ 
+        uint256 ptr = _in.ptr;
+        uint256 out;
+        assembly {
+            out := byte(0, mload(ptr))
+        }
+ 
+        return out != 0;
+    }
+ 
+    /**
+     * Reads an RLP bool value into a bool.
+     * @param _in RLP bool value.
+     * @return Decoded bool.
+     */
+    function readBool(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        return readBool(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP address value into a address.
+     * @param _in RLP address value.
+     * @return Decoded address.
+     */
+    function readAddress(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        if (_in.length == 1) {
+            return address(0);
+        }
+ 
+        Erequire(
+            _in.length == 21,
+            "Invalid RLP address value."
+        );
+ 
+        return address(readUint256(_in));
+    }
+ 
+    /**
+     * Reads an RLP address value into a address.
+     * @param _in RLP address value.
+     * @return Decoded address.
+     */
+    function readAddress(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        return readAddress(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads the raw bytes of an RLP item.
+     * @param _in RLP item to read.
+     * @return Raw RLP bytes.
+     */
+    function readRawBytes(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return _copy(_in);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Decodes the length of an RLP item.
+     * @param _in RLP item to decode.
+     * @return Offset of the encoded data.
+     * @return Length of the encoded data.
+     * @return RLP item type (LIST_ITEM or DATA_ITEM).
+     */
+    function _decodeLength(
+        RLPItem memory _in
+    )
+        private
+        pure
+        returns (
+            uint256,
+            uint256,
+            RLPItemType
+        )
+    {
+        require(
+            _in.length > 0,
+            "RLP item cannot be null."
+        );
+ 
+        uint256 ptr = _in.ptr;
+        uint256 prefix;
+        assembly {
+            prefix := byte(0, mload(ptr))
+        }
+ 
+        if (prefix <= 0x7f) {
+            // Single byte.
+ 
+            return (0, 1, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xb7) {
+            // Short string.
+ 
+            uint256 strLen = prefix - 0x80;
+            
+            Erequire(
+                _in.length > strLen,
+                "Invalid RLP short string."
+            );
+ 
+            return (1, strLen, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xbf) {
+            // Long string.
+            uint256 lenOfStrLen = prefix - 0xb7;
+ 
+            Erequire(
+                _in.length > lenOfStrLen,
+                "Invalid RLP long string length."
+            );
+ 
+            uint256 strLen;
+            assembly {
+                // Pick out the string length.
+                strLen := div(
+                    mload(add(ptr, 1)),
+                    exp(256, sub(32, lenOfStrLen))
+                )
+            }
+ 
+            Erequire(
+                _in.length > lenOfStrLen + strLen,
+                "Invalid RLP long string."
+            );
+ 
+            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xf7) {
+            // Short list.
+            uint256 listLen = prefix - 0xc0;
+ 
+            Erequire(
+                _in.length > listLen,
+                "Invalid RLP short list."
+            );
+ 
+            return (1, listLen, RLPItemType.LIST_ITEM);
+        } else {
+            // Long list.
+            uint256 lenOfListLen = prefix - 0xf7;
+ 
+            Erequire(
+                _in.length > lenOfListLen,
+                "Invalid RLP long list length."
+            );
+ 
+            uint256 listLen;
+            assembly {
+                // Pick out the list length.
+                listLen := div(
+                    mload(add(ptr, 1)),
+                    exp(256, sub(32, lenOfListLen))
+                )
+            }
+ 
+            Erequire(
+                _in.length > lenOfListLen + listLen,
+                "Invalid RLP long list."
+            );
+ 
+            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);
+        }
+    }
+ 
+    /**
+     * Copies the bytes from a memory location.
+     * @param _src Pointer to the location to read from.
+     * @param _offset Offset to start reading from.
+     * @param _length Number of bytes to read.
+     * @return Copied bytes.
+     */
+    function _copy(
+        uint256 _src,
+        uint256 _offset,
+        uint256 _length
+    )
+        private
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes memory out = new bytes(_length);
+        if (out.length == 0) {
+            return out;
+        }
+ 
+        uint256 src = _src + _offset;
+        uint256 dest;
+        assembly {
+            dest := add(out, 32)
+        }
+ 
+        // Copy over as many complete words as we can.
+        for (uint256 i = 0; i < _length / 32; i++) {
+            assembly {
+                mstore(dest, mload(src))
+            }
+ 
+            src += 32;
+            dest += 32;
+        }
+ 
+        // Pick out the remaining bytes.
+        uint256 mask = 256 ** (32 - (_length % 32)) - 1;
+        assembly {
+            mstore(
+                dest,
+                or(
+                    and(mload(src), not(mask)),
+                    and(mload(dest), mask)
+                )
+            )
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Copies an RLP item into bytes.
+     * @param _in RLP item to copy.
+     * @return Copied bytes.
+     */
+    function _copy(
+        RLPItem memory _in
+    )
+        private
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return _copy(_in.ptr, 0, _in.length);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/rlp/Lib_RLPWriter.sol.html b/coverage/lcov-report/libraries/rlp/Lib_RLPWriter.sol.html new file mode 100644 index 000000000..dee20330d --- /dev/null +++ b/coverage/lcov-report/libraries/rlp/Lib_RLPWriter.sol.html @@ -0,0 +1,911 @@ + + + + Code coverage report for libraries/rlp/Lib_RLPWriter.sol + + + + + + + +
+
+

+ all files / libraries/rlp/ Lib_RLPWriter.sol +

+
+
+ 94.55% + Statements + 52/55 +
+
+ 100% + Branches + 8/8 +
+
+ 90% + Functions + 9/10 +
+
+ 95.08% + Lines + 58/61 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +324× +  +324× +16× +  +308× +  +  +324× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +157× +157× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +139× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +465× +  +465× +415× +415× +  +50× +50× +50× +72× +72× +  +  +50× +50× +50× +72× +  +  +  +465× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +  +52× +52× +1643× +24× +  +  +  +52× +52× +45× +  +  +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1030× +1030× +1030× +  +1030× +420× +  +  +420× +420× +  +  +1030× +1030× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +157× + +  +  +149× +149× +149× +1030× +  +  +149× +149× +149× +  +149× +1030× +  +1030× +1030× +  +1030× +1030× +  +  +149× +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+ 
+/**
+ * @title Lib_RLPWriter
+ * @author Bakaoh (with modifications)
+ */
+library Lib_RLPWriter {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * RLP encodes a byte string.
+     * @param _in The byte string to encode.
+     * @return _out The RLP encoded string in bytes.
+     */
+    function writeBytes(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory encoded;
+ 
+        if (_in.length == 1 && uint8(_in[0]) < 128) {
+            encoded = _in;
+        } else {
+            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);
+        }
+ 
+        return encoded;
+    }
+ 
+    /**
+     * RLP encodes a list of RLP encoded byte byte strings.
+     * @param _in The list of RLP encoded byte strings.
+     * @return _out The RLP encoded list of items in bytes.
+     */
+    function writeList(
+        bytes[] memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory list = _flatten(_in);
+        return abi.encodePacked(_writeLength(list.length, 192), list);
+    }
+ 
+    /**
+     * RLP encodes a string.
+     * @param _in The string to encode.
+     * @return _out The RLP encoded string in bytes.
+     */
+    function writeString(
+        string memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(bytes(_in));
+    }
+ 
+    /**
+     * RLP encodes an address.
+     * @param _in The address to encode.
+     * @return _out The RLP encoded address in bytes.
+     */
+    function writeAddress(
+        address _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(abi.encodePacked(_in));
+    }
+ 
+    /**
+     * RLP encodes a uint.
+     * @param _in The uint256 to encode.
+     * @return _out The RLP encoded uint256 in bytes.
+     */
+    function writeUint(
+        uint256 _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(_toBinary(_in));
+    }
+ 
+    /**
+     * RLP encodes a bool.
+     * @param _in The bool to encode.
+     * @return _out The RLP encoded bool in bytes.
+     */
+    function writeBool(
+        bool _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory encoded = new bytes(1);
+        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));
+        return encoded;
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.
+     * @param _len The length of the string or the payload.
+     * @param _offset 128 if item is string, 192 if item is list.
+     * @return _encoded RLP encoded bytes.
+     */
+    function _writeLength(
+        uint256 _len,
+        uint256 _offset
+    )
+        private
+        pure
+        returns (
+            bytes memory _encoded
+        )
+    {
+        bytes memory encoded;
+ 
+        if (_len < 56) {
+            encoded = new bytes(1);
+            encoded[0] = byte(uint8(_len) + uint8(_offset));
+        } else {
+            uint256 lenLen;
+            uint256 i = 1;
+            while (_len / i != 0) {
+                lenLen++;
+                i *= 256;
+            }
+ 
+            encoded = new bytes(lenLen + 1);
+            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);
+            for(i = 1; i <= lenLen; i++) {
+                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));
+            }
+        }
+ 
+        return encoded;
+    }
+ 
+    /**
+     * Encode integer in big endian binary form with no leading zeroes.
+     * @notice TODO: This should be optimized with assembly to save gas costs.
+     * @param _x The integer to encode.
+     * @return _binary RLP encoded bytes.
+     */
+    function _toBinary(
+        uint256 _x
+    )
+        private
+        pure
+        returns (
+            bytes memory _binary
+        )
+    {
+        bytes memory b = abi.encodePacked(_x);
+ 
+        uint256 i = 0;
+        for (; i < 32; i++) {
+            if (b[i] != 0) {
+                break;
+            }
+        }
+ 
+        bytes memory res = new bytes(32 - i);
+        for (uint256 j = 0; j < res.length; j++) {
+            res[j] = b[i++];
+        }
+ 
+        return res;
+    }
+ 
+    /**
+     * Copies a piece of memory to another location.
+     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.
+     * @param _dest Destination location.
+     * @param _src Source location.
+     * @param _len Length of memory to copy.
+     */
+    function _memcpy(
+        uint256 _dest,
+        uint256 _src,
+        uint256 _len
+    )
+        private
+        pure
+    {
+        uint256 dest = _dest;
+        uint256 src = _src;
+        uint256 len = _len;
+ 
+        for(; len >= 32; len -= 32) {
+            assembly {
+                mstore(dest, mload(src))
+            }
+            dest += 32;
+            src += 32;
+        }
+ 
+        uint256 mask = 256 ** (32 - len) - 1;
+        assembly {
+            let srcpart := and(mload(src), not(mask))
+            let destpart := and(mload(dest), mask)
+            mstore(dest, or(destpart, srcpart))
+        }
+    }
+ 
+    /**
+     * Flattens a list of byte strings into one byte string.
+     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.
+     * @param _list List of byte strings to flatten.
+     * @return _flattened The flattened byte string.
+     */
+    function _flatten(
+        bytes[] memory _list
+    )
+        private
+        pure
+        returns (
+            bytes memory _flattened
+        )
+    {
+        if (_list.length == 0) {
+            return new bytes(0);
+        }
+ 
+        uint256 len;
+        uint256 i = 0;
+        for (; i < _list.length; i++) {
+            len += _list[i].length;
+        }
+ 
+        bytes memory flattened = new bytes(len);
+        uint256 flattenedPtr;
+        assembly { flattenedPtr := add(flattened, 0x20) }
+ 
+        for(i = 0; i < _list.length; i++) {
+            bytes memory item = _list[i];
+ 
+            uint256 listPtr;
+            assembly { listPtr := add(item, 0x20)}
+ 
+            _memcpy(flattenedPtr, listPtr, item.length);
+            flattenedPtr += _list[i].length;
+        }
+ 
+        return flattened;
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/rlp/index.html b/coverage/lcov-report/libraries/rlp/index.html new file mode 100644 index 000000000..bcae97d2c --- /dev/null +++ b/coverage/lcov-report/libraries/rlp/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for libraries/rlp/ + + + + + + + +
+
+

+ all files libraries/rlp/ +

+
+
+ 96.95% + Statements + 127/131 +
+
+ 72.92% + Branches + 35/48 +
+
+ 93.1% + Functions + 27/29 +
+
+ 97.22% + Lines + 140/144 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_RLPReader.sol
98.68%75/7667.5%27/4094.74%18/1998.8%82/83
Lib_RLPWriter.sol
94.55%52/55100%8/890%9/1095.08%58/61
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/standards/IUniswapV2ERC20.sol.html b/coverage/lcov-report/libraries/standards/IUniswapV2ERC20.sol.html new file mode 100644 index 000000000..76e84e00c --- /dev/null +++ b/coverage/lcov-report/libraries/standards/IUniswapV2ERC20.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for libraries/standards/IUniswapV2ERC20.sol + + + + + + + +
+
+

+ all files / libraries/standards/ IUniswapV2ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+interface IUniswapV2ERC20 {
+    event Approval(address indexed owner, address indexed spender, uint value);
+    event Transfer(address indexed from, address indexed to, uint value);
+ 
+    function name() external view returns (string memory);
+    function symbol() external view returns (string memory);
+    function decimals() external view returns (uint8);
+    function totalSupply() external view returns (uint);
+    function balanceOf(address owner) external view returns (uint);
+    function allowance(address owner, address spender) external view returns (uint);
+ 
+    function approve(address spender, uint value) external returns (bool);
+    function transfer(address to, uint value) external returns (bool);
+    function transferFrom(address from, address to, uint value) external returns (bool);
+ 
+    function DOMAIN_SEPARATOR() external view returns (bytes32);
+    function PERMIT_TYPEHASH() external pure returns (bytes32);
+    function nonces(address owner) external view returns (uint);
+ 
+    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/standards/UniSafeMath.sol.html b/coverage/lcov-report/libraries/standards/UniSafeMath.sol.html new file mode 100644 index 000000000..72011637e --- /dev/null +++ b/coverage/lcov-report/libraries/standards/UniSafeMath.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for libraries/standards/UniSafeMath.sol + + + + + + + +
+
+

+ all files / libraries/standards/ UniSafeMath.sol +

+
+
+ 66.67% + Statements + 2/3 +
+
+ 33.33% + Branches + 2/6 +
+
+ 66.67% + Functions + 2/3 +
+
+ 66.67% + Lines + 2/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  + +  +  +  +10× +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
+ 
+library UniSafeMath {
+    function add(uint x, uint y) internal pure returns (uint z) {
+        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
+    }
+ 
+    function sub(uint x, uint y) internal pure returns (uint z) {
+        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
+    }
+ 
+    function mul(uint x, uint y) internal pure returns (uint z) {
+        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/standards/UniswapV2ERC20.sol.html b/coverage/lcov-report/libraries/standards/UniswapV2ERC20.sol.html new file mode 100644 index 000000000..a80601a95 --- /dev/null +++ b/coverage/lcov-report/libraries/standards/UniswapV2ERC20.sol.html @@ -0,0 +1,359 @@ + + + + Code coverage report for libraries/standards/UniswapV2ERC20.sol + + + + + + + +
+
+

+ all files / libraries/standards/ UniswapV2ERC20.sol +

+
+
+ 82.14% + Statements + 23/28 +
+
+ 16.67% + Branches + 1/6 +
+
+ 88.89% + Functions + 8/9 +
+
+ 82.76% + Lines + 24/29 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +39× +39× +  +39× +39× +  +  +39× +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  + + + +  +  +  + + +  +  +  + + + +  +  +  + + +  +  +  + + +  +  +  + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+import './IUniswapV2ERC20.sol';
+import './UniSafeMath.sol';
+ 
+contract UniswapV2ERC20 is IUniswapV2ERC20 {
+    using UniSafeMath for uint;
+ 
+    string public override name;
+    string public override symbol;
+    uint8 public constant override decimals = 18;
+    uint public override totalSupply;
+    mapping(address => uint) public override balanceOf;
+    mapping(address => mapping(address => uint)) public override allowance;
+ 
+    bytes32 public override DOMAIN_SEPARATOR;
+    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
+    bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
+    mapping(address => uint) public override nonces;
+ 
+    constructor(
+    string memory _name,
+        string memory _symbol
+    ) {
+        name = _name;
+        symbol = _symbol;
+ 
+        uint chainId;
+        assembly {
+            chainId := chainid()
+        }
+        DOMAIN_SEPARATOR = keccak256(
+            abi.encode(
+                keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
+                keccak256(bytes(name)),
+                keccak256(bytes('1')),
+                chainId,
+                address(this)
+            )
+        );
+    }
+ 
+    function _mint(address to, uint value) internal {
+        totalSupply = totalSupply.add(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(address(0), to, value);
+    }
+ 
+    function _burn(address from, uint value) internal {
+        balanceOf[from] = balanceOf[from].sub(value);
+        totalSupply = totalSupply.sub(value);
+        emit Transfer(from, address(0), value);
+    }
+ 
+    function _approve(address owner, address spender, uint value) private {
+        allowance[owner][spender] = value;
+        emit Approval(owner, spender, value);
+    }
+ 
+    function _transfer(address from, address to, uint value) private {
+        balanceOf[from] = balanceOf[from].sub(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(from, to, value);
+    }
+ 
+    function approve(address spender, uint value) external override returns (bool) {
+        _approve(msg.sender, spender, value);
+        return true;
+    }
+ 
+    function transfer(address to, uint value) external override returns (bool) {
+        _transfer(msg.sender, to, value);
+        return true;
+    }
+ 
+    function transferFrom(address from, address to, uint value) external override returns (bool) {
+        Eif (allowance[from][msg.sender] != uint(-1)) {
+            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
+        }
+        _transfer(from, to, value);
+        return true;
+    }
+ 
+    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override {
+        require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
+        bytes32 digest = keccak256(
+            abi.encodePacked(
+                '\x19\x01',
+                DOMAIN_SEPARATOR,
+                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
+            )
+        );
+        address recoveredAddress = ecrecover(digest, v, r, s);
+        require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
+        _approve(owner, spender, value);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/standards/index.html b/coverage/lcov-report/libraries/standards/index.html new file mode 100644 index 000000000..220cb4426 --- /dev/null +++ b/coverage/lcov-report/libraries/standards/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for libraries/standards/ + + + + + + + +
+
+

+ all files libraries/standards/ +

+
+
+ 80.65% + Statements + 25/31 +
+
+ 25% + Branches + 3/12 +
+
+ 83.33% + Functions + 10/12 +
+
+ 81.25% + Lines + 26/32 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
IUniswapV2ERC20.sol
100%0/0100%0/0100%0/0100%0/0
UniSafeMath.sol
66.67%2/333.33%2/666.67%2/366.67%2/3
UniswapV2ERC20.sol
82.14%23/2816.67%1/688.89%8/982.76%24/29
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/trie/Lib_MerkleTrie.sol.html b/coverage/lcov-report/libraries/trie/Lib_MerkleTrie.sol.html new file mode 100644 index 000000000..cfc1241f8 --- /dev/null +++ b/coverage/lcov-report/libraries/trie/Lib_MerkleTrie.sol.html @@ -0,0 +1,2945 @@ + + + + Code coverage report for libraries/trie/Lib_MerkleTrie.sol + + + + + + + +
+
+

+ all files / libraries/trie/ Lib_MerkleTrie.sol +

+
+
+ 72.45% + Statements + 142/196 +
+
+ 55.88% + Branches + 38/68 +
+
+ 84.62% + Functions + 22/26 +
+
+ 72.02% + Lines + 139/193 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +22× +22× +22× +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +77× +73× +  +58× +  +58× +  +  +  +  +58× +  +58× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +95× +95× +  +95× +95× +95× +95× +  +  +95× +243× +243× +  +  +  +243× +  +243× +  +95× +  +  +  +  +  +148× +  +  +  +  +  +  +  +  +  +  +  +229× +147× +  +  +  +  +  +147× +147× +147× +147× +147× +  +  +82× +82× +82× +82× +82× +82× +  +82× +80× +  +  +  +  +  +73× +  +  +  +80× +80× +  + +  +  +  +  +  +  +  + + + +  +  + +  +  +  +  +  +  +  +80× +80× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +22× +  +  +  +  +  +22× +22× +  +22× +  +  +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +22× +22× +  +  +22× +  +65× +65× +  +65× +  +  +22× +22× +  +  + + +  +  +  + +  + +  +  +  +  +42× +  +42× +42× +42× +  +  +  +  +65× +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +99× +95× +  +95× +265× +265× +  +  +  +  +  +95× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +148× +  +148× +  +  +  +  +148× +  +  +148× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +172× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +51× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +65× +  +  +65× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +87× +42× +  +45× +45× +  +45× +44× +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +82× +82× +4991× +  +82× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +65× +  +65× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +714× +  +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +22× +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +23× +23× +23× +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +26× +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +43× +  +  +  +22× +22× +  +  +22× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+ 
+/**
+ * @title Lib_MerkleTrie
+ */
+library Lib_MerkleTrie {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum NodeType {
+        BranchNode,
+        ExtensionNode,
+        LeafNode
+    }
+ 
+    struct TrieNode {
+        bytes encoded;
+        Lib_RLPReader.RLPItem[] decoded;
+    }
+ 
+ 
+    /**********************
+     * Contract Constants *
+     **********************/
+ 
+    // TREE_RADIX determines the number of elements per branch node.
+    uint256 constant TREE_RADIX = 16;
+    // Branch nodes have TREE_RADIX elements plus an additional `value` slot.
+    uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;
+    // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.
+    uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;
+ 
+    // Prefixes are prepended to the `path` within a leaf or extension node and
+    // allow us to differentiate between the two node types. `ODD` or `EVEN` is
+    // determined by the number of nibbles within the unprefixed `path`. If the
+    // number of nibbles if even, we need to insert an extra padding nibble so
+    // the resulting prefixed `path` has an even number of nibbles.
+    uint8 constant PREFIX_EXTENSION_EVEN = 0;
+    uint8 constant PREFIX_EXTENSION_ODD = 1;
+    uint8 constant PREFIX_LEAF_EVEN = 2;
+    uint8 constant PREFIX_LEAF_ODD = 3;
+ 
+    // Just a utility constant. RLP represents `NULL` as 0x80.
+    bytes1 constant RLP_NULL = bytes1(0x80);
+    bytes constant RLP_NULL_BYTES = hex'80';
+    bytes32 constant internal KECCAK256_RLP_NULL_BYTES = keccak256(RLP_NULL_BYTES);
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Verifies a proof that a given key/value pair is present in the
+     * Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _value Value of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
+     * traditional Merkle trees, this proof is executed top-down and consists
+     * of a list of RLP-encoded nodes that make a path down to the target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
+     */
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        (
+            bool exists,
+            bytes memory value
+        ) = get(_key, _proof, _root);
+ 
+        return (
+            exists && Lib_BytesUtils.equal(_value, value)
+        );
+    }
+ 
+    /**
+     * @notice Verifies a proof that a given key is *not* present in
+     * the Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the key is absent in the trie, `false` otherwise.
+     */
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        (
+            bool exists,
+        ) = get(_key, _proof, _root);
+ 
+        return exists == false;
+    }
+ 
+    /**
+     * @notice Updates a Merkle trie and returns a new root hash.
+     * @param _key Key of the node to update, as a hex string.
+     * @param _value Value of the node to update, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node. If the key exists, we can simply update the value.
+     * Otherwise, we need to modify the trie to handle the new k/v pair.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _updatedRoot Root hash of the newly constructed trie.
+     */
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        // Special case when inserting the very first node.
+        Iif (_root == KECCAK256_RLP_NULL_BYTES) {
+            return getSingleNodeRootHash(_key, _value);
+        }
+ 
+        TrieNode[] memory proof = _parseProof(_proof);
+        (uint256 pathLength, bytes memory keyRemainder, ) = _walkNodePath(proof, _key, _root);
+        TrieNode[] memory newPath = _getNewPath(proof, pathLength, keyRemainder, _value);
+ 
+        return _getUpdatedTrieRoot(newPath, _key);
+    }
+ 
+    /**
+     * @notice Retrieves the value associated with a given key.
+     * @param _key Key to search for, as hex bytes.
+     * @param _proof Merkle trie inclusion proof for the key.
+     * @param _root Known root of the Merkle trie.
+     * @return _exists Whether or not the key exists.
+     * @return _value Value of the key if it exists.
+     */
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _exists,
+            bytes memory _value
+        )
+    {
+        TrieNode[] memory proof = _parseProof(_proof);
+        (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(proof, _key, _root);
+ 
+        bool exists = keyRemainder.length == 0;
+ 
+        Erequire(
+            exists || isFinalNode,
+            "Provided proof is invalid."
+        );
+ 
+        bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes('');
+ 
+        return (
+            exists,
+            value
+        );
+    }
+ 
+    /**
+     * Computes the root hash for a trie with a single node.
+     * @param _key Key for the single node.
+     * @param _value Value for the single node.
+     * @return _updatedRoot Hash of the trie.
+     */
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        return keccak256(_makeLeafNode(
+            Lib_BytesUtils.toNibbles(_key),
+            _value
+        ).encoded);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * @notice Walks through a proof using a provided key.
+     * @param _proof Inclusion proof to walk through.
+     * @param _key Key to use for the walk.
+     * @param _root Known root of the trie.
+     * @return _pathLength Length of the final path
+     * @return _keyRemainder Portion of the key remaining after the walk.
+     * @return _isFinalNode Whether or not we've hit a dead end.
+     */
+    function _walkNodePath(
+        TrieNode[] memory _proof,
+        bytes memory _key,
+        bytes32 _root
+    )
+        private
+        pure
+        returns (
+            uint256 _pathLength,
+            bytes memory _keyRemainder,
+            bool _isFinalNode
+        )
+    {
+        uint256 pathLength = 0;
+        bytes memory key = Lib_BytesUtils.toNibbles(_key);
+ 
+        bytes32 currentNodeID = _root;
+        uint256 currentKeyIndex = 0;
+        uint256 currentKeyIncrement = 0;
+        TrieNode memory currentNode;
+ 
+        // Proof is top-down, so we start at the first element (root).
+        for (uint256 i = 0; i < _proof.length; i++) {
+            currentNode = _proof[i];
+            currentKeyIndex += currentKeyIncrement;
+ 
+            // Keep track of the proof elements we actually need.
+            // It's expensive to resize arrays, so this simply reduces gas costs.
+            pathLength += 1;
+ 
+            if (currentKeyIndex == 0) {
+                // First proof element is always the root node.
+                require(
+                    keccak256(currentNode.encoded) == currentNodeID,
+                    "Invalid root hash"
+                );
+            } else Eif (currentNode.encoded.length >= 32) {
+                // Nodes 32 bytes or larger are hashed inside branch nodes.
+                require(
+                    keccak256(currentNode.encoded) == currentNodeID,
+                    "Invalid large internal hash"
+                );
+            } else {
+                // Nodes smaller than 31 bytes aren't hashed.
+                require(
+                    Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
+                    "Invalid internal node hash"
+                );
+            }
+ 
+            if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {
+                Iif (currentKeyIndex == key.length) {
+                    // We've hit the end of the key, meaning the value should be within this branch node.
+                    break;
+                } else {
+                    // We're not at the end of the key yet.
+                    // Figure out what the next node ID should be and continue.
+                    uint8 branchKey = uint8(key[currentKeyIndex]);
+                    Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
+                    currentNodeID = _getNodeID(nextNode);
+                    currentKeyIncrement = 1;
+                    continue;
+                }
+            } else Eif (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
+                bytes memory path = _getNodePath(currentNode);
+                uint8 prefix = uint8(path[0]);
+                uint8 offset = 2 - prefix % 2;
+                bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);
+                bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);
+                uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
+ 
+                if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
+                    if (
+                        pathRemainder.length == sharedNibbleLength &&
+                        keyRemainder.length == sharedNibbleLength
+                    ) {
+                        // The key within this leaf matches our key exactly.
+                        // Increment the key index to reflect that we have no remainder.
+                        currentKeyIndex += sharedNibbleLength;
+                    }
+ 
+                    // We've hit a leaf node, so our next node should be NULL.
+                    currentNodeID = bytes32(RLP_NULL);
+                    break;
+                } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
+                    Iif (sharedNibbleLength == 0) {
+                        // Our extension node doesn't share any part of our key.
+                        // We've hit the end of this path, updates will need to modify this extension.
+                        currentNodeID = bytes32(RLP_NULL);
+                        break;
+                    } else {
+                        // Our extension shares some nibbles.
+                        // Carry on to the next node.
+                        currentNodeID = _getNodeID(currentNode.decoded[1]);
+                        currentKeyIncrement = sharedNibbleLength;
+                        continue;
+                    }
+                } else {
+                    revert("Received a node with an unknown prefix");
+                }
+            } else {
+                revert("Received an unparseable node.");
+            }
+        }
+ 
+        // If our node ID is NULL, then we're at a dead end.
+        bool isFinalNode = currentNodeID == bytes32(RLP_NULL);
+        return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);
+    }
+ 
+    /**
+     * @notice Creates new nodes to support a k/v pair insertion into a given
+     * Merkle trie path.
+     * @param _path Path to the node nearest the k/v pair.
+     * @param _pathLength Length of the path. Necessary because the provided
+     * path may include additional nodes (e.g., it comes directly from a proof)
+     * and we can't resize in-memory arrays without costly duplication.
+     * @param _keyRemainder Portion of the initial key that must be inserted
+     * into the trie.
+     * @param _value Value to insert at the given key.
+     * @return _newPath A new path with the inserted k/v pair and extra supporting nodes.
+     */
+    function _getNewPath(
+        TrieNode[] memory _path,
+        uint256 _pathLength,
+        bytes memory _keyRemainder,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _newPath
+        )
+    {
+        bytes memory keyRemainder = _keyRemainder;
+ 
+        // Most of our logic depends on the status of the last node in the path.
+        TrieNode memory lastNode = _path[_pathLength - 1];
+        NodeType lastNodeType = _getNodeType(lastNode);
+ 
+        // Create an array for newly created nodes.
+        // We need up to three new nodes, depending on the contents of the last node.
+        // Since array resizing is expensive, we'll keep track of the size manually.
+        // We're using an explicit `totalNewNodes += 1` after insertions for clarity.
+        TrieNode[] memory newNodes = new TrieNode[](3);
+        uint256 totalNewNodes = 0;
+ 
+        Eif (keyRemainder.length == 0 && lastNodeType == NodeType.LeafNode) {
+            // We've found a leaf node with the given key.
+            // Simply need to update the value of the node to match.
+            newNodes[totalNewNodes] = _makeLeafNode(_getNodeKey(lastNode), _value);
+            totalNewNodes += 1;
+        } else if (lastNodeType == NodeType.BranchNode) {
+            if (keyRemainder.length == 0) {
+                // We've found a branch node with the given key.
+                // Simply need to update the value of the node to match.
+                newNodes[totalNewNodes] = _editBranchValue(lastNode, _value);
+                totalNewNodes += 1;
+            } else {
+                // We've found a branch node, but it doesn't contain our key.
+                // Reinsert the old branch for now.
+                newNodes[totalNewNodes] = lastNode;
+                totalNewNodes += 1;
+                // Create a new leaf node, slicing our remainder since the first byte points
+                // to our branch node.
+                newNodes[totalNewNodes] = _makeLeafNode(Lib_BytesUtils.slice(keyRemainder, 1), _value);
+                totalNewNodes += 1;
+            }
+        } else {
+            // Our last node is either an extension node or a leaf node with a different key.
+            bytes memory lastNodeKey = _getNodeKey(lastNode);
+            uint256 sharedNibbleLength = _getSharedNibbleLength(lastNodeKey, keyRemainder);
+ 
+            if (sharedNibbleLength != 0) {
+                // We've got some shared nibbles between the last node and our key remainder.
+                // We'll need to insert an extension node that covers these shared nibbles.
+                bytes memory nextNodeKey = Lib_BytesUtils.slice(lastNodeKey, 0, sharedNibbleLength);
+                newNodes[totalNewNodes] = _makeExtensionNode(nextNodeKey, _getNodeHash(_value));
+                totalNewNodes += 1;
+ 
+                // Cut down the keys since we've just covered these shared nibbles.
+                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, sharedNibbleLength);
+                keyRemainder = Lib_BytesUtils.slice(keyRemainder, sharedNibbleLength);
+            }
+ 
+            // Create an empty branch to fill in.
+            TrieNode memory newBranch = _makeEmptyBranchNode();
+ 
+            if (lastNodeKey.length == 0) {
+                // Key remainder was larger than the key for our last node.
+                // The value within our last node is therefore going to be shifted into
+                // a branch value slot.
+                newBranch = _editBranchValue(newBranch, _getNodeValue(lastNode));
+            } else {
+                // Last node key was larger than the key remainder.
+                // We're going to modify some index of our branch.
+                uint8 branchKey = uint8(lastNodeKey[0]);
+                // Move on to the next nibble.
+                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, 1);
+ 
+                if (lastNodeType == NodeType.LeafNode) {
+                    // We're dealing with a leaf node.
+                    // We'll modify the key and insert the old leaf node into the branch index.
+                    TrieNode memory modifiedLastNode = _makeLeafNode(lastNodeKey, _getNodeValue(lastNode));
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
+                } else if (lastNodeKey.length != 0) {
+                    // We're dealing with a shrinking extension node.
+                    // We need to modify the node to decrease the size of the key.
+                    TrieNode memory modifiedLastNode = _makeExtensionNode(lastNodeKey, _getNodeValue(lastNode));
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
+                } else {
+                    // We're dealing with an unnecessary extension node.
+                    // We're going to delete the node entirely.
+                    // Simply insert its current value into the branch index.
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeValue(lastNode));
+                }
+            }
+ 
+            if (keyRemainder.length == 0) {
+                // We've got nothing left in the key remainder.
+                // Simply insert the value into the branch value slot.
+                newBranch = _editBranchValue(newBranch, _value);
+                // Push the branch into the list of new nodes.
+                newNodes[totalNewNodes] = newBranch;
+                totalNewNodes += 1;
+            } else {
+                // We've got some key remainder to work with.
+                // We'll be inserting a leaf node into the trie.
+                // First, move on to the next nibble.
+                keyRemainder = Lib_BytesUtils.slice(keyRemainder, 1);
+                // Push the branch into the list of new nodes.
+                newNodes[totalNewNodes] = newBranch;
+                totalNewNodes += 1;
+                // Push a new leaf node for our k/v pair.
+                newNodes[totalNewNodes] = _makeLeafNode(keyRemainder, _value);
+                totalNewNodes += 1;
+            }
+        }
+ 
+        // Finally, join the old path with our newly created nodes.
+        // Since we're overwriting the last node in the path, we use `_pathLength - 1`.
+        return _joinNodeArrays(_path, _pathLength - 1, newNodes, totalNewNodes);
+    }
+ 
+    /**
+     * @notice Computes the trie root from a given path.
+     * @param _nodes Path to some k/v pair.
+     * @param _key Key for the k/v pair.
+     * @return _updatedRoot Root hash for the updated trie.
+     */
+    function _getUpdatedTrieRoot(
+        TrieNode[] memory _nodes,
+        bytes memory _key
+    )
+        private
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = Lib_BytesUtils.toNibbles(_key);
+ 
+        // Some variables to keep track of during iteration.
+        TrieNode memory currentNode;
+        NodeType currentNodeType;
+        bytes memory previousNodeHash;
+ 
+        // Run through the path backwards to rebuild our root hash.
+        for (uint256 i = _nodes.length; i > 0; i--) {
+            // Pick out the current node.
+            currentNode = _nodes[i - 1];
+            currentNodeType = _getNodeType(currentNode);
+ 
+            if (currentNodeType == NodeType.LeafNode) {
+                // Leaf nodes are already correctly encoded.
+                // Shift the key over to account for the nodes key.
+                bytes memory nodeKey = _getNodeKey(currentNode);
+                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
+            } else if (currentNodeType == NodeType.ExtensionNode) {
+                // Shift the key over to account for the nodes key.
+                bytes memory nodeKey = _getNodeKey(currentNode);
+                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
+ 
+                // If this node is the last element in the path, it'll be correctly encoded
+                // and we can skip this part.
+                Eif (previousNodeHash.length > 0) {
+                    // Re-encode the node based on the previous node.
+                    currentNode = _makeExtensionNode(nodeKey, previousNodeHash);
+                }
+            } else Eif (currentNodeType == NodeType.BranchNode) {
+                // If this node is the last element in the path, it'll be correctly encoded
+                // and we can skip this part.
+                Eif (previousNodeHash.length > 0) {
+                    // Re-encode the node based on the previous node.
+                    uint8 branchKey = uint8(key[key.length - 1]);
+                    key = Lib_BytesUtils.slice(key, 0, key.length - 1);
+                    currentNode = _editBranchIndex(currentNode, branchKey, previousNodeHash);
+                }
+            }
+ 
+            // Compute the node hash for the next iteration.
+            previousNodeHash = _getNodeHash(currentNode.encoded);
+        }
+ 
+        // Current node should be the root at this point.
+        // Simply return the hash of its encoding.
+        return keccak256(currentNode.encoded);
+    }
+ 
+    /**
+     * @notice Parses an RLP-encoded proof into something more useful.
+     * @param _proof RLP-encoded proof to parse.
+     * @return _parsed Proof parsed into easily accessible structs.
+     */
+    function _parseProof(
+        bytes memory _proof
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _parsed
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);
+        TrieNode[] memory proof = new TrieNode[](nodes.length);
+ 
+        for (uint256 i = 0; i < nodes.length; i++) {
+            bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);
+            proof[i] = TrieNode({
+                encoded: encoded,
+                decoded: Lib_RLPReader.readList(encoded)
+            });
+        }
+ 
+        return proof;
+    }
+ 
+    /**
+     * @notice Picks out the ID for a node. Node ID is referred to as the
+     * "hash" within the specification, but nodes < 32 bytes are not actually
+     * hashed.
+     * @param _node Node to pull an ID for.
+     * @return _nodeID ID for the node, depending on the size of its contents.
+     */
+    function _getNodeID(
+        Lib_RLPReader.RLPItem memory _node
+    )
+        private
+        pure
+        returns (
+            bytes32 _nodeID
+        )
+    {
+        bytes memory nodeID;
+ 
+        Iif (_node.length < 32) {
+            // Nodes smaller than 32 bytes are RLP encoded.
+            nodeID = Lib_RLPReader.readRawBytes(_node);
+        } else {
+            // Nodes 32 bytes or larger are hashed.
+            nodeID = Lib_RLPReader.readBytes(_node);
+        }
+ 
+        return Lib_BytesUtils.toBytes32(nodeID);
+    }
+ 
+    /**
+     * @notice Gets the path for a leaf or extension node.
+     * @param _node Node to get a path for.
+     * @return _path Node path, converted to an array of nibbles.
+     */
+    function _getNodePath(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _path
+        )
+    {
+        return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));
+    }
+ 
+    /**
+     * @notice Gets the key for a leaf or extension node. Keys are essentially
+     * just paths without any prefix.
+     * @param _node Node to get a key for.
+     * @return _key Node key, converted to an array of nibbles.
+     */
+    function _getNodeKey(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _key
+        )
+    {
+        return _removeHexPrefix(_getNodePath(_node));
+    }
+ 
+    /**
+     * @notice Gets the path for a node.
+     * @param _node Node to get a value for.
+     * @return _value Node value, as hex bytes.
+     */
+    function _getNodeValue(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _value
+        )
+    {
+        return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
+    }
+ 
+    /**
+     * @notice Computes the node hash for an encoded node. Nodes < 32 bytes
+     * are not hashed, all others are keccak256 hashed.
+     * @param _encoded Encoded node to hash.
+     * @return _hash Hash of the encoded node. Simply the input if < 32 bytes.
+     */
+    function _getNodeHash(
+        bytes memory _encoded
+    )
+        private
+        pure
+        returns (
+            bytes memory _hash
+        )
+    {
+        Iif (_encoded.length < 32) {
+            return _encoded;
+        } else {
+            return abi.encodePacked(keccak256(_encoded));
+        }
+    }
+ 
+    /**
+     * @notice Determines the type for a given node.
+     * @param _node Node to determine a type for.
+     * @return _type Type of the node; BranchNode/ExtensionNode/LeafNode.
+     */
+    function _getNodeType(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            NodeType _type
+        )
+    {
+        if (_node.decoded.length == BRANCH_NODE_LENGTH) {
+            return NodeType.BranchNode;
+        } else Eif (_node.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
+            bytes memory path = _getNodePath(_node);
+            uint8 prefix = uint8(path[0]);
+ 
+            if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
+                return NodeType.LeafNode;
+            } else Eif (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
+                return NodeType.ExtensionNode;
+            }
+        }
+ 
+        revert("Invalid node type");
+    }
+ 
+    /**
+     * @notice Utility; determines the number of nibbles shared between two
+     * nibble arrays.
+     * @param _a First nibble array.
+     * @param _b Second nibble array.
+     * @return _shared Number of shared nibbles.
+     */
+    function _getSharedNibbleLength(
+        bytes memory _a,
+        bytes memory _b
+    )
+        private
+        pure
+        returns (
+            uint256 _shared
+        )
+    {
+        uint256 i = 0;
+        while (_a.length > i && _b.length > i && _a[i] == _b[i]) {
+            i++;
+        }
+        return i;
+    }
+ 
+    /**
+     * @notice Utility; converts an RLP-encoded node into our nice struct.
+     * @param _raw RLP-encoded node to convert.
+     * @return _node Node as a TrieNode struct.
+     */
+    function _makeNode(
+        bytes[] memory _raw
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes memory encoded = Lib_RLPWriter.writeList(_raw);
+ 
+        return TrieNode({
+            encoded: encoded,
+            decoded: Lib_RLPReader.readList(encoded)
+        });
+    }
+ 
+    /**
+     * @notice Utility; converts an RLP-decoded node into our nice struct.
+     * @param _items RLP-decoded node to convert.
+     * @return _node Node as a TrieNode struct.
+     */
+    function _makeNode(
+        Lib_RLPReader.RLPItem[] memory _items
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](_items.length);
+        for (uint256 i = 0; i < _items.length; i++) {
+            raw[i] = Lib_RLPReader.readRawBytes(_items[i]);
+        }
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates a new extension node.
+     * @param _key Key for the extension node, unprefixed.
+     * @param _value Value for the extension node.
+     * @return _node New extension node with the given k/v pair.
+     */
+    function _makeExtensionNode(
+        bytes memory _key,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](2);
+        bytes memory key = _addHexPrefix(_key, false);
+        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
+        raw[1] = Lib_RLPWriter.writeBytes(_value);
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates a new leaf node.
+     * @dev This function is essentially identical to `_makeExtensionNode`.
+     * Although we could route both to a single method with a flag, it's
+     * more gas efficient to keep them separate and duplicate the logic.
+     * @param _key Key for the leaf node, unprefixed.
+     * @param _value Value for the leaf node.
+     * @return _node New leaf node with the given k/v pair.
+     */
+    function _makeLeafNode(
+        bytes memory _key,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](2);
+        bytes memory key = _addHexPrefix(_key, true);
+        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
+        raw[1] = Lib_RLPWriter.writeBytes(_value);
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates an empty branch node.
+     * @return _node Empty branch node as a TrieNode struct.
+     */
+    function _makeEmptyBranchNode()
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](BRANCH_NODE_LENGTH);
+        for (uint256 i = 0; i < raw.length; i++) {
+            raw[i] = RLP_NULL_BYTES;
+        }
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Modifies the value slot for a given branch.
+     * @param _branch Branch node to modify.
+     * @param _value Value to insert into the branch.
+     * @return _updatedNode Modified branch node.
+     */
+    function _editBranchValue(
+        TrieNode memory _branch,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _updatedNode
+        )
+    {
+        bytes memory encoded = Lib_RLPWriter.writeBytes(_value);
+        _branch.decoded[_branch.decoded.length - 1] = Lib_RLPReader.toRLPItem(encoded);
+        return _makeNode(_branch.decoded);
+    }
+ 
+    /**
+     * @notice Modifies a slot at an index for a given branch.
+     * @param _branch Branch node to modify.
+     * @param _index Slot index to modify.
+     * @param _value Value to insert into the slot.
+     * @return _updatedNode Modified branch node.
+     */
+    function _editBranchIndex(
+        TrieNode memory _branch,
+        uint8 _index,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _updatedNode
+        )
+    {
+        bytes memory encoded = _value.length < 32 ? _value : Lib_RLPWriter.writeBytes(_value);
+        _branch.decoded[_index] = Lib_RLPReader.toRLPItem(encoded);
+        return _makeNode(_branch.decoded);
+    }
+ 
+    /**
+     * @notice Utility; adds a prefix to a key.
+     * @param _key Key to prefix.
+     * @param _isLeaf Whether or not the key belongs to a leaf.
+     * @return _prefixedKey Prefixed key.
+     */
+    function _addHexPrefix(
+        bytes memory _key,
+        bool _isLeaf
+    )
+        private
+        pure
+        returns (
+            bytes memory _prefixedKey
+        )
+    {
+        uint8 prefix = _isLeaf ? uint8(0x02) : uint8(0x00);
+        uint8 offset = uint8(_key.length % 2);
+        bytes memory prefixed = new bytes(2 - offset);
+        prefixed[0] = bytes1(prefix + offset);
+        return abi.encodePacked(prefixed, _key);
+    }
+ 
+    /**
+     * @notice Utility; removes a prefix from a path.
+     * @param _path Path to remove the prefix from.
+     * @return _unprefixedKey Unprefixed key.
+     */
+    function _removeHexPrefix(
+        bytes memory _path
+    )
+        private
+        pure
+        returns (
+            bytes memory _unprefixedKey
+        )
+    {
+        if (uint8(_path[0]) % 2 == 0) {
+            return Lib_BytesUtils.slice(_path, 2);
+        } else {
+            return Lib_BytesUtils.slice(_path, 1);
+        }
+    }
+ 
+    /**
+     * @notice Utility; combines two node arrays. Array lengths are required
+     * because the actual lengths may be longer than the filled lengths.
+     * Array resizing is extremely costly and should be avoided.
+     * @param _a First array to join.
+     * @param _aLength Length of the first array.
+     * @param _b Second array to join.
+     * @param _bLength Length of the second array.
+     * @return _joined Combined node array.
+     */
+    function _joinNodeArrays(
+        TrieNode[] memory _a,
+        uint256 _aLength,
+        TrieNode[] memory _b,
+        uint256 _bLength
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _joined
+        )
+    {
+        TrieNode[] memory ret = new TrieNode[](_aLength + _bLength);
+ 
+        // Copy elements from the first array.
+        for (uint256 i = 0; i < _aLength; i++) {
+            ret[i] = _a[i];
+        }
+ 
+        // Copy elements from the second array.
+        for (uint256 i = 0; i < _bLength; i++) {
+            ret[i + _aLength] = _b[i];
+        }
+ 
+        return ret;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/trie/Lib_SecureMerkleTrie.sol.html b/coverage/lcov-report/libraries/trie/Lib_SecureMerkleTrie.sol.html new file mode 100644 index 000000000..14a776a75 --- /dev/null +++ b/coverage/lcov-report/libraries/trie/Lib_SecureMerkleTrie.sol.html @@ -0,0 +1,548 @@ + + + + Code coverage report for libraries/trie/Lib_SecureMerkleTrie.sol + + + + + + + +
+
+

+ all files / libraries/trie/ Lib_SecureMerkleTrie.sol +

+
+
+ 63.64% + Statements + 7/11 +
+
+ 100% + Branches + 0/0 +
+
+ 66.67% + Functions + 4/6 +
+
+ 63.64% + Lines + 7/11 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +47× +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_MerkleTrie } from "./Lib_MerkleTrie.sol";
+ 
+/**
+ * @title Lib_SecureMerkleTrie
+ */
+library Lib_SecureMerkleTrie {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Verifies a proof that a given key/value pair is present in the
+     * Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _value Value of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
+     * traditional Merkle trees, this proof is executed top-down and consists
+     * of a list of RLP-encoded nodes that make a path down to the target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
+     */
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
+    }
+ 
+    /**
+     * @notice Verifies a proof that a given key is *not* present in
+     * the Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the key is not present in the trie, `false` otherwise.
+     */
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.verifyExclusionProof(key, _proof, _root);
+    }
+ 
+    /**
+     * @notice Updates a Merkle trie and returns a new root hash.
+     * @param _key Key of the node to update, as a hex string.
+     * @param _value Value of the node to update, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node. If the key exists, we can simply update the value.
+     * Otherwise, we need to modify the trie to handle the new k/v pair.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _updatedRoot Root hash of the newly constructed trie.
+     */
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.update(key, _value, _proof, _root);
+    }
+ 
+    /**
+     * @notice Retrieves the value associated with a given key.
+     * @param _key Key to search for, as hex bytes.
+     * @param _proof Merkle trie inclusion proof for the key.
+     * @param _root Known root of the Merkle trie.
+     * @return _exists Whether or not the key exists.
+     * @return _value Value of the key if it exists.
+     */
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _exists,
+            bytes memory _value
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.get(key, _proof, _root);
+    }
+ 
+    /**
+     * Computes the root hash for a trie with a single node.
+     * @param _key Key for the single node.
+     * @param _value Value for the single node.
+     * @return _updatedRoot Hash of the trie.
+     */
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.getSingleNodeRootHash(key, _value);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Computes the secure counterpart to a key.
+     * @param _key Key to get a secure key from.
+     * @return _secureKey Secure version of the key.
+     */
+    function _getSecureKey(
+        bytes memory _key
+    )
+        private
+        pure
+        returns (
+            bytes memory _secureKey
+        )
+    {
+        return abi.encodePacked(keccak256(_key));
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/trie/index.html b/coverage/lcov-report/libraries/trie/index.html new file mode 100644 index 000000000..14d44409f --- /dev/null +++ b/coverage/lcov-report/libraries/trie/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for libraries/trie/ + + + + + + + +
+
+

+ all files libraries/trie/ +

+
+
+ 71.98% + Statements + 149/207 +
+
+ 55.88% + Branches + 38/68 +
+
+ 81.25% + Functions + 26/32 +
+
+ 71.57% + Lines + 146/204 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_MerkleTrie.sol
72.45%142/19655.88%38/6884.62%22/2672.02%139/193
Lib_SecureMerkleTrie.sol
63.64%7/11100%0/066.67%4/663.64%7/11
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/Lib_Bytes32Utils.sol.html b/coverage/lcov-report/libraries/utils/Lib_Bytes32Utils.sol.html new file mode 100644 index 000000000..23b140949 --- /dev/null +++ b/coverage/lcov-report/libraries/utils/Lib_Bytes32Utils.sol.html @@ -0,0 +1,416 @@ + + + + Code coverage report for libraries/utils/Lib_Bytes32Utils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_Bytes32Utils.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +40× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_Byte32Utils
+ */
+library Lib_Bytes32Utils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to "true."
+     * @param _in Input bytes32 value.
+     * @return Bytes32 as a boolean.
+     */
+    function toBool(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        return _in != 0;
+    }
+ 
+    /**
+     * Converts a boolean to a bytes32 value.
+     * @param _in Input boolean value.
+     * @return Boolean as a bytes32.
+     */
+    function fromBool(
+        bool _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return bytes32(uint256(_in ? 1 : 0));
+    }
+ 
+    /**
+     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.
+     * @param _in Input bytes32 value.
+     * @return Bytes32 as an address.
+     */
+    function toAddress(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        return address(uint160(uint256(_in)));
+    }
+ 
+    /**
+     * Converts an address to a bytes32.
+     * @param _in Input address value.
+     * @return Address as a bytes32.
+     */
+    function fromAddress(
+        address _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return bytes32(uint256(_in));
+    }
+ 
+    /**
+     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.
+     * @param _in Input bytes32 value.
+     * @return Bytes32 without any leading zeros.
+     */
+    function removeLeadingZeros(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes memory out;
+ 
+        assembly {
+            // Figure out how many leading zero bytes to remove.
+            let shift := 0
+            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {
+                shift := add(shift, 1)
+            }
+ 
+            // Reserve some space for our output and fix the free memory pointer.
+            out := mload(0x40)
+            mstore(0x40, add(out, 0x40))
+ 
+            // Shift the value and store it into the output bytes.
+            mstore(add(out, 0x20), shl(mul(shift, 8), _in))
+ 
+            // Store the new size (with leading zero bytes removed) in the output byte size.
+            mstore(out, sub(32, shift))
+        }
+ 
+        return out;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/Lib_BytesUtils.sol.html b/coverage/lcov-report/libraries/utils/Lib_BytesUtils.sol.html new file mode 100644 index 000000000..ebdd55e85 --- /dev/null +++ b/coverage/lcov-report/libraries/utils/Lib_BytesUtils.sol.html @@ -0,0 +1,728 @@ + + + + Code coverage report for libraries/utils/Lib_BytesUtils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_BytesUtils.sol +

+
+
+ 100% + Statements + 38/38 +
+
+ 63.64% + Branches + 14/22 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 44/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +311× +311× +311× +  +308× +  +308× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +308× +  +  +  +  +  +  +  +  +  +  +299× +73× +  +  +226× +  +  +  +  +  +  +  +  +  + + + +  +  + +  +  +  +  +  +  +  +  +  +164× + + +  +  + +  +  +162× +  +  +  +  +  +  +  +  +  + +  +  +  +15× +15× +15× +  +15× +  +  +  +15× +  +  +  +12× +12× +12× +  +12× +  +  +  +12× +  +  +  + + + +  + +  +  +  + +  +  +  +  +  +  +  +  +  +292× +  +292× +9144× +9144× +  +  +292× +  +  +  +  +  +  +  +  +  +26× +  +26× +708× +  +  +26× +  +  +  +  +  +  +  +  +  +  +26× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_BytesUtils
+ */
+library Lib_BytesUtils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start,
+        uint256 _length
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        Erequire(_length + 31 >= _length, "slice_overflow");
+        Erequire(_start + _length >= _start, "slice_overflow");
+        require(_bytes.length >= _start + _length, "slice_outOfBounds");
+ 
+        bytes memory tempBytes;
+ 
+        assembly {
+            switch iszero(_length)
+            case 0 {
+                // Get a location of some free memory and store it in tempBytes as
+                // Solidity does for memory variables.
+                tempBytes := mload(0x40)
+ 
+                // The first word of the slice result is potentially a partial
+                // word read from the original array. To read it, we calculate
+                // the length of that partial word and start copying that many
+                // bytes into the array. The first word we copy will start with
+                // data we don't care about, but the last `lengthmod` bytes will
+                // land at the beginning of the contents of the new array. When
+                // we're done copying, we overwrite the full first word with
+                // the actual length of the slice.
+                let lengthmod := and(_length, 31)
+ 
+                // The multiplication in the next line is necessary
+                // because when slicing multiples of 32 bytes (lengthmod == 0)
+                // the following copy loop was copying the origin's length
+                // and then ending prematurely not copying everything it should.
+                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
+                let end := add(mc, _length)
+ 
+                for {
+                    // The multiplication in the next line has the same exact purpose
+                    // as the one above.
+                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
+                } lt(mc, end) {
+                    mc := add(mc, 0x20)
+                    cc := add(cc, 0x20)
+                } {
+                    mstore(mc, mload(cc))
+                }
+ 
+                mstore(tempBytes, _length)
+ 
+                //update free-memory pointer
+                //allocating the array padded to 32 bytes like the compiler does now
+                mstore(0x40, and(add(mc, 31), not(31)))
+            }
+            //if we want a zero-length slice let's just return a zero-length array
+            default {
+                tempBytes := mload(0x40)
+ 
+                //zero out the 32 bytes slice we are about to return
+                //we need to do it because Solidity does not garbage collect
+                mstore(tempBytes, 0)
+ 
+                mstore(0x40, add(tempBytes, 0x20))
+            }
+        }
+ 
+        return tempBytes;
+    }
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        if (_bytes.length - _start == 0) {
+            return bytes('');
+        }
+ 
+        return slice(_bytes, _start, _bytes.length - _start);
+    }
+ 
+    function toBytes32PadLeft(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes32)
+    {
+        bytes32 ret;
+        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;
+        assembly {
+            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))
+        }
+        return ret;
+    }
+ 
+    function toBytes32(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes32)
+    {
+        if (_bytes.length < 32) {
+            bytes32 ret;
+            assembly {
+                ret := mload(add(_bytes, 32))
+            }
+            return ret;
+        }
+ 
+        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes
+    }
+ 
+    function toUint256(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (uint256)
+    {
+        return uint256(toBytes32(_bytes));
+    }
+ 
+    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
+        Erequire(_start + 3 >= _start, "toUint24_overflow");
+        Erequire(_bytes.length >= _start + 3 , "toUint24_outOfBounds");
+        uint24 tempUint;
+ 
+        assembly {
+            tempUint := mload(add(add(_bytes, 0x3), _start))
+        }
+ 
+        return tempUint;
+    }
+ 
+    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
+        Erequire(_start + 1 >= _start, "toUint8_overflow");
+        Erequire(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
+        uint8 tempUint;
+ 
+        assembly {
+            tempUint := mload(add(add(_bytes, 0x1), _start))
+        }
+ 
+        return tempUint;
+    }
+ 
+    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
+        Erequire(_start + 20 >= _start, "toAddress_overflow");
+        Erequire(_bytes.length >= _start + 20, "toAddress_outOfBounds");
+        address tempAddress;
+ 
+        assembly {
+            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
+        }
+ 
+        return tempAddress;
+    }
+ 
+    function toNibbles(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        bytes memory nibbles = new bytes(_bytes.length * 2);
+ 
+        for (uint256 i = 0; i < _bytes.length; i++) {
+            nibbles[i * 2] = _bytes[i] >> 4;
+            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);
+        }
+ 
+        return nibbles;
+    }
+ 
+    function fromNibbles(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        bytes memory ret = new bytes(_bytes.length / 2);
+ 
+        for (uint256 i = 0; i < ret.length; i++) {
+            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);
+        }
+ 
+        return ret;
+    }
+ 
+    function equal(
+        bytes memory _bytes,
+        bytes memory _other
+    )
+        internal
+        pure
+        returns (bool)
+    {
+        return keccak256(_bytes) == keccak256(_other);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/Lib_ECDSAUtils.sol.html b/coverage/lcov-report/libraries/utils/Lib_ECDSAUtils.sol.html new file mode 100644 index 000000000..713191c61 --- /dev/null +++ b/coverage/lcov-report/libraries/utils/Lib_ECDSAUtils.sol.html @@ -0,0 +1,356 @@ + + + + Code coverage report for libraries/utils/Lib_ECDSAUtils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_ECDSAUtils.sol +

+
+
+ 100% + Statements + 9/9 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× + +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_ECDSAUtils
+ */
+library Lib_ECDSAUtils {
+ 
+    /**************************************
+     * Internal Functions: ECDSA Recovery *
+     **************************************/
+ 
+    /**
+     * Recovers a signed address given a message and signature.
+     * @param _message Message that was originally signed.
+     * @param _isEthSignedMessage Whether or not the user used the `Ethereum Signed Message` prefix.
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     * @return _sender Signer address.
+     */
+    function recover(
+        bytes memory _message,
+        bool _isEthSignedMessage,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        internal
+        pure
+        returns (
+            address _sender
+        )
+    {
+        bytes32 messageHash = getMessageHash(_message, _isEthSignedMessage);
+ 
+        return ecrecover(
+            messageHash,
+            _v + 27,
+            _r,
+            _s
+        );
+    }
+ 
+    function getMessageHash(
+        bytes memory _message,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (bytes32) {
+        if (_isEthSignedMessage) {
+            return getEthSignedMessageHash(_message);
+        }
+        return getNativeMessageHash(_message);
+    }
+ 
+ 
+    /*************************************
+     * Private Functions: ECDSA Recovery *
+     *************************************/
+ 
+    /**
+     * Gets the native message hash (simple keccak256) for a message.
+     * @param _message Message to hash.
+     * @return _messageHash Native message hash.
+     */
+    function getNativeMessageHash(
+        bytes memory _message
+    )
+        private
+        pure
+        returns (
+            bytes32 _messageHash
+        )
+    {
+        return keccak256(_message);
+    }
+ 
+    /**
+     * Gets the hash of a message with the `Ethereum Signed Message` prefix.
+     * @param _message Message to hash.
+     * @return _messageHash Prefixed message hash.
+     */
+    function getEthSignedMessageHash(
+        bytes memory _message
+    )
+        private
+        pure
+        returns (
+            bytes32 _messageHash
+        )
+    {
+        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
+        bytes32 messageHash = keccak256(_message);
+        return keccak256(abi.encodePacked(prefix, messageHash));
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/Lib_ErrorUtils.sol.html b/coverage/lcov-report/libraries/utils/Lib_ErrorUtils.sol.html new file mode 100644 index 000000000..5f34eb479 --- /dev/null +++ b/coverage/lcov-report/libraries/utils/Lib_ErrorUtils.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for libraries/utils/Lib_ErrorUtils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_ErrorUtils.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title Lib_ErrorUtils
+ */
+library Lib_ErrorUtils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Encodes an error string into raw solidity-style revert data.
+     * (i.e. ascii bytes, prefixed with bytes4(keccak("Error(string))"))
+     * Ref: https://docs.soliditylang.org/en/v0.8.2/control-structures.html?highlight=Error(string)#panic-via-assert-and-error-via-require
+     * @param _reason Reason for the reversion.
+     * @return Standard solidity revert data for the given reason.
+     */
+    function encodeRevertString(
+        string memory _reason
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodeWithSignature(
+            "Error(string)",
+            _reason
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/Lib_EthUtils.sol.html b/coverage/lcov-report/libraries/utils/Lib_EthUtils.sol.html new file mode 100644 index 000000000..a7d7a6455 --- /dev/null +++ b/coverage/lcov-report/libraries/utils/Lib_EthUtils.sol.html @@ -0,0 +1,629 @@ + + + + Code coverage report for libraries/utils/Lib_EthUtils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_EthUtils.sol +

+
+
+ 83.33% + Statements + 10/12 +
+
+ 100% + Branches + 0/0 +
+
+ 85.71% + Functions + 6/7 +
+
+ 87.5% + Lines + 14/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +34× +  +  +  +  +  +  +34× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +212× +  +  +  +212× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +  +27× +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+import { Lib_Bytes32Utils } from "./Lib_Bytes32Utils.sol";
+ 
+/**
+ * @title Lib_EthUtils
+ */
+library Lib_EthUtils {
+ 
+    /***********************************
+     * Internal Functions: Code Access *
+     ***********************************/
+ 
+    /**
+     * Gets the code for a given address.
+     * @param _address Address to get code for.
+     * @param _offset Offset to start reading from.
+     * @param _length Number of bytes to read.
+     * @return _code Code read from the contract.
+     */
+    function getCode(
+        address _address,
+        uint256 _offset,
+        uint256 _length
+    )
+        internal
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        assembly {
+            _code := mload(0x40)
+            mstore(0x40, add(_code, add(_length, 0x20)))
+            mstore(_code, _length)
+            extcodecopy(_address, add(_code, 0x20), _offset, _length)
+        }
+ 
+        return _code;
+    }
+ 
+    /**
+     * Gets the full code for a given address.
+     * @param _address Address to get code for.
+     * @return _code Full code of the contract.
+     */
+    function getCode(
+        address _address
+    )
+        internal
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        return getCode(
+            _address,
+            0,
+            getCodeSize(_address)
+        );
+    }
+ 
+    /**
+     * Gets the size of a contract's code in bytes.
+     * @param _address Address to get code size for.
+     * @return _codeSize Size of the contract's code in bytes.
+     */
+    function getCodeSize(
+        address _address
+    )
+        internal
+        view
+        returns (
+            uint256 _codeSize
+        )
+    {
+        assembly {
+            _codeSize := extcodesize(_address)
+        }
+ 
+        return _codeSize;
+    }
+ 
+    /**
+     * Gets the hash of a contract's code.
+     * @param _address Address to get a code hash for.
+     * @return _codeHash Hash of the contract's code.
+     */
+    function getCodeHash(
+        address _address
+    )
+        internal
+        view
+        returns (
+            bytes32 _codeHash
+        )
+    {
+        assembly {
+            _codeHash := extcodehash(_address)
+        }
+ 
+        return _codeHash;
+    }
+ 
+ 
+    /*****************************************
+     * Internal Functions: Contract Creation *
+     *****************************************/
+ 
+    /**
+     * Creates a contract with some given initialization code.
+     * @param _code Contract initialization code.
+     * @return _created Address of the created contract.
+     */
+    function createContract(
+        bytes memory _code
+    )
+        internal
+        returns (
+            address _created
+        )
+    {
+        assembly {
+            _created := create(
+                0,
+                add(_code, 0x20),
+                mload(_code)
+            )
+        }
+ 
+        return _created;
+    }
+ 
+    /**
+     * Computes the address that would be generated by CREATE.
+     * @param _creator Address creating the contract.
+     * @param _nonce Creator's nonce.
+     * @return _address Address to be generated by CREATE.
+     */
+    function getAddressForCREATE(
+        address _creator,
+        uint256 _nonce
+    )
+        internal
+        pure
+        returns (
+            address _address
+        )
+    {
+        bytes[] memory encoded = new bytes[](2);
+        encoded[0] = Lib_RLPWriter.writeAddress(_creator);
+        encoded[1] = Lib_RLPWriter.writeUint(_nonce);
+ 
+        bytes memory encodedList = Lib_RLPWriter.writeList(encoded);
+        return Lib_Bytes32Utils.toAddress(keccak256(encodedList));
+    }
+ 
+    /**
+     * Computes the address that would be generated by CREATE2.
+     * @param _creator Address creating the contract.
+     * @param _bytecode Bytecode of the contract to be created.
+     * @param _salt 32 byte salt value mixed into the hash.
+     * @return _address Address to be generated by CREATE2.
+     */
+    function getAddressForCREATE2(
+        address _creator,
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        internal
+        pure
+        returns (address _address)
+    {
+        bytes32 hashedData = keccak256(abi.encodePacked(
+            byte(0xff),
+            _creator,
+            _salt,
+            keccak256(_bytecode)
+        ));
+ 
+        return Lib_Bytes32Utils.toAddress(hashedData);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/Lib_Math.sol.html b/coverage/lcov-report/libraries/utils/Lib_Math.sol.html new file mode 100644 index 000000000..a1abd31af --- /dev/null +++ b/coverage/lcov-report/libraries/utils/Lib_Math.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for libraries/utils/Lib_Math.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_Math.sol +

+
+
+ 0% + Statements + 0/3 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_Math
+ */
+library Lib_Math {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Calculates the minumum of two numbers.
+     * @param _x First number to compare.
+     * @param _y Second number to compare.
+     * @return Lesser of the two numbers.
+     */
+    function min(
+        uint256 _x,
+        uint256 _y
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        if (_x < _y) {
+            return _x;
+        }
+ 
+        return _y;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/Lib_MerkleTree.sol.html b/coverage/lcov-report/libraries/utils/Lib_MerkleTree.sol.html new file mode 100644 index 000000000..ddc48113f --- /dev/null +++ b/coverage/lcov-report/libraries/utils/Lib_MerkleTree.sol.html @@ -0,0 +1,725 @@ + + + + Code coverage report for libraries/utils/Lib_MerkleTree.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_MerkleTree.sol +

+
+
+ 97.83% + Statements + 45/46 +
+
+ 90.91% + Branches + 20/22 +
+
+ 100% + Functions + 3/3 +
+
+ 97.96% + Lines + 48/49 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +118× +  +  +  +  +117× +  +  +  +117× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +117× +  +  +117× +117× +  +  +117× +  +  +117× +  +  +117× +117× +  +117× +273× +273× +  +273× +4620× +4620× +4620× +  +  +  +  +4620× +  +  +273× +27× +27× +27× +  +  +  +  +27× +  +  +273× +273× +  +  +117× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +102× +  +  +  +  +101× +  +  +  +  +100× +  +  +  +  +99× +  +99× +653× +146× +  +  +  +  +  +  +507× +  +  +  +  +  +  +  +653× +  +  +99× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +  +  +  +  +100× + +  +  +  +  +97× +97× +97× +776× +206× +206× +  +  +  +  +97× +70× +  +  +97× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_MerkleTree
+ * @author River Keefer
+ */
+library Lib_MerkleTree {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Calculates a merkle root for a list of 32-byte leaf hashes.  WARNING: If the number
+     * of leaves passed in is not a power of two, it pads out the tree with zero hashes.
+     * If you do not know the original length of elements for the tree you are verifying,
+     * then this may allow empty leaves past _elements.length to pass a verification check down the line.
+     * Note that the _elements argument is modified, therefore it must not be used again afterwards
+     * @param _elements Array of hashes from which to generate a merkle root.
+     * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).
+     */
+    function getMerkleRoot(
+        bytes32[] memory _elements
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        require(
+            _elements.length > 0,
+            "Lib_MerkleTree: Must provide at least one leaf hash."
+        );
+ 
+        Iif (_elements.length == 0) {
+            return _elements[0];
+        }
+ 
+        uint256[16] memory defaults = [
+            0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,
+            0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,
+            0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,
+            0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,
+            0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,
+            0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,
+            0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,
+            0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,
+            0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,
+            0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,
+            0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,
+            0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,
+            0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,
+            0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,
+            0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,
+            0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10
+        ];
+ 
+        // Reserve memory space for our hashes.
+        bytes memory buf = new bytes(64);
+ 
+        // We'll need to keep track of left and right siblings.
+        bytes32 leftSibling;
+        bytes32 rightSibling;
+ 
+        // Number of non-empty nodes at the current depth.
+        uint256 rowSize = _elements.length;
+ 
+        // Current depth, counting from 0 at the leaves
+        uint256 depth = 0;
+ 
+        // Common sub-expressions
+        uint256 halfRowSize;         // rowSize / 2
+        bool rowSizeIsOdd;           // rowSize % 2 == 1
+ 
+        while (rowSize > 1) {
+            halfRowSize = rowSize / 2;
+            rowSizeIsOdd = rowSize % 2 == 1;
+ 
+            for (uint256 i = 0; i < halfRowSize; i++) {
+                leftSibling  = _elements[(2 * i)    ];
+                rightSibling = _elements[(2 * i) + 1];
+                assembly {
+                    mstore(add(buf, 32), leftSibling )
+                    mstore(add(buf, 64), rightSibling)
+                }
+ 
+                _elements[i] = keccak256(buf);
+            }
+ 
+            if (rowSizeIsOdd) {
+                leftSibling  = _elements[rowSize - 1];
+                rightSibling = bytes32(defaults[depth]);
+                assembly {
+                    mstore(add(buf, 32), leftSibling)
+                    mstore(add(buf, 64), rightSibling)
+                }
+ 
+                _elements[halfRowSize] = keccak256(buf);
+            }
+ 
+            rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);
+            depth++;
+        }
+ 
+        return _elements[0];
+    }
+ 
+    /**
+     * Verifies a merkle branch for the given leaf hash.  Assumes the original length
+     * of leaves generated is a known, correct input, and does not return true for indices
+     * extending past that index (even if _siblings would be otherwise valid.)
+     * @param _root The Merkle root to verify against.
+     * @param _leaf The leaf hash to verify inclusion of.
+     * @param _index The index in the tree of this leaf.
+     * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
+     * @param _totalLeaves The total number of leaves originally passed into.
+     * @return Whether or not the merkle branch and leaf passes verification.
+     */
+    function verify(
+        bytes32 _root,
+        bytes32 _leaf,
+        uint256 _index,
+        bytes32[] memory _siblings,
+        uint256 _totalLeaves
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        require(
+            _totalLeaves > 0,
+            "Lib_MerkleTree: Total leaves must be greater than zero."
+        );
+ 
+        require(
+            _index < _totalLeaves,
+            "Lib_MerkleTree: Index out of bounds."
+        );
+ 
+        require(
+            _siblings.length == _ceilLog2(_totalLeaves),
+            "Lib_MerkleTree: Total siblings does not correctly correspond to total leaves."
+        );
+ 
+        bytes32 computedRoot = _leaf;
+ 
+        for (uint256 i = 0; i < _siblings.length; i++) {
+            if ((_index & 1) == 1) {
+                computedRoot = keccak256(
+                    abi.encodePacked(
+                        _siblings[i],
+                        computedRoot
+                    )
+                );
+            } else {
+                computedRoot = keccak256(
+                    abi.encodePacked(
+                        computedRoot,
+                        _siblings[i]
+                    )
+                );
+            }
+ 
+            _index >>= 1;
+        }
+ 
+        return _root == computedRoot;
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Calculates the integer ceiling of the log base 2 of an input.
+     * @param _in Unsigned input to calculate the log.
+     * @return ceil(log_base_2(_in))
+     */
+    function _ceilLog2(
+        uint256 _in
+    )
+        private
+        pure
+        returns (
+            uint256
+        )
+    {
+        Erequire(
+            _in > 0,
+            "Lib_MerkleTree: Cannot compute ceil(log_2) of 0."
+        );
+ 
+        if (_in == 1) {
+            return 0;
+        }
+ 
+        // Find the highest set bit (will be floor(log_2)).
+        // Borrowed with <3 from https://github.com/ethereum/solidity-examples
+        uint256 val = _in;
+        uint256 highest = 0;
+        for (uint8 i = 128; i >= 1; i >>= 1) {
+            if (val & (uint(1) << i) - 1 << i != 0) {
+                highest += i;
+                val >>= i;
+            }
+        }
+ 
+        // Increment by one if this is not a perfect logarithm.
+        if ((uint(1) << highest) != _in) {
+            highest += 1;
+        }
+ 
+        return highest;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/Lib_ReentrancyGuard.sol.html b/coverage/lcov-report/libraries/utils/Lib_ReentrancyGuard.sol.html new file mode 100644 index 000000000..f9285d350 --- /dev/null +++ b/coverage/lcov-report/libraries/utils/Lib_ReentrancyGuard.sol.html @@ -0,0 +1,248 @@ + + + + Code coverage report for libraries/utils/Lib_ReentrancyGuard.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_ReentrancyGuard.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +54× +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +14× +  +14× +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @dev Contract module that helps prevent reentrant calls to a function.
+ *
+ * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
+ * available, which can be applied to functions to make sure there are no nested
+ * (reentrant) calls to them.
+ *
+ * Note that because there is a single `nonReentrant` guard, functions marked as
+ * `nonReentrant` may not call one another. This can be worked around by making
+ * those functions `private`, and then adding `external` `nonReentrant` entry
+ * points to them.
+ *
+ * TIP: If you would like to learn more about reentrancy and alternative ways
+ * to protect against it, check out our blog post
+ * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
+ */
+abstract contract Lib_ReentrancyGuard {
+    // Booleans are more expensive than uint256 or any type that takes up a full
+    // word because each write operation emits an extra SLOAD to first read the
+    // slot's contents, replace the bits taken up by the boolean, and then write
+    // back. This is the compiler's defense against contract upgrades and
+    // pointer aliasing, and it cannot be disabled.
+ 
+    // The values being non-zero value makes deployment a bit more expensive,
+    // but in exchange the refund on every call to nonReentrant will be lower in
+    // amount. Since refunds are capped to a percentage of the total
+    // transaction's gas, it is best to keep them low in cases like this one, to
+    // increase the likelihood of the full refund coming into effect.
+    uint256 private constant _NOT_ENTERED = 1;
+    uint256 private constant _ENTERED = 2;
+ 
+    uint256 private _status;
+ 
+    constructor () {
+        _status = _NOT_ENTERED;
+    }
+ 
+    /**
+     * @dev Prevents a contract from calling itself, directly or indirectly.
+     * Calling a `nonReentrant` function from another `nonReentrant`
+     * function is not supported. It is possible to prevent this from happening
+     * by making the `nonReentrant` function external, and make it call a
+     * `private` function that does the actual work.
+     */
+    modifier nonReentrant() {
+        // On the first call to nonReentrant, _notEntered will be true
+        Erequire(_status != _ENTERED, "ReentrancyGuard: reentrant call");
+ 
+        // Any calls to nonReentrant after this point will fail
+        _status = _ENTERED;
+ 
+        _;
+ 
+        // By storing the original value once again, a refund is triggered (see
+        // https://eips.ethereum.org/EIPS/eip-2200)
+        _status = _NOT_ENTERED;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/Lib_RingBuffer.sol.html b/coverage/lcov-report/libraries/utils/Lib_RingBuffer.sol.html new file mode 100644 index 000000000..a0835844d --- /dev/null +++ b/coverage/lcov-report/libraries/utils/Lib_RingBuffer.sol.html @@ -0,0 +1,1193 @@ + + + + Code coverage report for libraries/utils/Lib_RingBuffer.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_RingBuffer.sol +

+
+
+ 78.13% + Statements + 50/64 +
+
+ 54.17% + Branches + 13/24 +
+
+ 81.82% + Functions + 9/11 +
+
+ 77.46% + Lines + 55/71 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +572× +572× +  +  +572× +134× +  +  +  +572× +11× +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +572× +572× +  +  +572× +572× +572× +  +  +  +  +  +  +  +  +  +  +  +  +  +470× +  +470× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +538× +  +  +  +  +535× +535× +  +535× +  +  +535× +  +  +535× +  +  +  +  +535× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  + +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +441× +441× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +550× +550× +  +  +  +  +  +  +  +  +  +  +  +  +  +573× +573× +  +573× +573× +573× +  +  +  +  +573× +573× +573× +573× +  +  +  +  +  +573× +573× +  +  +573× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2572× +2572× +  +2572× +2572× +2572× +  +  +  +  +2572× +2572× +2572× +2572× +  +  +  +  +  +2572× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1642× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+library Lib_RingBuffer {
+    using Lib_RingBuffer for RingBuffer;
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct Buffer {
+        uint256 length;
+        mapping (uint256 => bytes32) buf;
+    }
+ 
+    struct RingBuffer {
+        bytes32 contextA;
+        bytes32 contextB;
+        Buffer bufferA;
+        Buffer bufferB;
+        uint256 nextOverwritableIndex;
+    }
+ 
+    struct RingBufferContext {
+        // contextA
+        uint40 globalIndex;
+        bytes27 extraData;
+ 
+        // contextB
+        uint64 currBufferIndex;
+        uint40 prevResetIndex;
+        uint40 currResetIndex;
+    }
+ 
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 constant MIN_CAPACITY = 16;
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Pushes a single element to the buffer.
+     * @param _self Buffer to access.
+     * @param _value Value to push to the buffer.
+     * @param _extraData Optional global extra data.
+     */
+    function push(
+        RingBuffer storage _self,
+        bytes32 _value,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
+ 
+        // Set a minimum capacity.
+        if (currBuffer.length == 0) {
+            currBuffer.length = MIN_CAPACITY;
+        }
+ 
+        // Check if we need to expand the buffer.
+        if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {
+            Iif (ctx.currResetIndex < _self.nextOverwritableIndex) {
+                // We're going to overwrite the inactive buffer.
+                // Bump the buffer index, reset the delete offset, and set our reset indices.
+                ctx.currBufferIndex++;
+                ctx.prevResetIndex = ctx.currResetIndex;
+                ctx.currResetIndex = ctx.globalIndex;
+ 
+                // Swap over to the next buffer.
+                currBuffer = _self.getBuffer(ctx.currBufferIndex);
+            } else {
+                // We're not overwriting yet, double the length of the current buffer.
+                currBuffer.length *= 2;
+            }
+        }
+ 
+        // Index to write to is the difference of the global and reset indices.
+        uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;
+        currBuffer.buf[writeHead] = _value;
+ 
+        // Bump the global index and insert our extra data, then save the context.
+        ctx.globalIndex++;
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Pushes a single element to the buffer.
+     * @param _self Buffer to access.
+     * @param _value Value to push to the buffer.
+     */
+    function push(
+        RingBuffer storage _self,
+        bytes32 _value
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        
+        _self.push(
+            _value,
+            ctx.extraData
+        );
+    }
+ 
+    /**
+     * Retrieves an element from the buffer.
+     * @param _self Buffer to access.
+     * @param _index Element index to retrieve.
+     * @return Value of the element at the given index.
+     */
+    function get(
+        RingBuffer storage _self,
+        uint256 _index
+    )
+        internal
+        view
+        returns (
+            bytes32    
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+ 
+        require(
+            _index < ctx.globalIndex,
+            "Index out of bounds."
+        );
+ 
+        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
+        Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);
+ 
+        Eif (_index >= ctx.currResetIndex) {
+            // We're trying to load an element from the current buffer.
+            // Relative index is just the difference from the reset index.
+            uint256 relativeIndex = _index - ctx.currResetIndex;
+ 
+            // Shouldn't happen but why not check.
+            Erequire(
+                relativeIndex < currBuffer.length,
+                "Index out of bounds."
+            );
+ 
+            return currBuffer.buf[relativeIndex];
+        } else {
+            // We're trying to load an element from the previous buffer.
+            // Relative index is the difference from the reset index in the other direction.
+            uint256 relativeIndex = ctx.currResetIndex - _index;
+ 
+            // Condition only fails in the case that we deleted and flipped buffers.
+            require(
+                ctx.currResetIndex > ctx.prevResetIndex,
+                "Index out of bounds."
+            );
+ 
+            // Make sure we're not trying to read beyond the array.
+            require(
+                relativeIndex <= prevBuffer.length,
+                "Index out of bounds."
+            );
+ 
+            return prevBuffer.buf[prevBuffer.length - relativeIndex];
+        }
+    }
+ 
+    /**
+     * Deletes all elements after (and including) a given index.
+     * @param _self Buffer to access.
+     * @param _index Index of the element to delete from (inclusive).
+     * @param _extraData Optional global extra data.
+     */
+    function deleteElementsAfterInclusive(
+        RingBuffer storage _self,
+        uint40 _index,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+ 
+        Erequire(
+            _index < ctx.globalIndex && _index >= ctx.prevResetIndex,
+            "Index out of bounds."
+        );
+ 
+        Iif (_index < ctx.currResetIndex) {
+            // We're switching back to the previous buffer.
+            // Reduce the buffer index, set the current reset index back to match the previous one.
+            // We use the equality of these two values to prevent reading beyond this buffer.
+            ctx.currBufferIndex--;
+            ctx.currResetIndex = ctx.prevResetIndex;
+        }
+ 
+        // Set our global index and extra data, save the context.
+        ctx.globalIndex = _index;
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Deletes all elements after (and including) a given index.
+     * @param _self Buffer to access.
+     * @param _index Index of the element to delete from (inclusive).
+     */
+    function deleteElementsAfterInclusive(
+        RingBuffer storage _self,
+        uint40 _index
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        _self.deleteElementsAfterInclusive(
+            _index,
+            ctx.extraData
+        );
+    }
+ 
+    /**
+     * Retrieves the current global index.
+     * @param _self Buffer to access.
+     * @return Current global index.
+     */
+    function getLength(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        return ctx.globalIndex;
+    }
+ 
+    /**
+     * Changes current global extra data.
+     * @param _self Buffer to access.
+     * @param _extraData New global extra data.
+     */
+    function setExtraData(
+        RingBuffer storage _self,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Retrieves the current global extra data.
+     * @param _self Buffer to access.
+     * @return Current global extra data.
+     */
+    function getExtraData(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            bytes27
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        return ctx.extraData;
+    }
+ 
+    /**
+     * Sets the current ring buffer context.
+     * @param _self Buffer to access.
+     * @param _ctx Current ring buffer context.
+     */
+    function setContext(
+        RingBuffer storage _self,
+        RingBufferContext memory _ctx
+    )
+        internal
+    {
+        bytes32 contextA;
+        bytes32 contextB;
+ 
+        uint40 globalIndex = _ctx.globalIndex;
+        bytes27 extraData = _ctx.extraData;
+        assembly {
+            contextA := globalIndex
+            contextA := or(contextA, extraData)
+        }
+ 
+        uint64 currBufferIndex = _ctx.currBufferIndex;
+        uint40 prevResetIndex = _ctx.prevResetIndex;
+        uint40 currResetIndex = _ctx.currResetIndex;
+        assembly {
+            contextB := currBufferIndex
+            contextB := or(contextB, shl(64, prevResetIndex))
+            contextB := or(contextB, shl(104, currResetIndex))
+        }
+ 
+        Eif (_self.contextA != contextA) {
+            _self.contextA = contextA;
+        }
+ 
+        Iif (_self.contextB != contextB) {
+            _self.contextB = contextB;
+        }
+    }
+ 
+    /**
+     * Retrieves the current ring buffer context.
+     * @param _self Buffer to access.
+     * @return Current ring buffer context.
+     */
+    function getContext(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            RingBufferContext memory
+        )
+    {
+        bytes32 contextA = _self.contextA;
+        bytes32 contextB = _self.contextB;
+ 
+        uint40 globalIndex;
+        bytes27 extraData;
+        assembly {
+            globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            extraData   := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)
+        }
+ 
+        uint64 currBufferIndex;
+        uint40 prevResetIndex;
+        uint40 currResetIndex;
+        assembly {
+            currBufferIndex :=          and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)
+            prevResetIndex  := shr(64,  and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))
+            currResetIndex  := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))
+        }
+ 
+        return RingBufferContext({
+            globalIndex: globalIndex,
+            extraData: extraData,
+            currBufferIndex: currBufferIndex,
+            prevResetIndex: prevResetIndex,
+            currResetIndex: currResetIndex
+        });
+    }
+ 
+    /**
+     * Retrieves the a buffer from the ring buffer by index.
+     * @param _self Buffer to access.
+     * @param _which Index of the sub buffer to access.
+     * @return Sub buffer for the index.
+     */
+    function getBuffer(
+        RingBuffer storage _self,
+        uint256 _which
+    )
+        internal
+        view
+        returns (
+            Buffer storage
+        )
+    {
+        return _which % 2 == 0 ? _self.bufferA : _self.bufferB;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/utils/index.html b/coverage/lcov-report/libraries/utils/index.html new file mode 100644 index 000000000..c793f1883 --- /dev/null +++ b/coverage/lcov-report/libraries/utils/index.html @@ -0,0 +1,197 @@ + + + + Code coverage report for libraries/utils/ + + + + + + + +
+
+

+ all files libraries/utils/ +

+
+
+ 89.07% + Statements + 163/183 +
+
+ 67.57% + Branches + 50/74 +
+
+ 91.11% + Functions + 41/45 +
+
+ 89.27% + Lines + 183/205 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_Bytes32Utils.sol
100%6/6100%0/0100%5/5100%7/7
Lib_BytesUtils.sol
100%38/3863.64%14/22100%11/11100%44/44
Lib_ECDSAUtils.sol
100%9/9100%2/2100%4/4100%9/9
Lib_ErrorUtils.sol
100%1/1100%0/0100%1/1100%1/1
Lib_EthUtils.sol
83.33%10/12100%0/085.71%6/787.5%14/16
Lib_Math.sol
0%0/30%0/20%0/10%0/3
Lib_MerkleTree.sol
97.83%45/4690.91%20/22100%3/397.96%48/49
Lib_ReentrancyGuard.sol
100%4/450%1/2100%2/2100%5/5
Lib_RingBuffer.sol
78.13%50/6454.17%13/2481.82%9/1177.46%55/71
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html b/coverage/lcov-report/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html new file mode 100644 index 000000000..5e49d6ba8 --- /dev/null +++ b/coverage/lcov-report/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html @@ -0,0 +1,1205 @@ + + + + Code coverage report for libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol + + + + + + + +
+
+

+ all files / libraries/wrappers/ Lib_SafeExecutionManagerWrapper.sol +

+
+
+ 100% + Statements + 30/30 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 16/16 +
+
+ 96.77% + Lines + 30/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +41× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +43× +  +  +  +  +  +  +43× +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +146× +146× +  +  +  +  +146× + +  +  +  +  +  +  +  +144× +  +  +  +  +  +  +  +  +  +  +  +145× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_ErrorUtils } from "../utils/Lib_ErrorUtils.sol";
+ 
+/**
+ * @title Lib_SafeExecutionManagerWrapper
+ * @dev The Safe Execution Manager Wrapper provides functions which facilitate writing OVM safe 
+ * code using the standard solidity compiler, by routing all its operations through the Execution 
+ * Manager.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+library Lib_SafeExecutionManagerWrapper {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Performs a safe ovmCALL.
+     * @param _gasLimit Gas limit for the call.
+     * @param _target Address to call.
+     * @param _calldata Data to send to the call.
+     * @return _success Whether or not the call reverted.
+     * @return _returndata Data returned by the call.
+     */
+    function safeCALL(
+        uint256 _gasLimit,
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCALL(uint256,address,bytes)",
+                _gasLimit,
+                _target,
+                _calldata
+            )
+        );
+ 
+        return abi.decode(returndata, (bool, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmDELEGATECALL.
+     * @param _gasLimit Gas limit for the call.
+     * @param _target Address to call.
+     * @param _calldata Data to send to the call.
+     * @return _success Whether or not the call reverted.
+     * @return _returndata Data returned by the call.
+     */
+    function safeDELEGATECALL(
+        uint256 _gasLimit,
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmDELEGATECALL(uint256,address,bytes)",
+                _gasLimit,
+                _target,
+                _calldata
+            )
+        );
+ 
+        return abi.decode(returndata, (bool, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmCREATE call.
+     * @param _gasLimit Gas limit for the creation.
+     * @param _bytecode Code for the new contract.
+     * @return _contract Address of the created contract.
+     */
+    function safeCREATE(
+        uint256 _gasLimit,
+        bytes memory _bytecode
+    )
+        internal
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            _gasLimit,
+            abi.encodeWithSignature(
+                "ovmCREATE(bytes)",
+                _bytecode
+            )
+        );
+ 
+        return abi.decode(returndata, (address, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmEXTCODESIZE call.
+     * @param _contract Address of the contract to query the size of.
+     * @return _EXTCODESIZE Size of the requested contract in bytes.
+     */
+    function safeEXTCODESIZE(
+        address _contract
+    )
+        internal
+        returns (
+            uint256 _EXTCODESIZE
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmEXTCODESIZE(address)",
+                _contract
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmCHAINID call.
+     * @return _CHAINID Result of calling ovmCHAINID.
+     */
+    function safeCHAINID()
+        internal
+        returns (
+            uint256 _CHAINID
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCHAINID()"
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmCALLER call.
+     * @return _CALLER Result of calling ovmCALLER.
+     */
+    function safeCALLER()
+        internal
+        returns (
+            address _CALLER
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCALLER()"
+            )
+        );
+ 
+        return abi.decode(returndata, (address));
+    }
+ 
+    /**
+     * Performs a safe ovmADDRESS call.
+     * @return _ADDRESS Result of calling ovmADDRESS.
+     */
+    function safeADDRESS()
+        internal
+        returns (
+            address _ADDRESS
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmADDRESS()"
+            )
+        );
+ 
+        return abi.decode(returndata, (address));
+    }
+ 
+    /**
+     * Performs a safe ovmGETNONCE call.
+     * @return _nonce Result of calling ovmGETNONCE.
+     */
+    function safeGETNONCE()
+        internal
+        returns (
+            uint256 _nonce
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmGETNONCE()"
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmSETNONCE call.
+     * @param _nonce New account nonce.
+     */
+    function safeSETNONCE(
+        uint256 _nonce
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSETNONCE(uint256)",
+                _nonce
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe ovmCREATEEOA call.
+     * @param _messageHash Message hash which was signed by EOA
+     * @param _v v value of signature (0 or 1)
+     * @param _r r value of signature
+     * @param _s s value of signature
+     */
+    function safeCREATEEOA(
+        bytes32 _messageHash,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCREATEEOA(bytes32,uint8,bytes32,bytes32)",
+                _messageHash,
+                _v,
+                _r,
+                _s
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe REVERT.
+     * @param _reason String revert reason to pass along with the REVERT.
+     */
+    function safeREVERT(
+        string memory _reason
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmREVERT(bytes)",
+                Lib_ErrorUtils.encodeRevertString(
+                    _reason
+                )
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe "require".
+     * @param _condition Boolean condition that must be true or will revert.
+     * @param _reason String revert reason to pass along with the REVERT.
+     */
+    function safeREQUIRE(
+        bool _condition,
+        string memory _reason
+    )
+        internal
+    {
+        if (!_condition) {
+            safeREVERT(
+                _reason
+            );
+        }
+    }
+ 
+    /**
+     * Performs a safe ovmSLOAD call.
+     */
+    function safeSLOAD(
+        bytes32 _key
+    )
+        internal
+        returns (
+            bytes32
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSLOAD(bytes32)",
+                _key
+            )
+        );
+ 
+        return abi.decode(returndata, (bytes32));
+    }
+ 
+    /**
+     * Performs a safe ovmSSTORE call.
+     */
+    function safeSSTORE(
+        bytes32 _key,
+        bytes32 _value
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSSTORE(bytes32,bytes32)",
+                _key,
+                _value
+            )
+        );
+    }
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Performs an ovm interaction and the necessary safety checks.
+     * @param _gasLimit Gas limit for the interaction.
+     * @param _calldata Data to send to the OVM_ExecutionManager (encoded with sighash).
+     * @return _returndata Data sent back by the OVM_ExecutionManager.
+     */
+    function _safeExecutionManagerInteraction(
+        uint256 _gasLimit,
+        bytes memory _calldata
+    )
+        private
+        returns (
+            bytes memory _returndata
+        )
+    {
+        address ovmExecutionManager = msg.sender;
+        (
+            bool success,
+            bytes memory returndata
+        ) = ovmExecutionManager.call{gas: _gasLimit}(_calldata);
+ 
+        if (success == false) {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        } else Iif (returndata.length == 1) {
+            assembly {
+                return(0, 1)
+            }
+        } else {
+            return returndata;
+        }
+    }
+ 
+    function _safeExecutionManagerInteraction(
+        bytes memory _calldata
+    )
+        private
+        returns (
+            bytes memory _returndata
+        )
+    {
+        return _safeExecutionManagerInteraction(
+            gasleft(),
+            _calldata
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/wrappers/Lib_SafeMathWrapper.sol.html b/coverage/lcov-report/libraries/wrappers/Lib_SafeMathWrapper.sol.html new file mode 100644 index 000000000..09c54906c --- /dev/null +++ b/coverage/lcov-report/libraries/wrappers/Lib_SafeMathWrapper.sol.html @@ -0,0 +1,566 @@ + + + + Code coverage report for libraries/wrappers/Lib_SafeMathWrapper.sol + + + + + + + +
+
+

+ all files / libraries/wrappers/ Lib_SafeMathWrapper.sol +

+
+
+ 21.05% + Statements + 4/19 +
+
+ 50% + Branches + 1/2 +
+
+ 12.5% + Functions + 1/8 +
+
+ 21.05% + Lines + 4/19 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// Pulled from @openzeppelin/contracts/math/SafeMath.sol
+// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_SafeExecutionManagerWrapper } from "./Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title Lib_SafeMathWrapper
+ */
+ 
+/**
+ * @dev Wrappers over Solidity's arithmetic operations with added overflow
+ * checks.
+ *
+ * Arithmetic operations in Solidity wrap on overflow. This can easily result
+ * in bugs, because programmers usually assume that an overflow raises an
+ * error, which is the standard behavior in high level programming languages.
+ * `SafeMath` restores this intuition by reverting the transaction when an
+ * operation overflows.
+ *
+ * Using this library instead of the unchecked operations eliminates an entire
+ * class of bugs, so it's recommended to use it always.
+ */
+ 
+library Lib_SafeMathWrapper {
+    /**
+     * @dev Returns the addition of two unsigned integers, reverting on
+     * overflow.
+     *
+     * Counterpart to Solidity's `+` operator.
+     *
+     * Requirements:
+     *
+     * - Addition cannot overflow.
+     */
+    function add(uint256 a, uint256 b) internal returns (uint256) {
+        uint256 c = a + b;
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c >= a, "Lib_SafeMathWrapper: addition overflow");
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the subtraction of two unsigned integers, reverting on
+     * overflow (when the result is negative).
+     *
+     * Counterpart to Solidity's `-` operator.
+     *
+     * Requirements:
+     *
+     * - Subtraction cannot overflow.
+     */
+    function sub(uint256 a, uint256 b) internal returns (uint256) {
+        return sub(a, b, "Lib_SafeMathWrapper: subtraction overflow");
+    }
+ 
+    /**
+     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
+     * overflow (when the result is negative).
+     *
+     * Counterpart to Solidity's `-` operator.
+     *
+     * Requirements:
+     *
+     * - Subtraction cannot overflow.
+     */
+    function sub(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b <= a, errorMessage);
+        uint256 c = a - b;
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the multiplication of two unsigned integers, reverting on
+     * overflow.
+     *
+     * Counterpart to Solidity's `*` operator.
+     *
+     * Requirements:
+     *
+     * - Multiplication cannot overflow.
+     */
+    function mul(uint256 a, uint256 b) internal returns (uint256) {
+        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
+        // benefit is lost if 'b' is also tested.
+        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
+        Iif (a == 0) {
+            return 0;
+        }
+ 
+        uint256 c = a * b;
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c / a == b, "Lib_SafeMathWrapper: multiplication overflow");
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the integer division of two unsigned integers. Reverts on
+     * division by zero. The result is rounded towards zero.
+     *
+     * Counterpart to Solidity's `/` operator. Note: this function uses a
+     * `revert` opcode (which leaves remaining gas untouched) while Solidity
+     * uses an invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function div(uint256 a, uint256 b) internal returns (uint256) {
+        return div(a, b, "Lib_SafeMathWrapper: division by zero");
+    }
+ 
+    /**
+     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
+     * division by zero. The result is rounded towards zero.
+     *
+     * Counterpart to Solidity's `/` operator. Note: this function uses a
+     * `revert` opcode (which leaves remaining gas untouched) while Solidity
+     * uses an invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function div(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b > 0, errorMessage);
+        uint256 c = a / b;
+        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+     * Reverts when dividing by zero.
+     *
+     * Counterpart to Solidity's `%` operator. This function uses a `revert`
+     * opcode (which leaves remaining gas untouched) while Solidity uses an
+     * invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function mod(uint256 a, uint256 b) internal returns (uint256) {
+        return mod(a, b, "Lib_SafeMathWrapper: modulo by zero");
+    }
+ 
+    /**
+     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+     * Reverts with custom message when dividing by zero.
+     *
+     * Counterpart to Solidity's `%` operator. This function uses a `revert`
+     * opcode (which leaves remaining gas untouched) while Solidity uses an
+     * invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function mod(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b != 0, errorMessage);
+        return a % b;
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libraries/wrappers/index.html b/coverage/lcov-report/libraries/wrappers/index.html new file mode 100644 index 000000000..4fa651258 --- /dev/null +++ b/coverage/lcov-report/libraries/wrappers/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for libraries/wrappers/ + + + + + + + +
+
+

+ all files libraries/wrappers/ +

+
+
+ 69.39% + Statements + 34/49 +
+
+ 75% + Branches + 6/8 +
+
+ 70.83% + Functions + 17/24 +
+
+ 68% + Lines + 34/50 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_SafeExecutionManagerWrapper.sol
100%30/3083.33%5/6100%16/1696.77%30/31
Lib_SafeMathWrapper.sol
21.05%4/1950%1/212.5%1/821.05%4/19
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..bf9e75672 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html @@ -0,0 +1,485 @@ + + + + Code coverage report for optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/accounts/ OVM_ECDSAContractAccount.sol +

+
+
+ 93.75% + Statements + 15/16 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 1/1 +
+
+ 93.75% + Lines + 15/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + +  +  +  +  +  + + +  +  +  +  +  + + +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+import { Lib_SafeMathWrapper } from "../../libraries/wrappers/Lib_SafeMathWrapper.sol";
+ 
+/**
+ * @title OVM_ECDSAContractAccount
+ * @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the
+ * ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by 
+ * providing eth_sign and EIP155 formatted transaction encodings.
+ *
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    // TODO: should be the amount sufficient to cover the gas costs of all of the transactions up
+    // to and including the CALL/CREATE which forms the entrypoint of the transaction.
+    uint256 constant EXECUTION_VALIDATION_GAS_OVERHEAD = 25000;
+    address constant ETH_ERC20_ADDRESS = 0x4200000000000000000000000000000000000006;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Executes a signed transaction.
+     * @param _transaction Signed EOA transaction.
+     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     * @return Whether or not the call returned (rather than reverted).
+     * @return Data returned by the call.
+     */
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        override
+        public
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
+ 
+        // Address of this contract within the ovm (ovmADDRESS) should be the same as the
+        // recovered address of the user who signed this message. This is how we manage to shim
+        // account abstraction even though the user isn't a contract.
+        // Need to make sure that the transaction nonce is right and bump it if so.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_ECDSAUtils.recover(
+                _transaction,
+                isEthSign,
+                _v,
+                _r,
+                _s
+            ) == Lib_SafeExecutionManagerWrapper.safeADDRESS(),
+            "Signature provided for EOA transaction execution is invalid."
+        );
+ 
+        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
+ 
+        // Need to make sure that the transaction chainId is correct.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.chainId == Lib_SafeExecutionManagerWrapper.safeCHAINID(),
+            "Transaction chainId does not match expected OVM chainId."
+        );
+ 
+        // Need to make sure that the transaction nonce is right.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
+            "Transaction nonce does not match the expected nonce."
+        );
+ 
+        // TEMPORARY: Disable gas checks for mainnet.
+        // // Need to make sure that the gas is sufficient to execute the transaction.
+        // Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+        //    gasleft() >= Lib_SafeMathWrapper.add(decodedTx.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD),
+        //    "Gas is not sufficient to execute the transaction."
+        // );
+ 
+        // Transfer fee to relayer.
+        address relayer = Lib_SafeExecutionManagerWrapper.safeCALLER();
+        uint256 fee = Lib_SafeMathWrapper.mul(decodedTx.gasLimit, decodedTx.gasPrice);
+        (bool success, ) = Lib_SafeExecutionManagerWrapper.safeCALL(
+            gasleft(),
+            ETH_ERC20_ADDRESS,
+            abi.encodeWithSignature("transfer(address,uint256)", relayer, fee)
+        );
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            success == true,
+            "Fee was not transferred to relayer."
+        );
+ 
+        // Contract creations are signalled by sending a transaction to the zero address.
+        if (decodedTx.to == address(0)) {
+            (address created, bytes memory revertData) = Lib_SafeExecutionManagerWrapper.safeCREATE(
+                decodedTx.gasLimit,
+                decodedTx.data
+            );
+ 
+            // Return true if the contract creation succeeded, false w/ revertData otherwise.
+            Eif (created != address(0)) {
+                return (true, abi.encode(created));
+            } else {
+                return (false, revertData);
+            }
+        } else {
+            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
+            // the nonce of the calling account. Normally an EOA would bump the nonce for both
+            // cases, but since this is a contract we'd end up bumping the nonce twice.
+            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
+ 
+            return Lib_SafeExecutionManagerWrapper.safeCALL(
+                decodedTx.gasLimit,
+                decodedTx.to,
+                decodedTx.data
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html new file mode 100644 index 000000000..ff7ae303f --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html @@ -0,0 +1,428 @@ + + + + Code coverage report for optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/accounts/ OVM_ProxyEOA.sol +

+
+
+ 87.5% + Statements + 7/8 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 5/5 +
+
+ 88.89% + Lines + 8/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_ProxyEOA
+ * @dev The Proxy EOA contract uses a delegate call to execute the logic in an implementation contract.
+ * In combination with the logic implemented in the ECDSA Contract Account, this enables a form of upgradable 
+ * 'account abstraction' on layer 2. 
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ProxyEOA {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _implementation Address of the initial implementation contract.
+     */
+    constructor(
+        address _implementation
+    )
+    {
+        _setImplementation(_implementation);
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        (bool success, bytes memory returndata) = Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
+            gasleft(),
+            getImplementation(),
+            msg.data
+        );
+ 
+        Eif (success) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            Lib_SafeExecutionManagerWrapper.safeREVERT(
+                string(returndata)
+            );
+        }
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Changes the implementation address.
+     * @param _implementation New implementation address.
+     */
+    function upgrade(
+        address _implementation
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_SafeExecutionManagerWrapper.safeADDRESS() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
+            "EOAs can only upgrade their own EOA implementation"
+        );
+ 
+        _setImplementation(_implementation);
+    }
+ 
+    /**
+     * Gets the address of the current implementation.
+     * @return Current implementation address.
+     */
+    function getImplementation()
+        public
+        returns (
+            address
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                IMPLEMENTATION_KEY
+            )
+        );
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _setImplementation(
+        address _implementation
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            IMPLEMENTATION_KEY,
+            Lib_Bytes32Utils.fromAddress(_implementation)
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/accounts/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/accounts/index.html new file mode 100644 index 000000000..83293fefa --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/accounts/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/OVM/accounts/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/accounts/ +

+
+
+ 91.67% + Statements + 22/24 +
+
+ 66.67% + Branches + 4/6 +
+
+ 100% + Functions + 6/6 +
+
+ 92% + Lines + 23/25 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_ECDSAContractAccount.sol
93.75%15/1675%3/4100%1/193.75%15/16
OVM_ProxyEOA.sol
87.5%7/850%1/2100%5/588.89%8/9
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html new file mode 100644 index 000000000..165d915d8 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html @@ -0,0 +1,443 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/messaging/ Abs_BaseCrossDomainMessenger.sol +

+
+
+ 77.78% + Statements + 7/9 +
+
+ 50% + Branches + 1/2 +
+
+ 80% + Functions + 4/5 +
+
+ 77.78% + Lines + 7/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/* Library Imports */
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/**
+ * @title Abs_BaseCrossDomainMessenger
+ * @dev The Base Cross Domain Messenger is an abstract contract providing the interface and common functionality used in the
+ * L1 and L2 Cross Domain Messengers. It can also serve as a template for developers wishing to implement a custom bridge 
+ * contract to suit their needs.
+ *
+ * Compiler used: defined by child contract
+ * Runtime target: defined by child contract
+ */
+abstract contract Abs_BaseCrossDomainMessenger is iAbs_BaseCrossDomainMessenger, Lib_ReentrancyGuard {
+    /**************
+     *  Constants *
+     **************/
+ 
+    // The default x-domain message sender being set to a non-zero value makes
+    // deployment a bit more expensive, but in exchange the refund on every call to
+    // `relayMessage` by the L1 and L2 messengers will be higher.
+    address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    mapping (bytes32 => bool) public relayedMessages;
+    mapping (bytes32 => bool) public successfulMessages;
+    mapping (bytes32 => bool) public sentMessages;
+    uint256 public messageNonce;
+    address internal xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    constructor() Lib_ReentrancyGuard() {}
+ 
+    function xDomainMessageSender() public override view returns (address) {
+        Irequire(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set");
+        return xDomainMsgSender;
+    }
+ 
+    /**
+     * Sends a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _message Message to send to the target.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function sendMessage(
+        address _target,
+        bytes memory _message,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            msg.sender,
+            _message,
+            messageNonce
+        );
+ 
+        messageNonce += 1;
+        sentMessages[keccak256(xDomainCalldata)] = true;
+ 
+        _sendXDomainMessage(xDomainCalldata, _gasLimit);
+        emit SentMessage(xDomainCalldata);
+    }
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Generates the correct cross domain calldata for a message.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @return ABI encoded cross domain calldata.
+     */
+    function _getXDomainCalldata(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodeWithSignature(
+            "relayMessage(address,address,bytes,uint256)",
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * param // Message to send.
+     * param // Gas limit for the provided message.
+     */
+    function _sendXDomainMessage(
+        bytes memory, // _message,
+        uint256 // _gasLimit
+    )
+        virtual
+        internal
+    {
+        revert("Implement me in child contracts!");
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html new file mode 100644 index 000000000..64986d93c --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html @@ -0,0 +1,947 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L1CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 30/30 +
+
+ 75% + Branches + 12/16 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 31/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  + +  +  +  +  + + + +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_AddressManager } from "../../../libraries/resolver/Lib_AddressManager.sol";
+import { Lib_SecureMerkleTrie } from "../../../libraries/trie/Lib_SecureMerkleTrie.sol";
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+import { iOVM_CanonicalTransactionChain } from "../../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_StateCommitmentChain } from "../../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+ 
+/* Contract Imports */
+import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_L1CrossDomainMessenger
+ * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. 
+ * In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted 
+ * via this contract's replay function. 
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * Pass a default zero address to the address resolver. This will be updated when initialized.
+     */
+    constructor()
+        Lib_AddressResolver(address(0))
+    {}
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    function initialize(
+        address _libAddressManager
+    )
+        public
+    {
+        Erequire(address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized.");
+        libAddressManager = Lib_AddressManager(_libAddressManager);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may successfully call a method.
+     */
+    modifier onlyRelayer() {
+        address relayer = resolve("OVM_L2MessageRelayer");
+        if (relayer != address(0)) {
+            Irequire(
+                msg.sender == relayer,
+                "Only OVM_L2MessageRelayer can relay L2-to-L1 messages."
+            );
+        }
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @inheritdoc iOVM_L1CrossDomainMessenger
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        L2MessageInclusionProof memory _proof
+    )
+        override
+        public
+        nonReentrant
+        onlyRelayer()
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        require(
+            _verifyXDomainMessage(
+                xDomainCalldata,
+                _proof
+            ) == true,
+            "Provided message could not be verified."
+        );
+ 
+        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
+ 
+        require(
+            successfulMessages[xDomainCalldataHash] == false,
+            "Provided message has already been received."
+        );
+ 
+        xDomainMsgSender = _sender;
+        (bool success, ) = _target.call(_message);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+        // Mark the message as received if the call was successful. Ensures that a message can be
+        // relayed multiple times in the case that the call reverted.
+        Eif (success == true) {
+            successfulMessages[xDomainCalldataHash] = true;
+            emit RelayedMessage(xDomainCalldataHash);
+        }
+ 
+        // Store an identifier that can be used to prove that the given message was relayed by some
+        // user. Gives us an easy way to pay relayers for their work.
+        bytes32 relayId = keccak256(
+            abi.encodePacked(
+                xDomainCalldata,
+                msg.sender,
+                block.number
+            )
+        );
+        relayedMessages[relayId] = true;
+    }
+ 
+    /**
+     * Replays a cross domain message to the target messenger.
+     * @inheritdoc iOVM_L1CrossDomainMessenger
+     */
+    function replayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        require(
+            sentMessages[keccak256(xDomainCalldata)] == true,
+            "Provided message has not already been sent."
+        );
+ 
+        _sendXDomainMessage(xDomainCalldata, _gasLimit);
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Verifies that the given message is valid.
+     * @param _xDomainCalldata Calldata to verify.
+     * @param _proof Inclusion proof for the message.
+     * @return Whether or not the provided message is valid.
+     */
+    function _verifyXDomainMessage(
+        bytes memory _xDomainCalldata,
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        return (
+            _verifyStateRootProof(_proof)
+            && _verifyStorageProof(_xDomainCalldata, _proof)
+        );
+    }
+ 
+    /**
+     * Verifies that the state root within an inclusion proof is valid.
+     * @param _proof Message inclusion proof.
+     * @return Whether or not the provided proof is valid.
+     */
+    function _verifyStateRootProof(
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+ 
+        return (
+            ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) == false
+            && ovmStateCommitmentChain.verifyStateCommitment(
+                _proof.stateRoot,
+                _proof.stateRootBatchHeader,
+                _proof.stateRootProof
+            )
+        );
+    }
+ 
+    /**
+     * Verifies that the storage proof within an inclusion proof is valid.
+     * @param _xDomainCalldata Encoded message calldata.
+     * @param _proof Message inclusion proof.
+     * @return Whether or not the provided proof is valid.
+     */
+    function _verifyStorageProof(
+        bytes memory _xDomainCalldata,
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 storageKey = keccak256(
+            abi.encodePacked(
+                keccak256(
+                    abi.encodePacked(
+                        _xDomainCalldata,
+                        resolve("OVM_L2CrossDomainMessenger")
+                    )
+                ),
+                uint256(0)
+            )
+        );
+ 
+        (
+            bool exists,
+            bytes memory encodedMessagePassingAccount
+        ) = Lib_SecureMerkleTrie.get(
+            abi.encodePacked(0x4200000000000000000000000000000000000000),
+            _proof.stateTrieWitness,
+            _proof.stateRoot
+        );
+ 
+        Erequire(
+            exists == true,
+            "Message passing predeploy has not been initialized or invalid proof provided."
+        );
+ 
+        Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
+            encodedMessagePassingAccount
+        );
+ 
+        return Lib_SecureMerkleTrie.verifyInclusionProof(
+            abi.encodePacked(storageKey),
+            abi.encodePacked(uint8(1)),
+            _proof.storageTrieWitness,
+            account.storageRoot
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * @param _message Message to send.
+     * @param _gasLimit OVM gas limit for the message.
+     */
+    function _sendXDomainMessage(
+        bytes memory _message,
+        uint256 _gasLimit
+    )
+        override
+        internal
+    {
+        iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).enqueue(
+            resolve("OVM_L2CrossDomainMessenger"),
+            _gasLimit,
+            _message
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html new file mode 100644 index 000000000..71f510689 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html @@ -0,0 +1,275 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L1MultiMessageRelayer.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+import { iOVM_L1MultiMessageRelayer } from "../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol";
+ 
+/* Contract Imports */
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+ 
+/**
+ * @title OVM_L1MultiMessageRelayer
+ * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the 
+ * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain
+ * Message Sender.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+    constructor(
+        address _libAddressManager
+    ) 
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyBatchRelayer() {
+        require(
+            msg.sender == resolve("OVM_L2BatchMessageRelayer"),
+            "OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer"
+        );
+        _;
+    }
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying
+     * @param _messages An array of L2 to L1 messages
+     */
+    function batchRelayMessages(L2ToL1Message[] calldata _messages) 
+        override
+        external
+        onlyBatchRelayer 
+    {
+        iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(resolve("Proxy__OVM_L1CrossDomainMessenger"));
+        for (uint256 i = 0; i < _messages.length; i++) {
+            L2ToL1Message memory message = _messages[i];
+            messenger.relayMessage(
+                message.target,
+                message.sender,
+                message.message,
+                message.messageNonce,
+                message.proof
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html new file mode 100644 index 000000000..a646692ae --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html @@ -0,0 +1,473 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L2CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  + +  + +  +  +  +  + + + +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/* Interface Imports */
+import { iOVM_L2CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol";
+import { iOVM_L1MessageSender } from "../../../iOVM/predeploys/iOVM_L1MessageSender.sol";
+import { iOVM_L2ToL1MessagePasser } from "../../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
+ 
+/* Contract Imports */
+import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_L2CrossDomainMessenger
+ * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point
+ * for L2 messages sent via the L1 Cross Domain Messenger.
+ * 
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+  */
+contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @inheritdoc iOVM_L2CrossDomainMessenger
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    )
+        override
+        nonReentrant
+        public
+    {
+        require(
+            _verifyXDomainMessage() == true,
+            "Provided message could not be verified."
+        );
+ 
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
+ 
+        require(
+            successfulMessages[xDomainCalldataHash] == false,
+            "Provided message has already been received."
+        );
+ 
+        xDomainMsgSender = _sender;
+        (bool success, ) = _target.call(_message);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+        // Mark the message as received if the call was successful. Ensures that a message can be
+        // relayed multiple times in the case that the call reverted.
+        Eif (success == true) {
+            successfulMessages[xDomainCalldataHash] = true;
+            emit RelayedMessage(xDomainCalldataHash);
+        }
+ 
+        // Store an identifier that can be used to prove that the given message was relayed by some
+        // user. Gives us an easy way to pay relayers for their work.
+        bytes32 relayId = keccak256(
+            abi.encodePacked(
+                xDomainCalldata,
+                msg.sender,
+                block.number
+            )
+        );
+        relayedMessages[relayId] = true;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Verifies that a received cross domain message is valid.
+     * @return _valid Whether or not the message is valid.
+     */
+    function _verifyXDomainMessage()
+        view
+        internal
+        returns (
+            bool _valid
+        )
+    {
+        return (
+            iOVM_L1MessageSender(resolve("OVM_L1MessageSender")).getL1MessageSender() == resolve("OVM_L1CrossDomainMessenger")
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * @param _message Message to send.
+     * param _gasLimit Gas limit for the provided message.
+     */
+    function _sendXDomainMessage(
+        bytes memory _message,
+        uint256 // _gasLimit
+    )
+        override
+        internal
+    {
+        iOVM_L2ToL1MessagePasser(resolve("OVM_L2ToL1MessagePasser")).passMessageToL1(_message);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/index.html new file mode 100644 index 000000000..69677e4b5 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/bridge/messaging/ +

+
+
+ 96.55% + Statements + 56/58 +
+
+ 76.92% + Branches + 20/26 +
+
+ 95.24% + Functions + 20/21 +
+
+ 96.67% + Lines + 58/60 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_BaseCrossDomainMessenger.sol
77.78%7/950%1/280%4/577.78%7/9
OVM_L1CrossDomainMessenger.sol
100%30/3075%12/16100%9/9100%31/31
OVM_L1MultiMessageRelayer.sol
100%5/5100%2/2100%3/3100%6/6
OVM_L2CrossDomainMessenger.sol
100%14/1483.33%5/6100%4/4100%14/14
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html new file mode 100644 index 000000000..6be8e110e --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html @@ -0,0 +1,692 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ Abs_L1TokenGateway.sol +

+
+
+ 83.33% + Statements + 10/12 +
+
+ 100% + Branches + 0/0 +
+
+ 75% + Functions + 6/8 +
+
+ 83.33% + Lines + 10/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm 
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+ 
+/**
+ * @title Abs_L1TokenGateway
+ * @dev An L1 Token Gateway is a contract which stores deposited L1 funds that are in use on L2.
+ * It synchronizes a corresponding L2 representation of the "deposited token", informing it
+ * of new deposits and releasing L1 funds when there are newly finalized withdrawals.
+ *
+ * NOTE: This abstract contract gives all the core functionality of an L1 token gateway, 
+ * but provides easy hooks in case developers need extensions in child contracts.
+ * In many cases, the default OVM_L1ERC20Gateway will suffice.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+abstract contract Abs_L1TokenGateway is iOVM_L1TokenGateway, OVM_CrossDomainEnabled {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    address public l2DepositedToken;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l2DepositedToken iOVM_L2DepositedToken-compatible address on the chain being deposited into.
+     * @param _l1messenger L1 Messenger address being used for cross-chain communications.
+     */
+    constructor(
+        address _l2DepositedToken,
+        address _l1messenger 
+    )
+        OVM_CrossDomainEnabled(_l1messenger)
+    {
+        l2DepositedToken = _l2DepositedToken;
+    }
+ 
+    /********************************
+     * Overridable Accounting logic *
+     ********************************/
+ 
+    // Default gas value which can be overridden if more complex logic runs on L2.
+    uint32 public DEFAULT_FINALIZE_DEPOSIT_L2_GAS = 1200000;
+ 
+    /**
+     * @dev Core logic to be performed when a withdrawal is finalized on L1.
+     * In most cases, this will simply send locked funds to the withdrawer.
+     *
+     * param _to Address being withdrawn to.
+     * param _amount Amount being withdrawn.
+     */
+    function _handleFinalizeWithdrawal(
+        address, // _to,
+        uint256 // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Implement me in child contracts");
+    }
+ 
+    /**
+     * @dev Core logic to be performed when a deposit is initiated on L1.
+     * In most cases, this will simply send locked funds to the withdrawer.
+     *
+     * param _from Address being deposited from on L1.
+     * param _to Address being deposited into on L2.
+     * param _amount Amount being deposited.
+     */
+    function _handleInitiateDeposit(
+        address, // _from,
+        address, // _to,
+        uint256 // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Implement me in child contracts");
+    }
+ 
+    /**
+     * @dev Overridable getter for the L2 gas limit, in the case it may be
+     * dynamic, and the above public constant does not suffice.
+     *
+     */
+ 
+    function getFinalizeDepositL2Gas()
+        public
+        view
+        returns(
+            uint32
+        )
+    {
+        return DEFAULT_FINALIZE_DEPOSIT_L2_GAS;
+    }
+ 
+    /**************
+     * Depositing *
+     **************/
+ 
+    /**
+     * @dev deposit an amount of the ERC20 to the caller's balance on L2
+     * @param _amount Amount of the ERC20 to deposit
+     */
+    function deposit(
+        uint _amount
+    )
+        public
+        override
+    {
+        _initiateDeposit(msg.sender, msg.sender, _amount);
+    }
+ 
+    /**
+     * @dev deposit an amount of ERC20 to a recipients's balance on L2
+     * @param _to L2 address to credit the withdrawal to
+     * @param _amount Amount of the ERC20 to deposit
+     */
+    function depositTo(
+        address _to,
+        uint _amount
+    )
+        public
+        override
+    {
+        _initiateDeposit(msg.sender, _to, _amount);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by informing the L2 Deposited Token
+     * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)
+     *
+     * @param _from Account to pull the deposit from on L1
+     * @param _to Account to give the deposit to on L2
+     * @param _amount Amount of the ERC20 to deposit.
+     */
+    function _initiateDeposit(
+        address _from,
+        address _to,
+        uint _amount
+    )
+        internal
+    {
+        // Call our deposit accounting handler implemented by child contracts.
+        _handleInitiateDeposit(
+            _from,
+            _to,
+            _amount
+        );
+ 
+        // Construct calldata for l2DepositedToken.finalizeDeposit(_to, _amount)
+        bytes memory data = abi.encodeWithSelector(
+            iOVM_L2DepositedToken.finalizeDeposit.selector,
+            _to,
+            _amount
+        );
+ 
+        // Send calldata into L2
+        sendCrossDomainMessage(
+            l2DepositedToken,
+            data,
+            getFinalizeDepositL2Gas()
+        );
+ 
+        emit DepositInitiated(_from, _to, _amount);
+    }
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    /**
+     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the 
+     * L1 ERC20 token. 
+     * This call will fail if the initialized withdrawal from L2 has not been finalized. 
+     *
+     * @param _to L1 address to credit the withdrawal to
+     * @param _amount Amount of the ERC20 to withdraw
+     */
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external
+        override 
+        onlyFromCrossDomainAccount(l2DepositedToken)
+    {
+        // Call our withdrawal accounting handler implemented by child contracts.
+        _handleFinalizeWithdrawal(
+            _to,
+            _amount
+        );
+ 
+        emit WithdrawalFinalized(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html new file mode 100644 index 000000000..a16bb0653 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html @@ -0,0 +1,755 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ Abs_L2DepositedToken.sol +

+
+
+ 86.67% + Statements + 13/15 +
+
+ 50% + Branches + 2/4 +
+
+ 80% + Functions + 8/10 +
+
+ 87.5% + Lines + 14/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  + +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+ 
+/**
+ * @title Abs_L2DepositedToken
+ * @dev An L2 Deposited Token is an L2 representation of funds which were deposited from L1.
+ * Usually contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
+ * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
+ *
+ * NOTE: This abstract contract gives all the core functionality of a deposited token implementation except for the
+ * token's internal accounting itself.  This gives developers an easy way to implement children with their own token code.
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+abstract contract Abs_L2DepositedToken is iOVM_L2DepositedToken, OVM_CrossDomainEnabled {
+ 
+    /*******************
+     * Contract Events *
+     *******************/
+ 
+    event Initialized(iOVM_L1TokenGateway _l1TokenGateway);
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    iOVM_L1TokenGateway public l1TokenGateway;
+ 
+    /********************************
+     * Constructor & Initialization *
+     ********************************/
+ 
+    /**
+     * @param _l2CrossDomainMessenger L1 Messenger address being used for cross-chain communications.
+     */
+    constructor(
+        address _l2CrossDomainMessenger
+    )
+        OVM_CrossDomainEnabled(_l2CrossDomainMessenger)
+    {}
+ 
+    /**
+     * @dev Initialize this contract with the L1 token gateway address.
+     * The flow: 1) this contract gets deployed on L2, 2) the L1
+     * gateway is deployed with addr from (1), 3) L1 gateway address passed here.
+     *
+     * @param _l1TokenGateway Address of the corresponding L1 gateway deployed to the main chain
+     */
+ 
+    function init(
+        iOVM_L1TokenGateway _l1TokenGateway
+    )
+        public
+    {
+        Erequire(address(l1TokenGateway) == address(0), "Contract has already been initialized");
+ 
+        l1TokenGateway = _l1TokenGateway;
+        
+        emit Initialized(l1TokenGateway);
+    }
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyInitialized() {
+        Erequire(address(l1TokenGateway) != address(0), "Contract has not yet been initialized");
+        _;
+    }
+ 
+    /********************************
+     * Overridable Accounting logic *
+     ********************************/
+ 
+    // Default gas value which can be overridden if more complex logic runs on L2.
+    uint32 constant DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS = 100000;
+ 
+    /**
+     * @dev Core logic to be performed when a withdrawal from L2 is initialized.
+     * In most cases, this will simply burn the withdrawn L2 funds.
+     *
+     * param _to Address being withdrawn to
+     * param _amount Amount being withdrawn
+     */
+ 
+    function _handleInitiateWithdrawal(
+        address, // _to,
+        uint // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Accounting must be implemented by child contract.");
+    }
+ 
+    /**
+     * @dev Core logic to be performed when a deposit from L2 is finalized on L2.
+     * In most cases, this will simply _mint() to credit L2 funds to the recipient.
+     *
+     * param _to Address being deposited to on L2
+     * param _amount Amount which was deposited on L1
+     */
+    function _handleFinalizeDeposit(
+        address, // _to
+        uint // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Accounting must be implemented by child contract.");
+    }
+ 
+    /**
+     * @dev Overridable getter for the *L1* gas limit of settling the withdrawal, in the case it may be
+     * dynamic, and the above public constant does not suffice.
+     *
+     */
+ 
+    function getFinalizeWithdrawalL1Gas()
+        public
+        view
+        virtual
+        returns(
+            uint32
+        )
+    {
+        return DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS;
+    }
+ 
+ 
+    /***************
+     * Withdrawing *
+     ***************/
+ 
+    /**
+     * @dev initiate a withdraw of some tokens to the caller's account on L1
+     * @param _amount Amount of the token to withdraw
+     */
+    function withdraw(
+        uint _amount
+    )
+        external
+        override
+        onlyInitialized()
+    {
+        _initiateWithdrawal(msg.sender, _amount);
+    }
+ 
+    /**
+     * @dev initiate a withdraw of some token to a recipient's account on L1
+     * @param _to L1 adress to credit the withdrawal to
+     * @param _amount Amount of the token to withdraw
+     */
+    function withdrawTo(
+        address _to,
+        uint _amount
+    )
+        external
+        override
+        onlyInitialized()
+    {
+        _initiateWithdrawal(_to, _amount);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by storing the token and informing the L2 token Gateway of the deposit.
+     *
+     * @param _to Account to give the withdrawal to on L1
+     * @param _amount Amount of the token to withdraw
+     */
+    function _initiateWithdrawal(
+        address _to,
+        uint _amount
+    )
+        internal
+    {
+        // Call our withdrawal accounting handler implemented by child contracts (usually a _burn)
+        _handleInitiateWithdrawal(_to, _amount);
+ 
+        // Construct calldata for l1TokenGateway.finalizeWithdrawal(_to, _amount)
+        bytes memory data = abi.encodeWithSelector(
+            iOVM_L1TokenGateway.finalizeWithdrawal.selector,
+            _to,
+            _amount
+        );
+ 
+        // Send message up to L1 gateway
+        sendCrossDomainMessage(
+            address(l1TokenGateway),
+            data,
+            getFinalizeWithdrawalL1Gas()
+        );
+ 
+        emit WithdrawalInitiated(msg.sender, _to, _amount);
+    }
+ 
+    /************************************
+     * Cross-chain Function: Depositing *
+     ************************************/
+ 
+    /**
+     * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this 
+     * L2 token. 
+     * This call will fail if it did not originate from a corresponding deposit in OVM_l1TokenGateway. 
+     *
+     * @param _to Address to receive the withdrawal at
+     * @param _amount Amount of the token to withdraw
+     */
+    function finalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        external
+        override 
+        onlyInitialized()
+        onlyFromCrossDomainAccount(address(l1TokenGateway))
+    {
+        _handleFinalizeDeposit(_to, _amount);
+        emit DepositFinalized(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html new file mode 100644 index 000000000..d1b1fb47f --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html @@ -0,0 +1,365 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L1ERC20Gateway.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 3/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm 
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+import { Abs_L1TokenGateway } from "./Abs_L1TokenGateway.sol";
+import { iOVM_ERC20 } from "../../../iOVM/predeploys/iOVM_ERC20.sol";
+ 
+/**
+ * @title OVM_L1ERC20Gateway
+ * @dev The L1 ERC20 Gateway is a contract which stores deposited L1 funds that are in use on L2.
+ * It synchronizes a corresponding L2 ERC20 Gateway, informing it of deposits, and listening to it
+ * for newly finalized withdrawals.
+ *
+ * NOTE: This contract extends Abs_L1TokenGateway, which is where we
+ * takes care of most of the initialization and the cross-chain logic.
+ * If you are looking to implement your own deposit/withdrawal contracts, you
+ * may also want to extend the abstract contract in a similar manner.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1ERC20Gateway is Abs_L1TokenGateway {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+    
+    iOVM_ERC20 public l1ERC20;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l1ERC20 L1 ERC20 address this contract stores deposits for
+     * @param _l2DepositedERC20 L2 Gateway address on the chain being deposited into
+     */
+    constructor(
+        iOVM_ERC20 _l1ERC20,
+        address _l2DepositedERC20,
+        address _l1messenger 
+    )
+        Abs_L1TokenGateway(
+            _l2DepositedERC20,
+            _l1messenger
+        )
+    {
+        l1ERC20 = _l1ERC20;
+    }
+ 
+ 
+    /**************
+     * Accounting *
+     **************/
+ 
+    /**
+     * @dev When a deposit is initiated on L1, the L1 Gateway
+     * transfers the funds to itself for future withdrawals
+     *
+     * @param _from L1 address ETH is being deposited from
+     * param _to L2 address that the ETH is being deposited to
+     * @param _amount Amount of ERC20 to send
+     */
+    function _handleInitiateDeposit(
+        address _from,
+        address, // _to,
+        uint256 _amount
+    )
+        internal
+        override
+    {
+         // Hold on to the newly deposited funds
+        l1ERC20.transferFrom(
+            _from,
+            address(this),
+            _amount
+        );
+    }
+ 
+    /**
+     * @dev When a withdrawal is finalized on L1, the L1 Gateway
+     * transfers the funds to the withdrawer
+     *
+     * @param _to L1 address that the ERC20 is being withdrawn to
+     * @param _amount Amount of ERC20 to send
+     */
+    function _handleFinalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        // Transfer withdrawn funds out to withdrawer
+        l1ERC20.transfer(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html new file mode 100644 index 000000000..64267feef --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html @@ -0,0 +1,557 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L1ETHGateway.sol +

+
+
+ 100% + Statements + 11/11 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 6/6 +
+
+ 91.67% + Lines + 11/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1ETHGateway } from "../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol";
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/**
+ * @title OVM_L1ETHGateway
+ * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {
+ 
+    /********************
+     * Public Constants *
+     ********************/
+ 
+    uint32 public constant override getFinalizeDepositL2Gas = 1200000;
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    address public ovmEth;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address manager for this OE deployment
+     * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken
+     */
+    constructor(
+        address _libAddressManager,
+        address _ovmEth
+    )
+        OVM_CrossDomainEnabled(address(0)) // overridden in constructor code
+        Lib_AddressResolver(_libAddressManager)
+    {
+        ovmEth = _ovmEth;
+        messenger = resolve("Proxy__OVM_L1CrossDomainMessenger"); // overrides OVM_CrossDomainEnabled constructor setting because resolve() is not yet accessible
+    }
+ 
+    /**************
+     * Depositing *
+     **************/
+ 
+    receive()
+        external
+        payable
+    {
+        _initiateDeposit(msg.sender, msg.sender);
+    }
+ 
+    /**
+     * @dev deposit an amount of the ETH to the caller's balance on L2
+     */
+    function deposit() 
+        external
+        override
+        payable
+    {
+        _initiateDeposit(msg.sender, msg.sender);
+    }
+ 
+    /**
+     * @dev deposit an amount of ETH to a recipients's balance on L2
+     * @param _to L2 address to credit the withdrawal to
+     */
+    function depositTo(
+        address _to
+    )
+        external
+        override
+        payable
+    {
+        _initiateDeposit(msg.sender, _to);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.
+     *
+     * @param _from Account to pull the deposit from on L1
+     * @param _to Account to give the deposit to on L2
+     */
+    function _initiateDeposit(
+        address _from,
+        address _to
+    )
+        internal
+    {
+        // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)
+        bytes memory data =
+            abi.encodeWithSelector(
+                iOVM_L2DepositedToken.finalizeDeposit.selector,
+                _to,
+                msg.value
+            );
+ 
+        // Send calldata into L2
+        sendCrossDomainMessage(
+            ovmEth,
+            data,
+            getFinalizeDepositL2Gas
+        );
+ 
+        emit DepositInitiated(_from, _to, msg.value);
+    }
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    /**
+     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the
+     * L1 ETH token.
+     * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized. 
+     *
+     * @param _to L1 address to credit the withdrawal to
+     * @param _amount Amount of the ETH to withdraw
+     */
+    function finalizeWithdrawal(
+        address _to,
+        uint256 _amount
+    )
+        external
+        override
+        onlyFromCrossDomainAccount(ovmEth)
+    {
+        _safeTransferETH(_to, _amount);
+ 
+        emit WithdrawalFinalized(_to, _amount);
+    }
+ 
+    /**********************************
+     * Internal Functions: Accounting *
+     **********************************/
+ 
+    /**
+     * @dev Internal accounting function for moving around L1 ETH.
+     *
+     * @param _to L1 address to transfer ETH to
+     * @param _value Amount of ETH to send to
+     */
+    function _safeTransferETH(
+        address _to,
+        uint256 _value
+    )
+        internal
+    {
+        (bool success, ) = _to.call{value: _value}(new bytes(0));
+        Erequire(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html new file mode 100644 index 000000000..703ace05a --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html @@ -0,0 +1,266 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L2DepositedERC20.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Contract Imports */
+import { UniswapV2ERC20 } from "../../../libraries/standards/UniswapV2ERC20.sol";
+ 
+/* Library Imports */
+import { Abs_L2DepositedToken } from "./Abs_L2DepositedToken.sol";
+ 
+/**
+ * @title OVM_L2DepositedERC20
+ * @dev The L2 Deposited ERC20 is an ERC20 implementation which represents L1 assets deposited into L2.
+ * This contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
+ * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
+ *
+ * NOTE: This contract implements the Abs_L2DepositedToken contract using Uniswap's ERC20 as the implementation.
+ * Alternative implementations can be used in this similar manner.
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract OVM_L2DepositedERC20 is Abs_L2DepositedToken, UniswapV2ERC20 {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.
+     * @param _name ERC20 name
+     * @param _symbol ERC20 symbol
+     */
+    constructor(
+        address _l2CrossDomainMessenger,
+        string memory _name,
+        string memory _symbol
+    )
+        Abs_L2DepositedToken(_l2CrossDomainMessenger)
+        UniswapV2ERC20(_name, _symbol)
+    {}
+ 
+    // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2 usage.
+    function _handleInitiateWithdrawal(
+        address, // _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        _burn(msg.sender, _amount);
+    }
+ 
+    // When a deposit is finalized, we credit the account on L2 with the same amount of tokens.
+    function _handleFinalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        _mint(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/index.html new file mode 100644 index 000000000..6d14f7c59 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/bridge/tokens/ +

+
+
+ 90.7% + Statements + 39/43 +
+
+ 50% + Branches + 3/6 +
+
+ 86.67% + Functions + 26/30 +
+
+ 88.89% + Lines + 40/45 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_L1TokenGateway.sol
83.33%10/12100%0/075%6/883.33%10/12
Abs_L2DepositedToken.sol
86.67%13/1550%2/480%8/1087.5%14/16
OVM_L1ERC20Gateway.sol
100%3/3100%0/0100%3/3100%3/3
OVM_L1ETHGateway.sol
100%11/1150%1/2100%6/691.67%11/12
OVM_L2DepositedERC20.sol
100%2/2100%0/0100%3/3100%2/2
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html new file mode 100644 index 000000000..a87b5bba5 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html @@ -0,0 +1,3755 @@ + + + + Code coverage report for optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/chain/ OVM_CanonicalTransactionChain.sol +

+
+
+ 95.51% + Statements + 149/156 +
+
+ 87.5% + Branches + 63/72 +
+
+ 84.38% + Functions + 27/32 +
+
+ 95.88% + Lines + 163/170 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +228× +228× +228× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +595× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +388× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +309× +309× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +106× +106× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +47× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +239× +  +  +  +  +238× +  +  +  +  +237× +  +  +  +  +  +  +  +236× +236× +  +  +  +236× +  +  +  +  +  +  +235× +235× +37600× +  +  +235× +  +  +  +  +  +  +  +  +235× +235× +  +  +  +  +235× +  +235× +235× +  +  +  +  +235× +235× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +110× +110× +110× +110× +  +  +  +  +  +110× +  +  +  +  +109× +  +  +  +  +108× +  +  +  +  +107× +  +  +  +  +106× +  +106× +  +  +  +  +  +  +  +106× +106× +  +  +  +  +106× +  +  +106× +  +  +106× +  +  +106× +  +  +  +106× +  +106× +106× +835× +  +835× +  +106× +  +  +  +829× +  +  +  +  +  +  +  +824× +  +  +824× +1639× +1639× +  +  +  +1639× +  +  +  +  +  +  +1639× +1639× +1639× +  +  +  +824× +179× +  +  +  +  +178× +178× +178× +  +  +  +94× +  +  +  +  +  +  +88× +  +  +  +  +87× +  +  +  +  +  +87× +87× +87× +87× +  +45× +45× +  +  +  +  +  +42× +  +  +  +  +42× +42× +  +  +  +  +  +87× +  +  +  +  +  +  +  +87× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +835× +835× +835× +835× +835× +  +835× +  +  +  +  +  +  +835× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +506× +  +506× +506× +506× +506× +506× +  +  +  +  +  +  +  +506× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +87× +87× +  +  +  +  +  +  +  +87× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +179× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +267× +267× +265× +  +265× +265× +265× +  +  +  +  +265× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +106× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1639× +419× +  +  +1639× +1639× +  +1639× +1639× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1639× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +87× +87× +  +87× +  +  +  +  +  +  +  +87× +  +  +  +  +  +  +  +87× +87× +  +  +  +  +  +  +87× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +106× + +  + +  +  +  +  + +  +  +  +  +  +  +102× +  +  +  +  +101× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +178× +  +  +  +  +  +177× +  +  +  +  +  +  +176× +  +  +  +  +174× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +829× +  +  +  +  +828× +  +  +  +  +  +827× +175× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +94× + +  +  +  +  +  +  +91× +89× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +179× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
+import { Lib_Math } from "../../libraries/utils/Lib_Math.sol";
+ 
+/* Interface Imports */
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/* Contract Imports */
+import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
+ 
+ 
+/**
+ * @title OVM_CanonicalTransactionChain
+ * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions
+ * which must be applied to the rollup state. It defines the ordering of rollup transactions by
+ * writing them to the 'CTC:batches' instance of the Chain Storage Container.
+ * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer
+ * will eventually append it to the rollup state.
+ * If the Sequencer does not include an enqueued transaction within the 'force inclusion period',
+ * then any account may force it to be included by calling appendQueueBatch().
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_AddressResolver {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    // L2 tx gas-related
+    uint256 constant public MIN_ROLLUP_TX_GAS = 100000;
+    uint256 constant public MAX_ROLLUP_TX_SIZE = 10000;
+    uint256 constant public L2_GAS_DISCOUNT_DIVISOR = 32;
+ 
+    // Encoding-related (all in bytes)
+    uint256 constant internal BATCH_CONTEXT_SIZE = 16;
+    uint256 constant internal BATCH_CONTEXT_LENGTH_POS = 12;
+    uint256 constant internal BATCH_CONTEXT_START_POS = 15;
+    uint256 constant internal TX_DATA_HEADER_SIZE = 3;
+    uint256 constant internal BYTES_TILL_TX_DATA = 65;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    uint256 public forceInclusionPeriodSeconds;
+    uint256 public forceInclusionPeriodBlocks;
+    uint256 public maxTransactionGasLimit;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    constructor(
+        address _libAddressManager,
+        uint256 _forceInclusionPeriodSeconds,
+        uint256 _forceInclusionPeriodBlocks,
+        uint256 _maxTransactionGasLimit
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        forceInclusionPeriodSeconds = _forceInclusionPeriodSeconds;
+        forceInclusionPeriodBlocks = _forceInclusionPeriodBlocks;
+        maxTransactionGasLimit = _maxTransactionGasLimit;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        override
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:CTC:batches")
+        );
+    }
+ 
+    /**
+     * Accesses the queue storage container.
+     * @return Reference to the queue storage container.
+     */
+    function queue()
+        override
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:CTC:queue")
+        );
+    }
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        override
+        public
+        view
+        returns (
+            uint256 _totalElements
+        )
+    {
+        (uint40 totalElements,,,) = _getBatchExtraData();
+        return uint256(totalElements);
+    }
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        override
+        public
+        view
+        returns (
+            uint256 _totalBatches
+        )
+    {
+        return batches().length();
+    }
+ 
+    /**
+     * Returns the index of the next element to be enqueued.
+     * @return Index for the next queue element.
+     */
+    function getNextQueueIndex()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,uint40 nextQueueIndex,,) = _getBatchExtraData();
+        return nextQueueIndex;
+    }
+ 
+    /**
+     * Returns the timestamp of the last transaction.
+     * @return Timestamp for the last transaction.
+     */
+    function getLastTimestamp()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,,uint40 lastTimestamp,) = _getBatchExtraData();
+        return lastTimestamp;
+    }
+ 
+    /**
+     * Returns the blocknumber of the last transaction.
+     * @return Blocknumber for the last transaction.
+     */
+    function getLastBlockNumber()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,,,uint40 lastBlockNumber) = _getBatchExtraData();
+        return lastBlockNumber;
+    }
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function getQueueElement(
+        uint256 _index
+    )
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        )
+    {
+        return _getQueueElement(
+            _index,
+            queue()
+        );
+    }
+ 
+    /**
+     * Get the number of queue elements which have not yet been included.
+     * @return Number of pending queue elements.
+     */
+    function getNumPendingQueueElements()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        return getQueueLength() - getNextQueueIndex();
+    }
+ 
+   /**
+     * Retrieves the length of the queue, including
+     * both pending and canonical transactions.
+     * @return Length of the queue.
+     */
+    function getQueueLength()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        return _getQueueLength(
+            queue()
+        );
+    }
+ 
+    /**
+     * Adds a transaction to the queue.
+     * @param _target Target L2 contract to send the transaction to.
+     * @param _gasLimit Gas limit for the enqueued L2 transaction.
+     * @param _data Transaction data.
+     */
+    function enqueue(
+        address _target,
+        uint256 _gasLimit,
+        bytes memory _data
+    )
+        override
+        public
+    {
+        require(
+            _data.length <= MAX_ROLLUP_TX_SIZE,
+            "Transaction data size exceeds maximum for rollup transaction."
+        );
+ 
+        require(
+            _gasLimit <= maxTransactionGasLimit,
+            "Transaction gas limit exceeds maximum for rollup transaction."
+        );
+ 
+        require(
+            _gasLimit >= MIN_ROLLUP_TX_GAS,
+            "Transaction gas limit too low to enqueue."
+        );
+ 
+        // We need to consume some amount of L1 gas in order to rate limit transactions going into
+        // L2. However, L2 is cheaper than L1 so we only need to burn some small proportion of the
+        // provided L1 gas.
+        uint256 gasToConsume = _gasLimit/L2_GAS_DISCOUNT_DIVISOR;
+        uint256 startingGas = gasleft();
+ 
+        // Although this check is not necessary (burn below will run out of gas if not true), it
+        // gives the user an explicit reason as to why the enqueue attempt failed.
+        require(
+            startingGas > gasToConsume,
+            "Insufficient gas for L2 rate limiting burn."
+        );
+ 
+        // Here we do some "dumb" work in order to burn gas, although we should probably replace
+        // this with something like minting gas token later on.
+        uint256 i;
+        while(startingGas - gasleft() < gasToConsume) {
+            i++;
+        }
+ 
+        bytes32 transactionHash = keccak256(
+            abi.encode(
+                msg.sender,
+                _target,
+                _gasLimit,
+                _data
+            )
+        );
+ 
+        bytes32 timestampAndBlockNumber;
+        assembly {
+            timestampAndBlockNumber := timestamp()
+            timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
+        }
+ 
+        iOVM_ChainStorageContainer queueRef = queue();
+ 
+        queueRef.push(transactionHash);
+        queueRef.push(timestampAndBlockNumber);
+ 
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the real queue length we need
+        // to divide by 2 and subtract 1.
+        uint256 queueIndex = queueRef.length() / 2 - 1;
+        emit TransactionEnqueued(
+            msg.sender,
+            _target,
+            _gasLimit,
+            _data,
+            queueIndex,
+            block.timestamp
+        );
+    }
+ 
+    /**
+     * Appends a given number of queued transactions as a single batch.
+     * param _numQueuedTransactions Number of transactions to append.
+     */
+    function appendQueueBatch(
+        uint256 // _numQueuedTransactions
+    )
+        override
+        public
+        pure
+    {
+        // TEMPORARY: Disable `appendQueueBatch` for minnet
+        revert("appendQueueBatch is currently disabled.");
+ 
+        // _numQueuedTransactions = Lib_Math.min(_numQueuedTransactions, getNumPendingQueueElements());
+        // require(
+        //     _numQueuedTransactions > 0,
+        //     "Must append more than zero transactions."
+        // );
+ 
+        // bytes32[] memory leaves = new bytes32[](_numQueuedTransactions);
+        // uint40 nextQueueIndex = getNextQueueIndex();
+ 
+        // for (uint256 i = 0; i < _numQueuedTransactions; i++) {
+        //     if (msg.sender != resolve("OVM_Sequencer")) {
+        //         Lib_OVMCodec.QueueElement memory el = getQueueElement(nextQueueIndex);
+        //         require(
+        //             el.timestamp + forceInclusionPeriodSeconds < block.timestamp,
+        //             "Queue transactions cannot be submitted during the sequencer inclusion period."
+        //         );
+        //     }
+        //     leaves[i] = _getQueueLeafHash(nextQueueIndex);
+        //     nextQueueIndex++;
+        // }
+ 
+        // Lib_OVMCodec.QueueElement memory lastElement = getQueueElement(nextQueueIndex - 1);
+ 
+        // _appendBatch(
+        //     Lib_MerkleTree.getMerkleRoot(leaves),
+        //     _numQueuedTransactions,
+        //     _numQueuedTransactions,
+        //     lastElement.timestamp,
+        //     lastElement.blockNumber
+        // );
+ 
+        // emit QueueBatchAppended(
+        //     nextQueueIndex - _numQueuedTransactions,
+        //     _numQueuedTransactions,
+        //     getTotalElements()
+        // );
+    }
+ 
+    /**
+     * Allows the sequencer to append a batch of transactions.
+     * @dev This function uses a custom encoding scheme for efficiency reasons.
+     * .param _shouldStartAtElement Specific batch we expect to start appending to.
+     * .param _totalElementsToAppend Total number of batch elements we expect to append.
+     * .param _contexts Array of batch contexts.
+     * .param _transactionDataFields Array of raw transaction data.
+     */
+    function appendSequencerBatch()
+        override
+        public
+    {
+        uint40 shouldStartAtElement;
+        uint24 totalElementsToAppend;
+        uint24 numContexts;
+        assembly {
+            shouldStartAtElement  := shr(216, calldataload(4))
+            totalElementsToAppend := shr(232, calldataload(9))
+            numContexts           := shr(232, calldataload(12))
+        }
+ 
+        require(
+            shouldStartAtElement == getTotalElements(),
+            "Actual batch start index does not match expected start index."
+        );
+ 
+        require(
+            msg.sender == resolve("OVM_Sequencer"),
+            "Function can only be called by the Sequencer."
+        );
+ 
+        require(
+            numContexts > 0,
+            "Must provide at least one batch context."
+        );
+ 
+        require(
+            totalElementsToAppend > 0,
+            "Must append at least one element."
+        );
+ 
+        uint40 nextTransactionPtr = uint40(BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts);
+ 
+        Erequire(
+            msg.data.length >= nextTransactionPtr,
+            "Not enough BatchContexts provided."
+        );
+ 
+        // Take a reference to the queue and its length so we don't have to keep resolving it.
+        // Length isn't going to change during the course of execution, so it's fine to simply
+        // resolve this once at the start. Saves gas.
+        iOVM_ChainStorageContainer queueRef = queue();
+        uint40 queueLength = _getQueueLength(queueRef);
+ 
+        // Reserve some memory to save gas on hashing later on. This is a relatively safe estimate
+        // for the average transaction size that will prevent having to resize this chunk of memory
+        // later on. Saves gas.
+        bytes memory hashMemory = new bytes((msg.data.length / totalElementsToAppend) * 2);
+ 
+        // Initialize the array of canonical chain leaves that we will append.
+        bytes32[] memory leaves = new bytes32[](totalElementsToAppend);
+ 
+        // Each leaf index corresponds to a tx, either sequenced or enqueued.
+        uint32 leafIndex = 0;
+ 
+        // Counter for number of sequencer transactions appended so far.
+        uint32 numSequencerTransactions = 0;
+ 
+        // We will sequentially append leaves which are pointers to the queue.
+        // The initial queue index is what is currently in storage.
+        uint40 nextQueueIndex = getNextQueueIndex();
+ 
+        BatchContext memory curContext;
+        for (uint32 i = 0; i < numContexts; i++) {
+            BatchContext memory nextContext = _getBatchContext(i);
+ 
+            if (i == 0) {
+                // Execute a special check for the first batch.
+                _validateFirstBatchContext(nextContext);
+            }
+ 
+            // Execute this check on every single batch, including the first one.
+            _validateNextBatchContext(
+                curContext,
+                nextContext,
+                nextQueueIndex,
+                queueRef
+            );
+ 
+            // Now we can update our current context.
+            curContext = nextContext;
+ 
+            // Process sequencer transactions first.
+            for (uint32 j = 0; j < curContext.numSequencedTransactions; j++) {
+                uint256 txDataLength;
+                assembly {
+                    txDataLength := shr(232, calldataload(nextTransactionPtr))
+                }
+ 
+                leaves[leafIndex] = _getSequencerLeafHash(
+                    curContext,
+                    nextTransactionPtr,
+                    txDataLength,
+                    hashMemory
+                );
+ 
+                nextTransactionPtr += uint40(TX_DATA_HEADER_SIZE + txDataLength);
+                numSequencerTransactions++;
+                leafIndex++;
+            }
+ 
+            // Now process any subsequent queue transactions.
+            for (uint32 j = 0; j < curContext.numSubsequentQueueTransactions; j++) {
+                require(
+                    nextQueueIndex < queueLength,
+                    "Not enough queued transactions to append."
+                );
+ 
+                leaves[leafIndex] = _getQueueLeafHash(nextQueueIndex);
+                nextQueueIndex++;
+                leafIndex++;
+            }
+        }
+ 
+        _validateFinalBatchContext(
+            curContext,
+            nextQueueIndex,
+            queueLength,
+            queueRef
+        );
+ 
+        require(
+            msg.data.length == nextTransactionPtr,
+            "Not all sequencer transactions were processed."
+        );
+ 
+        Erequire(
+            leafIndex == totalElementsToAppend,
+            "Actual transaction index does not match expected total elements to append."
+        );
+ 
+        // Generate the required metadata that we need to append this batch
+        uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
+        uint40 blockTimestamp;
+        uint40 blockNumber;
+        if (curContext.numSubsequentQueueTransactions == 0) {
+            // The last element is a sequencer tx, therefore pull timestamp and block number from the last context.
+            blockTimestamp = uint40(curContext.timestamp);
+            blockNumber = uint40(curContext.blockNumber);
+        } else {
+            // The last element is a queue tx, therefore pull timestamp and block number from the queue element.
+            // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at least one queue element.
+            // We increment nextQueueIndex after processing each queue element,
+            // so the index of the last element we processed is nextQueueIndex - 1.
+            Lib_OVMCodec.QueueElement memory lastElement = _getQueueElement(
+                nextQueueIndex - 1,
+                queueRef
+            );
+ 
+            blockTimestamp = lastElement.timestamp;
+            blockNumber = lastElement.blockNumber;
+        }
+ 
+        // For efficiency reasons getMerkleRoot modifies the `leaves` argument in place
+        // while calculating the root hash therefore any arguments passed to it must not
+        // be used again afterwards
+        _appendBatch(
+            Lib_MerkleTree.getMerkleRoot(leaves),
+            totalElementsToAppend,
+            numQueuedTransactions,
+            blockTimestamp,
+            blockNumber
+        );
+ 
+        emit SequencerBatchAppended(
+            nextQueueIndex - numQueuedTransactions,
+            numQueuedTransactions,
+            getTotalElements()
+        );
+    }
+ 
+    /**
+     * Verifies whether a transaction is included in the chain.
+     * @param _transaction Transaction to verify.
+     * @param _txChainElement Transaction chain element corresponding to the transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
+     * @return True if the transaction exists in the CTC, false if not.
+     */
+    function verifyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        if (_txChainElement.isSequenced == true) {
+            return _verifySequencerTransaction(
+                _transaction,
+                _txChainElement,
+                _batchHeader,
+                _inclusionProof
+            );
+        } else {
+            return _verifyQueueTransaction(
+                _transaction,
+                _txChainElement.queueIndex,
+                _batchHeader,
+                _inclusionProof
+            );
+        }
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Returns the BatchContext located at a particular index.
+     * @param _index The index of the BatchContext
+     * @return The BatchContext at the specified index.
+     */
+    function _getBatchContext(
+        uint256 _index
+    )
+        internal
+        pure
+        returns (
+            BatchContext memory
+        )
+    {
+        uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;
+        uint256 numSequencedTransactions;
+        uint256 numSubsequentQueueTransactions;
+        uint256 ctxTimestamp;
+        uint256 ctxBlockNumber;
+ 
+        assembly {
+            numSequencedTransactions       := shr(232, calldataload(contextPtr))
+            numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))
+            ctxTimestamp                   := shr(216, calldataload(add(contextPtr, 6)))
+            ctxBlockNumber                 := shr(216, calldataload(add(contextPtr, 11)))
+        }
+ 
+        return BatchContext({
+            numSequencedTransactions: numSequencedTransactions,
+            numSubsequentQueueTransactions: numSubsequentQueueTransactions,
+            timestamp: ctxTimestamp,
+            blockNumber: ctxBlockNumber
+        });
+    }
+ 
+    /**
+     * Parses the batch context from the extra data.
+     * @return Total number of elements submitted.
+     * @return Index of the next queue element.
+     */
+    function _getBatchExtraData()
+        internal
+        view
+        returns (
+            uint40,
+            uint40,
+            uint40,
+            uint40
+        )
+    {
+        bytes27 extraData = batches().getGlobalMetadata();
+ 
+        uint40 totalElements;
+        uint40 nextQueueIndex;
+        uint40 lastTimestamp;
+        uint40 lastBlockNumber;
+        assembly {
+            extraData       :=  shr(40, extraData)
+            totalElements   :=  and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            nextQueueIndex  :=  shr(40, and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000))
+            lastTimestamp   :=  shr(80, and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000))
+            lastBlockNumber :=  shr(120, and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000))
+        }
+ 
+        return (
+            totalElements,
+            nextQueueIndex,
+            lastTimestamp,
+            lastBlockNumber
+        );
+    }
+ 
+    /**
+     * Encodes the batch context for the extra data.
+     * @param _totalElements Total number of elements submitted.
+     * @param _nextQueueIndex Index of the next queue element.
+     * @param _timestamp Timestamp for the last batch.
+     * @param _blockNumber Block number of the last batch.
+     * @return Encoded batch context.
+     */
+    function _makeBatchExtraData(
+        uint40 _totalElements,
+        uint40 _nextQueueIndex,
+        uint40 _timestamp,
+        uint40 _blockNumber
+    )
+        internal
+        pure
+        returns (
+            bytes27
+        )
+    {
+        bytes27 extraData;
+        assembly {
+            extraData := _totalElements
+            extraData := or(extraData, shl(40, _nextQueueIndex))
+            extraData := or(extraData, shl(80, _timestamp))
+            extraData := or(extraData, shl(120, _blockNumber))
+            extraData := shl(40, extraData)
+        }
+ 
+        return extraData;
+    }
+ 
+    /**
+     * Retrieves the hash of a queue element.
+     * @param _index Index of the queue element to retrieve a hash for.
+     * @return Hash of the queue element.
+     */
+    function _getQueueLeafHash(
+        uint256 _index
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return _hashTransactionChainElement(
+            Lib_OVMCodec.TransactionChainElement({
+                isSequenced: false,
+                queueIndex: _index,
+                timestamp: 0,
+                blockNumber: 0,
+                txData: hex""
+            })
+        );
+    }
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function _getQueueElement(
+        uint256 _index,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        )
+    {
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the actual desired queue index
+        // we need to multiply by 2.
+        uint40 trueIndex = uint40(_index * 2);
+        bytes32 transactionHash = _queueRef.get(trueIndex);
+        bytes32 timestampAndBlockNumber = _queueRef.get(trueIndex + 1);
+ 
+        uint40 elementTimestamp;
+        uint40 elementBlockNumber;
+        assembly {
+            elementTimestamp   :=         and(timestampAndBlockNumber, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            elementBlockNumber := shr(40, and(timestampAndBlockNumber, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
+        }
+ 
+        return Lib_OVMCodec.QueueElement({
+            transactionHash: transactionHash,
+            timestamp: elementTimestamp,
+            blockNumber: elementBlockNumber
+        });
+    }
+ 
+    /**
+     * Retrieves the length of the queue.
+     * @return Length of the queue.
+     */
+    function _getQueueLength(
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the real queue length we need
+        // to divide by 2.
+        return uint40(_queueRef.length() / 2);
+    }
+ 
+    /**
+     * Retrieves the hash of a sequencer element.
+     * @param _context Batch context for the given element.
+     * @param _nextTransactionPtr Pointer to the next transaction in the calldata.
+     * @param _txDataLength Length of the transaction item.
+     * @return Hash of the sequencer element.
+     */
+    function _getSequencerLeafHash(
+        BatchContext memory _context,
+        uint256 _nextTransactionPtr,
+        uint256 _txDataLength,
+        bytes memory _hashMemory
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        // Only allocate more memory if we didn't reserve enough to begin with.
+        if (BYTES_TILL_TX_DATA + _txDataLength > _hashMemory.length) {
+            _hashMemory = new bytes(BYTES_TILL_TX_DATA + _txDataLength);
+        }
+ 
+        uint256 ctxTimestamp = _context.timestamp;
+        uint256 ctxBlockNumber = _context.blockNumber;
+ 
+        bytes32 leafHash;
+        assembly {
+            let chainElementStart := add(_hashMemory, 0x20)
+ 
+            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
+            // This distinguishes sequencer ChainElements from queue ChainElements because
+            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
+            // elements is always zero
+            mstore8(chainElementStart, 1)
+ 
+            mstore(add(chainElementStart, 1), ctxTimestamp)
+            mstore(add(chainElementStart, 33), ctxBlockNumber)
+ 
+            calldatacopy(add(chainElementStart, BYTES_TILL_TX_DATA), add(_nextTransactionPtr, 3), _txDataLength)
+ 
+            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, _txDataLength))
+        }
+ 
+        return leafHash;
+    }
+ 
+    /**
+     * Retrieves the hash of a sequencer element.
+     * @param _txChainElement The chain element which is hashed to calculate the leaf.
+     * @return Hash of the sequencer element.
+     */
+    function _getSequencerLeafHash(
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement
+    )
+        internal
+        view
+        returns(
+            bytes32
+        )
+    {
+        bytes memory txData = _txChainElement.txData;
+        uint256 txDataLength = _txChainElement.txData.length;
+ 
+        bytes memory chainElement = new bytes(BYTES_TILL_TX_DATA + txDataLength);
+        uint256 ctxTimestamp = _txChainElement.timestamp;
+        uint256 ctxBlockNumber = _txChainElement.blockNumber;
+ 
+        bytes32 leafHash;
+        assembly {
+            let chainElementStart := add(chainElement, 0x20)
+ 
+            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
+            // This distinguishes sequencer ChainElements from queue ChainElements because
+            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
+            // elements is always zero
+            mstore8(chainElementStart, 1)
+ 
+            mstore(add(chainElementStart, 1), ctxTimestamp)
+            mstore(add(chainElementStart, 33), ctxBlockNumber)
+ 
+            pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart, BYTES_TILL_TX_DATA), txDataLength))
+ 
+            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, txDataLength))
+        }
+ 
+        return leafHash;
+    }
+ 
+    /**
+     * Inserts a batch into the chain of batches.
+     * @param _transactionRoot Root of the transaction tree for this batch.
+     * @param _batchSize Number of elements in the batch.
+     * @param _numQueuedTransactions Number of queue transactions in the batch.
+     * @param _timestamp The latest batch timestamp.
+     * @param _blockNumber The latest batch blockNumber.
+     */
+    function _appendBatch(
+        bytes32 _transactionRoot,
+        uint256 _batchSize,
+        uint256 _numQueuedTransactions,
+        uint40 _timestamp,
+        uint40 _blockNumber
+    )
+        internal
+    {
+        iOVM_ChainStorageContainer batchesRef = batches();
+        (uint40 totalElements, uint40 nextQueueIndex,,) = _getBatchExtraData();
+ 
+        Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({
+            batchIndex: batchesRef.length(),
+            batchRoot: _transactionRoot,
+            batchSize: _batchSize,
+            prevTotalElements: totalElements,
+            extraData: hex""
+        });
+ 
+        emit TransactionBatchAppended(
+            header.batchIndex,
+            header.batchRoot,
+            header.batchSize,
+            header.prevTotalElements,
+            header.extraData
+        );
+ 
+        bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);
+        bytes27 latestBatchContext = _makeBatchExtraData(
+            totalElements + uint40(header.batchSize),
+            nextQueueIndex + uint40(_numQueuedTransactions),
+            _timestamp,
+            _blockNumber
+        );
+ 
+        batchesRef.push(batchHeaderHash, latestBatchContext);
+    }
+ 
+    /**
+     * Checks that the first batch context in a sequencer submission is valid
+     * @param _firstContext The batch context to validate.
+     */
+    function _validateFirstBatchContext(
+        BatchContext memory _firstContext
+    )
+        internal
+        view
+    {
+        // If there are existing elements, this batch must have the same context 
+        // or a later timestamp and block number.
+        if (getTotalElements() > 0) {
+            (,, uint40 lastTimestamp, uint40 lastBlockNumber) = _getBatchExtraData();
+ 
+            require(
+                _firstContext.blockNumber >= lastBlockNumber,
+                "Context block number is lower than last submitted."
+            );
+ 
+            Irequire(
+                _firstContext.timestamp >= lastTimestamp,
+                "Context timestamp is lower than last submitted."
+            );
+        }
+ 
+        // Sequencer cannot submit contexts which are more than the force inclusion period old.
+        require(
+            _firstContext.timestamp + forceInclusionPeriodSeconds >= block.timestamp,
+            "Context timestamp too far in the past."
+        );
+ 
+        require(
+            _firstContext.blockNumber + forceInclusionPeriodBlocks >= block.number,
+            "Context block number too far in the past."
+        );
+    }
+ 
+    /**
+     * Checks that a given batch context has a time context which is below a given que element
+     * @param _context The batch context to validate has values lower.
+     * @param _queueIndex Index of the queue element we are validating came later than the context.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateContextBeforeEnqueue(
+        BatchContext memory _context,
+        uint40 _queueIndex,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+            Lib_OVMCodec.QueueElement memory nextQueueElement = _getQueueElement(
+                _queueIndex,
+                _queueRef
+            );
+ 
+            // If the force inclusion period has passed for an enqueued transaction, it MUST be the next chain element.
+            require(
+                block.timestamp < nextQueueElement.timestamp + forceInclusionPeriodSeconds,
+                "Previously enqueued batches have expired and must be appended before a new sequencer batch."
+            );
+ 
+            // Just like sequencer transaction times must be increasing relative to each other,
+            // We also require that they be increasing relative to any interspersed queue elements.
+            require(
+                _context.timestamp <= nextQueueElement.timestamp,
+                "Sequencer transaction timestamp exceeds that of next queue element."
+            );
+ 
+            require(
+                _context.blockNumber <= nextQueueElement.blockNumber,
+                "Sequencer transaction blockNumber exceeds that of next queue element."
+            );
+    }
+ 
+    /**
+     * Checks that a given batch context is valid based on its previous context, and the next queue elemtent.
+     * @param _prevContext The previously validated batch context.
+     * @param _nextContext The batch context to validate with this call.
+     * @param _nextQueueIndex Index of the next queue element to process for the _nextContext's subsequentQueueElements.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateNextBatchContext(
+        BatchContext memory _prevContext,
+        BatchContext memory _nextContext,
+        uint40 _nextQueueIndex,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+        // All sequencer transactions' times must be greater than or equal to the previous ones.
+        require(
+            _nextContext.timestamp >= _prevContext.timestamp,
+            "Context timestamp values must monotonically increase."
+        );
+ 
+        require(
+            _nextContext.blockNumber >= _prevContext.blockNumber,
+            "Context blockNumber values must monotonically increase."
+        );
+ 
+        // If there is going to be a queue element pulled in from this context:
+        if (_nextContext.numSubsequentQueueTransactions > 0) {
+            _validateContextBeforeEnqueue(
+                _nextContext,
+                _nextQueueIndex,
+                _queueRef
+            );
+        }
+    }
+ 
+    /**
+     * Checks that the final batch context in a sequencer submission is valid.
+     * @param _finalContext The batch context to validate.
+     * @param _queueLength The length of the queue at the start of the batchAppend call.
+     * @param _nextQueueIndex The next element in the queue that will be pulled into the CTC.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateFinalBatchContext(
+        BatchContext memory _finalContext,
+        uint40 _nextQueueIndex,
+        uint40 _queueLength,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+        // If the queue is not now empty, check the mononoticity of whatever the next batch that will come in is.
+        if (_queueLength - _nextQueueIndex > 0 && _finalContext.numSubsequentQueueTransactions == 0) {
+            _validateContextBeforeEnqueue(
+                _finalContext,
+                _nextQueueIndex,
+                _queueRef
+            );
+        }
+        // Batches cannot be added from the future, or subsequent enqueue() contexts would violate monotonicity.
+        require(_finalContext.timestamp <= block.timestamp, "Context timestamp is from the future.");
+        require(_finalContext.blockNumber <= block.number, "Context block number is from the future.");
+    }
+ 
+    /**
+     * Hashes a transaction chain element.
+     * @param _element Chain element to hash.
+     * @return Hash of the chain element.
+     */
+    function _hashTransactionChainElement(
+        Lib_OVMCodec.TransactionChainElement memory _element
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(
+            abi.encode(
+                _element.isSequenced,
+                _element.queueIndex,
+                _element.timestamp,
+                _element.blockNumber,
+                _element.txData
+            )
+        );
+    }
+ 
+    /**
+     * Verifies a sequencer transaction, returning true if it was indeed included in the CTC
+     * @param _transaction The transaction we are verifying inclusion of.
+     * @param _txChainElement The chain element that the transaction is claimed to be a part of.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof An inclusion proof into the CTC at a particular index.
+     * @return True if the transaction was included in the specified location, else false.
+     */
+    function _verifySequencerTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        OVM_ExecutionManager ovmExecutionManager = OVM_ExecutionManager(resolve("OVM_ExecutionManager"));
+        uint256 gasLimit = ovmExecutionManager.getMaxTransactionGasLimit();
+        bytes32 leafHash = _getSequencerLeafHash(_txChainElement);
+ 
+        Erequire(
+            _verifyElement(
+                leafHash,
+                _batchHeader,
+                _inclusionProof
+            ),
+            "Invalid Sequencer transaction inclusion proof."
+        );
+ 
+        Erequire(
+            _transaction.blockNumber        == _txChainElement.blockNumber
+            && _transaction.timestamp       == _txChainElement.timestamp
+            && _transaction.entrypoint      == resolve("OVM_DecompressionPrecompileAddress")
+            && _transaction.gasLimit        == gasLimit
+            && _transaction.l1TxOrigin      == address(0)
+            && _transaction.l1QueueOrigin   == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
+            && keccak256(_transaction.data) == keccak256(_txChainElement.txData),
+            "Invalid Sequencer transaction."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * Verifies a queue transaction, returning true if it was indeed included in the CTC
+     * @param _transaction The transaction we are verifying inclusion of.
+     * @param _queueIndex The queueIndex of the queued transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof An inclusion proof into the CTC at a particular index (should point to queue tx).
+     * @return True if the transaction was included in the specified location, else false.
+     */
+    function _verifyQueueTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        uint256 _queueIndex,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 leafHash = _getQueueLeafHash(_queueIndex);
+ 
+        Erequire(
+            _verifyElement(
+                leafHash,
+                _batchHeader,
+                _inclusionProof
+            ),
+            "Invalid Queue transaction inclusion proof."
+        );
+ 
+        bytes32 transactionHash = keccak256(
+            abi.encode(
+                _transaction.l1TxOrigin,
+                _transaction.entrypoint,
+                _transaction.gasLimit,
+                _transaction.data
+            )
+        );
+ 
+        Lib_OVMCodec.QueueElement memory el = getQueueElement(_queueIndex);
+        Erequire(
+            el.transactionHash      == transactionHash
+            && el.timestamp   == _transaction.timestamp
+            && el.blockNumber == _transaction.blockNumber,
+            "Invalid Queue transaction."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * Verifies a batch inclusion proof.
+     * @param _element Hash of the element to verify a proof for.
+     * @param _batchHeader Header of the batch in which the element was included.
+     * @param _proof Merkle inclusion proof for the element.
+     */
+    function _verifyElement(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        Erequire(
+            Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(uint32(_batchHeader.batchIndex)),
+            "Invalid batch header."
+        );
+ 
+        Erequire(
+            Lib_MerkleTree.verify(
+                _batchHeader.batchRoot,
+                _element,
+                _proof.index,
+                _proof.siblings,
+                _batchHeader.batchSize
+            ),
+            "Invalid inclusion proof."
+        );
+ 
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html new file mode 100644 index 000000000..1e2bd3a07 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html @@ -0,0 +1,680 @@ + + + + Code coverage report for optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/chain/ OVM_ChainStorageContainer.sol +

+
+
+ 72.73% + Statements + 8/11 +
+
+ 50% + Branches + 1/2 +
+
+ 72.73% + Functions + 8/11 +
+
+ 75% + Lines + 9/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +516× +  +  +  +  +  +  +  +  +579× +  +  +  +579× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +580× +  +  +  +  +  +  +  +  +  +  +  +  +  +453× +  +  +  +  +  +  +  +  +  +  +  +  +470× +  +  +  +  +  +  +  +  +  +  +  +  +  +108× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_RingBuffer } from "../../libraries/utils/Lib_RingBuffer.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/**
+ * @title OVM_ChainStorageContainer
+ * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.
+ * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used
+ * in a fraud proof due to the fraud window having passed, and the associated chain state or
+ * transactions being finalized.
+ * Three distinct Chain Storage Containers will be deployed on Layer 1:
+ * 1. Stores transaction batches for the Canonical Transaction Chain
+ * 2. Stores queued transactions for the Canonical Transaction Chain
+ * 3. Stores chain state batches for the State Commitment Chain
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {
+ 
+    /*************
+     * Libraries *
+     *************/
+ 
+    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    string public owner;
+    Lib_RingBuffer.RingBuffer internal buffer;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _owner Name of the contract that owns this container (will be resolved later).
+     */
+    constructor(
+        address _libAddressManager,
+        string memory _owner
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        owner = _owner;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyOwner() {
+        Erequire(
+            msg.sender == resolve(owner),
+            "OVM_ChainStorageContainer: Function can only be called by the owner."
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function setGlobalMetadata(
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        return buffer.setExtraData(_globalMetadata);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function getGlobalMetadata()
+        override
+        public
+        view
+        returns (
+            bytes27
+        )
+    {
+        return buffer.getExtraData();
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function length()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return uint256(buffer.getLength());
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function push(
+        bytes32 _object
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.push(_object);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function push(
+        bytes32 _object,
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.push(_object, _globalMetadata);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function get(
+        uint256 _index
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        return buffer.get(uint40(_index));
+    }
+    
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.deleteElementsAfterInclusive(
+            uint40(_index)
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index,
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.deleteElementsAfterInclusive(
+            uint40(_index),
+            _globalMetadata
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function setNextOverwritableIndex(
+        uint256 _index
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.nextOverwritableIndex = _index;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html new file mode 100644 index 000000000..8b0dbf3fb --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html @@ -0,0 +1,1307 @@ + + + + Code coverage report for optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/chain/ OVM_StateCommitmentChain.sol +

+
+
+ 88.1% + Statements + 37/42 +
+
+ 67.86% + Branches + 19/28 +
+
+ 85.71% + Functions + 12/14 +
+
+ 88.64% + Lines + 39/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +60× +60× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +125× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +24× +  +  +  +  +24× +  +  +  +  +23× +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +74× +  +74× +74× +74× +  +  +  +  +  +74× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +22× +20× +  +  +  +  +  + +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
+ 
+/* Interface Imports */
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/* External Imports */
+import '@openzeppelin/contracts/math/SafeMath.sol';
+ 
+/**
+ * @title OVM_StateCommitmentChain
+ * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which
+ * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).
+ * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique
+ * state root calculated off-chain by applying the canonical transactions one by one.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 public FRAUD_PROOF_WINDOW;
+    uint256 public SEQUENCER_PUBLISH_WINDOW;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager,
+        uint256 _fraudProofWindow,
+        uint256 _sequencerPublishWindow
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        FRAUD_PROOF_WINDOW = _fraudProofWindow;
+        SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:SCC:batches")
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getTotalElements()
+        override
+        public
+        view
+        returns (
+            uint256 _totalElements
+        )
+    {
+        (uint40 totalElements, ) = _getBatchExtraData();
+        return uint256(totalElements);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getTotalBatches()
+        override
+        public
+        view
+        returns (
+            uint256 _totalBatches
+        )
+    {
+        return batches().length();
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getLastSequencerTimestamp()
+        override
+        public
+        view
+        returns (
+            uint256 _lastSequencerTimestamp
+        )
+    {
+        (, uint40 lastSequencerTimestamp) = _getBatchExtraData();
+        return uint256(lastSequencerTimestamp);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function appendStateBatch(
+        bytes32[] memory _batch,
+        uint256 _shouldStartAtElement
+    )
+        override
+        public
+    {
+        // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the
+        // publication of batches by some other user.
+        require(
+            _shouldStartAtElement == getTotalElements(),
+            "Actual batch start index does not match expected start index."
+        );
+ 
+        // Proposers must have previously staked at the BondManager
+        Erequire(
+            iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender),
+            "Proposer does not have enough collateral posted"
+        );
+ 
+        require(
+            _batch.length > 0,
+            "Cannot submit an empty state batch."
+        );
+ 
+        require(
+            getTotalElements() + _batch.length <= iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(),
+            "Number of state roots cannot exceed the number of canonical transactions."
+        );
+ 
+        // Pass the block's timestamp and the publisher of the data
+        // to be used in the fraud proofs
+        _appendBatch(
+            _batch,
+            abi.encode(block.timestamp, msg.sender)
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function deleteStateBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        override
+        public
+    {
+        require(
+            msg.sender == resolve("OVM_FraudVerifier"),
+            "State batches can only be deleted by the OVM_FraudVerifier."
+        );
+ 
+        require(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        Erequire(
+            insideFraudProofWindow(_batchHeader),
+            "State batches can only be deleted within the fraud proof window."
+        );
+ 
+        _deleteBatch(_batchHeader);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function verifyStateCommitment(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        require(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        require(
+            Lib_MerkleTree.verify(
+                _batchHeader.batchRoot,
+                _element,
+                _proof.index,
+                _proof.siblings,
+                _batchHeader.batchSize
+            ),
+            "Invalid inclusion proof."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function insideFraudProofWindow(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        override
+        public
+        view
+        returns (
+            bool _inside
+        )
+    {
+        (uint256 timestamp,) = abi.decode(
+            _batchHeader.extraData,
+            (uint256, address)
+        );
+ 
+        Erequire(
+            timestamp != 0,
+            "Batch header timestamp cannot be zero"
+        );
+        return SafeMath.add(timestamp, FRAUD_PROOF_WINDOW) > block.timestamp;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Parses the batch context from the extra data.
+     * @return Total number of elements submitted.
+     * @return Timestamp of the last batch submitted by the sequencer.
+     */
+    function _getBatchExtraData()
+        internal
+        view
+        returns (
+            uint40,
+            uint40
+        )
+    {
+        bytes27 extraData = batches().getGlobalMetadata();
+ 
+        uint40 totalElements;
+        uint40 lastSequencerTimestamp;
+        assembly {
+            extraData              := shr(40, extraData)
+            totalElements          :=         and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            lastSequencerTimestamp := shr(40, and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
+        }
+ 
+        return (
+            totalElements,
+            lastSequencerTimestamp
+        );
+    }
+ 
+    /**
+     * Encodes the batch context for the extra data.
+     * @param _totalElements Total number of elements submitted.
+     * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.
+     * @return Encoded batch context.
+     */
+    function _makeBatchExtraData(
+        uint40 _totalElements,
+        uint40 _lastSequencerTimestamp
+    )
+        internal
+        pure
+        returns (
+            bytes27
+        )
+    {
+        bytes27 extraData;
+        assembly {
+            extraData := _totalElements
+            extraData := or(extraData, shl(40, _lastSequencerTimestamp))
+            extraData := shl(40, extraData)
+        }
+ 
+        return extraData;
+    }
+ 
+    /**
+     * Appends a batch to the chain.
+     * @param _batch Elements within the batch.
+     * @param _extraData Any extra data to append to the batch.
+     */
+    function _appendBatch(
+        bytes32[] memory _batch,
+        bytes memory _extraData
+    )
+        internal
+    {
+        address sequencer = resolve("OVM_Proposer");
+        (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();
+ 
+        if (msg.sender == sequencer) {
+            lastSequencerTimestamp = uint40(block.timestamp);
+        } else {
+            // We keep track of the last batch submitted by the sequencer so there's a window in
+            // which only the sequencer can publish state roots. A window like this just reduces
+            // the chance of "system breaking" state roots being published while we're still in
+            // testing mode. This window should be removed or significantly reduced in the future.
+            require(
+                lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,
+                "Cannot publish state roots within the sequencer publication window."
+            );
+        }
+ 
+        // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place
+        // while calculating the root hash therefore any arguments passed to it must not
+        // be used again afterwards
+        Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({
+            batchIndex: getTotalBatches(),
+            batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),
+            batchSize: _batch.length,
+            prevTotalElements: totalElements,
+            extraData: _extraData
+        });
+ 
+        emit StateBatchAppended(
+            batchHeader.batchIndex,
+            batchHeader.batchRoot,
+            batchHeader.batchSize,
+            batchHeader.prevTotalElements,
+            batchHeader.extraData
+        );
+ 
+        batches().push(
+            Lib_OVMCodec.hashBatchHeader(batchHeader),
+            _makeBatchExtraData(
+                uint40(batchHeader.prevTotalElements + batchHeader.batchSize),
+                lastSequencerTimestamp
+            )
+        );
+    }
+ 
+    /**
+     * Removes a batch and all subsequent batches from the chain.
+     * @param _batchHeader Header of the batch to remove.
+     */
+    function _deleteBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+    {
+        Erequire(
+            _batchHeader.batchIndex < batches().length(),
+            "Invalid batch index."
+        );
+ 
+        Erequire(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        batches().deleteElementsAfterInclusive(
+            _batchHeader.batchIndex,
+            _makeBatchExtraData(
+                uint40(_batchHeader.prevTotalElements),
+                0
+            )
+        );
+ 
+        emit StateBatchDeleted(
+            _batchHeader.batchIndex,
+            _batchHeader.batchRoot
+        );
+    }
+ 
+    /**
+     * Checks that a batch header matches the stored hash for the given index.
+     * @param _batchHeader Batch header to validate.
+     * @return Whether or not the header matches the stored one.
+     */
+    function _isValidBatchHeader(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/chain/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/chain/index.html new file mode 100644 index 000000000..4929bf6b5 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/chain/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/OVM/chain/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/chain/ +

+
+
+ 92.82% + Statements + 194/209 +
+
+ 81.37% + Branches + 83/102 +
+
+ 82.46% + Functions + 47/57 +
+
+ 93.36% + Lines + 211/226 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_CanonicalTransactionChain.sol
95.51%149/15687.5%63/7284.38%27/3295.88%163/170
OVM_ChainStorageContainer.sol
72.73%8/1150%1/272.73%8/1175%9/12
OVM_StateCommitmentChain.sol
88.1%37/4267.86%19/2885.71%12/1488.64%39/44
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html new file mode 100644 index 000000000..89edc14b7 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html @@ -0,0 +1,5654 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/execution/ OVM_ExecutionManager.sol +

+
+
+ 82.2% + Statements + 194/236 +
+
+ 68.29% + Branches + 56/82 +
+
+ 88.52% + Functions + 54/61 +
+
+ 82.64% + Lines + 200/242 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244 +1245 +1246 +1247 +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1310 +1311 +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319 +1320 +1321 +1322 +1323 +1324 +1325 +1326 +1327 +1328 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1348 +1349 +1350 +1351 +1352 +1353 +1354 +1355 +1356 +1357 +1358 +1359 +1360 +1361 +1362 +1363 +1364 +1365 +1366 +1367 +1368 +1369 +1370 +1371 +1372 +1373 +1374 +1375 +1376 +1377 +1378 +1379 +1380 +1381 +1382 +1383 +1384 +1385 +1386 +1387 +1388 +1389 +1390 +1391 +1392 +1393 +1394 +1395 +1396 +1397 +1398 +1399 +1400 +1401 +1402 +1403 +1404 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1424 +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432 +1433 +1434 +1435 +1436 +1437 +1438 +1439 +1440 +1441 +1442 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +1458 +1459 +1460 +1461 +1462 +1463 +1464 +1465 +1466 +1467 +1468 +1469 +1470 +1471 +1472 +1473 +1474 +1475 +1476 +1477 +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489 +1490 +1491 +1492 +1493 +1494 +1495 +1496 +1497 +1498 +1499 +1500 +1501 +1502 +1503 +1504 +1505 +1506 +1507 +1508 +1509 +1510 +1511 +1512 +1513 +1514 +1515 +1516 +1517 +1518 +1519 +1520 +1521 +1522 +1523 +1524 +1525 +1526 +1527 +1528 +1529 +1530 +1531 +1532 +1533 +1534 +1535 +1536 +1537 +1538 +1539 +1540 +1541 +1542 +1543 +1544 +1545 +1546 +1547 +1548 +1549 +1550 +1551 +1552 +1553 +1554 +1555 +1556 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1576 +1577 +1578 +1579 +1580 +1581 +1582 +1583 +1584 +1585 +1586 +1587 +1588 +1589 +1590 +1591 +1592 +1593 +1594 +1595 +1596 +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609 +1610 +1611 +1612 +1613 +1614 +1615 +1616 +1617 +1618 +1619 +1620 +1621 +1622 +1623 +1624 +1625 +1626 +1627 +1628 +1629 +1630 +1631 +1632 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1652 +1653 +1654 +1655 +1656 +1657 +1658 +1659 +1660 +1661 +1662 +1663 +1664 +1665 +1666 +1667 +1668 +1669 +1670 +1671 +1672 +1673 +1674 +1675 +1676 +1677 +1678 +1679 +1680 +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688 +1689 +1690 +1691 +1692 +1693 +1694 +1695 +1696 +1697 +1698 +1699 +1700 +1701 +1702 +1703 +1704 +1705 +1706 +1707 +1708 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +1720 +1721 +1722 +1723 +1724 +1725 +1726 +1727 +1728 +1729 +1730 +1731 +1732 +1733 +1734 +1735 +1736 +1737 +1738 +1739 +1740 +1741 +1742 +1743 +1744 +1745 +1746 +1747 +1748 +1749 +1750 +1751 +1752 +1753 +1754 +1755 +1756 +1757 +1758 +1759 +1760 +1761 +1762 +1763 +1764 +1765 +1766 +1767 +1768 +1769 +1770 +1771 +1772 +1773 +1774 +1775 +1776 +1777 +1778 +1779 +1780 +1781 +1782 +1783 +1784 +1785 +1786 +1787 +1788 +1789 +1790 +1791 +1792 +1793 +1794 +1795 +1796 +1797 +1798 +1799 +1800 +1801 +1802 +1803 +1804 +1805 +1806 +1807 +1808 +1809 +1810 +1811 +1812 +1813 +1814 +1815 +1816 +1817 +1818 +1819 +1820 +1821 +1822 +1823 +1824 +1825 +1826 +1827 +1828 +1829 +1830 +1831 +1832 +1833 +1834 +1835 +1836 +1837 +1838 +1839 +1840 +1841 +1842 +1843 +1844 +1845 +1846 +1847 +1848 +1849 +1850 +1851 +1852 +1853 +1854 +1855 +1856 +1857 +1858 +1859 +1860 +1861 +1862 +1863 +1864  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +30× +30× +30× +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +55× +55× +55× +  +  +55× +46× +  +  +  +  +  +  +  +  +  +  +  +202× +202× +193× +  +  +193× +165× +  +  +28× +  +  +  +  +  +  +  +42× + +  +38× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +150× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +  +  +  +28× +  +  +27× +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  + + +  +  +  + +  +  + +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +155× +155× +155× +  +155× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +48× +  +48× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +  +29× +  +29× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +27× +27× +27× +  +  +  +27× +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +173× +  +  +  +  + +  +  +  +172× +  +  +  +  +170× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +197× +197× +  +  +  +  +  +197× +197× +197× +  +  +  +  +  +  +  +197× +  +  +  +  +  +197× +  +  +  +197× +  +  +  +197× +23× +  +  +  +  +  +  +  +  +  +23× + +  +  +  +  +  +18× +  +  +  +  +  +14× +  +  +  +  +18× +  +  +  +10× +  + +  +  +  +  +  +  +  +18× +  +  +  +192× +  +192× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +27× +  +  +27× +  +27× +  +  +10× +10× +10× +10× +  +  +  +  +  +  +  +10× +  +  +  +  +17× +17× + +  +  +  +  +  +  +  +  +  +  +16× +  +  +  +  +  +  +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +29× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +57× +57× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +370× +368× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +17× +17× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +55× +55× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +536× +  +  +  +  +536× + +  +  +  +  +534× +  +  +  +  +  +534× +144× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +53× +  +  +  +53× +  +  +  +  +  +53× +47× +47× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +62× +  +  +  +  +  +  +62× +  +  +  +  +  +62× +  +  +  +  +  +62× +46× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  + +  +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +20× + +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× + +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +198× +  +  +  +  +  +  +  +  +  +  +  +  +  +244× +  +  +  +244× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +394× +202× +  +  +  +394× +310× +  +  +  +394× +16× +  +  +  +  +  +  +  +  +  +  +  +  + + + + + + +  + +  +  +  +  +  +  +  +  +31× +31× +31× +31× +31× +31× +  +31× +  +31× +31× +31× +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
+import { Lib_ErrorUtils } from "../../libraries/utils/Lib_ErrorUtils.sol";
+ 
+/* Interface Imports */
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
+ 
+/* Contract Imports */
+import { OVM_ECDSAContractAccount } from "../accounts/OVM_ECDSAContractAccount.sol";
+import { OVM_ProxyEOA } from "../accounts/OVM_ProxyEOA.sol";
+import { OVM_DeployerWhitelist } from "../predeploys/OVM_DeployerWhitelist.sol";
+ 
+/**
+ * @title OVM_ExecutionManager
+ * @dev The Execution Manager (EM) is the core of our OVM implementation, and provides a sandboxed
+ * environment allowing us to execute OVM transactions deterministically on either Layer 1 or
+ * Layer 2.
+ * The EM's run() function is the first function called during the execution of any
+ * transaction on L2.
+ * For each context-dependent EVM operation the EM has a function which implements a corresponding
+ * OVM operation, which will read state from the State Manager contract.
+ * The EM relies on the Safety Checker to verify that code deployed to Layer 2 does not contain any
+ * context-dependent operations.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    iOVM_SafetyChecker internal ovmSafetyChecker;
+    iOVM_StateManager internal ovmStateManager;
+ 
+ 
+    /*******************************
+     * Execution Context Variables *
+     *******************************/
+ 
+    GasMeterConfig internal gasMeterConfig;
+    GlobalContext internal globalContext;
+    TransactionContext internal transactionContext;
+    MessageContext internal messageContext;
+    TransactionRecord internal transactionRecord;
+    MessageRecord internal messageRecord;
+ 
+ 
+    /**************************
+     * Gas Metering Constants *
+     **************************/
+ 
+    address constant GAS_METADATA_ADDRESS = 0x06a506A506a506A506a506a506A506A506A506A5;
+    uint256 constant NUISANCE_GAS_SLOAD = 20000;
+    uint256 constant NUISANCE_GAS_SSTORE = 20000;
+    uint256 constant MIN_NUISANCE_GAS_PER_CONTRACT = 30000;
+    uint256 constant NUISANCE_GAS_PER_CONTRACT_BYTE = 100;
+    uint256 constant MIN_GAS_FOR_INVALID_STATE_ACCESS = 30000;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager,
+        GasMeterConfig memory _gasMeterConfig,
+        GlobalContext memory _globalContext
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        ovmSafetyChecker = iOVM_SafetyChecker(resolve("OVM_SafetyChecker"));
+        gasMeterConfig = _gasMeterConfig;
+        globalContext = _globalContext;
+        _resetContext();
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Applies dynamically-sized refund to a transaction to account for the difference in execution
+     * between L1 and L2, so that the overall cost of the ovmOPCODE is fixed.
+     * @param _cost Desired gas cost for the function after the refund.
+     */
+    modifier netGasCost(
+        uint256 _cost
+    ) {
+        uint256 gasProvided = gasleft();
+        _;
+        uint256 gasUsed = gasProvided - gasleft();
+ 
+        // We want to refund everything *except* the specified cost.
+        if (_cost < gasUsed) {
+            transactionRecord.ovmGasRefund += gasUsed - _cost;
+        }
+    }
+ 
+    /**
+     * Applies a fixed-size gas refund to a transaction to account for the difference in execution
+     * between L1 and L2, so that the overall cost of an ovmOPCODE can be lowered.
+     * @param _discount Amount of gas cost to refund for the ovmOPCODE.
+     */
+    modifier fixedGasDiscount(
+        uint256 _discount
+    ) {
+        uint256 gasProvided = gasleft();
+        _;
+        uint256 gasUsed = gasProvided - gasleft();
+ 
+        // We want to refund the specified _discount, unless this risks underflow.
+        if (_discount < gasUsed) {
+            transactionRecord.ovmGasRefund += _discount;
+        } else {
+            // refund all we can without risking underflow.
+            transactionRecord.ovmGasRefund += gasUsed;
+        }
+    }
+ 
+    /**
+     * Makes sure we're not inside a static context.
+     */
+    modifier notStatic() {
+        if (messageContext.isStatic == true) {
+            _revertWithFlag(RevertFlag.STATIC_VIOLATION);
+        }
+        _;
+    }
+ 
+ 
+    /************************************
+     * Transaction Execution Entrypoint *
+     ************************************/
+ 
+    /**
+     * Starts the execution of a transaction via the OVM_ExecutionManager.
+     * @param _transaction Transaction data to be executed.
+     * @param _ovmStateManager iOVM_StateManager implementation providing account state.
+     */
+    function run(
+        Lib_OVMCodec.Transaction memory _transaction,
+        address _ovmStateManager
+    )
+        override
+        public
+    {
+        Erequire(transactionContext.ovmNUMBER == 0, "Only be callable at the start of a transaction");
+        // Store our OVM_StateManager instance (significantly easier than attempting to pass the
+        // address around in calldata).
+        ovmStateManager = iOVM_StateManager(_ovmStateManager);
+ 
+        // Make sure this function can't be called by anyone except the owner of the
+        // OVM_StateManager (expected to be an OVM_StateTransitioner). We can revert here because
+        // this would make the `run` itself invalid.
+        Erequire(
+            // This method may return false during fraud proofs, but always returns true in L2 nodes' State Manager precompile.
+            ovmStateManager.isAuthenticated(msg.sender),
+            "Only authenticated addresses in ovmStateManager can call this function"
+        );
+ 
+        // Initialize the execution context, must be initialized before we perform any gas metering
+        // or we'll throw a nuisance gas error.
+        _initContext(_transaction);
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Check whether we need to start a new epoch, do so if necessary.
+        // _checkNeedsNewEpoch(_transaction.timestamp);
+ 
+        // Make sure the transaction's gas limit is valid. We don't revert here because we reserve
+        // reverts for INVALID_STATE_ACCESS.
+        Iif (_isValidGasLimit(_transaction.gasLimit, _transaction.l1QueueOrigin) == false) {
+            _resetContext();
+            return;
+        }
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Check gas right before the call to get total gas consumed by OVM transaction.
+        // uint256 gasProvided = gasleft();
+ 
+        // Run the transaction, make sure to meter the gas usage.
+        ovmCALL(
+            _transaction.gasLimit - gasMeterConfig.minTransactionGasLimit,
+            _transaction.entrypoint,
+            _transaction.data
+        );
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Update the cumulative gas based on the amount of gas used.
+        // uint256 gasUsed = gasProvided - gasleft();
+        // _updateCumulativeGas(gasUsed, _transaction.l1QueueOrigin);
+ 
+        // Wipe the execution context.
+        _resetContext();
+ 
+        // Reset the ovmStateManager.
+        ovmStateManager = iOVM_StateManager(address(0));
+    }
+ 
+ 
+    /******************************
+     * Opcodes: Execution Context *
+     ******************************/
+ 
+    /**
+     * @notice Overrides CALLER.
+     * @return _CALLER Address of the CALLER within the current message context.
+     */
+    function ovmCALLER()
+        override
+        public
+        view
+        returns (
+            address _CALLER
+        )
+    {
+        return messageContext.ovmCALLER;
+    }
+ 
+    /**
+     * @notice Overrides ADDRESS.
+     * @return _ADDRESS Active ADDRESS within the current message context.
+     */
+    function ovmADDRESS()
+        override
+        public
+        view
+        returns (
+            address _ADDRESS
+        )
+    {
+        return messageContext.ovmADDRESS;
+    }
+ 
+    /**
+     * @notice Overrides TIMESTAMP.
+     * @return _TIMESTAMP Value of the TIMESTAMP within the transaction context.
+     */
+    function ovmTIMESTAMP()
+        override
+        public
+        view
+        returns (
+            uint256 _TIMESTAMP
+        )
+    {
+        return transactionContext.ovmTIMESTAMP;
+    }
+ 
+    /**
+     * @notice Overrides NUMBER.
+     * @return _NUMBER Value of the NUMBER within the transaction context.
+     */
+    function ovmNUMBER()
+        override
+        public
+        view
+        returns (
+            uint256 _NUMBER
+        )
+    {
+        return transactionContext.ovmNUMBER;
+    }
+ 
+    /**
+     * @notice Overrides GASLIMIT.
+     * @return _GASLIMIT Value of the block's GASLIMIT within the transaction context.
+     */
+    function ovmGASLIMIT()
+        override
+        public
+        view
+        returns (
+            uint256 _GASLIMIT
+        )
+    {
+        return transactionContext.ovmGASLIMIT;
+    }
+ 
+    /**
+     * @notice Overrides CHAINID.
+     * @return _CHAINID Value of the chain's CHAINID within the global context.
+     */
+    function ovmCHAINID()
+        override
+        public
+        view
+        returns (
+            uint256 _CHAINID
+        )
+    {
+        return globalContext.ovmCHAINID;
+    }
+ 
+    /*********************************
+     * Opcodes: L2 Execution Context *
+     *********************************/
+ 
+    /**
+     * @notice Specifies from which L1 rollup queue this transaction originated from.
+     * @return _queueOrigin Address of the ovmL1QUEUEORIGIN within the current message context.
+     */
+    function ovmL1QUEUEORIGIN()
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.QueueOrigin _queueOrigin
+        )
+    {
+        return transactionContext.ovmL1QUEUEORIGIN;
+    }
+ 
+    /**
+     * @notice Specifies which L1 account, if any, sent this transaction by calling enqueue().
+     * @return _l1TxOrigin Address of the account which sent the tx into L2 from L1.
+     */
+    function ovmL1TXORIGIN()
+        override
+        public
+        view
+        returns (
+            address _l1TxOrigin
+        )
+    {
+        return transactionContext.ovmL1TXORIGIN;
+    }
+ 
+    /********************
+     * Opcodes: Halting *
+     ********************/
+ 
+    /**
+     * @notice Overrides REVERT.
+     * @param _data Bytes data to pass along with the REVERT.
+     */
+    function ovmREVERT(
+        bytes memory _data
+    )
+        override
+        public
+    {
+        _revertWithFlag(RevertFlag.INTENTIONAL_REVERT, _data);
+    }
+ 
+ 
+    /******************************
+     * Opcodes: Contract Creation *
+     ******************************/
+ 
+    /**
+     * @notice Overrides CREATE.
+     * @param _bytecode Code to be used to CREATE a new contract.
+     * @return Address of the created contract.
+     * @return Revert data, if and only if the creation threw an exception.
+     */
+    function ovmCREATE(
+        bytes memory _bytecode
+    )
+        override
+        public
+        notStatic
+        fixedGasDiscount(40000)
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // Creator is always the current ADDRESS.
+        address creator = ovmADDRESS();
+ 
+        // Check that the deployer is whitelisted, or
+        // that arbitrary contract deployment has been enabled.
+        _checkDeployerAllowed(creator);
+ 
+        // Generate the correct CREATE address.
+        address contractAddress = Lib_EthUtils.getAddressForCREATE(
+            creator,
+            _getAccountNonce(creator)
+        );
+ 
+        return _createContract(
+            contractAddress,
+            _bytecode
+        );
+    }
+ 
+    /**
+     * @notice Overrides CREATE2.
+     * @param _bytecode Code to be used to CREATE2 a new contract.
+     * @param _salt Value used to determine the contract's address.
+     * @return Address of the created contract.
+     * @return Revert data, if and only if the creation threw an exception.
+     */
+    function ovmCREATE2(
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        override
+        public
+        notStatic
+        fixedGasDiscount(40000)
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // Creator is always the current ADDRESS.
+        address creator = ovmADDRESS();
+ 
+        // Check that the deployer is whitelisted, or
+        // that arbitrary contract deployment has been enabled.
+        _checkDeployerAllowed(creator);
+ 
+        // Generate the correct CREATE2 address.
+        address contractAddress = Lib_EthUtils.getAddressForCREATE2(
+            creator,
+            _bytecode,
+            _salt
+        );
+ 
+        return _createContract(
+            contractAddress,
+            _bytecode
+        );
+    }
+ 
+ 
+    /*******************************
+     * Account Abstraction Opcodes *
+     ******************************/
+ 
+    /**
+     * Retrieves the nonce of the current ovmADDRESS.
+     * @return _nonce Nonce of the current contract.
+     */
+    function ovmGETNONCE()
+        override
+        public
+        returns (
+            uint256 _nonce
+        )
+    {
+        return _getAccountNonce(ovmADDRESS());
+    }
+ 
+    /**
+     * Sets the nonce of the current ovmADDRESS.
+     * @param _nonce New nonce for the current contract.
+     */
+    function ovmSETNONCE(
+        uint256 _nonce
+    )
+        override
+        public
+        notStatic
+    {
+        _setAccountNonce(ovmADDRESS(), _nonce);
+    }
+ 
+    /**
+     * Creates a new EOA contract account, for account abstraction.
+     * @dev Essentially functions like ovmCREATE or ovmCREATE2, but we can bypass a lot of checks
+     *      because the contract we're creating is trusted (no need to do safety checking or to
+     *      handle unexpected reverts). Doesn't need to return an address because the address is
+     *      assumed to be the user's actual address.
+     * @param _messageHash Hash of a message signed by some user, for verification.
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     */
+    function ovmCREATEEOA(
+        bytes32 _messageHash,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        override
+        public
+        notStatic
+    {
+        // Recover the EOA address from the message hash and signature parameters. Since we do the
+        // hashing in advance, we don't have handle different message hashing schemes. Even if this
+        // function were to return the wrong address (rather than explicitly returning the zero
+        // address), the rest of the transaction would simply fail (since there's no EOA account to
+        // actually execute the transaction).
+        address eoa = ecrecover(
+            _messageHash,
+            _v + 27,
+            _r,
+            _s
+        );
+ 
+        // Invalid signature is a case we proactively handle with a revert. We could alternatively
+        // have this function return a `success` boolean, but this is just easier.
+        Iif (eoa == address(0)) {
+            ovmREVERT(bytes("Signature provided for EOA contract creation is invalid."));
+        }
+ 
+        // If the user already has an EOA account, then there's no need to perform this operation.
+        Iif (_hasEmptyAccount(eoa) == false) {
+            return;
+        }
+ 
+        // We always need to initialize the contract with the default account values.
+        _initPendingAccount(eoa);
+ 
+        // Temporarily set the current address so it's easier to access on L2.
+        address prevADDRESS = messageContext.ovmADDRESS;
+        messageContext.ovmADDRESS = eoa;
+ 
+        // Now actually create the account and get its bytecode. We're not worried about reverts
+        // (other than out of gas, which we can't capture anyway) because this contract is trusted.
+        OVM_ProxyEOA proxyEOA = new OVM_ProxyEOA(0x4200000000000000000000000000000000000003);
+ 
+        // Reset the address now that we're done deploying.
+        messageContext.ovmADDRESS = prevADDRESS;
+ 
+        // Commit the account with its final values.
+        _commitPendingAccount(
+            eoa,
+            address(proxyEOA),
+            keccak256(Lib_EthUtils.getCode(address(proxyEOA)))
+        );
+ 
+        _setAccountNonce(eoa, 0);
+    }
+ 
+ 
+    /*********************************
+     * Opcodes: Contract Interaction *
+     *********************************/
+ 
+    /**
+     * @notice Overrides CALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmCALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(100000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // CALL updates the CALLER and ADDRESS.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _address;
+ 
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+    /**
+     * @notice Overrides STATICCALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmSTATICCALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(80000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // STATICCALL updates the CALLER, updates the ADDRESS, and runs in a static context.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _address;
+        nextMessageContext.isStatic = true;
+ 
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+    /**
+     * @notice Overrides DELEGATECALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmDELEGATECALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(40000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // DELEGATECALL does not change anything about the message context.
+        MessageContext memory nextMessageContext = messageContext;
+        
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+ 
+    /************************************
+     * Opcodes: Contract Storage Access *
+     ************************************/
+ 
+    /**
+     * @notice Overrides SLOAD.
+     * @param _key 32 byte key of the storage slot to load.
+     * @return _value 32 byte value of the requested storage slot.
+     */
+    function ovmSLOAD(
+        bytes32 _key
+    )
+        override
+        public
+        netGasCost(40000)
+        returns (
+            bytes32 _value
+        )
+    {
+        // We always SLOAD from the storage of ADDRESS.
+        address contractAddress = ovmADDRESS();
+ 
+        return _getContractStorage(
+            contractAddress,
+            _key
+        );
+    }
+ 
+    /**
+     * @notice Overrides SSTORE.
+     * @param _key 32 byte key of the storage slot to set.
+     * @param _value 32 byte value for the storage slot.
+     */
+    function ovmSSTORE(
+        bytes32 _key,
+        bytes32 _value
+    )
+        override
+        public
+        notStatic
+        netGasCost(60000)
+    {
+        // We always SSTORE to the storage of ADDRESS.
+        address contractAddress = ovmADDRESS();
+ 
+        _putContractStorage(
+            contractAddress,
+            _key,
+            _value
+        );
+    }
+ 
+ 
+    /*********************************
+     * Opcodes: Contract Code Access *
+     *********************************/
+ 
+    /**
+     * @notice Overrides EXTCODECOPY.
+     * @param _contract Address of the contract to copy code from.
+     * @param _offset Offset in bytes from the start of contract code to copy beyond.
+     * @param _length Total number of bytes to copy from the contract's code.
+     * @return _code Bytes of code copied from the requested contract.
+     */
+    function ovmEXTCODECOPY(
+        address _contract,
+        uint256 _offset,
+        uint256 _length
+    )
+        override
+        public
+        returns (
+            bytes memory _code
+        )
+    {
+        // `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of
+        // return data. By blocking reads of one byte, we're able to use the condition that an
+        // OVM_ExecutionManager function return value having a length of exactly one byte indicates
+        // an error without an explicit revert. If users were able to read a single byte, they
+        // could forcibly trigger behavior that should only be available to this contract.
+        uint256 length = _length == 1 ? 2 : _length;
+ 
+        return Lib_EthUtils.getCode(
+            _getAccountEthAddress(_contract),
+            _offset,
+            length
+        );
+    }
+ 
+    /**
+     * @notice Overrides EXTCODESIZE.
+     * @param _contract Address of the contract to query the size of.
+     * @return _EXTCODESIZE Size of the requested contract in bytes.
+     */
+    function ovmEXTCODESIZE(
+        address _contract
+    )
+        override
+        public
+        returns (
+            uint256 _EXTCODESIZE
+        )
+    {
+        return Lib_EthUtils.getCodeSize(
+            _getAccountEthAddress(_contract)
+        );
+    }
+ 
+    /**
+     * @notice Overrides EXTCODEHASH.
+     * @param _contract Address of the contract to query the hash of.
+     * @return _EXTCODEHASH Hash of the requested contract.
+     */
+    function ovmEXTCODEHASH(
+        address _contract
+    )
+        override
+        public
+        returns (
+            bytes32 _EXTCODEHASH
+        )
+    {
+        return Lib_EthUtils.getCodeHash(
+            _getAccountEthAddress(_contract)
+        );
+    }
+ 
+    /***************************************
+     * Public Functions: Execution Context *
+     ***************************************/
+ 
+    function getMaxTransactionGasLimit()
+        external
+        view
+        override
+        returns (
+            uint256 _maxTransactionGasLimit
+        )
+    {
+        return gasMeterConfig.maxTransactionGasLimit;
+    }
+ 
+    /********************************************
+     * Public Functions: Deployment Whitelisting *
+     ********************************************/
+ 
+    /**
+     * Checks whether the given address is on the whitelist to ovmCREATE/ovmCREATE2, and reverts if not.
+     * @param _deployerAddress Address attempting to deploy a contract.
+     */
+    function _checkDeployerAllowed(
+        address _deployerAddress
+    )
+        internal
+    {
+        // From an OVM semantics perspective, this will appear identical to
+        // the deployer ovmCALLing the whitelist.  This is fine--in a sense, we are forcing them to.
+        (bool success, bytes memory data) = ovmCALL(
+            gasleft(),
+            0x4200000000000000000000000000000000000002,
+            abi.encodeWithSignature("isDeployerAllowed(address)", _deployerAddress)
+        );
+        bool isAllowed = abi.decode(data, (bool));
+ 
+        if (!isAllowed || !success) {
+            _revertWithFlag(RevertFlag.CREATOR_NOT_ALLOWED);
+        }
+    }
+ 
+    /********************************************
+     * Internal Functions: Contract Interaction *
+     ********************************************/
+ 
+    /**
+     * Creates a new contract and associates it with some contract address.
+     * @param _contractAddress Address to associate the created contract with.
+     * @param _bytecode Bytecode to be used to create the contract.
+     * @return Final OVM contract address.
+     * @return Revertdata, if and only if the creation threw an exception.
+     */
+    function _createContract(
+        address _contractAddress,
+        bytes memory _bytecode
+    )
+        internal
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // We always update the nonce of the creating account, even if the creation fails.
+        _setAccountNonce(ovmADDRESS(), _getAccountNonce(ovmADDRESS()) + 1);
+ 
+        // We're stepping into a CREATE or CREATE2, so we need to update ADDRESS to point
+        // to the contract's associated address and CALLER to point to the previous ADDRESS.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = messageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _contractAddress;
+ 
+        // Run the common logic which occurs between call-type and create-type messages,
+        // passing in the creation bytecode and `true` to trigger create-specific logic.
+        (bool success, bytes memory data) = _handleExternalMessage(
+            nextMessageContext,
+            gasleft(),
+            _contractAddress,
+            _bytecode,
+            true
+        );
+ 
+        // Yellow paper requires that address returned is zero if the contract deployment fails.
+        return (
+            success ? _contractAddress : address(0),
+            data
+        );
+    }
+ 
+    /**
+     * Calls the deployed contract associated with a given address.
+     * @param _nextMessageContext Message context to be used for the call.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _contract OVM address to be called.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function _callContract(
+        MessageContext memory _nextMessageContext,
+        uint256 _gasLimit,
+        address _contract,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // We reserve addresses of the form 0xdeaddeaddead...NNNN for the container contracts in L2 geth.
+        // So, we block calls to these addresses since they are not safe to run as an OVM contract itself.
+        if (
+            (uint256(_contract) & uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000))
+            == uint256(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000)
+        ) {
+            // EVM does not return data in the success case, see: https://github.com/ethereum/go-ethereum/blob/aae7660410f0ef90279e14afaaf2f429fdc2a186/core/vm/instructions.go#L600-L604
+            return (true, hex'');
+        }
+ 
+        // Both 0x0000... and the EVM precompiles have the same address on L1 and L2 --> no trie lookup needed.
+        address codeContractAddress =
+            uint(_contract) < 100
+            ? _contract
+            : _getAccountEthAddress(_contract);
+ 
+        return _handleExternalMessage(
+            _nextMessageContext,
+            _gasLimit,
+            codeContractAddress,
+            _calldata,
+            false
+        );
+    }
+ 
+    /**
+     * Handles all interactions which involve the execution manager calling out to untrusted code (both calls and creates).
+     * Ensures that OVM-related measures are enforced, including L2 gas refunds, nuisance gas, and flagged reversions.
+     * 
+     * @param _nextMessageContext Message context to be used for the external message.
+     * @param _gasLimit Amount of gas to be passed into this message.
+     * @param _contract OVM address being called or deployed to
+     * @param _data Data for the message (either calldata or creation code)
+     * @param _isCreate Whether this is a create-type message.
+     * @return Whether or not the message (either a call or deployment) succeeded.
+     * @return Data returned by the message.
+     */
+    function _handleExternalMessage(
+        MessageContext memory _nextMessageContext,
+        uint256 _gasLimit,
+        address _contract,
+        bytes memory _data,
+        bool _isCreate
+    )
+        internal
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        // We need to switch over to our next message context for the duration of this call.
+        MessageContext memory prevMessageContext = messageContext;
+        _switchMessageContext(prevMessageContext, _nextMessageContext);
+ 
+        // Nuisance gas is a system used to bound the ability for an attacker to make fraud proofs
+        // expensive by touching a lot of different accounts or storage slots. Since most contracts
+        // only use a few storage slots during any given transaction, this shouldn't be a limiting
+        // factor.
+        uint256 prevNuisanceGasLeft = messageRecord.nuisanceGasLeft;
+        uint256 nuisanceGasLimit = _getNuisanceGasLimit(_gasLimit);
+        messageRecord.nuisanceGasLeft = nuisanceGasLimit;
+ 
+        // Make the call and make sure to pass in the gas limit. Another instance of hidden
+        // complexity. `_contract` is guaranteed to be a safe contract, meaning its return/revert
+        // behavior can be controlled. In particular, we enforce that flags are passed through
+        // revert data as to retrieve execution metadata that would normally be reverted out of
+        // existence.
+ 
+        (bool success, bytes memory returndata) =
+            _isCreate
+            ? _handleContractCreation(_gasLimit, _data, _contract)
+            : _contract.call{gas: _gasLimit}(_data);
+ 
+        // Switch back to the original message context now that we're out of the call.
+        _switchMessageContext(_nextMessageContext, prevMessageContext);
+ 
+        // Assuming there were no reverts, the message record should be accurate here. We'll update
+        // this value in the case of a revert.
+        uint256 nuisanceGasLeft = messageRecord.nuisanceGasLeft;
+ 
+        // Reverts at this point are completely OK, but we need to make a few updates based on the
+        // information passed through the revert.
+        if (success == false) {
+            (
+                RevertFlag flag,
+                uint256 nuisanceGasLeftPostRevert,
+                uint256 ovmGasRefund,
+                bytes memory returndataFromFlag
+            ) = _decodeRevertData(returndata);
+ 
+            // INVALID_STATE_ACCESS is the only flag that triggers an immediate abort of the
+            // parent EVM message. This behavior is necessary because INVALID_STATE_ACCESS must
+            // halt any further transaction execution that could impact the execution result.
+            if (flag == RevertFlag.INVALID_STATE_ACCESS) {
+                _revertWithFlag(flag);
+            }
+ 
+            // INTENTIONAL_REVERT, UNSAFE_BYTECODE, STATIC_VIOLATION, and CREATOR_NOT_ALLOWED aren't
+            // dependent on the input state, so we can just handle them like standard reverts. Our only change here
+            // is to record the gas refund reported by the call (enforced by safety checking).
+            if (
+                flag == RevertFlag.INTENTIONAL_REVERT
+                || flag == RevertFlag.UNSAFE_BYTECODE
+                || flag == RevertFlag.STATIC_VIOLATION
+                || flag == RevertFlag.CREATOR_NOT_ALLOWED
+            ) {
+                transactionRecord.ovmGasRefund = ovmGasRefund;
+            }
+ 
+            // INTENTIONAL_REVERT needs to pass up the user-provided return data encoded into the
+            // flag, *not* the full encoded flag. All other revert types return no data.
+            if (
+                flag == RevertFlag.INTENTIONAL_REVERT
+                || _isCreate
+            ) {
+                returndata = returndataFromFlag;
+            } else {
+                returndata = hex'';
+            }
+ 
+            // Reverts mean we need to use up whatever "nuisance gas" was used by the call.
+            // EXCEEDS_NUISANCE_GAS explicitly reduces the remaining nuisance gas for this message
+            // to zero. OUT_OF_GAS is a "pseudo" flag given that messages return no data when they
+            // run out of gas, so we have to treat this like EXCEEDS_NUISANCE_GAS. All other flags
+            // will simply pass up the remaining nuisance gas.
+            nuisanceGasLeft = nuisanceGasLeftPostRevert;
+        }
+ 
+        // We need to reset the nuisance gas back to its original value minus the amount used here.
+        messageRecord.nuisanceGasLeft = prevNuisanceGasLeft - (nuisanceGasLimit - nuisanceGasLeft);
+ 
+        return (
+            success,
+            returndata
+        );
+    }
+ 
+    /**
+     * Handles the creation-specific safety measures required for OVM contract deployment.
+     * This function sanitizes the return types for creation messages to match calls (bool, bytes).
+     * This allows for consistent handling of both types of messages in _handleExternalMessage().
+     * 
+     * @param _gasLimit Amount of gas to be passed into this creation.
+     * @param _creationCode Code to pass into CREATE for deployment.
+     * @param _address OVM address being deployed to.
+     * @return Whether or not the call succeeded.
+     * @return If creation fails: revert data. Otherwise: empty.
+     */
+    function _handleContractCreation(
+        uint _gasLimit,
+        bytes memory _creationCode,
+        address _address
+    )
+        internal
+        returns(
+            bool,
+            bytes memory
+        )
+    {
+        // Check that there is not already code at this address.
+        Iif (_hasEmptyAccount(_address) == false) {
+            // Note: in the EVM, this case burns all allotted gas.  For improved
+            // developer experience, we do return the remaining ones.
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.CREATE_COLLISION,
+                    Lib_ErrorUtils.encodeRevertString("A contract has already been deployed to this address")
+                )
+            );
+        }
+ 
+        // Check the creation bytecode against the OVM_SafetyChecker.
+        Iif (ovmSafetyChecker.isBytecodeSafe(_creationCode) == false) {
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.UNSAFE_BYTECODE,
+                    Lib_ErrorUtils.encodeRevertString("Contract creation code contains unsafe opcodes. Did you use the right compiler or pass an unsafe constructor argument?")
+                )
+            );
+        }
+ 
+        // We always need to initialize the contract with the default account values.
+        _initPendingAccount(_address);
+ 
+        // Actually execute the EVM create message,
+        address ethAddress = Lib_EthUtils.createContract(_creationCode);
+        
+        if (ethAddress == address(0)) {
+            // If the creation fails, the EVM lets us grab its revert data. This may contain a revert flag
+            // to be used above in _handleExternalMessage.
+            uint256 revertDataSize;
+            assembly { revertDataSize := returndatasize() }
+            bytes memory revertdata = new bytes(revertDataSize);
+            assembly {
+                returndatacopy(
+                    add(revertdata, 0x20),
+                    0,
+                    revertDataSize
+                )
+            }
+            // Return that the creation failed, and the data it reverted with.
+            return (false, revertdata);
+        }
+ 
+        // Again simply checking that the deployed code is safe too. Contracts can generate
+        // arbitrary deployment code, so there's no easy way to analyze this beforehand.
+        bytes memory deployedCode = Lib_EthUtils.getCode(ethAddress);
+        if (ovmSafetyChecker.isBytecodeSafe(deployedCode) == false) {
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.UNSAFE_BYTECODE,
+                    Lib_ErrorUtils.encodeRevertString("Constructor attempted to deploy unsafe bytecode.")
+                )
+            );
+        }
+ 
+        // Contract creation didn't need to be reverted and the bytecode is safe. We finish up by
+        // associating the desired address with the newly created contract's code hash and address.
+        _commitPendingAccount(
+            _address,
+            ethAddress,
+            Lib_EthUtils.getCodeHash(ethAddress)
+        );
+ 
+        // Successful deployments will not give access to returndata, in both the EVM and the OVM.
+        return (true, hex'');
+    }
+ 
+    /******************************************
+     * Internal Functions: State Manipulation *
+     ******************************************/
+ 
+    /**
+     * Checks whether an account exists within the OVM_StateManager.
+     * @param _address Address of the account to check.
+     * @return _exists Whether or not the account exists.
+     */
+    function _hasAccount(
+        address _address
+    )
+        internal
+        returns (
+            bool _exists
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.hasAccount(_address);
+    }
+ 
+    /**
+     * Checks whether a known empty account exists within the OVM_StateManager.
+     * @param _address Address of the account to check.
+     * @return _exists Whether or not the account empty exists.
+     */
+    function _hasEmptyAccount(
+        address _address
+    )
+        internal
+        returns (
+            bool _exists
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.hasEmptyAccount(_address);
+    }
+ 
+    /**
+     * Sets the nonce of an account.
+     * @param _address Address of the account to modify.
+     * @param _nonce New account nonce.
+     */
+    function _setAccountNonce(
+        address _address,
+        uint256 _nonce
+    )
+        internal
+    {
+        _checkAccountChange(_address);
+        ovmStateManager.setAccountNonce(_address, _nonce);
+    }
+ 
+    /**
+     * Gets the nonce of an account.
+     * @param _address Address of the account to access.
+     * @return _nonce Nonce of the account.
+     */
+    function _getAccountNonce(
+        address _address
+    )
+        internal
+        returns (
+            uint256 _nonce
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.getAccountNonce(_address);
+    }
+ 
+    /**
+     * Retrieves the Ethereum address of an account.
+     * @param _address Address of the account to access.
+     * @return _ethAddress Corresponding Ethereum address.
+     */
+    function _getAccountEthAddress(
+        address _address
+    )
+        internal
+        returns (
+            address _ethAddress
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.getAccountEthAddress(_address);
+    }
+ 
+    /**
+     * Creates the default account object for the given address.
+     * @param _address Address of the account create.
+     */
+    function _initPendingAccount(
+        address _address
+    )
+        internal
+    {
+        // Although it seems like `_checkAccountChange` would be more appropriate here, we don't
+        // actually consider an account "changed" until it's inserted into the state (in this case
+        // by `_commitPendingAccount`).
+        _checkAccountLoad(_address);
+        ovmStateManager.initPendingAccount(_address);
+    }
+ 
+    /**
+     * Stores additional relevant data for a new account, thereby "committing" it to the state.
+     * This function is only called during `ovmCREATE` and `ovmCREATE2` after a successful contract
+     * creation.
+     * @param _address Address of the account to commit.
+     * @param _ethAddress Address of the associated deployed contract.
+     * @param _codeHash Hash of the code stored at the address.
+     */
+    function _commitPendingAccount(
+        address _address,
+        address _ethAddress,
+        bytes32 _codeHash
+    )
+        internal
+    {
+        _checkAccountChange(_address);
+        ovmStateManager.commitPendingAccount(
+            _address,
+            _ethAddress,
+            _codeHash
+        );
+    }
+ 
+    /**
+     * Retrieves the value of a storage slot.
+     * @param _contract Address of the contract to query.
+     * @param _key 32 byte key of the storage slot.
+     * @return _value 32 byte storage slot value.
+     */
+    function _getContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+        returns (
+            bytes32 _value
+        )
+    {
+        _checkContractStorageLoad(_contract, _key);
+        return ovmStateManager.getContractStorage(_contract, _key);
+    }
+ 
+    /**
+     * Sets the value of a storage slot.
+     * @param _contract Address of the contract to modify.
+     * @param _key 32 byte key of the storage slot.
+     * @param _value 32 byte storage slot value.
+     */
+    function _putContractStorage(
+        address _contract,
+        bytes32 _key,
+        bytes32 _value
+    )
+        internal
+    {
+        // We don't set storage if the value didn't change. Although this acts as a convenient
+        // optimization, it's also necessary to avoid the case in which a contract with no storage
+        // attempts to store the value "0" at any key. Putting this value (and therefore requiring
+        // that the value be committed into the storage trie after execution) would incorrectly
+        // modify the storage root.
+        Iif (_getContractStorage(_contract, _key) == _value) {
+            return;
+        }
+ 
+        _checkContractStorageChange(_contract, _key);
+        ovmStateManager.putContractStorage(_contract, _key, _value);
+    }
+ 
+    /**
+     * Validation whenever a contract needs to be loaded. Checks that the account exists, charges
+     * nuisance gas if the account hasn't been loaded before.
+     * @param _address Address of the account to load.
+     */
+    function _checkAccountLoad(
+        address _address
+    )
+        internal
+    {
+        // See `_checkContractStorageLoad` for more information.
+        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
+            _revertWithFlag(RevertFlag.OUT_OF_GAS);
+        }
+ 
+        // See `_checkContractStorageLoad` for more information.
+        if (ovmStateManager.hasAccount(_address) == false) {
+            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
+        }
+ 
+        // Check whether the account has been loaded before and mark it as loaded if not. We need
+        // this because "nuisance gas" only applies to the first time that an account is loaded.
+        (
+            bool _wasAccountAlreadyLoaded
+        ) = ovmStateManager.testAndSetAccountLoaded(_address);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
+        // on the size of the contract code.
+        if (_wasAccountAlreadyLoaded == false) {
+            _useNuisanceGas(
+                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
+            );
+        }
+    }
+ 
+    /**
+     * Validation whenever a contract needs to be changed. Checks that the account exists, charges
+     * nuisance gas if the account hasn't been changed before.
+     * @param _address Address of the account to change.
+     */
+    function _checkAccountChange(
+        address _address
+    )
+        internal
+    {
+        // Start by checking for a load as we only want to charge nuisance gas proportional to
+        // contract size once.
+        _checkAccountLoad(_address);
+ 
+        // Check whether the account has been changed before and mark it as changed if not. We need
+        // this because "nuisance gas" only applies to the first time that an account is changed.
+        (
+            bool _wasAccountAlreadyChanged
+        ) = ovmStateManager.testAndSetAccountChanged(_address);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
+        // on the size of the contract code.
+        if (_wasAccountAlreadyChanged == false) {
+            ovmStateManager.incrementTotalUncommittedAccounts();
+            _useNuisanceGas(
+                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
+            );
+        }
+    }
+ 
+    /**
+     * Validation whenever a slot needs to be loaded. Checks that the account exists, charges
+     * nuisance gas if the slot hasn't been loaded before.
+     * @param _contract Address of the account to load from.
+     * @param _key 32 byte key to load.
+     */
+    function _checkContractStorageLoad(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+    {
+        // Another case of hidden complexity. If we didn't enforce this requirement, then a
+        // contract could pass in just enough gas to cause the INVALID_STATE_ACCESS check to fail
+        // on L1 but not on L2. A contract could use this behavior to prevent the
+        // OVM_ExecutionManager from detecting an invalid state access. Reverting with OUT_OF_GAS
+        // allows us to also charge for the full message nuisance gas, because you deserve that for
+        // trying to break the contract in this way.
+        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
+            _revertWithFlag(RevertFlag.OUT_OF_GAS);
+        }
+ 
+        // We need to make sure that the transaction isn't trying to access storage that hasn't
+        // been provided to the OVM_StateManager. We'll immediately abort if this is the case.
+        // We know that we have enough gas to do this check because of the above test.
+        Iif (ovmStateManager.hasContractStorage(_contract, _key) == false) {
+            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
+        }
+ 
+        // Check whether the slot has been loaded before and mark it as loaded if not. We need
+        // this because "nuisance gas" only applies to the first time that a slot is loaded.
+        (
+            bool _wasContractStorageAlreadyLoaded
+        ) = ovmStateManager.testAndSetContractStorageLoaded(_contract, _key);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge some fixed amount of
+        // "nuisance gas".
+        if (_wasContractStorageAlreadyLoaded == false) {
+            _useNuisanceGas(NUISANCE_GAS_SLOAD);
+        }
+    }
+ 
+    /**
+     * Validation whenever a slot needs to be changed. Checks that the account exists, charges
+     * nuisance gas if the slot hasn't been changed before.
+     * @param _contract Address of the account to change.
+     * @param _key 32 byte key to change.
+     */
+    function _checkContractStorageChange(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+    {
+        // Start by checking for load to make sure we have the storage slot and that we charge the
+        // "nuisance gas" necessary to prove the storage slot state.
+        _checkContractStorageLoad(_contract, _key);
+ 
+        // Check whether the slot has been changed before and mark it as changed if not. We need
+        // this because "nuisance gas" only applies to the first time that a slot is changed.
+        (
+            bool _wasContractStorageAlreadyChanged
+        ) = ovmStateManager.testAndSetContractStorageChanged(_contract, _key);
+ 
+        // If we hadn't already changed the account, then we'll need to charge some fixed amount of
+        // "nuisance gas".
+        Eif (_wasContractStorageAlreadyChanged == false) {
+            // Changing a storage slot means that we're also going to have to change the
+            // corresponding account, so do an account change check.
+            _checkAccountChange(_contract);
+ 
+            ovmStateManager.incrementTotalUncommittedContractStorage();
+            _useNuisanceGas(NUISANCE_GAS_SSTORE);
+        }
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Revert Logic *
+     ************************************/
+ 
+    /**
+     * Simple encoding for revert data.
+     * @param _flag Flag to revert with.
+     * @param _data Additional user-provided revert data.
+     * @return _revertdata Encoded revert data.
+     */
+    function _encodeRevertData(
+        RevertFlag _flag,
+        bytes memory _data
+    )
+        internal
+        view
+        returns (
+            bytes memory _revertdata
+        )
+    {
+        // Out of gas and create exceptions will fundamentally return no data, so simulating it shouldn't either.
+        Iif (
+            _flag == RevertFlag.OUT_OF_GAS
+        ) {
+            return bytes('');
+        }
+ 
+        // INVALID_STATE_ACCESS doesn't need to return any data other than the flag.
+        if (_flag == RevertFlag.INVALID_STATE_ACCESS) {
+            return abi.encode(
+                _flag,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        // Just ABI encode the rest of the parameters.
+        return abi.encode(
+            _flag,
+            messageRecord.nuisanceGasLeft,
+            transactionRecord.ovmGasRefund,
+            _data
+        );
+    }
+ 
+    /**
+     * Simple decoding for revert data.
+     * @param _revertdata Revert data to decode.
+     * @return _flag Flag used to revert.
+     * @return _nuisanceGasLeft Amount of nuisance gas unused by the message.
+     * @return _ovmGasRefund Amount of gas refunded during the message.
+     * @return _data Additional user-provided revert data.
+     */
+    function _decodeRevertData(
+        bytes memory _revertdata
+    )
+        internal
+        pure
+        returns (
+            RevertFlag _flag,
+            uint256 _nuisanceGasLeft,
+            uint256 _ovmGasRefund,
+            bytes memory _data
+        )
+    {
+        // A length of zero means the call ran out of gas, just return empty data.
+        if (_revertdata.length == 0) {
+            return (
+                RevertFlag.OUT_OF_GAS,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        // ABI decode the incoming data.
+        return abi.decode(_revertdata, (RevertFlag, uint256, uint256, bytes));
+    }
+ 
+    /**
+     * Causes a message to revert or abort.
+     * @param _flag Flag to revert with.
+     * @param _data Additional user-provided data.
+     */
+    function _revertWithFlag(
+        RevertFlag _flag,
+        bytes memory _data
+    )
+        internal
+        view
+    {
+        bytes memory revertdata = _encodeRevertData(
+            _flag,
+            _data
+        );
+ 
+        assembly {
+            revert(add(revertdata, 0x20), mload(revertdata))
+        }
+    }
+ 
+    /**
+     * Causes a message to revert or abort.
+     * @param _flag Flag to revert with.
+     */
+    function _revertWithFlag(
+        RevertFlag _flag
+    )
+        internal
+    {
+        _revertWithFlag(_flag, bytes(''));
+    }
+ 
+ 
+    /******************************************
+     * Internal Functions: Nuisance Gas Logic *
+     ******************************************/
+ 
+    /**
+     * Computes the nuisance gas limit from the gas limit.
+     * @dev This function is currently using a naive implementation whereby the nuisance gas limit
+     *      is set to exactly equal the lesser of the gas limit or remaining gas. It's likely that
+     *      this implementation is perfectly fine, but we may change this formula later.
+     * @param _gasLimit Gas limit to compute from.
+     * @return _nuisanceGasLimit Computed nuisance gas limit.
+     */
+    function _getNuisanceGasLimit(
+        uint256 _gasLimit
+    )
+        internal
+        view
+        returns (
+            uint256 _nuisanceGasLimit
+        )
+    {
+        return _gasLimit < gasleft() ? _gasLimit : gasleft();
+    }
+ 
+    /**
+     * Uses a certain amount of nuisance gas.
+     * @param _amount Amount of nuisance gas to use.
+     */
+    function _useNuisanceGas(
+        uint256 _amount
+    )
+        internal
+    {
+        // Essentially the same as a standard OUT_OF_GAS, except we also retain a record of the gas
+        // refund to be given at the end of the transaction.
+        Iif (messageRecord.nuisanceGasLeft < _amount) {
+            _revertWithFlag(RevertFlag.EXCEEDS_NUISANCE_GAS);
+        }
+ 
+        messageRecord.nuisanceGasLeft -= _amount;
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Gas Metering *
+     ************************************/
+ 
+    /**
+     * Checks whether a transaction needs to start a new epoch and does so if necessary.
+     * @param _timestamp Transaction timestamp.
+     */
+    function _checkNeedsNewEpoch(
+        uint256 _timestamp
+    )
+        internal
+    {
+        if (
+            _timestamp >= (
+                _getGasMetadata(GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP)
+                + gasMeterConfig.secondsPerEpoch
+            )
+        ) {
+            _putGasMetadata(
+                GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP,
+                _timestamp
+            );
+ 
+            _putGasMetadata(
+                GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS,
+                _getGasMetadata(
+                    GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS
+                )
+            );
+ 
+            _putGasMetadata(
+                GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS,
+                _getGasMetadata(
+                    GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS
+                )
+            );
+        }
+    }
+ 
+    /**
+     * Validates the gas limit for a given transaction.
+     * @param _gasLimit Gas limit provided by the transaction.
+     * param _queueOrigin Queue from which the transaction originated.
+     * @return _valid Whether or not the gas limit is valid.
+     */
+    function _isValidGasLimit(
+        uint256 _gasLimit,
+        Lib_OVMCodec.QueueOrigin // _queueOrigin
+    )
+        view
+        internal
+        returns (
+            bool _valid
+        )
+    {
+        // Always have to be below the maximum gas limit.
+        Iif (_gasLimit > gasMeterConfig.maxTransactionGasLimit) {
+            return false;
+        }
+ 
+        // Always have to be above the minimum gas limit.
+        Iif (_gasLimit < gasMeterConfig.minTransactionGasLimit) {
+            return false;
+        }
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        return true;
+        // GasMetadataKey cumulativeGasKey;
+        // GasMetadataKey prevEpochGasKey;
+        // if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
+        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
+        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS;
+        // } else {
+        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
+        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS;
+        // }
+ 
+        // return (
+        //     (
+        //         _getGasMetadata(cumulativeGasKey)
+        //         - _getGasMetadata(prevEpochGasKey)
+        //         + _gasLimit
+        //     ) < gasMeterConfig.maxGasPerQueuePerEpoch
+        // );
+    }
+ 
+    /**
+     * Updates the cumulative gas after a transaction.
+     * @param _gasUsed Gas used by the transaction.
+     * @param _queueOrigin Queue from which the transaction originated.
+     */
+    function _updateCumulativeGas(
+        uint256 _gasUsed,
+        Lib_OVMCodec.QueueOrigin _queueOrigin
+    )
+        internal
+    {
+        GasMetadataKey cumulativeGasKey;
+        if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
+            cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
+        } else {
+            cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
+        }
+ 
+        _putGasMetadata(
+            cumulativeGasKey,
+            (
+                _getGasMetadata(cumulativeGasKey)
+                + gasMeterConfig.minTransactionGasLimit
+                + _gasUsed
+                - transactionRecord.ovmGasRefund
+            )
+        );
+    }
+ 
+    /**
+     * Retrieves the value of a gas metadata key.
+     * @param _key Gas metadata key to retrieve.
+     * @return _value Value stored at the given key.
+     */
+    function _getGasMetadata(
+        GasMetadataKey _key
+    )
+        internal
+        returns (
+            uint256 _value
+        )
+    {
+        return uint256(_getContractStorage(
+            GAS_METADATA_ADDRESS,
+            bytes32(uint256(_key))
+        ));
+    }
+ 
+    /**
+     * Sets the value of a gas metadata key.
+     * @param _key Gas metadata key to set.
+     * @param _value Value to store at the given key.
+     */
+    function _putGasMetadata(
+        GasMetadataKey _key,
+        uint256 _value
+    )
+        internal
+    {
+        _putContractStorage(
+            GAS_METADATA_ADDRESS,
+            bytes32(uint256(_key)),
+            bytes32(uint256(_value))
+        );
+    }
+ 
+ 
+    /*****************************************
+     * Internal Functions: Execution Context *
+     *****************************************/
+ 
+    /**
+     * Swaps over to a new message context.
+     * @param _prevMessageContext Context we're switching from.
+     * @param _nextMessageContext Context we're switching to.
+     */
+    function _switchMessageContext(
+        MessageContext memory _prevMessageContext,
+        MessageContext memory _nextMessageContext
+    )
+        internal
+    {
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.ovmCALLER != _nextMessageContext.ovmCALLER) {
+            messageContext.ovmCALLER = _nextMessageContext.ovmCALLER;
+        }
+ 
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.ovmADDRESS != _nextMessageContext.ovmADDRESS) {
+            messageContext.ovmADDRESS = _nextMessageContext.ovmADDRESS;
+        }
+ 
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.isStatic != _nextMessageContext.isStatic) {
+            messageContext.isStatic = _nextMessageContext.isStatic;
+        }
+    }
+ 
+    /**
+     * Initializes the execution context.
+     * @param _transaction OVM transaction being executed.
+     */
+    function _initContext(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        internal
+    {
+        transactionContext.ovmTIMESTAMP = _transaction.timestamp;
+        transactionContext.ovmNUMBER = _transaction.blockNumber;
+        transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
+        transactionContext.ovmL1QUEUEORIGIN = _transaction.l1QueueOrigin;
+        transactionContext.ovmL1TXORIGIN = _transaction.l1TxOrigin;
+        transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
+ 
+        messageRecord.nuisanceGasLeft = _getNuisanceGasLimit(_transaction.gasLimit);
+    }
+ 
+    /**
+     * Resets the transaction and message context.
+     */
+    function _resetContext()
+        internal
+    {
+        transactionContext.ovmL1TXORIGIN = address(0);
+        transactionContext.ovmTIMESTAMP = 0;
+        transactionContext.ovmNUMBER = 0;
+        transactionContext.ovmGASLIMIT = 0;
+        transactionContext.ovmTXGASLIMIT = 0;
+        transactionContext.ovmL1QUEUEORIGIN = Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE;
+ 
+        transactionRecord.ovmGasRefund = 0;
+ 
+        messageContext.ovmCALLER = address(0);
+        messageContext.ovmADDRESS = address(0);
+        messageContext.isStatic = false;
+ 
+        messageRecord.nuisanceGasLeft = 0;
+    }
+ 
+    /*****************************
+     * L2-only Helper Functions *
+     *****************************/
+ 
+    /**
+     * Unreachable helper function for simulating eth_calls with an OVM message context.
+     * This function will throw an exception in all cases other than when used as a custom entrypoint in L2 Geth to simulate eth_call.
+     * @param _transaction the message transaction to simulate.
+     * @param _from the OVM account the simulated call should be from.
+     */
+    function simulateMessage(
+        Lib_OVMCodec.Transaction memory _transaction,
+        address _from,
+        iOVM_StateManager _ovmStateManager
+    )
+        external
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        // Prevent this call from having any effect unless in a custom-set VM frame
+        require(msg.sender == address(0));
+ 
+        ovmStateManager = _ovmStateManager;
+        _initContext(_transaction);
+        messageRecord.nuisanceGasLeft = uint(-1);
+ 
+        messageContext.ovmADDRESS = _from;
+ 
+        bool isCreate = _transaction.entrypoint == address(0);
+        if (isCreate) {
+            (address created, bytes memory revertData) = ovmCREATE(_transaction.data);
+            if (created == address(0)) {
+                return (false, revertData);
+            } else {
+                // The eth_call RPC endpoint for to = undefined will return the deployed bytecode 
+                // in the success case, differing from standard create messages.
+                return (true, Lib_EthUtils.getCode(created));
+            }
+        } else {
+            return ovmCALL(
+                _transaction.gasLimit,
+                _transaction.entrypoint,
+                _transaction.data
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html new file mode 100644 index 000000000..90baa02d9 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html @@ -0,0 +1,509 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/execution/ OVM_SafetyChecker.sol +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +277× +  +  +  +  +  +  +  +  +  +  +277× +  +277× +  +277× +  +277× +277× +277× +  +  +277× +277× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +152× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
+ 
+/**
+ * @title OVM_SafetyChecker
+ * @dev  The Safety Checker verifies that contracts deployed on L2 do not contain any
+ * "unsafe" operations. An operation is considered unsafe if it would access state variables which
+ * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used
+ * to "escape the sandbox" of the OVM, resulting in non-deterministic fraud proofs. 
+ * That is, an attacker would be able to "prove fraud" on an honestly applied transaction.
+ * Note that a "safe" contract requires opcodes to appear in a particular pattern;
+ * omission of "unsafe" opcodes is necessary, but not sufficient.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_SafetyChecker is iOVM_SafetyChecker {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Returns whether or not all of the provided bytecode is safe.
+     * @param _bytecode The bytecode to safety check.
+     * @return `true` if the bytecode is safe, `false` otherwise.
+     */
+    function isBytecodeSafe(
+        bytes memory _bytecode
+    )
+        override
+        external
+        pure
+        returns (
+            bool
+        )
+    {
+        // autogenerated by gen_safety_checker_constants.py
+        // number of bytes to skip for each opcode
+        uint256[8] memory opcodeSkippableBytes = [
+            uint256(0x0001010101010101010101010000000001010101010101010101010101010000),
+            uint256(0x0100000000000000000000000000000000000000010101010101000000010100),
+            uint256(0x0000000000000000000000000000000001010101000000010101010100000000),
+            uint256(0x0203040500000000000000000000000000000000000000000000000000000000),
+            uint256(0x0101010101010101010101010101010101010101010101010101010101010101),
+            uint256(0x0101010101000000000000000000000000000000000000000000000000000000),
+            uint256(0x0000000000000000000000000000000000000000000000000000000000000000),
+            uint256(0x0000000000000000000000000000000000000000000000000000000000000000)
+        ];
+        // Mask to gate opcode specific cases
+        uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);
+        // Halting opcodes
+        uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);
+        // PUSH opcodes
+        uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);
+ 
+        uint256 codeLength;
+        uint256 _pc;
+        assembly {
+            _pc := add(_bytecode, 0x20)
+        }
+        codeLength = _pc + _bytecode.length;
+        do {
+            // current opcode: 0x00...0xff
+            uint256 opNum;
+ 
+            // inline assembly removes the extra add + bounds check
+            assembly {
+                let word := mload(_pc) //load the next 32 bytes at pc into word
+ 
+                // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord
+                // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4
+                // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).
+                // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,
+                // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.
+                let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                _pc := add(_pc, indexInWord)
+ 
+                opNum := byte(indexInWord, word)
+            }
+ 
+            // + push opcodes
+            // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]
+            // + caller opcode CALLER(0x33)
+            // + blacklisted opcodes
+            uint256 opBit = 1 << opNum;
+            if (opBit & opcodeGateMask == 0) {
+                if (opBit & opcodePushMask == 0) {
+                    // all pushes are valid opcodes
+                    // subsequent bytes are not opcodes. Skip them.
+                    _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to
+                    // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)
+                    continue;
+                } else if (opBit & opcodeHaltingMask == 0) {
+                    // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)
+                    // We are now inside unreachable code until we hit a JUMPDEST!
+                    do {
+                        _pc++;
+                        assembly {
+                            opNum := byte(0, mload(_pc))
+                        }
+                        // encountered a JUMPDEST
+                        if (opNum == 0x5b) break;
+                        // skip PUSHed bytes
+                        if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)
+                    } while (_pc < codeLength);
+                    // opNum is 0x5b, so we don't continue here since the pc++ is fine
+                } else if (opNum == 0x33) { // Caller opcode
+                    uint256 firstOps; // next 32 bytes of bytecode
+                    uint256 secondOps; // following 32 bytes of bytecode
+ 
+                    assembly {
+                        firstOps := mload(_pc)
+                        // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits
+                        secondOps := shr(216, mload(add(_pc, 0x20)))
+                    }
+ 
+                    // Call identity precompile
+                    // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL
+                    // 32 - 8 bytes = 24 bytes = 192
+                    if ((firstOps >> 192) == 0x3350600060045af1) {
+                        _pc += 8;
+                    // Call EM and abort execution if instructed
+                    // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST 
+                    } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {
+                        _pc += 37;
+                    } else {
+                        return false;
+                    }
+                    continue;
+                } else {
+                    // encountered a non-whitelisted opcode!
+                    return false;
+                }
+            }
+            _pc++;
+        } while (_pc < codeLength);
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html new file mode 100644 index 000000000..35ac577fa --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html @@ -0,0 +1,2279 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/OVM_StateManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/execution/ OVM_StateManager.sol +

+
+
+ 79.69% + Statements + 51/64 +
+
+ 100% + Branches + 12/12 +
+
+ 80% + Functions + 28/35 +
+
+ 80% + Lines + 52/65 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +348× +  +  +  +  +  +  +  +  +  +  +  +  +  +1041× +  +  +  +1040× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +58× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +33× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +35× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +62× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +371× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +32× +32× +32× +32× +32× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +19× +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +543× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +66× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +73× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +38× +  +  +  +  +  +  +38× +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +62× +  +  +  + +  +  +  +55× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +77× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +74× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +33× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +616× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +107× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +707× +  +707× +282× +  +  +707× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+ 
+/**
+ * @title OVM_StateManager
+ * @dev The State Manager contract holds all storage values for contracts in the OVM. It can only be written to by the
+ * the Execution Manager and State Transitioner. It runs on L1 during the setup and execution of a fraud proof.
+ * The same logic runs on L2, but has been implemented as a precompile in the L2 go-ethereum client
+ * (see https://github.com/ethereum-optimism/go-ethereum/blob/master/core/vm/ovm_state_manager.go).
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateManager is iOVM_StateManager {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 constant internal EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
+    bytes32 constant internal EMPTY_ACCOUNT_CODE_HASH =    0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
+    bytes32 constant internal STORAGE_XOR_VALUE =          0xFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEF;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    address override public owner;
+    address override public ovmExecutionManager;
+    mapping (address => Lib_OVMCodec.Account) internal accounts;
+    mapping (address => mapping (bytes32 => bytes32)) internal contractStorage;
+    mapping (address => mapping (bytes32 => bool)) internal verifiedContractStorage;
+    mapping (bytes32 => ItemState) internal itemStates;
+    uint256 internal totalUncommittedAccounts;
+    uint256 internal totalUncommittedContractStorage;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _owner Address of the owner of this contract.
+     */
+    constructor(
+        address _owner
+    )
+    {
+        owner = _owner;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Simple authentication, this contract should only be accessible to the owner (which is expected to be the State Transitioner during `PRE_EXECUTION` 
+     * or the OVM_ExecutionManager during transaction execution.
+     */
+    modifier authenticated() {
+        // owner is the State Transitioner
+        require(
+            msg.sender == owner || msg.sender == ovmExecutionManager,
+            "Function can only be called by authenticated addresses"
+        );
+        _;
+    }
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Checks whether a given address is allowed to modify this contract.
+     * @param _address Address to check.
+     * @return Whether or not the address can modify this contract.
+     */
+    function isAuthenticated(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return (_address == owner || _address == ovmExecutionManager);
+    }
+ 
+    /**
+     * Sets the address of the OVM_ExecutionManager.
+     * @param _ovmExecutionManager Address of the OVM_ExecutionManager.
+     */
+    function setExecutionManager(
+        address _ovmExecutionManager
+    )
+        override
+        public
+        authenticated
+    {
+        ovmExecutionManager = _ovmExecutionManager;
+    }
+ 
+    /**
+     * Inserts an account into the state.
+     * @param _address Address of the account to insert.
+     * @param _account Account to insert for the given address.
+     */
+    function putAccount(
+        address _address,
+        Lib_OVMCodec.Account memory _account
+    )
+        override
+        public
+        authenticated
+    {
+        accounts[_address] = _account;
+    }
+ 
+    /**
+     * Marks an account as empty.
+     * @param _address Address of the account to mark.
+     */
+    function putEmptyAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
+        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
+    }
+ 
+    /**
+     * Retrieves an account from the state.
+     * @param _address Address of the account to retrieve.
+     * @return Account for the given address.
+     */
+    function getAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.Account memory
+        )
+    {
+        return accounts[_address];
+    }
+ 
+    /**
+     * Checks whether the state has a given account.
+     * @param _address Address of the account to check.
+     * @return Whether or not the state has the account.
+     */
+    function hasAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return accounts[_address].codeHash != bytes32(0);
+    }
+ 
+    /**
+     * Checks whether the state has a given known empty account.
+     * @param _address Address of the account to check.
+     * @return Whether or not the state has the empty account.
+     */
+    function hasEmptyAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return (
+            accounts[_address].codeHash == EMPTY_ACCOUNT_CODE_HASH
+            && accounts[_address].nonce == 0
+        );
+    }
+ 
+    /**
+     * Sets the nonce of an account.
+     * @param _address Address of the account to modify.
+     * @param _nonce New account nonce.
+     */
+    function setAccountNonce(
+        address _address,
+        uint256 _nonce
+    )
+        override
+        public
+        authenticated
+    {
+        accounts[_address].nonce = _nonce;
+    }
+ 
+    /**
+     * Gets the nonce of an account.
+     * @param _address Address of the account to access.
+     * @return Nonce of the account.
+     */
+    function getAccountNonce(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return accounts[_address].nonce;
+    }
+ 
+    /**
+     * Retrieves the Ethereum address of an account.
+     * @param _address Address of the account to access.
+     * @return Corresponding Ethereum address.
+     */
+    function getAccountEthAddress(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            address
+        )
+    {
+        return accounts[_address].ethAddress;
+    }
+ 
+    /**
+     * Retrieves the storage root of an account.
+     * @param _address Address of the account to access.
+     * @return Corresponding storage root.
+     */
+    function getAccountStorageRoot(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        return accounts[_address].storageRoot;
+    }
+ 
+    /**
+     * Initializes a pending account (during CREATE or CREATE2) with the default values.
+     * @param _address Address of the account to initialize.
+     */
+    function initPendingAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.nonce = 1;
+        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
+        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
+        account.isFresh = true;
+    }
+ 
+    /**
+     * Finalizes the creation of a pending account (during CREATE or CREATE2).
+     * @param _address Address of the account to finalize.
+     * @param _ethAddress Address of the account's associated contract on Ethereum.
+     * @param _codeHash Hash of the account's code.
+     */
+    function commitPendingAccount(
+        address _address,
+        address _ethAddress,
+        bytes32 _codeHash
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.ethAddress = _ethAddress;
+        account.codeHash = _codeHash;
+    }
+ 
+    /**
+     * Checks whether an account has already been retrieved, and marks it as retrieved if not.
+     * @param _address Address of the account to check.
+     * @return Whether or not the account was already loaded.
+     */
+    function testAndSetAccountLoaded(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_address),
+            ItemState.ITEM_LOADED
+        );
+    }
+ 
+    /**
+     * Checks whether an account has already been modified, and marks it as modified if not.
+     * @param _address Address of the account to check.
+     * @return Whether or not the account was already modified.
+     */
+    function testAndSetAccountChanged(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_address),
+            ItemState.ITEM_CHANGED
+        );
+    }
+ 
+    /**
+     * Attempts to mark an account as committed.
+     * @param _address Address of the account to commit.
+     * @return Whether or not the account was committed.
+     */
+    function commitAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        if (itemStates[item] != ItemState.ITEM_CHANGED) {
+            return false;
+        }
+ 
+        itemStates[item] = ItemState.ITEM_COMMITTED;
+        totalUncommittedAccounts -= 1;
+ 
+        return true;
+    }
+ 
+    /**
+     * Increments the total number of uncommitted accounts.
+     */
+    function incrementTotalUncommittedAccounts()
+        override
+        public
+        authenticated
+    {
+        totalUncommittedAccounts += 1;
+    }
+ 
+    /**
+     * Gets the total number of uncommitted accounts.
+     * @return Total uncommitted accounts.
+     */
+    function getTotalUncommittedAccounts()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return totalUncommittedAccounts;
+    }
+ 
+    /**
+     * Checks whether a given account was changed during execution.
+     * @param _address Address to check.
+     * @return Whether or not the account was changed.
+     */
+    function wasAccountChanged(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        return itemStates[item] >= ItemState.ITEM_CHANGED;
+    }
+ 
+    /**
+     * Checks whether a given account was committed after execution.
+     * @param _address Address to check.
+     * @return Whether or not the account was committed.
+     */
+    function wasAccountCommitted(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        return itemStates[item] >= ItemState.ITEM_COMMITTED;
+    }
+ 
+ 
+    /************************************
+     * Public Functions: Storage Access *
+     ************************************/
+ 
+    /**
+     * Changes a contract storage slot value.
+     * @param _contract Address of the contract to modify.
+     * @param _key 32 byte storage slot key.
+     * @param _value 32 byte storage slot value.
+     */
+    function putContractStorage(
+        address _contract,
+        bytes32 _key,
+        bytes32 _value
+    )
+        override
+        public
+        authenticated
+    {
+        // A hilarious optimization. `SSTORE`ing a value of `bytes32(0)` is common enough that it's
+        // worth populating this with a non-zero value in advance (during the fraud proof
+        // initialization phase) to cut the execution-time cost down to 5000 gas.
+        contractStorage[_contract][_key] = _value ^ STORAGE_XOR_VALUE;
+ 
+        // Only used when initially populating the contract storage. OVM_ExecutionManager will
+        // perform a `hasContractStorage` INVALID_STATE_ACCESS check before putting any contract
+        // storage because writing to zero when the actual value is nonzero causes a gas
+        // discrepancy. Could be moved into a new `putVerifiedContractStorage` function, or
+        // something along those lines.
+        if (verifiedContractStorage[_contract][_key] == false) {
+            verifiedContractStorage[_contract][_key] = true;
+        }
+    }
+ 
+    /**
+     * Retrieves a contract storage slot value.
+     * @param _contract Address of the contract to access.
+     * @param _key 32 byte storage slot key.
+     * @return 32 byte storage slot value.
+     */
+    function getContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        // Storage XOR system doesn't work for newly created contracts that haven't set this
+        // storage slot value yet.
+        if (
+            verifiedContractStorage[_contract][_key] == false
+            && accounts[_contract].isFresh
+        ) {
+            return bytes32(0);
+        }
+ 
+        // See `putContractStorage` for more information about the XOR here.
+        return contractStorage[_contract][_key] ^ STORAGE_XOR_VALUE;
+    }
+ 
+    /**
+     * Checks whether a contract storage slot exists in the state.
+     * @param _contract Address of the contract to access.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the key was set in the state.
+     */
+    function hasContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return verifiedContractStorage[_contract][_key] || accounts[_contract].isFresh;
+    }
+ 
+    /**
+     * Checks whether a storage slot has already been retrieved, and marks it as retrieved if not.
+     * @param _contract Address of the contract to check.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the slot was already loaded.
+     */
+    function testAndSetContractStorageLoaded(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_contract, _key),
+            ItemState.ITEM_LOADED
+        );
+    }
+ 
+    /**
+     * Checks whether a storage slot has already been modified, and marks it as modified if not.
+     * @param _contract Address of the contract to check.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the slot was already modified.
+     */
+    function testAndSetContractStorageChanged(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_contract, _key),
+            ItemState.ITEM_CHANGED
+        );
+    }
+ 
+    /**
+     * Attempts to mark a storage slot as committed.
+     * @param _contract Address of the account to commit.
+     * @param _key 32 byte slot key to commit.
+     * @return Whether or not the slot was committed.
+     */
+    function commitContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        if (itemStates[item] != ItemState.ITEM_CHANGED) {
+            return false;
+        }
+ 
+        itemStates[item] = ItemState.ITEM_COMMITTED;
+        totalUncommittedContractStorage -= 1;
+ 
+        return true;
+    }
+ 
+    /**
+     * Increments the total number of uncommitted storage slots.
+     */
+    function incrementTotalUncommittedContractStorage()
+        override
+        public
+        authenticated
+    {
+        totalUncommittedContractStorage += 1;
+    }
+ 
+    /**
+     * Gets the total number of uncommitted storage slots.
+     * @return Total uncommitted storage slots.
+     */
+    function getTotalUncommittedContractStorage()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return totalUncommittedContractStorage;
+    }
+ 
+    /**
+     * Checks whether a given storage slot was changed during execution.
+     * @param _contract Address to check.
+     * @param _key Key of the storage slot to check.
+     * @return Whether or not the storage slot was changed.
+     */
+    function wasContractStorageChanged(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        return itemStates[item] >= ItemState.ITEM_CHANGED;
+    }
+ 
+    /**
+     * Checks whether a given storage slot was committed after execution.
+     * @param _contract Address to check.
+     * @param _key Key of the storage slot to check.
+     * @return Whether or not the storage slot was committed.
+     */
+    function wasContractStorageCommitted(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        return itemStates[item] >= ItemState.ITEM_COMMITTED;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Generates a unique hash for an address.
+     * @param _address Address to generate a hash for.
+     * @return Unique hash for the given address.
+     */
+    function _getItemHash(
+        address _address
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(abi.encodePacked(_address));
+    }
+ 
+    /**
+     * Generates a unique hash for an address/key pair.
+     * @param _contract Address to generate a hash for.
+     * @param _key Key to generate a hash for.
+     * @return Unique hash for the given pair.
+     */
+    function _getItemHash(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(abi.encodePacked(
+            _contract,
+            _key
+        ));
+    }
+ 
+    /**
+     * Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets the
+     * item to the provided state if not.
+     * @param _item 32 byte item ID to check.
+     * @param _minItemState Minimum state that must be satisfied by the item.
+     * @return Whether or not the item was already in the state.
+     */
+    function _testAndSetItemState(
+        bytes32 _item,
+        ItemState _minItemState
+    )
+        internal
+        returns (
+            bool
+        )
+    {
+        bool wasItemState = itemStates[_item] >= _minItemState;
+ 
+        if (wasItemState == false) {
+            itemStates[_item] = _minItemState;
+        }
+ 
+        return wasItemState;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html new file mode 100644 index 000000000..24ddc0ae5 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html @@ -0,0 +1,188 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/execution/ OVM_StateManagerFactory.sol +

+
+
+ 0% + Statements + 0/1 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
+ 
+/* Contract Imports */
+import { OVM_StateManager } from "./OVM_StateManager.sol";
+ 
+/**
+ * @title OVM_StateManagerFactory
+ * @dev The State Manager Factory is called by a State Transitioner's init code, to create a new
+ * State Manager for use in the Fraud Verification process.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateManagerFactory is iOVM_StateManagerFactory {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Creates a new OVM_StateManager
+     * @param _owner Owner of the created contract.
+     * @return New OVM_StateManager instance.
+     */
+    function create(
+        address _owner
+    )
+        override
+        public
+        returns (
+            iOVM_StateManager
+        )
+    {
+        return new OVM_StateManager(_owner);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/index.html new file mode 100644 index 000000000..f8e89be66 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/execution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/execution/ +

+
+
+ 81.88% + Statements + 253/309 +
+
+ 72.34% + Branches + 68/94 +
+
+ 84.69% + Functions + 83/98 +
+
+ 82.39% + Lines + 262/318 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_ExecutionManager.sol
82.2%194/23668.29%56/8288.52%54/6182.64%200/242
OVM_SafetyChecker.sol
100%8/8100%0/0100%1/1100%10/10
OVM_StateManager.sol
79.69%51/64100%12/1280%28/3580%52/65
OVM_StateManagerFactory.sol
0%0/1100%0/00%0/10%0/1
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html new file mode 100644 index 000000000..510331797 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html @@ -0,0 +1,662 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ ERC1820Registry.sol +

+
+
+ 0% + Statements + 0/38 +
+
+ 0% + Branches + 0/22 +
+
+ 0% + Functions + 0/10 +
+
+ 0% + Lines + 0/39 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: CC0-1.0
+/* ERC1820 Pseudo-introspection Registry Contract
+ * This standard defines a universal registry smart contract where any address (contract or regular account) can
+ * register which interface it supports and which smart contract is responsible for its implementation.
+ *
+ * Written in 2019 by Jordi Baylina and Jacques Dafflon
+ *
+ * To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to
+ * this software to the public domain worldwide. This software is distributed without any warranty.
+ *
+ * You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
+ * <http://creativecommons.org/publicdomain/zero/1.0/>.
+ */
+pragma solidity >0.5.0 <0.8.0;
+ 
+/// @dev The interface a contract MUST implement if it is the implementer of
+/// some (other) interface for any address other than itself.
+interface ERC1820ImplementerInterface {
+    /// @notice Indicates whether the contract implements the interface 'interfaceHash' for the address 'addr' or not.
+    /// @param interfaceHash keccak256 hash of the name of the interface
+    /// @param addr Address for which the contract will implement the interface
+    /// @return ERC1820_ACCEPT_MAGIC only if the contract implements 'interfaceHash' for the address 'addr'.
+    function canImplementInterfaceForAddress(bytes32 interfaceHash, address addr) external view returns(bytes32);
+}
+ 
+/**
+ * @title ERC1820 Pseudo-introspection Registry Contract
+ * @author Jordi Baylina and Jacques Dafflon
+ * @dev This contract is the official implementation of the ERC1820 Registry 
+ * For more details, see https://eips.ethereum.org/EIPS/eip-1820
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract ERC1820Registry {
+    bytes4 constant internal INVALID_ID = 0xffffffff;
+    bytes4 constant internal ERC165ID = 0x01ffc9a7;
+    bytes32 constant internal ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
+ 
+    mapping(address => mapping(bytes32 => address)) internal interfaces;
+    mapping(address => address) internal managers;
+    mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
+ 
+    /// @notice Indicates a contract is the 'implementer' of 'interfaceHash' for 'addr'.
+    event InterfaceImplementerSet(address indexed addr, bytes32 indexed interfaceHash, address indexed implementer);
+    /// @notice Indicates 'newManager' is the address of the new manager for 'addr'.
+    event ManagerChanged(address indexed addr, address indexed newManager);
+ 
+    /// @notice Query if an address implements an interface and through which contract.
+    /// @param _addr Address being queried for the implementer of an interface.
+    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
+    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
+    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
+    /// @return The address of the contract which implements the interface '_interfaceHash' for '_addr'
+    /// or '0' if '_addr' did not register an implementer for this interface.
+    function getInterfaceImplementer(address _addr, bytes32 _interfaceHash) external view returns (address) {
+        address addr = _addr == address(0) ? msg.sender : _addr;
+        if (isERC165Interface(_interfaceHash)) {
+            bytes4 erc165InterfaceHash = bytes4(_interfaceHash);
+            return implementsERC165Interface(addr, erc165InterfaceHash) ? addr : address(0);
+        }
+        return interfaces[addr][_interfaceHash];
+    }
+ 
+    /// @notice Sets the contract which implements a specific interface for an address.
+    /// Only the manager defined for that address can set it.
+    /// (Each address is the manager for itself until it sets a new manager.)
+    /// @param _addr Address for which to set the interface.
+    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
+    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
+    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
+    /// @param _implementer Contract address implementing '_interfaceHash' for '_addr'.
+    function setInterfaceImplementer(address _addr, bytes32 _interfaceHash, address _implementer) external {
+        address addr = _addr == address(0) ? msg.sender : _addr;
+        require(getManager(addr) == msg.sender, "Not the manager");
+ 
+        require(!isERC165Interface(_interfaceHash), "Must not be an ERC165 hash");
+        if (_implementer != address(0) && _implementer != msg.sender) {
+            require(
+                ERC1820ImplementerInterface(_implementer)
+                    .canImplementInterfaceForAddress(_interfaceHash, addr) == ERC1820_ACCEPT_MAGIC,
+                "Does not implement the interface"
+            );
+        }
+        interfaces[addr][_interfaceHash] = _implementer;
+        emit InterfaceImplementerSet(addr, _interfaceHash, _implementer);
+    }
+ 
+    /// @notice Sets '_newManager' as manager for '_addr'.
+    /// The new manager will be able to call 'setInterfaceImplementer' for '_addr'.
+    /// @param _addr Address for which to set the new manager.
+    /// @param _newManager Address of the new manager for 'addr'. (Pass '0x0' to reset the manager to '_addr'.)
+    function setManager(address _addr, address _newManager) external {
+        require(getManager(_addr) == msg.sender, "Not the manager");
+        managers[_addr] = _newManager == _addr ? address(0) : _newManager;
+        emit ManagerChanged(_addr, _newManager);
+    }
+ 
+    /// @notice Get the manager of an address.
+    /// @param _addr Address for which to return the manager.
+    /// @return Address of the manager for a given address.
+    function getManager(address _addr) public view returns(address) {
+        // By default the manager of an address is the same address
+        if (managers[_addr] == address(0)) {
+            return _addr;
+        } else {
+            return managers[_addr];
+        }
+    }
+ 
+    /// @notice Compute the keccak256 hash of an interface given its name.
+    /// @param _interfaceName Name of the interface.
+    /// @return The keccak256 hash of an interface name.
+    function interfaceHash(string calldata _interfaceName) external pure returns(bytes32) {
+        return keccak256(abi.encodePacked(_interfaceName));
+    }
+ 
+    /* --- ERC165 Related Functions --- */
+    /* --- Developed in collaboration with William Entriken. --- */
+ 
+    /// @notice Updates the cache with whether the contract implements an ERC165 interface or not.
+    /// @param _contract Address of the contract for which to update the cache.
+    /// @param _interfaceId ERC165 interface for which to update the cache.
+    function updateERC165Cache(address _contract, bytes4 _interfaceId) external {
+        interfaces[_contract][_interfaceId] = implementsERC165InterfaceNoCache(
+            _contract, _interfaceId) ? _contract : address(0);
+        erc165Cached[_contract][_interfaceId] = true;
+    }
+ 
+    /// @notice Checks whether a contract implements an ERC165 interface or not.
+    //  If the result is not cached a direct lookup on the contract address is performed.
+    //  If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
+    //  'updateERC165Cache' with the contract address.
+    /// @param _contract Address of the contract to check.
+    /// @param _interfaceId ERC165 interface to check.
+    /// @return True if '_contract' implements '_interfaceId', false otherwise.
+    function implementsERC165Interface(address _contract, bytes4 _interfaceId) public view returns (bool) {
+        if (!erc165Cached[_contract][_interfaceId]) {
+            return implementsERC165InterfaceNoCache(_contract, _interfaceId);
+        }
+        return interfaces[_contract][_interfaceId] == _contract;
+    }
+ 
+    /// @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
+    /// @param _contract Address of the contract to check.
+    /// @param _interfaceId ERC165 interface to check.
+    /// @return True if '_contract' implements '_interfaceId', false otherwise.
+    function implementsERC165InterfaceNoCache(address _contract, bytes4 _interfaceId) public view returns (bool) {
+        uint256 success;
+        uint256 result;
+ 
+        (success, result) = noThrowCall(_contract, ERC165ID);
+        if (success == 0 || result == 0) {
+            return false;
+        }
+ 
+        (success, result) = noThrowCall(_contract, INVALID_ID);
+        if (success == 0 || result != 0) {
+            return false;
+        }
+ 
+        (success, result) = noThrowCall(_contract, _interfaceId);
+        if (success == 1 && result == 1) {
+            return true;
+        }
+        return false;
+    }
+ 
+    /// @notice Checks whether the hash is a ERC165 interface (ending with 28 zeroes) or not.
+    /// @param _interfaceHash The hash to check.
+    /// @return True if '_interfaceHash' is an ERC165 interface (ending with 28 zeroes), false otherwise.
+    function isERC165Interface(bytes32 _interfaceHash) internal pure returns (bool) {
+        return _interfaceHash & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0;
+    }
+ 
+    /// @dev Make a call on a contract without throwing if the function does not exist.
+    function noThrowCall(address _contract, bytes4 _interfaceId)
+        internal view returns (uint256 success, uint256 result)
+    {
+        bytes4 erc165ID = ERC165ID;
+ 
+        assembly {
+            let x := mload(0x40)               // Find empty storage location using "free memory pointer"
+            mstore(x, erc165ID)                // Place signature at beginning of empty storage
+            mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
+ 
+            success := staticcall(
+                30000,                         // 30k gas
+                _contract,                     // To addr
+                x,                             // Inputs are stored at location x
+                0x24,                          // Inputs are 36 (4 + 32) bytes long
+                x,                             // Store output over input (saves space)
+                0x20                           // Outputs are 32 bytes long
+            )
+ 
+            result := mload(x)                 // Load the result
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html new file mode 100644 index 000000000..bf503a6c9 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html @@ -0,0 +1,701 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_DeployerWhitelist.sol +

+
+
+ 36.36% + Statements + 8/22 +
+
+ 66.67% + Branches + 4/6 +
+
+ 12.5% + Functions + 1/8 +
+
+ 34.78% + Lines + 8/23 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +29× +25× +  +  + +  +  +  + + +  +  + +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+ 
+/* Interface Imports */
+import { iOVM_DeployerWhitelist } from "../../iOVM/predeploys/iOVM_DeployerWhitelist.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_DeployerWhitelist
+ * @dev The Deployer Whitelist is a temporary predeploy used to provide additional safety during the
+ * initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts
+ * which are allowed to deploy contracts on Layer2. The Execution Manager will only allow an 
+ * ovmCREATE or ovmCREATE2 operation to proceed if the deployer's address whitelisted.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_DeployerWhitelist is iOVM_DeployerWhitelist {
+ 
+    /**********************
+     * Contract Constants *
+     **********************/
+ 
+    bytes32 internal constant KEY_INITIALIZED =                0x0000000000000000000000000000000000000000000000000000000000000010;
+    bytes32 internal constant KEY_OWNER =                      0x0000000000000000000000000000000000000000000000000000000000000011;
+    bytes32 internal constant KEY_ALLOW_ARBITRARY_DEPLOYMENT = 0x0000000000000000000000000000000000000000000000000000000000000012;
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+    
+    /**
+     * Blocks functions to anyone except the contract owner.
+     */
+    modifier onlyOwner() {
+        address owner = Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                KEY_OWNER
+            )
+        );
+ 
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_SafeExecutionManagerWrapper.safeCALLER() == owner,
+            "Function can only be called by the owner of this contract."
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+    
+    /**
+     * Initializes the whitelist.
+     * @param _owner Address of the owner for this contract.
+     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
+     */
+    function initialize(
+        address _owner,
+        bool _allowArbitraryDeployment
+    )
+        override
+        public
+    {
+        bool initialized = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
+        );
+ 
+        if (initialized == true) {
+            return;
+        }
+ 
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_INITIALIZED,
+            Lib_Bytes32Utils.fromBool(true)
+        );
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_OWNER,
+            Lib_Bytes32Utils.fromAddress(_owner)
+        );
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
+            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
+        );
+    }
+ 
+    /**
+     * Gets the owner of the whitelist.
+     */
+    function getOwner()
+        override
+        public
+        returns(
+            address
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                KEY_OWNER
+            )
+        );
+    }
+ 
+    /**
+     * Adds or removes an address from the deployment whitelist.
+     * @param _deployer Address to update permissions for.
+     * @param _isWhitelisted Whether or not the address is whitelisted.
+     */
+    function setWhitelistedDeployer(
+        address _deployer,
+        bool _isWhitelisted
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            Lib_Bytes32Utils.fromAddress(_deployer),
+            Lib_Bytes32Utils.fromBool(_isWhitelisted)
+        );
+    }
+ 
+    /**
+     * Updates the owner of this contract.
+     * @param _owner Address of the new owner.
+     */
+    function setOwner(
+        address _owner
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_OWNER,
+            Lib_Bytes32Utils.fromAddress(_owner)
+        );
+    }
+ 
+    /**
+     * Updates the arbitrary deployment flag.
+     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
+     */
+    function setAllowArbitraryDeployment(
+        bool _allowArbitraryDeployment
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
+            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
+        );
+    }
+ 
+    /**
+     * Permanently enables arbitrary contract deployment and deletes the owner.
+     */
+    function enableArbitraryContractDeployment()
+        override
+        public
+        onlyOwner
+    {
+        setAllowArbitraryDeployment(true);
+        setOwner(address(0));
+    }
+ 
+    /**
+     * Checks whether an address is allowed to deploy contracts.
+     * @param _deployer Address to check.
+     * @return _allowed Whether or not the address can deploy contracts.
+     */
+    function isDeployerAllowed(
+        address _deployer
+    )
+        override
+        public
+        returns (
+            bool _allowed
+        )
+    {
+        bool initialized = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
+        );
+ 
+        if (initialized == false) {
+            return true;
+        }
+ 
+        bool allowArbitraryDeployment = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_ALLOW_ARBITRARY_DEPLOYMENT)
+        );
+ 
+        if (allowArbitraryDeployment == true) {
+            return true;
+        }
+ 
+        bool isWhitelisted = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                Lib_Bytes32Utils.fromAddress(_deployer)
+            )
+        );
+ 
+        return isWhitelisted;        
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html new file mode 100644 index 000000000..2aaa2721b --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html @@ -0,0 +1,167 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_ETH.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_ETH.sol +

+
+
+ 0% + Statements + 0/1 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Contract Imports */
+import { OVM_L2DepositedERC20 } from "../bridge/tokens/OVM_L2DepositedERC20.sol";
+ 
+/**
+ * @title OVM_ETH
+ * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that 
+ * unlike on Layer 1, Layer 2 accounts do not have a balance field.
+ * 
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract OVM_ETH is OVM_L2DepositedERC20 {
+    constructor(
+        address _l2CrossDomainMessenger,
+        address _l1ETHGateway
+    ) 
+        OVM_L2DepositedERC20(
+            _l2CrossDomainMessenger,
+            "Ether",
+            "ETH"
+        )
+    {
+        init(iOVM_L1TokenGateway(_l1ETHGateway));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html new file mode 100644 index 000000000..cb471696f --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html @@ -0,0 +1,194 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_L1MessageSender.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_L1MessageSender } from "../../iOVM/predeploys/iOVM_L1MessageSender.sol";
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+ 
+/**
+ * @title OVM_L1MessageSender
+ * @dev The L1MessageSender is a predeploy contract running on L2. During the execution of cross 
+ * domain transaction from L1 to L2, it returns the address of the L1 account (either an EOA or
+ * contract) which sent the message to L2 via the Canonical Transaction Chain's `enqueue()` 
+ * function.
+ * 
+ * This contract exclusively serves as a getter for the ovmL1TXORIGIN operation. This is necessary 
+ * because there is no corresponding operation in the EVM which the the optimistic solidity compiler 
+ * can be replaced with a call to the ExecutionManager's ovmL1TXORIGIN() function.
+ *
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_L1MessageSender is iOVM_L1MessageSender {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @return _l1MessageSender L1 message sender address (msg.sender).
+     */
+    function getL1MessageSender()
+        override
+        public
+        view
+        returns (
+            address _l1MessageSender
+        )
+    {
+        // Note that on L2 msg.sender (ie. evmCALLER) will always be the Execution Manager 
+        return iOVM_ExecutionManager(msg.sender).ovmL1TXORIGIN();
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html new file mode 100644 index 000000000..0795787c0 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html @@ -0,0 +1,215 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_L2ToL1MessagePasser.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_L2ToL1MessagePasser } from "../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
+ 
+/**
+ * @title OVM_L2ToL1MessagePasser
+ * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the 
+ * of a message on L2. The L1 Cross Domain Messenger performs this proof in its
+ * _verifyStorageProof function, which verifies the existence of the transaction hash in this 
+ * contract's `sentMessages` mapping.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    mapping (bytes32 => bool) public sentMessages;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Passes a message to L1.
+     * @param _message Message to pass to L1.
+     */
+    function passMessageToL1(
+        bytes memory _message
+    )
+        override
+        public
+    {
+        // Note: although this function is public, only messages sent from the OVM_L2CrossDomainMessenger 
+        // will be relayed by the OVM_L1CrossDomainMessenger. This is enforced by a check in 
+        // OVM_L1CrossDomainMessenger._verifyStorageProof().
+        sentMessages[keccak256(
+            abi.encodePacked(
+                _message,
+                msg.sender
+            )
+        )] = true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html new file mode 100644 index 000000000..e738ae32f --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html @@ -0,0 +1,413 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_ProxySequencerEntrypoint.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 7/7 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_ProxySequencerEntrypoint 
+ * @dev The Proxy Sequencer Entrypoint is a predeployed proxy to the implementation of the 
+ * Sequencer Entrypoint. This will enable the Optimism team to upgrade the Sequencer Entrypoint 
+ * contract.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ProxySequencerEntrypoint {
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
+            gasleft(),
+            _getImplementation(),
+            msg.data
+        );
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function init(
+        address _implementation,
+        address _owner
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            _getOwner() == address(0),
+            "ProxySequencerEntrypoint has already been inited"
+        );
+        _setOwner(_owner);
+        _setImplementation(_implementation);
+    }
+ 
+    function upgrade(
+        address _implementation
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            _getOwner() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
+            "Only owner can upgrade the Entrypoint"
+        );
+ 
+        _setImplementation(_implementation);
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _setImplementation(
+        address _implementation
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            bytes32(uint256(0)),
+            bytes32(uint256(uint160(_implementation)))
+        );
+    }
+ 
+    function _getImplementation()
+        internal
+        returns (
+            address _implementation
+        )
+    {
+        return address(uint160(uint256(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                bytes32(uint256(0))
+            )
+        )));
+    }
+ 
+    function _setOwner(
+        address _owner
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            bytes32(uint256(1)),
+            bytes32(uint256(uint160(_owner)))
+        );
+    }
+ 
+    function _getOwner()
+        internal
+        returns (
+            address _owner
+        )
+    {
+        return address(uint160(uint256(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                bytes32(uint256(1))
+            )
+        )));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html new file mode 100644 index 000000000..3d96f0a5e --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html @@ -0,0 +1,446 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_SequencerEntrypoint.sol +

+
+
+ 100% + Statements + 18/18 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 17/17 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + + +  +  + + +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  + + +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_SequencerEntrypoint
+ * @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by 
+ * any account. It accepts a more efficient compressed calldata format, which it decompresses and 
+ * encodes to the standard EIP155 transaction format.
+ * This contract is the implementation referenced by the Proxy Sequencer Entrypoint, thus enabling
+ * the Optimism team to upgrade the decompression of calldata from the Sequencer.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_SequencerEntrypoint {
+ 
+    /*********
+     * Enums *
+     *********/
+    
+    enum TransactionType {
+        NATIVE_ETH_TRANSACTION,
+        ETH_SIGNED_MESSAGE
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    /**
+     * Uses a custom "compressed" format to save on calldata gas:
+     * calldata[00:01]: transaction type (0 == EIP 155, 2 == Eth Sign Message)
+     * calldata[01:33]: signature "r" parameter
+     * calldata[33:65]: signature "s" parameter
+     * calldata[65:66]: signature "v" parameter
+     * calldata[66:69]: transaction gas limit
+     * calldata[69:72]: transaction gas price
+     * calldata[72:75]: transaction nonce
+     * calldata[75:95]: transaction target address
+     * calldata[95:XX]: transaction data
+     */
+    fallback()
+        external
+    {
+        TransactionType transactionType = _getTransactionType(Lib_BytesUtils.toUint8(msg.data, 0));
+ 
+        bytes32 r = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 1, 32));
+        bytes32 s = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 33, 32));
+        uint8 v = Lib_BytesUtils.toUint8(msg.data, 65);
+ 
+        // Remainder is the transaction to execute.
+        bytes memory compressedTx = Lib_BytesUtils.slice(msg.data, 66);
+        bool isEthSignedMessage = transactionType == TransactionType.ETH_SIGNED_MESSAGE;
+ 
+        // Need to decompress and then re-encode the transaction based on the original encoding.
+        bytes memory encodedTx = Lib_OVMCodec.encodeEIP155Transaction(
+            Lib_OVMCodec.decompressEIP155Transaction(compressedTx),
+            isEthSignedMessage
+        );
+ 
+        address target = Lib_ECDSAUtils.recover(
+            encodedTx,
+            isEthSignedMessage,
+            uint8(v),
+            r,
+            s
+        );
+ 
+        if (Lib_SafeExecutionManagerWrapper.safeEXTCODESIZE(target) == 0) {
+            // ProxyEOA has not yet been deployed for this EOA.
+            bytes32 messageHash = Lib_ECDSAUtils.getMessageHash(encodedTx, isEthSignedMessage);
+            Lib_SafeExecutionManagerWrapper.safeCREATEEOA(messageHash, uint8(v), r, s);
+        }
+ 
+        // ProxyEOA has been deployed for this EOA, continue to CALL.
+        bytes memory callbytes = abi.encodeWithSignature(
+            "execute(bytes,uint8,uint8,bytes32,bytes32)",
+            encodedTx,
+            isEthSignedMessage,
+            uint8(v),
+            r,
+            s
+        );
+ 
+        Lib_SafeExecutionManagerWrapper.safeCALL(
+            gasleft(),
+            target,
+            callbytes
+        );
+    }
+    
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Converts a uint256 into a TransactionType enum.
+     * @param _transactionType Transaction type index.
+     * @return _txType Transaction type enum value.
+     */
+    function _getTransactionType(
+        uint8 _transactionType
+    )
+        internal
+        returns (
+            TransactionType _txType
+        )
+    {
+        if (_transactionType == 0) {
+            return TransactionType.NATIVE_ETH_TRANSACTION;
+        } if (_transactionType == 2) {
+            return TransactionType.ETH_SIGNED_MESSAGE;
+        } else {
+            Lib_SafeExecutionManagerWrapper.safeREVERT(
+                "Transaction type must be 0 or 2"
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/index.html new file mode 100644 index 000000000..82416007a --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/predeploys/ +

+
+
+ 41.76% + Statements + 38/91 +
+
+ 29.41% + Branches + 10/34 +
+
+ 40% + Functions + 12/30 +
+
+ 40.22% + Lines + 37/92 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ERC1820Registry.sol
0%0/380%0/220%0/100%0/39
OVM_DeployerWhitelist.sol
36.36%8/2266.67%4/612.5%1/834.78%8/23
OVM_ETH.sol
0%0/1100%0/00%0/10%0/1
OVM_L1MessageSender.sol
100%1/1100%0/0100%1/1100%1/1
OVM_L2ToL1MessagePasser.sol
100%1/1100%0/0100%1/1100%1/1
OVM_ProxySequencerEntrypoint.sol
100%10/10100%0/0100%7/7100%10/10
OVM_SequencerEntrypoint.sol
100%18/18100%6/6100%2/2100%17/17
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html new file mode 100644 index 000000000..23684e3af --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ Abs_FraudContributor.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +14× +14× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/// Minimal contract to be inherited by contracts consumed by users that provide
+/// data for fraud proofs
+abstract contract Abs_FraudContributor is Lib_AddressResolver {
+    /// Decorate your functions with this modifier to store how much total gas was
+    /// consumed by the sender, to reward users fairly
+    modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
+        uint256 startGas = gasleft();
+        _;
+        uint256 gasSpent = startGas - gasleft();
+        iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html new file mode 100644 index 000000000..1de4a2fa1 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html @@ -0,0 +1,689 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/OVM_BondManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ OVM_BondManager.sol +

+
+
+ 100% + Statements + 42/42 +
+
+ 86.67% + Branches + 26/30 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 41/41 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +63× +  +  +  +  +  +  +  +  +  +  +46× +46× +  +45× +45× +  +  +  +  +  +13× +12× +  +  +  +11× +  +11× +11× + + + +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +11× +  +  +  +  + +  +  +  +10× +  +  +  +  +  +18× +  +  +  +  +  +18× +  +  +  +  + + + +  + + +  +  +  +  + +  + +  +  +  + +  +  + + +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  + + +  +  + +  +  +  + +  +  + +  +  + +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_BondManager, Errors, ERC20 } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+ 
+/**
+ * @title OVM_BondManager
+ * @dev The Bond Manager contract handles deposits in the form of an ERC20 token from bonded 
+ * Proposers. It also handles the accounting of gas costs spent by a Verifier during the course of a
+ * fraud proof. In the event of a successful fraud proof, the fraudulent Proposer's bond is slashed, 
+ * and the Verifier's gas costs are refunded.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
+ 
+    /****************************
+     * Constants and Parameters *
+     ****************************/
+ 
+    /// The period to find the earliest fraud proof for a publisher
+    uint256 public constant multiFraudProofPeriod = 7 days;
+ 
+    /// The dispute period
+    uint256 public constant disputePeriodSeconds = 7 days;
+ 
+    /// The minimum collateral a sequencer must post
+    uint256 public constant requiredCollateral = 1 ether;
+ 
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    /// The bond token
+    ERC20 immutable public token;
+ 
+ 
+    /********************************************
+     * Contract Variables: Internal Accounting  *
+     *******************************************/
+ 
+    /// The bonds posted by each proposer
+    mapping(address => Bond) public bonds;
+ 
+    /// For each pre-state root, there's an array of witnessProviders that must be rewarded
+    /// for posting witnesses
+    mapping(bytes32 => Rewards) public witnessProviders;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /// Initializes with a ERC20 token to be used for the fidelity bonds
+    /// and with the Address Manager
+    constructor(
+        ERC20 _token,
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        token = _token;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /// Adds `who` to the list of witnessProviders for the provided `preStateRoot`.
+    function recordGasSpent(bytes32 _preStateRoot, bytes32 _txHash, address who, uint256 gasSpent) override public {
+        // The sender must be the transitioner that corresponds to the claimed pre-state root
+        address transitioner = address(iOVM_FraudVerifier(resolve("OVM_FraudVerifier")).getStateTransitioner(_preStateRoot, _txHash));
+        require(transitioner == msg.sender, Errors.ONLY_TRANSITIONER);
+ 
+        witnessProviders[_preStateRoot].total += gasSpent;
+        witnessProviders[_preStateRoot].gasSpent[who] += gasSpent;
+    }
+ 
+    /// Slashes + distributes rewards or frees up the sequencer's bond, only called by
+    /// `FraudVerifier.finalizeFraudVerification`
+    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) override public {
+        require(msg.sender == resolve("OVM_FraudVerifier"), Errors.ONLY_FRAUD_VERIFIER);
+        require(witnessProviders[_preStateRoot].canClaim == false, Errors.ALREADY_FINALIZED);
+ 
+        // allow users to claim from that state root's
+        // pool of collateral (effectively slashing the sequencer)
+        witnessProviders[_preStateRoot].canClaim = true;
+ 
+        Bond storage bond = bonds[publisher];
+        if (bond.firstDisputeAt == 0) {
+            bond.firstDisputeAt = block.timestamp;
+            bond.earliestDisputedStateRoot = _preStateRoot;
+            bond.earliestTimestamp = timestamp;
+        } else if (
+            // only update the disputed state root for the publisher if it's within
+            // the dispute period _and_ if it's before the previous one
+            block.timestamp < bond.firstDisputeAt + multiFraudProofPeriod &&
+            timestamp < bond.earliestTimestamp
+        ) {
+            bond.earliestDisputedStateRoot = _preStateRoot;
+            bond.earliestTimestamp = timestamp;
+        }
+ 
+        // if the fraud proof's dispute period does not intersect with the 
+        // withdrawal's timestamp, then the user should not be slashed
+        // e.g if a user at day 10 submits a withdrawal, and a fraud proof
+        // from day 1 gets published, the user won't be slashed since day 8 (1d + 7d)
+        // is before the user started their withdrawal. on the contrary, if the user
+        // had started their withdrawal at, say, day 6, they would be slashed
+        if (
+            bond.withdrawalTimestamp != 0 && 
+            uint256(bond.withdrawalTimestamp) > timestamp + disputePeriodSeconds &&
+            bond.state == State.WITHDRAWING
+        ) {
+            return;
+        }
+ 
+        // slash!
+        bond.state = State.NOT_COLLATERALIZED;
+    }
+ 
+    /// Sequencers call this function to post collateral which will be used for
+    /// the `appendBatch` call
+    function deposit() override public {
+        Erequire(
+            token.transferFrom(msg.sender, address(this), requiredCollateral),
+            Errors.ERC20_ERR
+        );
+ 
+        // This cannot overflow
+        bonds[msg.sender].state = State.COLLATERALIZED;
+    }
+ 
+    /// Starts the withdrawal for a publisher
+    function startWithdrawal() override public {
+        Bond storage bond = bonds[msg.sender];
+        Erequire(bond.withdrawalTimestamp == 0, Errors.WITHDRAWAL_PENDING);
+        require(bond.state == State.COLLATERALIZED, Errors.WRONG_STATE);
+ 
+        bond.state = State.WITHDRAWING;
+        bond.withdrawalTimestamp = uint32(block.timestamp);
+    }
+ 
+    /// Finalizes a pending withdrawal from a publisher
+    function finalizeWithdrawal() override public {
+        Bond storage bond = bonds[msg.sender];
+ 
+        require(
+            block.timestamp >= uint256(bond.withdrawalTimestamp) + disputePeriodSeconds, 
+            Errors.TOO_EARLY
+        );
+        require(bond.state == State.WITHDRAWING, Errors.SLASHED);
+        
+        // refunds!
+        bond.state = State.NOT_COLLATERALIZED;
+        bond.withdrawalTimestamp = 0;
+        
+        Erequire(
+            token.transfer(msg.sender, requiredCollateral),
+            Errors.ERC20_ERR
+        );
+    }
+ 
+    /// Claims the user's reward for the witnesses they provided for the earliest
+    /// disputed state root of the designated publisher
+    function claim(address who) override public {
+        Bond storage bond = bonds[who];
+        require(
+            block.timestamp >= bond.firstDisputeAt + multiFraudProofPeriod,
+            Errors.WAIT_FOR_DISPUTES
+        );
+ 
+        // reward the earliest state root for this publisher
+        bytes32 _preStateRoot = bond.earliestDisputedStateRoot;
+        Rewards storage rewards = witnessProviders[_preStateRoot];
+ 
+        // only allow claiming if fraud was proven in `finalize`
+        require(rewards.canClaim, Errors.CANNOT_CLAIM);
+ 
+        // proportional allocation - only reward 50% (rest gets locked in the
+        // contract forever
+        uint256 amount = (requiredCollateral * rewards.gasSpent[msg.sender]) / (2 * rewards.total);
+ 
+        // reset the user's spent gas so they cannot double claim
+        rewards.gasSpent[msg.sender] = 0;
+ 
+        // transfer
+        Erequire(token.transfer(msg.sender, amount), Errors.ERC20_ERR);
+    }
+ 
+    /// Checks if the user is collateralized
+    function isCollateralized(address who) override public view returns (bool) {
+        return bonds[who].state == State.COLLATERALIZED;
+    }
+ 
+    /// Gets how many witnesses the user has provided for the state root
+    function getGasSpent(bytes32 preStateRoot, address who) override public view returns (uint256) {
+        return witnessProviders[preStateRoot].gasSpent[who];
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html new file mode 100644 index 000000000..d513958f4 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html @@ -0,0 +1,953 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ OVM_FraudVerifier.sol +

+
+
+ 96.43% + Statements + 27/28 +
+
+ 94.44% + Branches + 17/18 +
+
+ 100% + Functions + 7/7 +
+
+ 96.43% + Lines + 27/28 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +12× +  +  +  +12× +12× +  +12× +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +10× +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  +  + +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+ 
+/* Contract Imports */
+import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
+ 
+ 
+ 
+/**
+ * @title OVM_FraudVerifier
+ * @dev The Fraud Verifier contract coordinates the entire fraud proof verification process. 
+ * If the fraud proof was successful it prunes any state batches from State Commitment Chain
+ * which were published after the fraudulent state root.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_FraudVerifier is Lib_AddressResolver, Abs_FraudContributor, iOVM_FraudVerifier {
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    mapping (bytes32 => iOVM_StateTransitioner) internal transitioners;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+ 
+    /***************************************
+     * Public Functions: Transition Status *
+     ***************************************/
+ 
+    /**
+     * Retrieves the state transitioner for a given root.
+     * @param _preStateRoot State root to query a transitioner for.
+     * @return _transitioner Corresponding state transitioner contract.
+     */
+    function getStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        override
+        public
+        view
+        returns (
+            iOVM_StateTransitioner _transitioner
+        )
+    {
+        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
+    }
+ 
+ 
+    /****************************************
+     * Public Functions: Fraud Verification *
+     ****************************************/
+ 
+    /**
+     * Begins the fraud verification process.
+     * @param _preStateRoot State root before the fraudulent transaction.
+     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
+     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
+     * @param _transaction OVM transaction claimed to be fraudulent.
+     * @param _txChainElement OVM transaction chain element.
+     * @param _transactionBatchHeader Batch header for the provided transaction.
+     * @param _transactionProof Inclusion proof for the provided transaction.
+     */
+    function initializeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _transactionBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _transactionProof
+    )
+        override
+        public
+        contributesToFraudProof(_preStateRoot, Lib_OVMCodec.hashTransaction(_transaction))
+    {
+        bytes32 _txHash = Lib_OVMCodec.hashTransaction(_transaction);
+ 
+        Iif (_hasStateTransitioner(_preStateRoot, _txHash)) {
+            return;
+        }
+ 
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+        iOVM_CanonicalTransactionChain ovmCanonicalTransactionChain = iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain"));
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _preStateRoot,
+                _preStateRootBatchHeader,
+                _preStateRootProof
+            ),
+            "Invalid pre-state root inclusion proof."
+        );
+ 
+        require(
+            ovmCanonicalTransactionChain.verifyTransaction(
+                _transaction,
+                _txChainElement,
+                _transactionBatchHeader,
+                _transactionProof
+            ),
+            "Invalid transaction inclusion proof."
+        );
+ 
+        require (
+            _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1 == _transactionBatchHeader.prevTotalElements + _transactionProof.index,
+            "Pre-state root global index must equal to the transaction root global index."
+        );
+ 
+        _deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index);
+ 
+        emit FraudProofInitialized(
+            _preStateRoot,
+            _preStateRootProof.index,
+            _txHash,
+            msg.sender
+        );
+    }
+ 
+    /**
+     * Finalizes the fraud verification process.
+     * @param _preStateRoot State root before the fraudulent transaction.
+     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
+     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
+     * @param _txHash The transaction for the state root
+     * @param _postStateRoot State root after the fraudulent transaction.
+     * @param _postStateRootBatchHeader Batch header for the provided post-state root.
+     * @param _postStateRootProof Inclusion proof for the provided post-state root.
+     */
+    function finalizeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
+        bytes32 _txHash,
+        bytes32 _postStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _postStateRootProof
+    )
+        override
+        public
+        contributesToFraudProof(_preStateRoot, _txHash)
+    {
+        iOVM_StateTransitioner transitioner = getStateTransitioner(_preStateRoot, _txHash);
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+ 
+        require(
+            transitioner.isComplete() == true,
+            "State transition process must be completed prior to finalization."
+        );
+ 
+        require (
+            _postStateRootBatchHeader.prevTotalElements + _postStateRootProof.index == _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1,
+            "Post-state root global index must equal to the pre state root global index plus one."
+        );
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _preStateRoot,
+                _preStateRootBatchHeader,
+                _preStateRootProof
+            ),
+            "Invalid pre-state root inclusion proof."
+        );
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _postStateRoot,
+                _postStateRootBatchHeader,
+                _postStateRootProof
+            ),
+            "Invalid post-state root inclusion proof."
+        );
+ 
+        // If the post state root did not match, then there was fraud and we should delete the batch
+        require(
+            _postStateRoot != transitioner.getPostStateRoot(),
+            "State transition has not been proven fraudulent."
+        );
+        
+        _cancelStateTransition(_postStateRootBatchHeader, _preStateRoot);
+ 
+        // TEMPORARY: Remove the transitioner; for minnet.
+        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitioner(0x0000000000000000000000000000000000000000);
+ 
+        emit FraudProofFinalized(
+            _preStateRoot,
+            _preStateRootProof.index,
+            _txHash,
+            msg.sender
+        );
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Verification *
+     ************************************/
+ 
+    /**
+     * Checks whether a transitioner already exists for a given pre-state root.
+     * @param _preStateRoot Pre-state root to check.
+     * @return _exists Whether or not we already have a transitioner for the root.
+     */
+    function _hasStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        internal
+        view
+        returns (
+            bool _exists
+        )
+    {
+        return address(getStateTransitioner(_preStateRoot, _txHash)) != address(0);
+    }
+ 
+    /**
+     * Deploys a new state transitioner.
+     * @param _preStateRoot Pre-state root to initialize the transitioner with.
+     * @param _txHash Hash of the transaction this transitioner will execute.
+     * @param _stateTransitionIndex Index of the transaction in the chain.
+     */
+    function _deployTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        uint256 _stateTransitionIndex
+    )
+        internal
+    {
+        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitionerFactory(
+            resolve("OVM_StateTransitionerFactory")
+        ).create(
+            address(libAddressManager),
+            _stateTransitionIndex,
+            _preStateRoot,
+            _txHash
+        );
+    }
+ 
+    /**
+     * Removes a state transition from the state commitment chain.
+     * @param _postStateRootBatchHeader Header for the post-state root.
+     * @param _preStateRoot Pre-state root hash.
+     */
+    function _cancelStateTransition(
+        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
+        bytes32 _preStateRoot
+    )
+        internal
+    {
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+        iOVM_BondManager ovmBondManager = iOVM_BondManager(resolve("OVM_BondManager"));
+ 
+        // Delete the state batch.
+        ovmStateCommitmentChain.deleteStateBatch(
+            _postStateRootBatchHeader
+        );
+ 
+        // Get the timestamp and publisher for that block.
+        (uint256 timestamp, address publisher) = abi.decode(_postStateRootBatchHeader.extraData, (uint256, address));
+ 
+        // Slash the bonds at the bond manager.
+        ovmBondManager.finalize(
+            _preStateRoot,
+            publisher,
+            timestamp
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html new file mode 100644 index 000000000..fe900da65 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html @@ -0,0 +1,1484 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ OVM_StateTransitioner.sol +

+
+
+ 80% + Statements + 40/50 +
+
+ 62.5% + Branches + 20/32 +
+
+ 90.91% + Functions + 10/11 +
+
+ 80.39% + Lines + 41/51 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +42× +42× +  +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  + +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
+import { Lib_SecureMerkleTrie } from "../../libraries/trie/Lib_SecureMerkleTrie.sol";
+import { Lib_RLPWriter } from "../../libraries/rlp/Lib_RLPWriter.sol";
+import { Lib_RLPReader } from "../../libraries/rlp/Lib_RLPReader.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
+ 
+/* Contract Imports */
+import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
+ 
+/**
+ * @title OVM_StateTransitioner
+ * @dev The State Transitioner coordinates the execution of a state transition during the evaluation of a
+ * fraud proof. It feeds verified input to the Execution Manager's run(), and controls a State Manager (which is
+ * uniquely created for each fraud proof).
+ * Once a fraud proof has been initialized, this contract is provided with the pre-state root and verifies
+ * that the OVM storage slots committed to the State Mangager are contained in that state
+ * This contract controls the State Manager and Execution Manager, and uses them to calculate the
+ * post-state root by applying the transaction. The Fraud Verifier can then check for fraud by comparing
+ * the calculated post-state root with the proposed post-state root.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateTransitioner is Lib_AddressResolver, Abs_FraudContributor, iOVM_StateTransitioner {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum TransitionPhase {
+        PRE_EXECUTION,
+        POST_EXECUTION,
+        COMPLETE
+    }
+ 
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    iOVM_StateManager public ovmStateManager;
+ 
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    bytes32 internal preStateRoot;
+    bytes32 internal postStateRoot;
+    TransitionPhase public phase;
+    uint256 internal stateTransitionIndex;
+    bytes32 internal transactionHash;
+ 
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 internal constant EMPTY_ACCOUNT_CODE_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
+    bytes32 internal constant EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _stateTransitionIndex Index of the state transition being verified.
+     * @param _preStateRoot State root before the transition was executed.
+     * @param _transactionHash Hash of the executed transaction.
+     */
+    constructor(
+        address _libAddressManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        stateTransitionIndex = _stateTransitionIndex;
+        preStateRoot = _preStateRoot;
+        postStateRoot = _preStateRoot;
+        transactionHash = _transactionHash;
+ 
+        ovmStateManager = iOVM_StateManagerFactory(resolve("OVM_StateManagerFactory")).create(address(this));
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Checks that a function is only run during a specific phase.
+     * @param _phase Phase the function must run within.
+     */
+    modifier onlyDuringPhase(
+        TransitionPhase _phase
+    ) {
+        Erequire(
+            phase == _phase,
+            "Function must be called during the correct phase."
+        );
+        _;
+    }
+ 
+ 
+    /**********************************
+     * Public Functions: State Access *
+     **********************************/
+ 
+    /**
+     * Retrieves the state root before execution.
+     * @return _preStateRoot State root before execution.
+     */
+    function getPreStateRoot()
+        override
+        public
+        view
+        returns (
+            bytes32 _preStateRoot
+        )
+    {
+        return preStateRoot;
+    }
+ 
+    /**
+     * Retrieves the state root after execution.
+     * @return _postStateRoot State root after execution.
+     */
+    function getPostStateRoot()
+        override
+        public
+        view
+        returns (
+            bytes32 _postStateRoot
+        )
+    {
+        return postStateRoot;
+    }
+ 
+    /**
+     * Checks whether the transitioner is complete.
+     * @return _complete Whether or not the transition process is finished.
+     */
+    function isComplete()
+        override
+        public
+        view
+        returns (
+            bool _complete
+        )
+    {
+        return phase == TransitionPhase.COMPLETE;
+    }
+    
+ 
+    /***********************************
+     * Public Functions: Pre-Execution *
+     ***********************************/
+ 
+    /**
+     * Allows a user to prove the initial state of a contract.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _ethContractAddress Address of the corresponding contract on L1.
+     * @param _stateTrieWitness Proof of the account state.
+     */
+    function proveContractState(
+        address _ovmContractAddress,
+        address _ethContractAddress,
+        bytes memory _stateTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        // Exit quickly to avoid unnecessary work.
+        Erequire(
+            (
+                ovmStateManager.hasAccount(_ovmContractAddress) == false
+                && ovmStateManager.hasEmptyAccount(_ovmContractAddress) == false
+            ),
+            "Account state has already been proven."
+        );
+ 
+        // Function will fail if the proof is not a valid inclusion or exclusion proof.
+        (
+            bool exists,
+            bytes memory encodedAccount
+        ) = Lib_SecureMerkleTrie.get(
+            abi.encodePacked(_ovmContractAddress),
+            _stateTrieWitness,
+            preStateRoot
+        );
+ 
+        Eif (exists == true) {
+            // Account exists, this was an inclusion proof.
+            Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
+                encodedAccount
+            );
+ 
+            address ethContractAddress = _ethContractAddress;
+            Iif (account.codeHash == EMPTY_ACCOUNT_CODE_HASH) {
+                // Use a known empty contract to prevent an attack in which a user provides a
+                // contract address here and then later deploys code to it.
+                ethContractAddress = 0x0000000000000000000000000000000000000000;
+            } else {
+                // Otherwise, make sure that the code at the provided eth address matches the hash
+                // of the code stored on L2.
+                Erequire(
+                    Lib_EthUtils.getCodeHash(ethContractAddress) == account.codeHash,
+                    "OVM_StateTransitioner: Provided L1 contract code hash does not match L2 contract code hash."
+                );
+            }
+ 
+            ovmStateManager.putAccount(
+                _ovmContractAddress,
+                Lib_OVMCodec.Account({
+                    nonce: account.nonce,
+                    balance: account.balance,
+                    storageRoot: account.storageRoot,
+                    codeHash: account.codeHash,
+                    ethAddress: ethContractAddress,
+                    isFresh: false
+                })
+            );
+        } else {
+            // Account does not exist, this was an exclusion proof.
+            ovmStateManager.putEmptyAccount(_ovmContractAddress);
+        }
+    }
+ 
+    /**
+     * Allows a user to prove the initial state of a contract storage slot.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _key Claimed account slot key.
+     * @param _storageTrieWitness Proof of the storage slot.
+     */
+    function proveStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes memory _storageTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        // Exit quickly to avoid unnecessary work.
+        Erequire(
+            ovmStateManager.hasContractStorage(_ovmContractAddress, _key) == false,
+            "Storage slot has already been proven."
+        );
+ 
+        require(
+            ovmStateManager.hasAccount(_ovmContractAddress) == true,
+            "Contract must be verified before proving a storage slot."
+        );
+ 
+        bytes32 storageRoot = ovmStateManager.getAccountStorageRoot(_ovmContractAddress);
+        bytes32 value;
+ 
+        Iif (storageRoot == EMPTY_ACCOUNT_STORAGE_ROOT) {
+            // Storage trie was empty, so the user is always allowed to insert zero-byte values.
+            value = bytes32(0);
+        } else {
+            // Function will fail if the proof is not a valid inclusion or exclusion proof.
+            (
+                bool exists,
+                bytes memory encodedValue
+            ) = Lib_SecureMerkleTrie.get(
+                abi.encodePacked(_key),
+                _storageTrieWitness,
+                storageRoot
+            );
+ 
+            Eif (exists == true) {
+                // Inclusion proof.
+                // Stored values are RLP encoded, with leading zeros removed.
+                value = Lib_BytesUtils.toBytes32PadLeft(
+                    Lib_RLPReader.readBytes(encodedValue)
+                );
+            } else {
+                // Exclusion proof, can only be zero bytes.
+                value = bytes32(0);
+            }
+        }
+ 
+        ovmStateManager.putContractStorage(
+            _ovmContractAddress,
+            _key,
+            value
+        );
+    }
+ 
+ 
+    /*******************************
+     * Public Functions: Execution *
+     *******************************/
+ 
+    /**
+     * Executes the state transition.
+     * @param _transaction OVM transaction to execute.
+     */
+    function applyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        Irequire(
+            Lib_OVMCodec.hashTransaction(_transaction) == transactionHash,
+            "Invalid transaction provided."
+        );
+ 
+        // We require gas to complete the logic here in run() before/after execution,
+        // But must ensure the full _tx.gasLimit can be given to the ovmCALL (determinism)
+        // This includes 1/64 of the gas getting lost because of EIP-150 (lost twice--first 
+        // going into EM, then going into the code contract).
+        require(
+            gasleft() >= 100000 + _transaction.gasLimit * 1032 / 1000, // 1032/1000 = 1.032 = (64/63)^2 rounded up
+            "Not enough gas to execute transaction deterministically."
+        );
+ 
+        iOVM_ExecutionManager ovmExecutionManager = iOVM_ExecutionManager(resolve("OVM_ExecutionManager"));
+ 
+        // We call `setExecutionManager` right before `run` (and not earlier) just in case the
+        // OVM_ExecutionManager address was updated between the time when this contract was created
+        // and when `applyTransaction` was called.
+        ovmStateManager.setExecutionManager(address(ovmExecutionManager));
+ 
+        // `run` always succeeds *unless* the user hasn't provided enough gas to `applyTransaction`
+        // or an INVALID_STATE_ACCESS flag was triggered. Either way, we won't get beyond this line
+        // if that's the case.
+        ovmExecutionManager.run(_transaction, address(ovmStateManager));
+ 
+        phase = TransitionPhase.POST_EXECUTION;
+    }
+ 
+ 
+    /************************************
+     * Public Functions: Post-Execution *
+     ************************************/
+ 
+    /**
+     * Allows a user to commit the final state of a contract.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _stateTrieWitness Proof of the account state.
+     */
+    function commitContractState(
+        address _ovmContractAddress,
+        bytes memory _stateTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        Erequire(
+            ovmStateManager.getTotalUncommittedContractStorage() == 0,
+            "All storage must be committed before committing account states."
+        );
+ 
+        require (
+            ovmStateManager.commitAccount(_ovmContractAddress) == true,
+            "Account state wasn't changed or has already been committed."
+        );
+ 
+        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
+ 
+        postStateRoot = Lib_SecureMerkleTrie.update(
+            abi.encodePacked(_ovmContractAddress),
+            Lib_OVMCodec.encodeEVMAccount(
+                Lib_OVMCodec.toEVMAccount(account)
+            ),
+            _stateTrieWitness,
+            postStateRoot
+        );
+ 
+        // Emit an event to help clients figure out the proof ordering.
+        emit AccountCommitted(
+            _ovmContractAddress
+        );
+    }
+ 
+    /**
+     * Allows a user to commit the final state of a contract storage slot.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _key Claimed account slot key.
+     * @param _storageTrieWitness Proof of the storage slot.
+     */
+    function commitStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes memory _storageTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        require(
+            ovmStateManager.commitContractStorage(_ovmContractAddress, _key) == true,
+            "Storage slot value wasn't changed or has already been committed."
+        );
+ 
+        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
+        bytes32 value = ovmStateManager.getContractStorage(_ovmContractAddress, _key);
+ 
+        account.storageRoot = Lib_SecureMerkleTrie.update(
+            abi.encodePacked(_key),
+            Lib_RLPWriter.writeBytes(
+                Lib_Bytes32Utils.removeLeadingZeros(value)
+            ),
+            _storageTrieWitness,
+            account.storageRoot
+        );
+ 
+        ovmStateManager.putAccount(_ovmContractAddress, account);
+ 
+        // Emit an event to help clients figure out the proof ordering.
+        emit ContractStorageCommitted(
+            _ovmContractAddress,
+            _key
+        );
+    }
+ 
+ 
+    /**********************************
+     * Public Functions: Finalization *
+     **********************************/
+ 
+    /**
+     * Finalizes the transition process.
+     */
+    function completeTransition()
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+    {
+        require(
+            ovmStateManager.getTotalUncommittedAccounts() == 0,
+            "All accounts must be committed before completing a transition."
+        );
+ 
+        require(
+            ovmStateManager.getTotalUncommittedContractStorage() == 0,
+            "All storage must be committed before completing a transition."
+        );
+ 
+        phase = TransitionPhase.COMPLETE;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html new file mode 100644 index 000000000..6072bb685 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html @@ -0,0 +1,266 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ OVM_StateTransitionerFactory.sol +

+
+
+ 50% + Statements + 1/2 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 2/2 +
+
+ 50% + Lines + 1/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+ 
+/* Contract Imports */
+import { OVM_StateTransitioner } from "./OVM_StateTransitioner.sol";
+ 
+/**
+ * @title OVM_StateTransitionerFactory
+ * @dev The State Transitioner Factory is used by the Fraud Verifier to create a new State 
+ * Transitioner during the initialization of a fraud proof.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateTransitionerFactory is iOVM_StateTransitionerFactory, Lib_AddressResolver {
+ 
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    /**
+     * Creates a new OVM_StateTransitioner
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _stateTransitionIndex Index of the state transition being verified.
+     * @param _preStateRoot State root before the transition was executed.
+     * @param _transactionHash Hash of the executed transaction.
+     * @return _ovmStateTransitioner New OVM_StateTransitioner instance.
+     */
+    function create(
+        address _libAddressManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        override
+        public
+        returns (
+            iOVM_StateTransitioner _ovmStateTransitioner
+        )
+    {
+        Irequire(
+            msg.sender == resolve("OVM_FraudVerifier"),
+            "Create can only be done by the OVM_FraudVerifier."
+        );
+        return new OVM_StateTransitioner(
+            _libAddressManager,
+            _stateTransitionIndex,
+            _preStateRoot,
+            _transactionHash
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/index.html new file mode 100644 index 000000000..e160dcf28 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/OVM/verification/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/verification/ +

+
+
+ 90.4% + Statements + 113/125 +
+
+ 78.05% + Branches + 64/82 +
+
+ 96.67% + Functions + 29/30 +
+
+ 90.48% + Lines + 114/126 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_FraudContributor.sol
100%3/3100%0/0100%1/1100%4/4
OVM_BondManager.sol
100%42/4286.67%26/30100%9/9100%41/41
OVM_FraudVerifier.sol
96.43%27/2894.44%17/18100%7/796.43%27/28
OVM_StateTransitioner.sol
80%40/5062.5%20/3290.91%10/1180.39%41/51
OVM_StateTransitionerFactory.sol
50%1/250%1/2100%2/250%1/2
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..cb0d9f22a --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/accounts/ iOVM_ECDSAContractAccount.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_ECDSAContractAccount
+ */
+interface iOVM_ECDSAContractAccount {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    ) external returns (bool _success, bytes memory _returndata);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/index.html new file mode 100644 index 000000000..ef910e5b5 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/accounts/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/accounts/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_ECDSAContractAccount.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html new file mode 100644 index 000000000..f21d38c1a --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html @@ -0,0 +1,173 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/messaging/ iAbs_BaseCrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iAbs_BaseCrossDomainMessenger
+ */
+interface iAbs_BaseCrossDomainMessenger {
+ 
+    /**********
+     * Events *
+     **********/
+    event SentMessage(bytes message);
+    event RelayedMessage(bytes32 msgHash);
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+    function xDomainMessageSender() external view returns (address);
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sends a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _message Message to send to the target.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function sendMessage(
+        address _target,
+        bytes calldata _message,
+        uint32 _gasLimit
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html new file mode 100644 index 000000000..da13fd02b --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html @@ -0,0 +1,257 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L1CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title iOVM_L1CrossDomainMessenger
+ */
+interface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    struct L2MessageInclusionProof {
+        bytes32 stateRoot;
+        Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;
+        Lib_OVMCodec.ChainInclusionProof stateRootProof;
+        bytes stateTrieWitness;
+        bytes storageTrieWitness;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @param _proof Inclusion proof for the given message.
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        L2MessageInclusionProof memory _proof
+    ) external;
+ 
+    /**
+     * Replays a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _sender Original sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function replayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        uint32 _gasLimit
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html new file mode 100644 index 000000000..bb37bbe09 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L1MultiMessageRelayer.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+interface iOVM_L1MultiMessageRelayer {
+ 
+    struct L2ToL1Message {
+        address target;
+        address sender;
+        bytes message;
+        uint256 messageNonce;
+        iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;
+    }
+ 
+    function batchRelayMessages(L2ToL1Message[] calldata _messages) external; 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html new file mode 100644 index 000000000..10a409698 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html @@ -0,0 +1,155 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L2CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title iOVM_L2CrossDomainMessenger
+ */
+interface iOVM_L2CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/index.html new file mode 100644 index 000000000..3d8e3efae --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/bridge/messaging/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iAbs_BaseCrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MultiMessageRelayer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html new file mode 100644 index 000000000..8f52453eb --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html @@ -0,0 +1,230 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L1ETHGateway.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L1ETHGateway
+ */
+interface iOVM_L1ETHGateway {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event DepositInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+ 
+    event WithdrawalFinalized(
+        address indexed _to,
+        uint256 _amount
+    );
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function deposit()
+        external
+        payable;
+ 
+    function depositTo(
+        address _to
+    )
+        external
+        payable;
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+    function getFinalizeDepositL2Gas()
+        external
+        view
+        returns(
+            uint32
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html new file mode 100644 index 000000000..4de6d7385 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html @@ -0,0 +1,218 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L1TokenGateway.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L1TokenGateway
+ */
+interface iOVM_L1TokenGateway {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event DepositInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+  
+    event WithdrawalFinalized(
+        address indexed _to,
+        uint256 _amount
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function deposit(
+        uint _amount
+    )
+        external;
+ 
+    function depositTo(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html new file mode 100644 index 000000000..0b3777f82 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html @@ -0,0 +1,218 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L2DepositedToken.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L2DepositedToken
+ */
+interface iOVM_L2DepositedToken {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event WithdrawalInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+ 
+    event DepositFinalized(
+        address indexed _to,
+        uint256 _amount
+    );    
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function withdraw(
+        uint _amount
+    )
+        external;
+ 
+    function withdrawTo(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/index.html new file mode 100644 index 000000000..60ef990a9 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/bridge/tokens/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_L1ETHGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1TokenGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2DepositedToken.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html new file mode 100644 index 000000000..719bb7c7e --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html @@ -0,0 +1,782 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/chain/ iOVM_CanonicalTransactionChain.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_ChainStorageContainer } from "./iOVM_ChainStorageContainer.sol";
+ 
+/**
+ * @title iOVM_CanonicalTransactionChain
+ */
+interface iOVM_CanonicalTransactionChain {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event TransactionEnqueued(
+        address _l1TxOrigin,
+        address _target,
+        uint256 _gasLimit,
+        bytes _data,
+        uint256 _queueIndex,
+        uint256 _timestamp
+    );
+ 
+    event QueueBatchAppended(
+        uint256 _startingQueueIndex,
+        uint256 _numQueueElements,
+        uint256 _totalElements
+    );
+ 
+    event SequencerBatchAppended(
+        uint256 _startingQueueIndex,
+        uint256 _numQueueElements,
+        uint256 _totalElements
+    );
+ 
+    event TransactionBatchAppended(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot,
+        uint256 _batchSize,
+        uint256 _prevTotalElements,
+        bytes _extraData
+    );
+ 
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct BatchContext {
+        uint256 numSequencedTransactions;
+        uint256 numSubsequentQueueTransactions;
+        uint256 timestamp;
+        uint256 blockNumber;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        external
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        );
+ 
+    /**
+     * Accesses the queue storage container.
+     * @return Reference to the queue storage container.
+     */
+    function queue()
+        external
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        );
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        external
+        view
+        returns (
+            uint256 _totalElements
+        );
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        external
+        view
+        returns (
+            uint256 _totalBatches
+        );
+ 
+    /**
+     * Returns the index of the next element to be enqueued.
+     * @return Index for the next queue element.
+     */
+    function getNextQueueIndex()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function getQueueElement(
+        uint256 _index
+    )
+        external
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        );
+ 
+    /**
+     * Returns the timestamp of the last transaction.
+     * @return Timestamp for the last transaction.
+     */
+    function getLastTimestamp()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Returns the blocknumber of the last transaction.
+     * @return Blocknumber for the last transaction.
+     */
+    function getLastBlockNumber()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Get the number of queue elements which have not yet been included.
+     * @return Number of pending queue elements.
+     */
+    function getNumPendingQueueElements()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Retrieves the length of the queue, including
+     * both pending and canonical transactions.
+     * @return Length of the queue.
+     */
+    function getQueueLength()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+ 
+    /**
+     * Adds a transaction to the queue.
+     * @param _target Target contract to send the transaction to.
+     * @param _gasLimit Gas limit for the given transaction.
+     * @param _data Transaction data.
+     */
+    function enqueue(
+        address _target,
+        uint256 _gasLimit,
+        bytes memory _data
+    )
+        external;
+ 
+    /**
+     * Appends a given number of queued transactions as a single batch.
+     * @param _numQueuedTransactions Number of transactions to append.
+     */
+    function appendQueueBatch(
+        uint256 _numQueuedTransactions
+    )
+        external;
+ 
+    /**
+     * Allows the sequencer to append a batch of transactions.
+     * @dev This function uses a custom encoding scheme for efficiency reasons.
+     * .param _shouldStartAtElement Specific batch we expect to start appending to.
+     * .param _totalElementsToAppend Total number of batch elements we expect to append.
+     * .param _contexts Array of batch contexts.
+     * .param _transactionDataFields Array of raw transaction data.
+     */
+    function appendSequencerBatch(
+        // uint40 _shouldStartAtElement,
+        // uint24 _totalElementsToAppend,
+        // BatchContext[] _contexts,
+        // bytes[] _transactionDataFields
+    )
+        external;
+ 
+    /**
+     * Verifies whether a transaction is included in the chain.
+     * @param _transaction Transaction to verify.
+     * @param _txChainElement Transaction chain element corresponding to the transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
+     * @return True if the transaction exists in the CTC, false if not.
+     */
+    function verifyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        external
+        view
+        returns (
+            bool
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html new file mode 100644 index 000000000..2a6ce20dc --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html @@ -0,0 +1,398 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/chain/ iOVM_ChainStorageContainer.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_ChainStorageContainer
+ */
+interface iOVM_ChainStorageContainer {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sets the container's global metadata field. We're using `bytes27` here because we use five
+     * bytes to maintain the length of the underlying data structure, meaning we have an extra
+     * 27 bytes to store arbitrary data.
+     * @param _globalMetadata New global metadata to set.
+     */
+    function setGlobalMetadata(
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Retrieves the container's global metadata field.
+     * @return Container global metadata field.
+     */
+    function getGlobalMetadata()
+        external
+        view
+        returns (
+            bytes27
+        );
+ 
+    /**
+     * Retrieves the number of objects stored in the container.
+     * @return Number of objects in the container.
+     */
+    function length()
+        external
+        view
+        returns (
+            uint256
+        );
+ 
+    /**
+     * Pushes an object into the container.
+     * @param _object A 32 byte value to insert into the container.
+     */
+    function push(
+        bytes32 _object
+    )
+        external;
+ 
+    /**
+     * Pushes an object into the container. Function allows setting the global metadata since
+     * we'll need to touch the "length" storage slot anyway, which also contains the global
+     * metadata (it's an optimization).
+     * @param _object A 32 byte value to insert into the container.
+     * @param _globalMetadata New global metadata for the container.
+     */
+    function push(
+        bytes32 _object,
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Retrieves an object from the container.
+     * @param _index Index of the particular object to access.
+     * @return 32 byte object value.
+     */
+    function get(
+        uint256 _index
+    )
+        external
+        view
+        returns (
+            bytes32
+        );
+ 
+    /**
+     * Removes all objects after and including a given index.
+     * @param _index Object index to delete from.
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index
+    )
+        external;
+ 
+    /**
+     * Removes all objects after and including a given index. Also allows setting the global
+     * metadata field.
+     * @param _index Object index to delete from.
+     * @param _globalMetadata New global metadata for the container.
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index,
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Marks an index as overwritable, meaing the underlying buffer can start to write values over
+     * any objects before and including the given index.
+     */
+    function setNextOverwritableIndex(
+        uint256 _index
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html new file mode 100644 index 000000000..a65b5ceef --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html @@ -0,0 +1,419 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/chain/ iOVM_StateCommitmentChain.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateCommitmentChain
+ */
+interface iOVM_StateCommitmentChain {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event StateBatchAppended(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot,
+        uint256 _batchSize,
+        uint256 _prevTotalElements,
+        bytes _extraData
+    );
+ 
+    event StateBatchDeleted(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        external
+        view
+        returns (
+            uint256 _totalElements
+        );
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        external
+        view
+        returns (
+            uint256 _totalBatches
+        );
+ 
+    /**
+     * Retrieves the timestamp of the last batch submitted by the sequencer.
+     * @return _lastSequencerTimestamp Last sequencer batch timestamp.
+     */
+    function getLastSequencerTimestamp()
+        external
+        view
+        returns (
+            uint256 _lastSequencerTimestamp
+        );
+ 
+    /**
+     * Appends a batch of state roots to the chain.
+     * @param _batch Batch of state roots.
+     * @param _shouldStartAtElement Index of the element at which this batch should start.
+     */
+    function appendStateBatch(
+        bytes32[] calldata _batch,
+        uint256 _shouldStartAtElement
+    )
+        external;
+ 
+    /**
+     * Deletes all state roots after (and including) a given batch.
+     * @param _batchHeader Header of the batch to start deleting from.
+     */
+    function deleteStateBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        external;
+ 
+    /**
+     * Verifies a batch inclusion proof.
+     * @param _element Hash of the element to verify a proof for.
+     * @param _batchHeader Header of the batch in which the element was included.
+     * @param _proof Merkle inclusion proof for the element.
+     */
+    function verifyStateCommitment(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        external
+        view
+        returns (
+            bool _verified
+        );
+ 
+    /**
+     * Checks whether a given batch is still inside its fraud proof window.
+     * @param _batchHeader Header of the batch to check.
+     * @return _inside Whether or not the batch is inside the fraud proof window.
+     */
+    function insideFraudProofWindow(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        external
+        view
+        returns (
+            bool _inside
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/index.html new file mode 100644 index 000000000..79692cb03 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/chain/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/chain/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_CanonicalTransactionChain.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ChainStorageContainer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateCommitmentChain.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html new file mode 100644 index 000000000..caae9773f --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html @@ -0,0 +1,533 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/execution/ iOVM_ExecutionManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+interface iOVM_ExecutionManager {
+    /**********
+     * Enums *
+     *********/
+ 
+    enum RevertFlag {
+        OUT_OF_GAS,
+        INTENTIONAL_REVERT,
+        EXCEEDS_NUISANCE_GAS,
+        INVALID_STATE_ACCESS,
+        UNSAFE_BYTECODE,
+        CREATE_COLLISION,
+        STATIC_VIOLATION,
+        CREATOR_NOT_ALLOWED
+    }
+ 
+    enum GasMetadataKey {
+        CURRENT_EPOCH_START_TIMESTAMP,
+        CUMULATIVE_SEQUENCER_QUEUE_GAS,
+        CUMULATIVE_L1TOL2_QUEUE_GAS,
+        PREV_EPOCH_SEQUENCER_QUEUE_GAS,
+        PREV_EPOCH_L1TOL2_QUEUE_GAS
+    }
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct GasMeterConfig {
+        uint256 minTransactionGasLimit;
+        uint256 maxTransactionGasLimit;
+        uint256 maxGasPerQueuePerEpoch;
+        uint256 secondsPerEpoch;
+    }
+ 
+    struct GlobalContext {
+        uint256 ovmCHAINID;
+    }
+ 
+    struct TransactionContext {
+        Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;
+        uint256 ovmTIMESTAMP;
+        uint256 ovmNUMBER;
+        uint256 ovmGASLIMIT;
+        uint256 ovmTXGASLIMIT;
+        address ovmL1TXORIGIN;
+    }
+ 
+    struct TransactionRecord {
+        uint256 ovmGasRefund;
+    }
+ 
+    struct MessageContext {
+        address ovmCALLER;
+        address ovmADDRESS;
+        bool isStatic;
+    }
+ 
+    struct MessageRecord {
+        uint256 nuisanceGasLeft;
+    }
+ 
+ 
+    /************************************
+     * Transaction Execution Entrypoint *
+     ************************************/
+ 
+    function run(
+        Lib_OVMCodec.Transaction calldata _transaction,
+        address _txStateManager
+    ) external;
+ 
+ 
+    /*******************
+     * Context Opcodes *
+     *******************/
+ 
+    function ovmCALLER() external view returns (address _caller);
+    function ovmADDRESS() external view returns (address _address);
+    function ovmTIMESTAMP() external view returns (uint256 _timestamp);
+    function ovmNUMBER() external view returns (uint256 _number);
+    function ovmGASLIMIT() external view returns (uint256 _gasLimit);
+    function ovmCHAINID() external view returns (uint256 _chainId);
+ 
+ 
+    /**********************
+     * L2 Context Opcodes *
+     **********************/
+ 
+    function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
+    function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
+ 
+ 
+    /*******************
+     * Halting Opcodes *
+     *******************/
+ 
+    function ovmREVERT(bytes memory _data) external;
+ 
+ 
+    /*****************************
+     * Contract Creation Opcodes *
+     *****************************/
+ 
+    function ovmCREATE(bytes memory _bytecode) external returns (address _contract, bytes memory _revertdata);
+    function ovmCREATE2(bytes memory _bytecode, bytes32 _salt) external returns (address _contract, bytes memory _revertdata);
+ 
+ 
+    /*******************************
+     * Account Abstraction Opcodes *
+     ******************************/
+ 
+    function ovmGETNONCE() external returns (uint256 _nonce);
+    function ovmSETNONCE(uint256 _nonce) external;
+    function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
+ 
+ 
+    /****************************
+     * Contract Calling Opcodes *
+     ****************************/
+ 
+    function ovmCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+    function ovmSTATICCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+    function ovmDELEGATECALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+ 
+ 
+    /****************************
+     * Contract Storage Opcodes *
+     ****************************/
+ 
+    function ovmSLOAD(bytes32 _key) external returns (bytes32 _value);
+    function ovmSSTORE(bytes32 _key, bytes32 _value) external;
+ 
+ 
+    /*************************
+     * Contract Code Opcodes *
+     *************************/
+ 
+    function ovmEXTCODECOPY(address _contract, uint256 _offset, uint256 _length) external returns (bytes memory _code);
+    function ovmEXTCODESIZE(address _contract) external returns (uint256 _size);
+    function ovmEXTCODEHASH(address _contract) external returns (bytes32 _hash);
+ 
+ 
+    /***************************************
+     * Public Functions: Execution Context *
+     ***************************************/
+ 
+    function getMaxTransactionGasLimit() external view returns (uint _maxTransactionGasLimit);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html new file mode 100644 index 000000000..2879de4b0 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html @@ -0,0 +1,107 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/execution/ iOVM_SafetyChecker.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_SafetyChecker
+ */
+interface iOVM_SafetyChecker {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html new file mode 100644 index 000000000..d50f8d0b1 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html @@ -0,0 +1,296 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/execution/ iOVM_StateManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateManager
+ */
+interface iOVM_StateManager {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum ItemState {
+        ITEM_UNTOUCHED,
+        ITEM_LOADED,
+        ITEM_CHANGED,
+        ITEM_COMMITTED
+    }
+ 
+    /***************************
+     * Public Functions: Misc *
+     ***************************/
+ 
+    function isAuthenticated(address _address) external view returns (bool);
+ 
+    /***************************
+     * Public Functions: Setup *
+     ***************************/
+ 
+    function owner() external view returns (address _owner);
+    function ovmExecutionManager() external view returns (address _ovmExecutionManager);
+    function setExecutionManager(address _ovmExecutionManager) external;
+ 
+ 
+    /************************************
+     * Public Functions: Account Access *
+     ************************************/
+ 
+    function putAccount(address _address, Lib_OVMCodec.Account memory _account) external;
+    function putEmptyAccount(address _address) external;
+    function getAccount(address _address) external view returns (Lib_OVMCodec.Account memory _account);
+    function hasAccount(address _address) external view returns (bool _exists);
+    function hasEmptyAccount(address _address) external view returns (bool _exists);
+    function setAccountNonce(address _address, uint256 _nonce) external;
+    function getAccountNonce(address _address) external view returns (uint256 _nonce);
+    function getAccountEthAddress(address _address) external view returns (address _ethAddress);
+    function getAccountStorageRoot(address _address) external view returns (bytes32 _storageRoot);
+    function initPendingAccount(address _address) external;
+    function commitPendingAccount(address _address, address _ethAddress, bytes32 _codeHash) external;
+    function testAndSetAccountLoaded(address _address) external returns (bool _wasAccountAlreadyLoaded);
+    function testAndSetAccountChanged(address _address) external returns (bool _wasAccountAlreadyChanged);
+    function commitAccount(address _address) external returns (bool _wasAccountCommitted);
+    function incrementTotalUncommittedAccounts() external;
+    function getTotalUncommittedAccounts() external view returns (uint256 _total);
+    function wasAccountChanged(address _address) external view returns (bool);
+    function wasAccountCommitted(address _address) external view returns (bool);
+ 
+ 
+    /************************************
+     * Public Functions: Storage Access *
+     ************************************/
+ 
+    function putContractStorage(address _contract, bytes32 _key, bytes32 _value) external;
+    function getContractStorage(address _contract, bytes32 _key) external view returns (bytes32 _value);
+    function hasContractStorage(address _contract, bytes32 _key) external view returns (bool _exists);
+    function testAndSetContractStorageLoaded(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyLoaded);
+    function testAndSetContractStorageChanged(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyChanged);
+    function commitContractStorage(address _contract, bytes32 _key) external returns (bool _wasContractStorageCommitted);
+    function incrementTotalUncommittedContractStorage() external;
+    function getTotalUncommittedContractStorage() external view returns (uint256 _total);
+    function wasContractStorageChanged(address _contract, bytes32 _key) external view returns (bool);
+    function wasContractStorageCommitted(address _contract, bytes32 _key) external view returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html new file mode 100644 index 000000000..ad5e6f218 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html @@ -0,0 +1,134 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/execution/ iOVM_StateManagerFactory.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { iOVM_StateManager } from "./iOVM_StateManager.sol";
+ 
+/**
+ * @title iOVM_StateManagerFactory
+ */
+interface iOVM_StateManagerFactory {
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    function create(
+        address _owner
+    )
+        external
+        returns (
+            iOVM_StateManager _ovmStateManager
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/index.html new file mode 100644 index 000000000..05e6abd73 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/execution/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_ExecutionManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_SafetyChecker.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManagerFactory.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html new file mode 100644 index 000000000..eea280b9e --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html @@ -0,0 +1,125 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/predeploys/ iOVM_DeployerWhitelist.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_DeployerWhitelist
+ */
+interface iOVM_DeployerWhitelist {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function initialize(address _owner, bool _allowArbitraryDeployment) external;
+    function getOwner() external returns (address _owner);
+    function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;
+    function setOwner(address _newOwner) external;
+    function setAllowArbitraryDeployment(bool _allowArbitraryDeployment) external;
+    function enableArbitraryContractDeployment() external;
+    function isDeployerAllowed(address _deployer) external returns (bool _allowed);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html new file mode 100644 index 000000000..4015dddbb --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html @@ -0,0 +1,224 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/predeploys/ iOVM_ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_ERC20
+ */
+interface iOVM_ERC20 {
+    /* This is a slight change to the ERC20 base standard.
+    function totalSupply() constant returns (uint256 supply);
+    is replaced with:
+    uint256 public totalSupply;
+    This automatically creates a getter function for the totalSupply.
+    This is moved to the base contract since public getter functions are not
+    currently recognised as an implementation of the matching abstract
+    function by the compiler.
+    */
+    /// total amount of tokens
+    function totalSupply() external view returns (uint256);
+ 
+    /// @param _owner The address from which the balance will be retrieved
+    /// @return balance The balance
+    function balanceOf(address _owner) external view returns (uint256 balance);
+ 
+    /// @notice send `_value` token to `_to` from `msg.sender`
+    /// @param _to The address of the recipient
+    /// @param _value The amount of token to be transferred
+    /// @return success Whether the transfer was successful or not
+    function transfer(address _to, uint256 _value) external returns (bool success);
+ 
+    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
+    /// @param _from The address of the sender
+    /// @param _to The address of the recipient
+    /// @param _value The amount of token to be transferred
+    /// @return success Whether the transfer was successful or not
+    function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
+ 
+    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
+    /// @param _spender The address of the account able to transfer the tokens
+    /// @param _value The amount of tokens to be approved for transfer
+    /// @return success Whether the approval was successful or not
+    function approve(address _spender, uint256 _value) external returns (bool success);
+ 
+    /// @param _owner The address of the account owning tokens
+    /// @param _spender The address of the account able to transfer the tokens
+    /// @return remaining Amount of remaining tokens allowed to spent
+    function allowance(address _owner, address _spender) external view returns (uint256 remaining);
+ 
+    // solhint-disable-next-line no-simple-event-func-name
+    event Transfer(address indexed _from, address indexed _to, uint256 _value);
+    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
+    event Mint(address indexed _account, uint256 _amount);
+    event Burn(address indexed _account, uint256 _amount);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html new file mode 100644 index 000000000..2ee6275c9 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html @@ -0,0 +1,107 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/predeploys/ iOVM_L1MessageSender.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_L1MessageSender
+ */
+interface iOVM_L1MessageSender {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function getL1MessageSender() external view returns (address _l1MessageSender);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html new file mode 100644 index 000000000..3fbedd282 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html @@ -0,0 +1,140 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/predeploys/ iOVM_L2ToL1MessagePasser.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_L2ToL1MessagePasser
+ */
+interface iOVM_L2ToL1MessagePasser {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event L2ToL1Message(
+        uint256 _nonce,
+        address _sender,
+        bytes _data
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function passMessageToL1(bytes calldata _message) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/index.html new file mode 100644 index 000000000..fc65f5166 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/predeploys/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_DeployerWhitelist.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ERC20.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MessageSender.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2ToL1MessagePasser.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html new file mode 100644 index 000000000..736e664e0 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html @@ -0,0 +1,389 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/verification/ iOVM_BondManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+interface ERC20 {
+    function transfer(address, uint256) external returns (bool);
+    function transferFrom(address, address, uint256) external returns (bool);
+}
+ 
+/// All the errors which may be encountered on the bond manager
+library Errors {
+    string constant ERC20_ERR = "BondManager: Could not post bond";
+    string constant ALREADY_FINALIZED = "BondManager: Fraud proof for this pre-state root has already been finalized";
+    string constant SLASHED = "BondManager: Cannot finalize withdrawal, you probably got slashed";
+    string constant WRONG_STATE = "BondManager: Wrong bond state for proposer";
+    string constant CANNOT_CLAIM = "BondManager: Cannot claim yet. Dispute must be finalized first";
+ 
+    string constant WITHDRAWAL_PENDING = "BondManager: Withdrawal already pending";
+    string constant TOO_EARLY = "BondManager: Too early to finalize your withdrawal";
+ 
+    string constant ONLY_TRANSITIONER = "BondManager: Only the transitioner for this pre-state root may call this function";
+    string constant ONLY_FRAUD_VERIFIER = "BondManager: Only the fraud verifier may call this function";
+    string constant ONLY_STATE_COMMITMENT_CHAIN = "BondManager: Only the state commitment chain may call this function";
+    string constant WAIT_FOR_DISPUTES = "BondManager: Wait for other potential disputes";
+}
+ 
+/**
+ * @title iOVM_BondManager
+ */
+interface iOVM_BondManager {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    /// The lifecycle of a proposer's bond
+    enum State {
+        // Before depositing or after getting slashed, a user is uncollateralized
+        NOT_COLLATERALIZED,
+        // After depositing, a user is collateralized
+        COLLATERALIZED,
+        // After a user has initiated a withdrawal
+        WITHDRAWING
+    }
+ 
+    /// A bond posted by a proposer
+    struct Bond {
+        // The user's state
+        State state;
+        // The timestamp at which a proposer issued their withdrawal request
+        uint32 withdrawalTimestamp;
+        // The time when the first disputed was initiated for this bond
+        uint256 firstDisputeAt;
+        // The earliest observed state root for this bond which has had fraud
+        bytes32 earliestDisputedStateRoot;
+        // The state root's timestamp
+        uint256 earliestTimestamp;
+    }
+ 
+    // Per pre-state root, store the number of state provisions that were made
+    // and how many of these calls were made by each user. Payouts will then be
+    // claimed by users proportionally for that dispute.
+    struct Rewards {
+        // Flag to check if rewards for a fraud proof are claimable
+        bool canClaim;
+        // Total number of `recordGasSpent` calls made
+        uint256 total;
+        // The gas spent by each user to provide witness data. The sum of all
+        // values inside this map MUST be equal to the value of `total`
+        mapping(address => uint256) gasSpent;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function recordGasSpent(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        address _who,
+        uint256 _gasSpent
+    ) external;
+ 
+    function finalize(
+        bytes32 _preStateRoot,
+        address _publisher,
+        uint256 _timestamp
+    ) external;
+ 
+    function deposit() external;
+ 
+    function startWithdrawal() external;
+ 
+    function finalizeWithdrawal() external;
+ 
+    function claim(
+        address _who
+    ) external;
+ 
+    function isCollateralized(
+        address _who
+    ) external view returns (bool);
+ 
+    function getGasSpent(
+        bytes32 _preStateRoot,
+        address _who
+    ) external view returns (uint256);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html new file mode 100644 index 000000000..6a84d41e2 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html @@ -0,0 +1,260 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/verification/ iOVM_FraudVerifier.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
+ 
+/**
+ * @title iOVM_FraudVerifier
+ */
+interface iOVM_FraudVerifier {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event FraudProofInitialized(
+        bytes32 _preStateRoot,
+        uint256 _preStateRootIndex,
+        bytes32 _transactionHash,
+        address _who
+    );
+ 
+    event FraudProofFinalized(
+        bytes32 _preStateRoot,
+        uint256 _preStateRootIndex,
+        bytes32 _transactionHash,
+        address _who
+    );
+ 
+ 
+    /***************************************
+     * Public Functions: Transition Status *
+     ***************************************/
+ 
+    function getStateTransitioner(bytes32 _preStateRoot, bytes32 _txHash) external view returns (iOVM_StateTransitioner _transitioner);
+ 
+ 
+    /****************************************
+     * Public Functions: Fraud Verification *
+     ****************************************/
+ 
+    function initializeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
+        Lib_OVMCodec.Transaction calldata _transaction,
+        Lib_OVMCodec.TransactionChainElement calldata _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader calldata _transactionBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _transactionProof
+    ) external;
+ 
+    function finalizeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
+        bytes32 _txHash,
+        bytes32 _postStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _postStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _postStateRootProof
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html new file mode 100644 index 000000000..7bf0a4555 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html @@ -0,0 +1,314 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/verification/ iOVM_StateTransitioner.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateTransitioner
+ */
+interface iOVM_StateTransitioner {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event AccountCommitted(
+        address _address
+    );
+ 
+    event ContractStorageCommitted(
+        address _address,
+        bytes32 _key
+    );
+ 
+ 
+    /**********************************
+     * Public Functions: State Access *
+     **********************************/
+ 
+    function getPreStateRoot() external view returns (bytes32 _preStateRoot);
+    function getPostStateRoot() external view returns (bytes32 _postStateRoot);
+    function isComplete() external view returns (bool _complete);
+ 
+ 
+    /***********************************
+     * Public Functions: Pre-Execution *
+     ***********************************/
+ 
+    function proveContractState(
+        address _ovmContractAddress,
+        address _ethContractAddress,
+        bytes calldata _stateTrieWitness
+    ) external;
+ 
+    function proveStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes calldata _storageTrieWitness
+    ) external;
+ 
+ 
+    /*******************************
+     * Public Functions: Execution *
+     *******************************/
+ 
+    function applyTransaction(
+        Lib_OVMCodec.Transaction calldata _transaction
+    ) external;
+ 
+ 
+    /************************************
+     * Public Functions: Post-Execution *
+     ************************************/
+ 
+    function commitContractState(
+        address _ovmContractAddress,
+        bytes calldata _stateTrieWitness
+    ) external;
+ 
+    function commitStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes calldata _storageTrieWitness
+    ) external;
+ 
+ 
+    /**********************************
+     * Public Functions: Finalization *
+     **********************************/
+ 
+    function completeTransition() external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html new file mode 100644 index 000000000..29124d9c6 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html @@ -0,0 +1,143 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/verification/ iOVM_StateTransitionerFactory.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
+ 
+/**
+ * @title iOVM_StateTransitionerFactory
+ */
+interface iOVM_StateTransitionerFactory {
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    function create(
+        address _proxyManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        external
+        returns (
+            iOVM_StateTransitioner _ovmStateTransitioner
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/index.html new file mode 100644 index 000000000..4655a37c6 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/verification/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_BondManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_FraudVerifier.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitioner.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitionerFactory.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html new file mode 100644 index 000000000..38cfe2666 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html @@ -0,0 +1,308 @@ + + + + Code coverage report for optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/bridge/ OVM_CrossDomainEnabled.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +78× +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_CrossDomainEnabled
+ * @dev Helper contract for contracts performing cross-domain communications
+ *
+ * Compiler used: defined by inheriting contract
+ * Runtime target: defined by inheriting contract
+ */
+contract OVM_CrossDomainEnabled {
+    // Messenger contract used to send and recieve messages from the other domain.
+    address public messenger;
+ 
+    /***************
+     * Constructor *
+     ***************/    
+    constructor(
+        address _messenger
+    ) {
+        messenger = _messenger;
+    }
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * @notice Enforces that the modified function is only callable by a specific cross-domain account.
+     * @param _sourceDomainAccount The only account on the originating domain which is authenticated to call this function.
+     */
+    modifier onlyFromCrossDomainAccount(
+        address _sourceDomainAccount
+    ) {
+        require(
+            msg.sender == address(getCrossDomainMessenger()),
+            "OVM_XCHAIN: messenger contract unauthenticated"
+        );
+ 
+        require(
+            getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,
+            "OVM_XCHAIN: wrong sender of cross-domain message"
+        );
+ 
+        _;
+    }
+    
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Gets the messenger, usually from storage.  This function is exposed in case a child contract needs to override.
+     * @return The address of the cross-domain messenger contract which should be used. 
+     */
+    function getCrossDomainMessenger()
+        internal
+        virtual
+        returns(
+            iAbs_BaseCrossDomainMessenger
+        )
+    {
+        return iAbs_BaseCrossDomainMessenger(messenger);
+    }
+ 
+    /**
+     * @notice Sends a message to an account on another domain
+     * @param _crossDomainTarget The intended recipient on the destination domain
+     * @param _data The data to send to the target (usually calldata to a function with `onlyFromCrossDomainAccount()`)
+     * @param _gasLimit The gasLimit for the receipt of the message on the target domain.
+     */
+    function sendCrossDomainMessage(
+        address _crossDomainTarget,
+        bytes memory _data,
+        uint32 _gasLimit
+    ) internal {
+        getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/bridge/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/bridge/index.html new file mode 100644 index 000000000..53b785d67 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/bridge/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/libraries/bridge/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/bridge/ +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 6/6 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_CrossDomainEnabled.sol
100%5/5100%4/4100%4/4100%6/6
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html new file mode 100644 index 000000000..d903ad31e --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html @@ -0,0 +1,1178 @@ + + + + Code coverage report for optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/codec/ Lib_OVMCodec.sol +

+
+
+ 100% + Statements + 33/33 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 33/33 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  + +  + + + + + +  + +  + + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +113× +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+import { Lib_Bytes32Utils } from "../utils/Lib_Bytes32Utils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title Lib_OVMCodec
+ */
+library Lib_OVMCodec {
+ 
+    /*********
+     * Enums *
+     *********/
+ 
+    enum EOASignatureType {
+        EIP155_TRANSACTON,
+        ETH_SIGNED_MESSAGE
+    }
+ 
+    enum QueueOrigin {
+        SEQUENCER_QUEUE,
+        L1TOL2_QUEUE
+    }
+ 
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct Account {
+        uint256 nonce;
+        uint256 balance;
+        bytes32 storageRoot;
+        bytes32 codeHash;
+        address ethAddress;
+        bool isFresh;
+    }
+ 
+    struct EVMAccount {
+        uint256 nonce;
+        uint256 balance;
+        bytes32 storageRoot;
+        bytes32 codeHash;
+    }
+ 
+    struct ChainBatchHeader {
+        uint256 batchIndex;
+        bytes32 batchRoot;
+        uint256 batchSize;
+        uint256 prevTotalElements;
+        bytes extraData;
+    }
+ 
+    struct ChainInclusionProof {
+        uint256 index;
+        bytes32[] siblings;
+    }
+ 
+    struct Transaction {
+        uint256 timestamp;
+        uint256 blockNumber;
+        QueueOrigin l1QueueOrigin;
+        address l1TxOrigin;
+        address entrypoint;
+        uint256 gasLimit;
+        bytes data;
+    }
+ 
+    struct TransactionChainElement {
+        bool isSequenced;
+        uint256 queueIndex;  // QUEUED TX ONLY
+        uint256 timestamp;   // SEQUENCER TX ONLY
+        uint256 blockNumber; // SEQUENCER TX ONLY
+        bytes txData;        // SEQUENCER TX ONLY
+    }
+ 
+    struct QueueElement {
+        bytes32 transactionHash;
+        uint40 timestamp;
+        uint40 blockNumber;
+    }
+ 
+    struct EIP155Transaction {
+        uint256 nonce;
+        uint256 gasPrice;
+        uint256 gasLimit;
+        address to;
+        uint256 value;
+        bytes data;
+        uint256 chainId;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Decodes an EOA transaction (i.e., native Ethereum RLP encoding).
+     * @param _transaction Encoded EOA transaction.
+     * @return Transaction decoded into a struct.
+     */
+    function decodeEIP155Transaction(
+        bytes memory _transaction,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (
+            EIP155Transaction memory
+        )
+    {
+        if (_isEthSignedMessage) {
+            (
+                uint256 _nonce,
+                uint256 _gasLimit,
+                uint256 _gasPrice,
+                uint256 _chainId,
+                address _to,
+                bytes memory _data
+            ) = abi.decode(
+                _transaction,
+                (uint256, uint256, uint256, uint256, address ,bytes)
+            );
+            return EIP155Transaction({
+                nonce: _nonce,
+                gasPrice: _gasPrice,
+                gasLimit: _gasLimit,
+                to: _to,
+                value: 0,
+                data: _data,
+                chainId: _chainId
+            });
+        } else {
+            Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);
+ 
+            return EIP155Transaction({
+                nonce: Lib_RLPReader.readUint256(decoded[0]),
+                gasPrice: Lib_RLPReader.readUint256(decoded[1]),
+                gasLimit: Lib_RLPReader.readUint256(decoded[2]),
+                to: Lib_RLPReader.readAddress(decoded[3]),
+                value: Lib_RLPReader.readUint256(decoded[4]),
+                data: Lib_RLPReader.readBytes(decoded[5]),
+                chainId:  Lib_RLPReader.readUint256(decoded[6])
+            });
+        }
+    }
+ 
+    /**
+     * Decompresses a compressed EIP155 transaction.
+     * @param _transaction Compressed EIP155 transaction bytes.
+     * @return Transaction parsed into a struct.
+     */
+    function decompressEIP155Transaction(
+        bytes memory _transaction
+    )
+        internal
+        returns (
+            EIP155Transaction memory
+        )
+    {
+        return EIP155Transaction({
+            gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),
+            gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,
+            nonce: Lib_BytesUtils.toUint24(_transaction, 6),
+            to: Lib_BytesUtils.toAddress(_transaction, 9),
+            data: Lib_BytesUtils.slice(_transaction, 29),
+            chainId: Lib_SafeExecutionManagerWrapper.safeCHAINID(),
+            value: 0
+        });
+    }
+ 
+    /**
+     * Encodes an EOA transaction back into the original transaction.
+     * @param _transaction EIP155transaction to encode.
+     * @param _isEthSignedMessage Whether or not this was an eth signed message.
+     * @return Encoded transaction.
+     */
+    function encodeEIP155Transaction(
+        EIP155Transaction memory _transaction,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        if (_isEthSignedMessage) {
+            return abi.encode(
+                _transaction.nonce,
+                _transaction.gasLimit,
+                _transaction.gasPrice,
+                _transaction.chainId,
+                _transaction.to,
+                _transaction.data
+            );
+        } else {
+            bytes[] memory raw = new bytes[](9);
+ 
+            raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
+            raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
+            raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
+            if (_transaction.to == address(0)) {
+                raw[3] = Lib_RLPWriter.writeBytes('');
+            } else {
+                raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
+            }
+            raw[4] = Lib_RLPWriter.writeUint(0);
+            raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
+            raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
+            raw[7] = Lib_RLPWriter.writeBytes(bytes(''));
+            raw[8] = Lib_RLPWriter.writeBytes(bytes(''));
+ 
+            return Lib_RLPWriter.writeList(raw);
+        }
+    }
+ 
+    /**
+     * Encodes a standard OVM transaction.
+     * @param _transaction OVM transaction to encode.
+     * @return Encoded transaction bytes.
+     */
+    function encodeTransaction(
+        Transaction memory _transaction
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodePacked(
+            _transaction.timestamp,
+            _transaction.blockNumber,
+            _transaction.l1QueueOrigin,
+            _transaction.l1TxOrigin,
+            _transaction.entrypoint,
+            _transaction.gasLimit,
+            _transaction.data
+        );
+    }
+ 
+    /**
+     * Hashes a standard OVM transaction.
+     * @param _transaction OVM transaction to encode.
+     * @return Hashed transaction
+     */
+    function hashTransaction(
+        Transaction memory _transaction
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(encodeTransaction(_transaction));
+    }
+ 
+    /**
+     * Converts an OVM account to an EVM account.
+     * @param _in OVM account to convert.
+     * @return Converted EVM account.
+     */
+    function toEVMAccount(
+        Account memory _in
+    )
+        internal
+        pure
+        returns (
+            EVMAccount memory
+        )
+    {
+        return EVMAccount({
+            nonce: _in.nonce,
+            balance: _in.balance,
+            storageRoot: _in.storageRoot,
+            codeHash: _in.codeHash
+        });
+    }
+ 
+    /**
+     * @notice RLP-encodes an account state struct.
+     * @param _account Account state struct.
+     * @return RLP-encoded account state.
+     */
+    function encodeEVMAccount(
+        EVMAccount memory _account
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes[] memory raw = new bytes[](4);
+ 
+        // Unfortunately we can't create this array outright because
+        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning
+        // index-by-index circumvents this issue.
+        raw[0] = Lib_RLPWriter.writeBytes(
+            Lib_Bytes32Utils.removeLeadingZeros(
+                bytes32(_account.nonce)
+            )
+        );
+        raw[1] = Lib_RLPWriter.writeBytes(
+            Lib_Bytes32Utils.removeLeadingZeros(
+                bytes32(_account.balance)
+            )
+        );
+        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));
+        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));
+ 
+        return Lib_RLPWriter.writeList(raw);
+    }
+ 
+    /**
+     * @notice Decodes an RLP-encoded account state into a useful struct.
+     * @param _encoded RLP-encoded account state.
+     * @return Account state struct.
+     */
+    function decodeEVMAccount(
+        bytes memory _encoded
+    )
+        internal
+        pure
+        returns (
+            EVMAccount memory
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);
+ 
+        return EVMAccount({
+            nonce: Lib_RLPReader.readUint256(accountState[0]),
+            balance: Lib_RLPReader.readUint256(accountState[1]),
+            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),
+            codeHash: Lib_RLPReader.readBytes32(accountState[3])
+        });
+    }
+ 
+    /**
+     * Calculates a hash for a given batch header.
+     * @param _batchHeader Header to hash.
+     * @return Hash of the header.
+     */
+    function hashBatchHeader(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(
+            abi.encode(
+                _batchHeader.batchRoot,
+                _batchHeader.batchSize,
+                _batchHeader.prevTotalElements,
+                _batchHeader.extraData
+            )
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/codec/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/codec/index.html new file mode 100644 index 000000000..9d8deae87 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/codec/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/libraries/codec/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/codec/ +

+
+
+ 100% + Statements + 33/33 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 33/33 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_OVMCodec.sol
100%33/33100%6/6100%9/9100%33/33
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html new file mode 100644 index 000000000..39482864f --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html @@ -0,0 +1,272 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/resolver/ Lib_AddressManager.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +390× +390× +  +  +  +  +  +  +  +  +  +2164× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2554× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { Ownable } from "./Lib_Ownable.sol";
+ 
+/**
+ * @title Lib_AddressManager
+ */
+contract Lib_AddressManager is Ownable {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event AddressSet(
+        string _name,
+        address _newAddress
+    );
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    mapping (bytes32 => address) private addresses;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function setAddress(
+        string memory _name,
+        address _address
+    )
+        public
+        onlyOwner
+    {
+        emit AddressSet(_name, _address);
+        addresses[_getNameHash(_name)] = _address;
+    }
+ 
+    function getAddress(
+        string memory _name
+    )
+        public
+        view
+        returns (address)
+    {
+        return addresses[_getNameHash(_name)];
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _getNameHash(
+        string memory _name
+    )
+        internal
+        pure
+        returns (
+            bytes32 _hash
+        )
+    {
+        return keccak256(abi.encodePacked(_name));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html new file mode 100644 index 000000000..648b9c25f --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html @@ -0,0 +1,209 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/resolver/ Lib_AddressResolver.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1062× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2133× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressManager } from "./Lib_AddressManager.sol";
+ 
+/**
+ * @title Lib_AddressResolver
+ */
+abstract contract Lib_AddressResolver {
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    Lib_AddressManager internal libAddressManager;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Lib_AddressManager.
+     */
+    constructor(
+        address _libAddressManager
+    )  {
+        libAddressManager = Lib_AddressManager(_libAddressManager);
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function resolve(
+        string memory _name
+    )
+        public
+        view
+        returns (
+            address _contract
+        )
+    {
+        return libAddressManager.getAddress(_name);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html new file mode 100644 index 000000000..b25d23d2e --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html @@ -0,0 +1,293 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/Lib_Ownable.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/resolver/ Lib_Ownable.sol +

+
+
+ 37.5% + Statements + 3/8 +
+
+ 25% + Branches + 1/4 +
+
+ 50% + Functions + 2/4 +
+
+ 44.44% + Lines + 4/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +126× +126× +  +  +  +  +  +  +  +  +390× +  +  +  +390× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Ownable
+ * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
+ */
+abstract contract Ownable {
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    address public owner;
+ 
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event OwnershipTransferred(
+        address indexed previousOwner,
+        address indexed newOwner
+    );
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    constructor() {
+        owner = msg.sender;
+        emit OwnershipTransferred(address(0), owner);
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyOwner() {
+        Erequire(
+            owner == msg.sender,
+            "Ownable: caller is not the owner"
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function renounceOwnership()
+        public
+        virtual
+        onlyOwner
+    {
+        emit OwnershipTransferred(owner, address(0));
+        owner = address(0);
+    }
+ 
+    function transferOwnership(address _newOwner)
+        public
+        virtual
+        onlyOwner
+    {
+        require(
+            _newOwner != address(0),
+            "Ownable: new owner cannot be the zero address"
+        );
+ 
+        emit OwnershipTransferred(owner, _newOwner);
+        owner = _newOwner;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html new file mode 100644 index 000000000..5d72132f0 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html @@ -0,0 +1,281 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/resolver/ Lib_ResolvedDelegateProxy.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 8/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +36× +36× +  +  +  +  +  +  +  +  +  +  +31× +31× +  +  +  +  +31× +  +31× +22× +  +  +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressManager } from "./Lib_AddressManager.sol";
+ 
+/**
+ * @title Lib_ResolvedDelegateProxy
+ */
+contract Lib_ResolvedDelegateProxy {
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+ 
+    // Using mappings to store fields to avoid overwriting storage slots in the
+    // implementation contract. For example, instead of storing these fields at
+    // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.
+    // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html
+    // NOTE: Do not use this code in your own contract system. 
+    //      There is a known flaw in this contract, and we will remove it from the repository
+    //      in the near future. Due to the very limited way that we are using it, this flaw is
+    //      not an issue in our system. 
+    mapping(address=>string) private implementationName;
+    mapping(address=>Lib_AddressManager) private addressManager;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Lib_AddressManager.
+     * @param _implementationName implementationName of the contract to proxy to.
+     */
+    constructor(
+        address _libAddressManager,
+        string memory _implementationName
+    )
+    {
+        addressManager[address(this)] = Lib_AddressManager(_libAddressManager);
+        implementationName[address(this)] = _implementationName;
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        address target = addressManager[address(this)].getAddress((implementationName[address(this)]));
+        Erequire(
+            target != address(0),
+            "Target address must be initialized."
+        );
+ 
+        (bool success, bytes memory returndata) = target.delegatecall(msg.data);
+ 
+        if (success == true) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/index.html new file mode 100644 index 000000000..db7272d11 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/resolver/ +

+
+
+ 75% + Statements + 15/20 +
+
+ 50% + Branches + 4/8 +
+
+ 81.82% + Functions + 9/11 +
+
+ 78.26% + Lines + 18/23 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_AddressManager.sol
100%4/4100%0/0100%3/3100%4/4
Lib_AddressResolver.sol
100%2/2100%0/0100%2/2100%2/2
Lib_Ownable.sol
37.5%3/825%1/450%2/444.44%4/9
Lib_ResolvedDelegateProxy.sol
100%6/675%3/4100%2/2100%8/8
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html new file mode 100644 index 000000000..4e8f16658 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html @@ -0,0 +1,1925 @@ + + + + Code coverage report for optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/rlp/ Lib_RLPReader.sol +

+
+
+ 98.68% + Statements + 75/76 +
+
+ 67.5% + Branches + 27/40 +
+
+ 94.74% + Functions + 18/19 +
+
+ 98.8% + Lines + 82/83 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +512× +512× +  +  +  +512× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +450× +  +  +  +  +  +446× +  +  +  +  +  +  +  +  +446× +  +446× +446× +446× +4230× +  +  +  +  +4230× +  +  +  +  +  +  +  +4230× +  +  +  +  +4230× +4230× +  +  +  +446× +  +  +  +446× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +450× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +651× +  +  +  +  +  +651× +  +  +  +  +651× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +68× +  +  +  +  +68× +  +  +  +  +  +68× +  +  +  +  +68× +68× +68× +  +  +  +  +  +  +  +  +68× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +56× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +776× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5399× +  +  +  +  +5395× +5395× +5395× +  +  +  +5395× +  +  +33× +  +  +  +4334× +  +4334× +  +  +  +  +4334× +  +  +536× +  +536× +  +  +  +  +536× +536× +  +  +  +  +  +  +  +536× +  +  +  +  +536× +  +  +89× +  +89× +  +  +  +  +89× +  +  +403× +  +403× +  +  +  +  +403× +403× +  +  +  +  +  +  +  +403× +  +  +  +  +403× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1427× +1427× + +  +  +1426× +1426× +1426× +  +  +  +  +1426× +2634× +  +  +  +2634× +2634× +  +  +  +1426× +1426× +  +  +  +  +  +  +  +  +  +1426× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +776× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_RLPReader
+ * @dev Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).
+ */
+library Lib_RLPReader {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 constant internal MAX_LIST_LENGTH = 32;
+ 
+ 
+    /*********
+     * Enums *
+     *********/
+ 
+    enum RLPItemType {
+        DATA_ITEM,
+        LIST_ITEM
+    }
+ 
+    
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct RLPItem {
+        uint256 length;
+        uint256 ptr;
+    }
+    
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+    
+    /**
+     * Converts bytes to a reference to memory position and length.
+     * @param _in Input bytes to convert.
+     * @return Output memory reference.
+     */
+    function toRLPItem(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem memory
+        )
+    {
+        uint256 ptr;
+        assembly {
+            ptr := add(_in, 32)
+        }
+ 
+        return RLPItem({
+            length: _in.length,
+            ptr: ptr
+        });
+    }
+ 
+    /**
+     * Reads an RLP list value into a list of RLP items.
+     * @param _in RLP list value.
+     * @return Decoded RLP list items.
+     */
+    function readList(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem[] memory
+        )
+    {
+        (
+            uint256 listOffset,
+            ,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.LIST_ITEM,
+            "Invalid RLP list value."
+        );
+ 
+        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by
+        // writing to the length. Since we can't know the number of RLP items without looping over
+        // the entire input, we'd have to loop twice to accurately size this array. It's easier to
+        // simply set a reasonable maximum list length and decrease the size before we finish.
+        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);
+ 
+        uint256 itemCount = 0;
+        uint256 offset = listOffset;
+        while (offset < _in.length) {
+            Erequire(
+                itemCount < MAX_LIST_LENGTH,
+                "Provided RLP list exceeds max list length."
+            );
+ 
+            (
+                uint256 itemOffset,
+                uint256 itemLength,
+            ) = _decodeLength(RLPItem({
+                length: _in.length - offset,
+                ptr: _in.ptr + offset
+            }));
+ 
+            out[itemCount] = RLPItem({
+                length: itemLength + itemOffset,
+                ptr: _in.ptr + offset
+            });
+ 
+            itemCount += 1;
+            offset += itemOffset + itemLength;
+        }
+ 
+        // Decrease the array size to match the actual item count.
+        assembly {
+            mstore(out, itemCount)
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Reads an RLP list value into a list of RLP items.
+     * @param _in RLP list value.
+     * @return Decoded RLP list items.
+     */
+    function readList(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem[] memory
+        )
+    {
+        return readList(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bytes value into bytes.
+     * @param _in RLP bytes value.
+     * @return Decoded bytes.
+     */
+    function readBytes(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        (
+            uint256 itemOffset,
+            uint256 itemLength,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.DATA_ITEM,
+            "Invalid RLP bytes value."
+        );
+ 
+        return _copy(_in.ptr, itemOffset, itemLength);
+    }
+ 
+    /**
+     * Reads an RLP bytes value into bytes.
+     * @param _in RLP bytes value.
+     * @return Decoded bytes.
+     */
+    function readBytes(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return readBytes(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP string value into a string.
+     * @param _in RLP string value.
+     * @return Decoded string.
+     */
+    function readString(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            string memory
+        )
+    {
+        return string(readBytes(_in));
+    }
+ 
+    /**
+     * Reads an RLP string value into a string.
+     * @param _in RLP string value.
+     * @return Decoded string.
+     */
+    function readString(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            string memory
+        )
+    {
+        return readString(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bytes32 value into a bytes32.
+     * @param _in RLP bytes32 value.
+     * @return Decoded bytes32.
+     */
+    function readBytes32(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        Erequire(
+            _in.length <= 33,
+            "Invalid RLP bytes32 value."
+        );
+ 
+        (
+            uint256 itemOffset,
+            uint256 itemLength,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.DATA_ITEM,
+            "Invalid RLP bytes32 value."
+        );
+ 
+        uint256 ptr = _in.ptr + itemOffset;
+        bytes32 out;
+        assembly {
+            out := mload(ptr)
+ 
+            // Shift the bytes over to match the item size.
+            if lt(itemLength, 32) {
+                out := div(out, exp(256, sub(32, itemLength)))
+            }
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Reads an RLP bytes32 value into a bytes32.
+     * @param _in RLP bytes32 value.
+     * @return Decoded bytes32.
+     */
+    function readBytes32(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return readBytes32(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP uint256 value into a uint256.
+     * @param _in RLP uint256 value.
+     * @return Decoded uint256.
+     */
+    function readUint256(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        return uint256(readBytes32(_in));
+    }
+ 
+    /**
+     * Reads an RLP uint256 value into a uint256.
+     * @param _in RLP uint256 value.
+     * @return Decoded uint256.
+     */
+    function readUint256(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        return readUint256(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bool value into a bool.
+     * @param _in RLP bool value.
+     * @return Decoded bool.
+     */
+    function readBool(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        Erequire(
+            _in.length == 1,
+            "Invalid RLP boolean value."
+        );
+ 
+        uint256 ptr = _in.ptr;
+        uint256 out;
+        assembly {
+            out := byte(0, mload(ptr))
+        }
+ 
+        return out != 0;
+    }
+ 
+    /**
+     * Reads an RLP bool value into a bool.
+     * @param _in RLP bool value.
+     * @return Decoded bool.
+     */
+    function readBool(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        return readBool(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP address value into a address.
+     * @param _in RLP address value.
+     * @return Decoded address.
+     */
+    function readAddress(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        if (_in.length == 1) {
+            return address(0);
+        }
+ 
+        Erequire(
+            _in.length == 21,
+            "Invalid RLP address value."
+        );
+ 
+        return address(readUint256(_in));
+    }
+ 
+    /**
+     * Reads an RLP address value into a address.
+     * @param _in RLP address value.
+     * @return Decoded address.
+     */
+    function readAddress(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        return readAddress(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads the raw bytes of an RLP item.
+     * @param _in RLP item to read.
+     * @return Raw RLP bytes.
+     */
+    function readRawBytes(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return _copy(_in);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Decodes the length of an RLP item.
+     * @param _in RLP item to decode.
+     * @return Offset of the encoded data.
+     * @return Length of the encoded data.
+     * @return RLP item type (LIST_ITEM or DATA_ITEM).
+     */
+    function _decodeLength(
+        RLPItem memory _in
+    )
+        private
+        pure
+        returns (
+            uint256,
+            uint256,
+            RLPItemType
+        )
+    {
+        require(
+            _in.length > 0,
+            "RLP item cannot be null."
+        );
+ 
+        uint256 ptr = _in.ptr;
+        uint256 prefix;
+        assembly {
+            prefix := byte(0, mload(ptr))
+        }
+ 
+        if (prefix <= 0x7f) {
+            // Single byte.
+ 
+            return (0, 1, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xb7) {
+            // Short string.
+ 
+            uint256 strLen = prefix - 0x80;
+            
+            Erequire(
+                _in.length > strLen,
+                "Invalid RLP short string."
+            );
+ 
+            return (1, strLen, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xbf) {
+            // Long string.
+            uint256 lenOfStrLen = prefix - 0xb7;
+ 
+            Erequire(
+                _in.length > lenOfStrLen,
+                "Invalid RLP long string length."
+            );
+ 
+            uint256 strLen;
+            assembly {
+                // Pick out the string length.
+                strLen := div(
+                    mload(add(ptr, 1)),
+                    exp(256, sub(32, lenOfStrLen))
+                )
+            }
+ 
+            Erequire(
+                _in.length > lenOfStrLen + strLen,
+                "Invalid RLP long string."
+            );
+ 
+            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xf7) {
+            // Short list.
+            uint256 listLen = prefix - 0xc0;
+ 
+            Erequire(
+                _in.length > listLen,
+                "Invalid RLP short list."
+            );
+ 
+            return (1, listLen, RLPItemType.LIST_ITEM);
+        } else {
+            // Long list.
+            uint256 lenOfListLen = prefix - 0xf7;
+ 
+            Erequire(
+                _in.length > lenOfListLen,
+                "Invalid RLP long list length."
+            );
+ 
+            uint256 listLen;
+            assembly {
+                // Pick out the list length.
+                listLen := div(
+                    mload(add(ptr, 1)),
+                    exp(256, sub(32, lenOfListLen))
+                )
+            }
+ 
+            Erequire(
+                _in.length > lenOfListLen + listLen,
+                "Invalid RLP long list."
+            );
+ 
+            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);
+        }
+    }
+ 
+    /**
+     * Copies the bytes from a memory location.
+     * @param _src Pointer to the location to read from.
+     * @param _offset Offset to start reading from.
+     * @param _length Number of bytes to read.
+     * @return Copied bytes.
+     */
+    function _copy(
+        uint256 _src,
+        uint256 _offset,
+        uint256 _length
+    )
+        private
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes memory out = new bytes(_length);
+        if (out.length == 0) {
+            return out;
+        }
+ 
+        uint256 src = _src + _offset;
+        uint256 dest;
+        assembly {
+            dest := add(out, 32)
+        }
+ 
+        // Copy over as many complete words as we can.
+        for (uint256 i = 0; i < _length / 32; i++) {
+            assembly {
+                mstore(dest, mload(src))
+            }
+ 
+            src += 32;
+            dest += 32;
+        }
+ 
+        // Pick out the remaining bytes.
+        uint256 mask = 256 ** (32 - (_length % 32)) - 1;
+        assembly {
+            mstore(
+                dest,
+                or(
+                    and(mload(src), not(mask)),
+                    and(mload(dest), mask)
+                )
+            )
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Copies an RLP item into bytes.
+     * @param _in RLP item to copy.
+     * @return Copied bytes.
+     */
+    function _copy(
+        RLPItem memory _in
+    )
+        private
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return _copy(_in.ptr, 0, _in.length);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html new file mode 100644 index 000000000..03e613a85 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html @@ -0,0 +1,911 @@ + + + + Code coverage report for optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/rlp/ Lib_RLPWriter.sol +

+
+
+ 94.55% + Statements + 52/55 +
+
+ 100% + Branches + 8/8 +
+
+ 90% + Functions + 9/10 +
+
+ 95.08% + Lines + 58/61 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +324× +  +324× +16× +  +308× +  +  +324× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +157× +157× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +139× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +465× +  +465× +415× +415× +  +50× +50× +50× +72× +72× +  +  +50× +50× +50× +72× +  +  +  +465× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +  +52× +52× +1643× +24× +  +  +  +52× +52× +45× +  +  +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1030× +1030× +1030× +  +1030× +420× +  +  +420× +420× +  +  +1030× +1030× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +157× + +  +  +149× +149× +149× +1030× +  +  +149× +149× +149× +  +149× +1030× +  +1030× +1030× +  +1030× +1030× +  +  +149× +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+ 
+/**
+ * @title Lib_RLPWriter
+ * @author Bakaoh (with modifications)
+ */
+library Lib_RLPWriter {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * RLP encodes a byte string.
+     * @param _in The byte string to encode.
+     * @return _out The RLP encoded string in bytes.
+     */
+    function writeBytes(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory encoded;
+ 
+        if (_in.length == 1 && uint8(_in[0]) < 128) {
+            encoded = _in;
+        } else {
+            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);
+        }
+ 
+        return encoded;
+    }
+ 
+    /**
+     * RLP encodes a list of RLP encoded byte byte strings.
+     * @param _in The list of RLP encoded byte strings.
+     * @return _out The RLP encoded list of items in bytes.
+     */
+    function writeList(
+        bytes[] memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory list = _flatten(_in);
+        return abi.encodePacked(_writeLength(list.length, 192), list);
+    }
+ 
+    /**
+     * RLP encodes a string.
+     * @param _in The string to encode.
+     * @return _out The RLP encoded string in bytes.
+     */
+    function writeString(
+        string memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(bytes(_in));
+    }
+ 
+    /**
+     * RLP encodes an address.
+     * @param _in The address to encode.
+     * @return _out The RLP encoded address in bytes.
+     */
+    function writeAddress(
+        address _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(abi.encodePacked(_in));
+    }
+ 
+    /**
+     * RLP encodes a uint.
+     * @param _in The uint256 to encode.
+     * @return _out The RLP encoded uint256 in bytes.
+     */
+    function writeUint(
+        uint256 _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(_toBinary(_in));
+    }
+ 
+    /**
+     * RLP encodes a bool.
+     * @param _in The bool to encode.
+     * @return _out The RLP encoded bool in bytes.
+     */
+    function writeBool(
+        bool _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory encoded = new bytes(1);
+        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));
+        return encoded;
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.
+     * @param _len The length of the string or the payload.
+     * @param _offset 128 if item is string, 192 if item is list.
+     * @return _encoded RLP encoded bytes.
+     */
+    function _writeLength(
+        uint256 _len,
+        uint256 _offset
+    )
+        private
+        pure
+        returns (
+            bytes memory _encoded
+        )
+    {
+        bytes memory encoded;
+ 
+        if (_len < 56) {
+            encoded = new bytes(1);
+            encoded[0] = byte(uint8(_len) + uint8(_offset));
+        } else {
+            uint256 lenLen;
+            uint256 i = 1;
+            while (_len / i != 0) {
+                lenLen++;
+                i *= 256;
+            }
+ 
+            encoded = new bytes(lenLen + 1);
+            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);
+            for(i = 1; i <= lenLen; i++) {
+                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));
+            }
+        }
+ 
+        return encoded;
+    }
+ 
+    /**
+     * Encode integer in big endian binary form with no leading zeroes.
+     * @notice TODO: This should be optimized with assembly to save gas costs.
+     * @param _x The integer to encode.
+     * @return _binary RLP encoded bytes.
+     */
+    function _toBinary(
+        uint256 _x
+    )
+        private
+        pure
+        returns (
+            bytes memory _binary
+        )
+    {
+        bytes memory b = abi.encodePacked(_x);
+ 
+        uint256 i = 0;
+        for (; i < 32; i++) {
+            if (b[i] != 0) {
+                break;
+            }
+        }
+ 
+        bytes memory res = new bytes(32 - i);
+        for (uint256 j = 0; j < res.length; j++) {
+            res[j] = b[i++];
+        }
+ 
+        return res;
+    }
+ 
+    /**
+     * Copies a piece of memory to another location.
+     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.
+     * @param _dest Destination location.
+     * @param _src Source location.
+     * @param _len Length of memory to copy.
+     */
+    function _memcpy(
+        uint256 _dest,
+        uint256 _src,
+        uint256 _len
+    )
+        private
+        pure
+    {
+        uint256 dest = _dest;
+        uint256 src = _src;
+        uint256 len = _len;
+ 
+        for(; len >= 32; len -= 32) {
+            assembly {
+                mstore(dest, mload(src))
+            }
+            dest += 32;
+            src += 32;
+        }
+ 
+        uint256 mask = 256 ** (32 - len) - 1;
+        assembly {
+            let srcpart := and(mload(src), not(mask))
+            let destpart := and(mload(dest), mask)
+            mstore(dest, or(destpart, srcpart))
+        }
+    }
+ 
+    /**
+     * Flattens a list of byte strings into one byte string.
+     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.
+     * @param _list List of byte strings to flatten.
+     * @return _flattened The flattened byte string.
+     */
+    function _flatten(
+        bytes[] memory _list
+    )
+        private
+        pure
+        returns (
+            bytes memory _flattened
+        )
+    {
+        if (_list.length == 0) {
+            return new bytes(0);
+        }
+ 
+        uint256 len;
+        uint256 i = 0;
+        for (; i < _list.length; i++) {
+            len += _list[i].length;
+        }
+ 
+        bytes memory flattened = new bytes(len);
+        uint256 flattenedPtr;
+        assembly { flattenedPtr := add(flattened, 0x20) }
+ 
+        for(i = 0; i < _list.length; i++) {
+            bytes memory item = _list[i];
+ 
+            uint256 listPtr;
+            assembly { listPtr := add(item, 0x20)}
+ 
+            _memcpy(flattenedPtr, listPtr, item.length);
+            flattenedPtr += _list[i].length;
+        }
+ 
+        return flattened;
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/rlp/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/rlp/index.html new file mode 100644 index 000000000..a6477149e --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/rlp/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/libraries/rlp/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/rlp/ +

+
+
+ 96.95% + Statements + 127/131 +
+
+ 72.92% + Branches + 35/48 +
+
+ 93.1% + Functions + 27/29 +
+
+ 97.22% + Lines + 140/144 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_RLPReader.sol
98.68%75/7667.5%27/4094.74%18/1998.8%82/83
Lib_RLPWriter.sol
94.55%52/55100%8/890%9/1095.08%58/61
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html new file mode 100644 index 000000000..c7a07cece --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/standards/ IUniswapV2ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+interface IUniswapV2ERC20 {
+    event Approval(address indexed owner, address indexed spender, uint value);
+    event Transfer(address indexed from, address indexed to, uint value);
+ 
+    function name() external view returns (string memory);
+    function symbol() external view returns (string memory);
+    function decimals() external view returns (uint8);
+    function totalSupply() external view returns (uint);
+    function balanceOf(address owner) external view returns (uint);
+    function allowance(address owner, address spender) external view returns (uint);
+ 
+    function approve(address spender, uint value) external returns (bool);
+    function transfer(address to, uint value) external returns (bool);
+    function transferFrom(address from, address to, uint value) external returns (bool);
+ 
+    function DOMAIN_SEPARATOR() external view returns (bytes32);
+    function PERMIT_TYPEHASH() external pure returns (bytes32);
+    function nonces(address owner) external view returns (uint);
+ 
+    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html new file mode 100644 index 000000000..fca77d0f2 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/libraries/standards/UniSafeMath.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/standards/ UniSafeMath.sol +

+
+
+ 66.67% + Statements + 2/3 +
+
+ 33.33% + Branches + 2/6 +
+
+ 66.67% + Functions + 2/3 +
+
+ 66.67% + Lines + 2/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  + +  +  +  +10× +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
+ 
+library UniSafeMath {
+    function add(uint x, uint y) internal pure returns (uint z) {
+        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
+    }
+ 
+    function sub(uint x, uint y) internal pure returns (uint z) {
+        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
+    }
+ 
+    function mul(uint x, uint y) internal pure returns (uint z) {
+        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html new file mode 100644 index 000000000..17a1f4209 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html @@ -0,0 +1,359 @@ + + + + Code coverage report for optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/standards/ UniswapV2ERC20.sol +

+
+
+ 82.14% + Statements + 23/28 +
+
+ 16.67% + Branches + 1/6 +
+
+ 88.89% + Functions + 8/9 +
+
+ 82.76% + Lines + 24/29 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +39× +39× +  +39× +39× +  +  +39× +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  + + + +  +  +  + + +  +  +  + + + +  +  +  + + +  +  +  + + +  +  +  + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+import './IUniswapV2ERC20.sol';
+import './UniSafeMath.sol';
+ 
+contract UniswapV2ERC20 is IUniswapV2ERC20 {
+    using UniSafeMath for uint;
+ 
+    string public override name;
+    string public override symbol;
+    uint8 public constant override decimals = 18;
+    uint public override totalSupply;
+    mapping(address => uint) public override balanceOf;
+    mapping(address => mapping(address => uint)) public override allowance;
+ 
+    bytes32 public override DOMAIN_SEPARATOR;
+    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
+    bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
+    mapping(address => uint) public override nonces;
+ 
+    constructor(
+    string memory _name,
+        string memory _symbol
+    ) {
+        name = _name;
+        symbol = _symbol;
+ 
+        uint chainId;
+        assembly {
+            chainId := chainid()
+        }
+        DOMAIN_SEPARATOR = keccak256(
+            abi.encode(
+                keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
+                keccak256(bytes(name)),
+                keccak256(bytes('1')),
+                chainId,
+                address(this)
+            )
+        );
+    }
+ 
+    function _mint(address to, uint value) internal {
+        totalSupply = totalSupply.add(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(address(0), to, value);
+    }
+ 
+    function _burn(address from, uint value) internal {
+        balanceOf[from] = balanceOf[from].sub(value);
+        totalSupply = totalSupply.sub(value);
+        emit Transfer(from, address(0), value);
+    }
+ 
+    function _approve(address owner, address spender, uint value) private {
+        allowance[owner][spender] = value;
+        emit Approval(owner, spender, value);
+    }
+ 
+    function _transfer(address from, address to, uint value) private {
+        balanceOf[from] = balanceOf[from].sub(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(from, to, value);
+    }
+ 
+    function approve(address spender, uint value) external override returns (bool) {
+        _approve(msg.sender, spender, value);
+        return true;
+    }
+ 
+    function transfer(address to, uint value) external override returns (bool) {
+        _transfer(msg.sender, to, value);
+        return true;
+    }
+ 
+    function transferFrom(address from, address to, uint value) external override returns (bool) {
+        Eif (allowance[from][msg.sender] != uint(-1)) {
+            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
+        }
+        _transfer(from, to, value);
+        return true;
+    }
+ 
+    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override {
+        require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
+        bytes32 digest = keccak256(
+            abi.encodePacked(
+                '\x19\x01',
+                DOMAIN_SEPARATOR,
+                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
+            )
+        );
+        address recoveredAddress = ecrecover(digest, v, r, s);
+        require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
+        _approve(owner, spender, value);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/standards/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/standards/index.html new file mode 100644 index 000000000..a7881423d --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/standards/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/libraries/standards/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/standards/ +

+
+
+ 80.65% + Statements + 25/31 +
+
+ 25% + Branches + 3/12 +
+
+ 83.33% + Functions + 10/12 +
+
+ 81.25% + Lines + 26/32 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
IUniswapV2ERC20.sol
100%0/0100%0/0100%0/0100%0/0
UniSafeMath.sol
66.67%2/333.33%2/666.67%2/366.67%2/3
UniswapV2ERC20.sol
82.14%23/2816.67%1/688.89%8/982.76%24/29
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html new file mode 100644 index 000000000..873c10410 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html @@ -0,0 +1,2945 @@ + + + + Code coverage report for optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/trie/ Lib_MerkleTrie.sol +

+
+
+ 72.45% + Statements + 142/196 +
+
+ 55.88% + Branches + 38/68 +
+
+ 84.62% + Functions + 22/26 +
+
+ 72.02% + Lines + 139/193 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +22× +22× +22× +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +77× +73× +  +58× +  +58× +  +  +  +  +58× +  +58× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +95× +95× +  +95× +95× +95× +95× +  +  +95× +243× +243× +  +  +  +243× +  +243× +  +95× +  +  +  +  +  +148× +  +  +  +  +  +  +  +  +  +  +  +229× +147× +  +  +  +  +  +147× +147× +147× +147× +147× +  +  +82× +82× +82× +82× +82× +82× +  +82× +80× +  +  +  +  +  +73× +  +  +  +80× +80× +  + +  +  +  +  +  +  +  + + + +  +  + +  +  +  +  +  +  +  +80× +80× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +22× +  +  +  +  +  +22× +22× +  +22× +  +  +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +22× +22× +  +  +22× +  +65× +65× +  +65× +  +  +22× +22× +  +  + + +  +  +  + +  + +  +  +  +  +42× +  +42× +42× +42× +  +  +  +  +65× +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +99× +95× +  +95× +265× +265× +  +  +  +  +  +95× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +148× +  +148× +  +  +  +  +148× +  +  +148× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +172× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +51× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +65× +  +  +65× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +87× +42× +  +45× +45× +  +45× +44× +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +82× +82× +4991× +  +82× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +65× +  +65× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +714× +  +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +22× +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +23× +23× +23× +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +26× +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +43× +  +  +  +22× +22× +  +  +22× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+ 
+/**
+ * @title Lib_MerkleTrie
+ */
+library Lib_MerkleTrie {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum NodeType {
+        BranchNode,
+        ExtensionNode,
+        LeafNode
+    }
+ 
+    struct TrieNode {
+        bytes encoded;
+        Lib_RLPReader.RLPItem[] decoded;
+    }
+ 
+ 
+    /**********************
+     * Contract Constants *
+     **********************/
+ 
+    // TREE_RADIX determines the number of elements per branch node.
+    uint256 constant TREE_RADIX = 16;
+    // Branch nodes have TREE_RADIX elements plus an additional `value` slot.
+    uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;
+    // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.
+    uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;
+ 
+    // Prefixes are prepended to the `path` within a leaf or extension node and
+    // allow us to differentiate between the two node types. `ODD` or `EVEN` is
+    // determined by the number of nibbles within the unprefixed `path`. If the
+    // number of nibbles if even, we need to insert an extra padding nibble so
+    // the resulting prefixed `path` has an even number of nibbles.
+    uint8 constant PREFIX_EXTENSION_EVEN = 0;
+    uint8 constant PREFIX_EXTENSION_ODD = 1;
+    uint8 constant PREFIX_LEAF_EVEN = 2;
+    uint8 constant PREFIX_LEAF_ODD = 3;
+ 
+    // Just a utility constant. RLP represents `NULL` as 0x80.
+    bytes1 constant RLP_NULL = bytes1(0x80);
+    bytes constant RLP_NULL_BYTES = hex'80';
+    bytes32 constant internal KECCAK256_RLP_NULL_BYTES = keccak256(RLP_NULL_BYTES);
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Verifies a proof that a given key/value pair is present in the
+     * Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _value Value of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
+     * traditional Merkle trees, this proof is executed top-down and consists
+     * of a list of RLP-encoded nodes that make a path down to the target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
+     */
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        (
+            bool exists,
+            bytes memory value
+        ) = get(_key, _proof, _root);
+ 
+        return (
+            exists && Lib_BytesUtils.equal(_value, value)
+        );
+    }
+ 
+    /**
+     * @notice Verifies a proof that a given key is *not* present in
+     * the Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the key is absent in the trie, `false` otherwise.
+     */
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        (
+            bool exists,
+        ) = get(_key, _proof, _root);
+ 
+        return exists == false;
+    }
+ 
+    /**
+     * @notice Updates a Merkle trie and returns a new root hash.
+     * @param _key Key of the node to update, as a hex string.
+     * @param _value Value of the node to update, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node. If the key exists, we can simply update the value.
+     * Otherwise, we need to modify the trie to handle the new k/v pair.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _updatedRoot Root hash of the newly constructed trie.
+     */
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        // Special case when inserting the very first node.
+        Iif (_root == KECCAK256_RLP_NULL_BYTES) {
+            return getSingleNodeRootHash(_key, _value);
+        }
+ 
+        TrieNode[] memory proof = _parseProof(_proof);
+        (uint256 pathLength, bytes memory keyRemainder, ) = _walkNodePath(proof, _key, _root);
+        TrieNode[] memory newPath = _getNewPath(proof, pathLength, keyRemainder, _value);
+ 
+        return _getUpdatedTrieRoot(newPath, _key);
+    }
+ 
+    /**
+     * @notice Retrieves the value associated with a given key.
+     * @param _key Key to search for, as hex bytes.
+     * @param _proof Merkle trie inclusion proof for the key.
+     * @param _root Known root of the Merkle trie.
+     * @return _exists Whether or not the key exists.
+     * @return _value Value of the key if it exists.
+     */
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _exists,
+            bytes memory _value
+        )
+    {
+        TrieNode[] memory proof = _parseProof(_proof);
+        (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(proof, _key, _root);
+ 
+        bool exists = keyRemainder.length == 0;
+ 
+        Erequire(
+            exists || isFinalNode,
+            "Provided proof is invalid."
+        );
+ 
+        bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes('');
+ 
+        return (
+            exists,
+            value
+        );
+    }
+ 
+    /**
+     * Computes the root hash for a trie with a single node.
+     * @param _key Key for the single node.
+     * @param _value Value for the single node.
+     * @return _updatedRoot Hash of the trie.
+     */
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        return keccak256(_makeLeafNode(
+            Lib_BytesUtils.toNibbles(_key),
+            _value
+        ).encoded);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * @notice Walks through a proof using a provided key.
+     * @param _proof Inclusion proof to walk through.
+     * @param _key Key to use for the walk.
+     * @param _root Known root of the trie.
+     * @return _pathLength Length of the final path
+     * @return _keyRemainder Portion of the key remaining after the walk.
+     * @return _isFinalNode Whether or not we've hit a dead end.
+     */
+    function _walkNodePath(
+        TrieNode[] memory _proof,
+        bytes memory _key,
+        bytes32 _root
+    )
+        private
+        pure
+        returns (
+            uint256 _pathLength,
+            bytes memory _keyRemainder,
+            bool _isFinalNode
+        )
+    {
+        uint256 pathLength = 0;
+        bytes memory key = Lib_BytesUtils.toNibbles(_key);
+ 
+        bytes32 currentNodeID = _root;
+        uint256 currentKeyIndex = 0;
+        uint256 currentKeyIncrement = 0;
+        TrieNode memory currentNode;
+ 
+        // Proof is top-down, so we start at the first element (root).
+        for (uint256 i = 0; i < _proof.length; i++) {
+            currentNode = _proof[i];
+            currentKeyIndex += currentKeyIncrement;
+ 
+            // Keep track of the proof elements we actually need.
+            // It's expensive to resize arrays, so this simply reduces gas costs.
+            pathLength += 1;
+ 
+            if (currentKeyIndex == 0) {
+                // First proof element is always the root node.
+                require(
+                    keccak256(currentNode.encoded) == currentNodeID,
+                    "Invalid root hash"
+                );
+            } else Eif (currentNode.encoded.length >= 32) {
+                // Nodes 32 bytes or larger are hashed inside branch nodes.
+                require(
+                    keccak256(currentNode.encoded) == currentNodeID,
+                    "Invalid large internal hash"
+                );
+            } else {
+                // Nodes smaller than 31 bytes aren't hashed.
+                require(
+                    Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
+                    "Invalid internal node hash"
+                );
+            }
+ 
+            if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {
+                Iif (currentKeyIndex == key.length) {
+                    // We've hit the end of the key, meaning the value should be within this branch node.
+                    break;
+                } else {
+                    // We're not at the end of the key yet.
+                    // Figure out what the next node ID should be and continue.
+                    uint8 branchKey = uint8(key[currentKeyIndex]);
+                    Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
+                    currentNodeID = _getNodeID(nextNode);
+                    currentKeyIncrement = 1;
+                    continue;
+                }
+            } else Eif (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
+                bytes memory path = _getNodePath(currentNode);
+                uint8 prefix = uint8(path[0]);
+                uint8 offset = 2 - prefix % 2;
+                bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);
+                bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);
+                uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
+ 
+                if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
+                    if (
+                        pathRemainder.length == sharedNibbleLength &&
+                        keyRemainder.length == sharedNibbleLength
+                    ) {
+                        // The key within this leaf matches our key exactly.
+                        // Increment the key index to reflect that we have no remainder.
+                        currentKeyIndex += sharedNibbleLength;
+                    }
+ 
+                    // We've hit a leaf node, so our next node should be NULL.
+                    currentNodeID = bytes32(RLP_NULL);
+                    break;
+                } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
+                    Iif (sharedNibbleLength == 0) {
+                        // Our extension node doesn't share any part of our key.
+                        // We've hit the end of this path, updates will need to modify this extension.
+                        currentNodeID = bytes32(RLP_NULL);
+                        break;
+                    } else {
+                        // Our extension shares some nibbles.
+                        // Carry on to the next node.
+                        currentNodeID = _getNodeID(currentNode.decoded[1]);
+                        currentKeyIncrement = sharedNibbleLength;
+                        continue;
+                    }
+                } else {
+                    revert("Received a node with an unknown prefix");
+                }
+            } else {
+                revert("Received an unparseable node.");
+            }
+        }
+ 
+        // If our node ID is NULL, then we're at a dead end.
+        bool isFinalNode = currentNodeID == bytes32(RLP_NULL);
+        return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);
+    }
+ 
+    /**
+     * @notice Creates new nodes to support a k/v pair insertion into a given
+     * Merkle trie path.
+     * @param _path Path to the node nearest the k/v pair.
+     * @param _pathLength Length of the path. Necessary because the provided
+     * path may include additional nodes (e.g., it comes directly from a proof)
+     * and we can't resize in-memory arrays without costly duplication.
+     * @param _keyRemainder Portion of the initial key that must be inserted
+     * into the trie.
+     * @param _value Value to insert at the given key.
+     * @return _newPath A new path with the inserted k/v pair and extra supporting nodes.
+     */
+    function _getNewPath(
+        TrieNode[] memory _path,
+        uint256 _pathLength,
+        bytes memory _keyRemainder,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _newPath
+        )
+    {
+        bytes memory keyRemainder = _keyRemainder;
+ 
+        // Most of our logic depends on the status of the last node in the path.
+        TrieNode memory lastNode = _path[_pathLength - 1];
+        NodeType lastNodeType = _getNodeType(lastNode);
+ 
+        // Create an array for newly created nodes.
+        // We need up to three new nodes, depending on the contents of the last node.
+        // Since array resizing is expensive, we'll keep track of the size manually.
+        // We're using an explicit `totalNewNodes += 1` after insertions for clarity.
+        TrieNode[] memory newNodes = new TrieNode[](3);
+        uint256 totalNewNodes = 0;
+ 
+        Eif (keyRemainder.length == 0 && lastNodeType == NodeType.LeafNode) {
+            // We've found a leaf node with the given key.
+            // Simply need to update the value of the node to match.
+            newNodes[totalNewNodes] = _makeLeafNode(_getNodeKey(lastNode), _value);
+            totalNewNodes += 1;
+        } else if (lastNodeType == NodeType.BranchNode) {
+            if (keyRemainder.length == 0) {
+                // We've found a branch node with the given key.
+                // Simply need to update the value of the node to match.
+                newNodes[totalNewNodes] = _editBranchValue(lastNode, _value);
+                totalNewNodes += 1;
+            } else {
+                // We've found a branch node, but it doesn't contain our key.
+                // Reinsert the old branch for now.
+                newNodes[totalNewNodes] = lastNode;
+                totalNewNodes += 1;
+                // Create a new leaf node, slicing our remainder since the first byte points
+                // to our branch node.
+                newNodes[totalNewNodes] = _makeLeafNode(Lib_BytesUtils.slice(keyRemainder, 1), _value);
+                totalNewNodes += 1;
+            }
+        } else {
+            // Our last node is either an extension node or a leaf node with a different key.
+            bytes memory lastNodeKey = _getNodeKey(lastNode);
+            uint256 sharedNibbleLength = _getSharedNibbleLength(lastNodeKey, keyRemainder);
+ 
+            if (sharedNibbleLength != 0) {
+                // We've got some shared nibbles between the last node and our key remainder.
+                // We'll need to insert an extension node that covers these shared nibbles.
+                bytes memory nextNodeKey = Lib_BytesUtils.slice(lastNodeKey, 0, sharedNibbleLength);
+                newNodes[totalNewNodes] = _makeExtensionNode(nextNodeKey, _getNodeHash(_value));
+                totalNewNodes += 1;
+ 
+                // Cut down the keys since we've just covered these shared nibbles.
+                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, sharedNibbleLength);
+                keyRemainder = Lib_BytesUtils.slice(keyRemainder, sharedNibbleLength);
+            }
+ 
+            // Create an empty branch to fill in.
+            TrieNode memory newBranch = _makeEmptyBranchNode();
+ 
+            if (lastNodeKey.length == 0) {
+                // Key remainder was larger than the key for our last node.
+                // The value within our last node is therefore going to be shifted into
+                // a branch value slot.
+                newBranch = _editBranchValue(newBranch, _getNodeValue(lastNode));
+            } else {
+                // Last node key was larger than the key remainder.
+                // We're going to modify some index of our branch.
+                uint8 branchKey = uint8(lastNodeKey[0]);
+                // Move on to the next nibble.
+                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, 1);
+ 
+                if (lastNodeType == NodeType.LeafNode) {
+                    // We're dealing with a leaf node.
+                    // We'll modify the key and insert the old leaf node into the branch index.
+                    TrieNode memory modifiedLastNode = _makeLeafNode(lastNodeKey, _getNodeValue(lastNode));
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
+                } else if (lastNodeKey.length != 0) {
+                    // We're dealing with a shrinking extension node.
+                    // We need to modify the node to decrease the size of the key.
+                    TrieNode memory modifiedLastNode = _makeExtensionNode(lastNodeKey, _getNodeValue(lastNode));
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
+                } else {
+                    // We're dealing with an unnecessary extension node.
+                    // We're going to delete the node entirely.
+                    // Simply insert its current value into the branch index.
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeValue(lastNode));
+                }
+            }
+ 
+            if (keyRemainder.length == 0) {
+                // We've got nothing left in the key remainder.
+                // Simply insert the value into the branch value slot.
+                newBranch = _editBranchValue(newBranch, _value);
+                // Push the branch into the list of new nodes.
+                newNodes[totalNewNodes] = newBranch;
+                totalNewNodes += 1;
+            } else {
+                // We've got some key remainder to work with.
+                // We'll be inserting a leaf node into the trie.
+                // First, move on to the next nibble.
+                keyRemainder = Lib_BytesUtils.slice(keyRemainder, 1);
+                // Push the branch into the list of new nodes.
+                newNodes[totalNewNodes] = newBranch;
+                totalNewNodes += 1;
+                // Push a new leaf node for our k/v pair.
+                newNodes[totalNewNodes] = _makeLeafNode(keyRemainder, _value);
+                totalNewNodes += 1;
+            }
+        }
+ 
+        // Finally, join the old path with our newly created nodes.
+        // Since we're overwriting the last node in the path, we use `_pathLength - 1`.
+        return _joinNodeArrays(_path, _pathLength - 1, newNodes, totalNewNodes);
+    }
+ 
+    /**
+     * @notice Computes the trie root from a given path.
+     * @param _nodes Path to some k/v pair.
+     * @param _key Key for the k/v pair.
+     * @return _updatedRoot Root hash for the updated trie.
+     */
+    function _getUpdatedTrieRoot(
+        TrieNode[] memory _nodes,
+        bytes memory _key
+    )
+        private
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = Lib_BytesUtils.toNibbles(_key);
+ 
+        // Some variables to keep track of during iteration.
+        TrieNode memory currentNode;
+        NodeType currentNodeType;
+        bytes memory previousNodeHash;
+ 
+        // Run through the path backwards to rebuild our root hash.
+        for (uint256 i = _nodes.length; i > 0; i--) {
+            // Pick out the current node.
+            currentNode = _nodes[i - 1];
+            currentNodeType = _getNodeType(currentNode);
+ 
+            if (currentNodeType == NodeType.LeafNode) {
+                // Leaf nodes are already correctly encoded.
+                // Shift the key over to account for the nodes key.
+                bytes memory nodeKey = _getNodeKey(currentNode);
+                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
+            } else if (currentNodeType == NodeType.ExtensionNode) {
+                // Shift the key over to account for the nodes key.
+                bytes memory nodeKey = _getNodeKey(currentNode);
+                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
+ 
+                // If this node is the last element in the path, it'll be correctly encoded
+                // and we can skip this part.
+                Eif (previousNodeHash.length > 0) {
+                    // Re-encode the node based on the previous node.
+                    currentNode = _makeExtensionNode(nodeKey, previousNodeHash);
+                }
+            } else Eif (currentNodeType == NodeType.BranchNode) {
+                // If this node is the last element in the path, it'll be correctly encoded
+                // and we can skip this part.
+                Eif (previousNodeHash.length > 0) {
+                    // Re-encode the node based on the previous node.
+                    uint8 branchKey = uint8(key[key.length - 1]);
+                    key = Lib_BytesUtils.slice(key, 0, key.length - 1);
+                    currentNode = _editBranchIndex(currentNode, branchKey, previousNodeHash);
+                }
+            }
+ 
+            // Compute the node hash for the next iteration.
+            previousNodeHash = _getNodeHash(currentNode.encoded);
+        }
+ 
+        // Current node should be the root at this point.
+        // Simply return the hash of its encoding.
+        return keccak256(currentNode.encoded);
+    }
+ 
+    /**
+     * @notice Parses an RLP-encoded proof into something more useful.
+     * @param _proof RLP-encoded proof to parse.
+     * @return _parsed Proof parsed into easily accessible structs.
+     */
+    function _parseProof(
+        bytes memory _proof
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _parsed
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);
+        TrieNode[] memory proof = new TrieNode[](nodes.length);
+ 
+        for (uint256 i = 0; i < nodes.length; i++) {
+            bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);
+            proof[i] = TrieNode({
+                encoded: encoded,
+                decoded: Lib_RLPReader.readList(encoded)
+            });
+        }
+ 
+        return proof;
+    }
+ 
+    /**
+     * @notice Picks out the ID for a node. Node ID is referred to as the
+     * "hash" within the specification, but nodes < 32 bytes are not actually
+     * hashed.
+     * @param _node Node to pull an ID for.
+     * @return _nodeID ID for the node, depending on the size of its contents.
+     */
+    function _getNodeID(
+        Lib_RLPReader.RLPItem memory _node
+    )
+        private
+        pure
+        returns (
+            bytes32 _nodeID
+        )
+    {
+        bytes memory nodeID;
+ 
+        Iif (_node.length < 32) {
+            // Nodes smaller than 32 bytes are RLP encoded.
+            nodeID = Lib_RLPReader.readRawBytes(_node);
+        } else {
+            // Nodes 32 bytes or larger are hashed.
+            nodeID = Lib_RLPReader.readBytes(_node);
+        }
+ 
+        return Lib_BytesUtils.toBytes32(nodeID);
+    }
+ 
+    /**
+     * @notice Gets the path for a leaf or extension node.
+     * @param _node Node to get a path for.
+     * @return _path Node path, converted to an array of nibbles.
+     */
+    function _getNodePath(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _path
+        )
+    {
+        return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));
+    }
+ 
+    /**
+     * @notice Gets the key for a leaf or extension node. Keys are essentially
+     * just paths without any prefix.
+     * @param _node Node to get a key for.
+     * @return _key Node key, converted to an array of nibbles.
+     */
+    function _getNodeKey(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _key
+        )
+    {
+        return _removeHexPrefix(_getNodePath(_node));
+    }
+ 
+    /**
+     * @notice Gets the path for a node.
+     * @param _node Node to get a value for.
+     * @return _value Node value, as hex bytes.
+     */
+    function _getNodeValue(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _value
+        )
+    {
+        return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
+    }
+ 
+    /**
+     * @notice Computes the node hash for an encoded node. Nodes < 32 bytes
+     * are not hashed, all others are keccak256 hashed.
+     * @param _encoded Encoded node to hash.
+     * @return _hash Hash of the encoded node. Simply the input if < 32 bytes.
+     */
+    function _getNodeHash(
+        bytes memory _encoded
+    )
+        private
+        pure
+        returns (
+            bytes memory _hash
+        )
+    {
+        Iif (_encoded.length < 32) {
+            return _encoded;
+        } else {
+            return abi.encodePacked(keccak256(_encoded));
+        }
+    }
+ 
+    /**
+     * @notice Determines the type for a given node.
+     * @param _node Node to determine a type for.
+     * @return _type Type of the node; BranchNode/ExtensionNode/LeafNode.
+     */
+    function _getNodeType(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            NodeType _type
+        )
+    {
+        if (_node.decoded.length == BRANCH_NODE_LENGTH) {
+            return NodeType.BranchNode;
+        } else Eif (_node.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
+            bytes memory path = _getNodePath(_node);
+            uint8 prefix = uint8(path[0]);
+ 
+            if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
+                return NodeType.LeafNode;
+            } else Eif (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
+                return NodeType.ExtensionNode;
+            }
+        }
+ 
+        revert("Invalid node type");
+    }
+ 
+    /**
+     * @notice Utility; determines the number of nibbles shared between two
+     * nibble arrays.
+     * @param _a First nibble array.
+     * @param _b Second nibble array.
+     * @return _shared Number of shared nibbles.
+     */
+    function _getSharedNibbleLength(
+        bytes memory _a,
+        bytes memory _b
+    )
+        private
+        pure
+        returns (
+            uint256 _shared
+        )
+    {
+        uint256 i = 0;
+        while (_a.length > i && _b.length > i && _a[i] == _b[i]) {
+            i++;
+        }
+        return i;
+    }
+ 
+    /**
+     * @notice Utility; converts an RLP-encoded node into our nice struct.
+     * @param _raw RLP-encoded node to convert.
+     * @return _node Node as a TrieNode struct.
+     */
+    function _makeNode(
+        bytes[] memory _raw
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes memory encoded = Lib_RLPWriter.writeList(_raw);
+ 
+        return TrieNode({
+            encoded: encoded,
+            decoded: Lib_RLPReader.readList(encoded)
+        });
+    }
+ 
+    /**
+     * @notice Utility; converts an RLP-decoded node into our nice struct.
+     * @param _items RLP-decoded node to convert.
+     * @return _node Node as a TrieNode struct.
+     */
+    function _makeNode(
+        Lib_RLPReader.RLPItem[] memory _items
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](_items.length);
+        for (uint256 i = 0; i < _items.length; i++) {
+            raw[i] = Lib_RLPReader.readRawBytes(_items[i]);
+        }
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates a new extension node.
+     * @param _key Key for the extension node, unprefixed.
+     * @param _value Value for the extension node.
+     * @return _node New extension node with the given k/v pair.
+     */
+    function _makeExtensionNode(
+        bytes memory _key,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](2);
+        bytes memory key = _addHexPrefix(_key, false);
+        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
+        raw[1] = Lib_RLPWriter.writeBytes(_value);
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates a new leaf node.
+     * @dev This function is essentially identical to `_makeExtensionNode`.
+     * Although we could route both to a single method with a flag, it's
+     * more gas efficient to keep them separate and duplicate the logic.
+     * @param _key Key for the leaf node, unprefixed.
+     * @param _value Value for the leaf node.
+     * @return _node New leaf node with the given k/v pair.
+     */
+    function _makeLeafNode(
+        bytes memory _key,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](2);
+        bytes memory key = _addHexPrefix(_key, true);
+        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
+        raw[1] = Lib_RLPWriter.writeBytes(_value);
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates an empty branch node.
+     * @return _node Empty branch node as a TrieNode struct.
+     */
+    function _makeEmptyBranchNode()
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](BRANCH_NODE_LENGTH);
+        for (uint256 i = 0; i < raw.length; i++) {
+            raw[i] = RLP_NULL_BYTES;
+        }
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Modifies the value slot for a given branch.
+     * @param _branch Branch node to modify.
+     * @param _value Value to insert into the branch.
+     * @return _updatedNode Modified branch node.
+     */
+    function _editBranchValue(
+        TrieNode memory _branch,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _updatedNode
+        )
+    {
+        bytes memory encoded = Lib_RLPWriter.writeBytes(_value);
+        _branch.decoded[_branch.decoded.length - 1] = Lib_RLPReader.toRLPItem(encoded);
+        return _makeNode(_branch.decoded);
+    }
+ 
+    /**
+     * @notice Modifies a slot at an index for a given branch.
+     * @param _branch Branch node to modify.
+     * @param _index Slot index to modify.
+     * @param _value Value to insert into the slot.
+     * @return _updatedNode Modified branch node.
+     */
+    function _editBranchIndex(
+        TrieNode memory _branch,
+        uint8 _index,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _updatedNode
+        )
+    {
+        bytes memory encoded = _value.length < 32 ? _value : Lib_RLPWriter.writeBytes(_value);
+        _branch.decoded[_index] = Lib_RLPReader.toRLPItem(encoded);
+        return _makeNode(_branch.decoded);
+    }
+ 
+    /**
+     * @notice Utility; adds a prefix to a key.
+     * @param _key Key to prefix.
+     * @param _isLeaf Whether or not the key belongs to a leaf.
+     * @return _prefixedKey Prefixed key.
+     */
+    function _addHexPrefix(
+        bytes memory _key,
+        bool _isLeaf
+    )
+        private
+        pure
+        returns (
+            bytes memory _prefixedKey
+        )
+    {
+        uint8 prefix = _isLeaf ? uint8(0x02) : uint8(0x00);
+        uint8 offset = uint8(_key.length % 2);
+        bytes memory prefixed = new bytes(2 - offset);
+        prefixed[0] = bytes1(prefix + offset);
+        return abi.encodePacked(prefixed, _key);
+    }
+ 
+    /**
+     * @notice Utility; removes a prefix from a path.
+     * @param _path Path to remove the prefix from.
+     * @return _unprefixedKey Unprefixed key.
+     */
+    function _removeHexPrefix(
+        bytes memory _path
+    )
+        private
+        pure
+        returns (
+            bytes memory _unprefixedKey
+        )
+    {
+        if (uint8(_path[0]) % 2 == 0) {
+            return Lib_BytesUtils.slice(_path, 2);
+        } else {
+            return Lib_BytesUtils.slice(_path, 1);
+        }
+    }
+ 
+    /**
+     * @notice Utility; combines two node arrays. Array lengths are required
+     * because the actual lengths may be longer than the filled lengths.
+     * Array resizing is extremely costly and should be avoided.
+     * @param _a First array to join.
+     * @param _aLength Length of the first array.
+     * @param _b Second array to join.
+     * @param _bLength Length of the second array.
+     * @return _joined Combined node array.
+     */
+    function _joinNodeArrays(
+        TrieNode[] memory _a,
+        uint256 _aLength,
+        TrieNode[] memory _b,
+        uint256 _bLength
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _joined
+        )
+    {
+        TrieNode[] memory ret = new TrieNode[](_aLength + _bLength);
+ 
+        // Copy elements from the first array.
+        for (uint256 i = 0; i < _aLength; i++) {
+            ret[i] = _a[i];
+        }
+ 
+        // Copy elements from the second array.
+        for (uint256 i = 0; i < _bLength; i++) {
+            ret[i + _aLength] = _b[i];
+        }
+ 
+        return ret;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html new file mode 100644 index 000000000..1e999e7d4 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html @@ -0,0 +1,548 @@ + + + + Code coverage report for optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/trie/ Lib_SecureMerkleTrie.sol +

+
+
+ 63.64% + Statements + 7/11 +
+
+ 100% + Branches + 0/0 +
+
+ 66.67% + Functions + 4/6 +
+
+ 63.64% + Lines + 7/11 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +47× +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_MerkleTrie } from "./Lib_MerkleTrie.sol";
+ 
+/**
+ * @title Lib_SecureMerkleTrie
+ */
+library Lib_SecureMerkleTrie {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Verifies a proof that a given key/value pair is present in the
+     * Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _value Value of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
+     * traditional Merkle trees, this proof is executed top-down and consists
+     * of a list of RLP-encoded nodes that make a path down to the target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
+     */
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
+    }
+ 
+    /**
+     * @notice Verifies a proof that a given key is *not* present in
+     * the Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the key is not present in the trie, `false` otherwise.
+     */
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.verifyExclusionProof(key, _proof, _root);
+    }
+ 
+    /**
+     * @notice Updates a Merkle trie and returns a new root hash.
+     * @param _key Key of the node to update, as a hex string.
+     * @param _value Value of the node to update, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node. If the key exists, we can simply update the value.
+     * Otherwise, we need to modify the trie to handle the new k/v pair.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _updatedRoot Root hash of the newly constructed trie.
+     */
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.update(key, _value, _proof, _root);
+    }
+ 
+    /**
+     * @notice Retrieves the value associated with a given key.
+     * @param _key Key to search for, as hex bytes.
+     * @param _proof Merkle trie inclusion proof for the key.
+     * @param _root Known root of the Merkle trie.
+     * @return _exists Whether or not the key exists.
+     * @return _value Value of the key if it exists.
+     */
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _exists,
+            bytes memory _value
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.get(key, _proof, _root);
+    }
+ 
+    /**
+     * Computes the root hash for a trie with a single node.
+     * @param _key Key for the single node.
+     * @param _value Value for the single node.
+     * @return _updatedRoot Hash of the trie.
+     */
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.getSingleNodeRootHash(key, _value);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Computes the secure counterpart to a key.
+     * @param _key Key to get a secure key from.
+     * @return _secureKey Secure version of the key.
+     */
+    function _getSecureKey(
+        bytes memory _key
+    )
+        private
+        pure
+        returns (
+            bytes memory _secureKey
+        )
+    {
+        return abi.encodePacked(keccak256(_key));
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/trie/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/trie/index.html new file mode 100644 index 000000000..8aa2158f9 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/trie/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/libraries/trie/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/trie/ +

+
+
+ 71.98% + Statements + 149/207 +
+
+ 55.88% + Branches + 38/68 +
+
+ 81.25% + Functions + 26/32 +
+
+ 71.57% + Lines + 146/204 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_MerkleTrie.sol
72.45%142/19655.88%38/6884.62%22/2672.02%139/193
Lib_SecureMerkleTrie.sol
63.64%7/11100%0/066.67%4/663.64%7/11
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html new file mode 100644 index 000000000..2faa1790a --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html @@ -0,0 +1,416 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_Bytes32Utils.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +40× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_Byte32Utils
+ */
+library Lib_Bytes32Utils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to "true."
+     * @param _in Input bytes32 value.
+     * @return Bytes32 as a boolean.
+     */
+    function toBool(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        return _in != 0;
+    }
+ 
+    /**
+     * Converts a boolean to a bytes32 value.
+     * @param _in Input boolean value.
+     * @return Boolean as a bytes32.
+     */
+    function fromBool(
+        bool _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return bytes32(uint256(_in ? 1 : 0));
+    }
+ 
+    /**
+     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.
+     * @param _in Input bytes32 value.
+     * @return Bytes32 as an address.
+     */
+    function toAddress(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        return address(uint160(uint256(_in)));
+    }
+ 
+    /**
+     * Converts an address to a bytes32.
+     * @param _in Input address value.
+     * @return Address as a bytes32.
+     */
+    function fromAddress(
+        address _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return bytes32(uint256(_in));
+    }
+ 
+    /**
+     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.
+     * @param _in Input bytes32 value.
+     * @return Bytes32 without any leading zeros.
+     */
+    function removeLeadingZeros(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes memory out;
+ 
+        assembly {
+            // Figure out how many leading zero bytes to remove.
+            let shift := 0
+            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {
+                shift := add(shift, 1)
+            }
+ 
+            // Reserve some space for our output and fix the free memory pointer.
+            out := mload(0x40)
+            mstore(0x40, add(out, 0x40))
+ 
+            // Shift the value and store it into the output bytes.
+            mstore(add(out, 0x20), shl(mul(shift, 8), _in))
+ 
+            // Store the new size (with leading zero bytes removed) in the output byte size.
+            mstore(out, sub(32, shift))
+        }
+ 
+        return out;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html new file mode 100644 index 000000000..b1d79bba0 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html @@ -0,0 +1,728 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_BytesUtils.sol +

+
+
+ 100% + Statements + 38/38 +
+
+ 63.64% + Branches + 14/22 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 44/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +311× +311× +311× +  +308× +  +308× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +308× +  +  +  +  +  +  +  +  +  +  +299× +73× +  +  +226× +  +  +  +  +  +  +  +  +  + + + +  +  + +  +  +  +  +  +  +  +  +  +164× + + +  +  + +  +  +162× +  +  +  +  +  +  +  +  +  + +  +  +  +15× +15× +15× +  +15× +  +  +  +15× +  +  +  +12× +12× +12× +  +12× +  +  +  +12× +  +  +  + + + +  + +  +  +  + +  +  +  +  +  +  +  +  +  +292× +  +292× +9144× +9144× +  +  +292× +  +  +  +  +  +  +  +  +  +26× +  +26× +708× +  +  +26× +  +  +  +  +  +  +  +  +  +  +26× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_BytesUtils
+ */
+library Lib_BytesUtils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start,
+        uint256 _length
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        Erequire(_length + 31 >= _length, "slice_overflow");
+        Erequire(_start + _length >= _start, "slice_overflow");
+        require(_bytes.length >= _start + _length, "slice_outOfBounds");
+ 
+        bytes memory tempBytes;
+ 
+        assembly {
+            switch iszero(_length)
+            case 0 {
+                // Get a location of some free memory and store it in tempBytes as
+                // Solidity does for memory variables.
+                tempBytes := mload(0x40)
+ 
+                // The first word of the slice result is potentially a partial
+                // word read from the original array. To read it, we calculate
+                // the length of that partial word and start copying that many
+                // bytes into the array. The first word we copy will start with
+                // data we don't care about, but the last `lengthmod` bytes will
+                // land at the beginning of the contents of the new array. When
+                // we're done copying, we overwrite the full first word with
+                // the actual length of the slice.
+                let lengthmod := and(_length, 31)
+ 
+                // The multiplication in the next line is necessary
+                // because when slicing multiples of 32 bytes (lengthmod == 0)
+                // the following copy loop was copying the origin's length
+                // and then ending prematurely not copying everything it should.
+                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
+                let end := add(mc, _length)
+ 
+                for {
+                    // The multiplication in the next line has the same exact purpose
+                    // as the one above.
+                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
+                } lt(mc, end) {
+                    mc := add(mc, 0x20)
+                    cc := add(cc, 0x20)
+                } {
+                    mstore(mc, mload(cc))
+                }
+ 
+                mstore(tempBytes, _length)
+ 
+                //update free-memory pointer
+                //allocating the array padded to 32 bytes like the compiler does now
+                mstore(0x40, and(add(mc, 31), not(31)))
+            }
+            //if we want a zero-length slice let's just return a zero-length array
+            default {
+                tempBytes := mload(0x40)
+ 
+                //zero out the 32 bytes slice we are about to return
+                //we need to do it because Solidity does not garbage collect
+                mstore(tempBytes, 0)
+ 
+                mstore(0x40, add(tempBytes, 0x20))
+            }
+        }
+ 
+        return tempBytes;
+    }
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        if (_bytes.length - _start == 0) {
+            return bytes('');
+        }
+ 
+        return slice(_bytes, _start, _bytes.length - _start);
+    }
+ 
+    function toBytes32PadLeft(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes32)
+    {
+        bytes32 ret;
+        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;
+        assembly {
+            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))
+        }
+        return ret;
+    }
+ 
+    function toBytes32(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes32)
+    {
+        if (_bytes.length < 32) {
+            bytes32 ret;
+            assembly {
+                ret := mload(add(_bytes, 32))
+            }
+            return ret;
+        }
+ 
+        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes
+    }
+ 
+    function toUint256(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (uint256)
+    {
+        return uint256(toBytes32(_bytes));
+    }
+ 
+    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
+        Erequire(_start + 3 >= _start, "toUint24_overflow");
+        Erequire(_bytes.length >= _start + 3 , "toUint24_outOfBounds");
+        uint24 tempUint;
+ 
+        assembly {
+            tempUint := mload(add(add(_bytes, 0x3), _start))
+        }
+ 
+        return tempUint;
+    }
+ 
+    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
+        Erequire(_start + 1 >= _start, "toUint8_overflow");
+        Erequire(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
+        uint8 tempUint;
+ 
+        assembly {
+            tempUint := mload(add(add(_bytes, 0x1), _start))
+        }
+ 
+        return tempUint;
+    }
+ 
+    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
+        Erequire(_start + 20 >= _start, "toAddress_overflow");
+        Erequire(_bytes.length >= _start + 20, "toAddress_outOfBounds");
+        address tempAddress;
+ 
+        assembly {
+            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
+        }
+ 
+        return tempAddress;
+    }
+ 
+    function toNibbles(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        bytes memory nibbles = new bytes(_bytes.length * 2);
+ 
+        for (uint256 i = 0; i < _bytes.length; i++) {
+            nibbles[i * 2] = _bytes[i] >> 4;
+            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);
+        }
+ 
+        return nibbles;
+    }
+ 
+    function fromNibbles(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        bytes memory ret = new bytes(_bytes.length / 2);
+ 
+        for (uint256 i = 0; i < ret.length; i++) {
+            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);
+        }
+ 
+        return ret;
+    }
+ 
+    function equal(
+        bytes memory _bytes,
+        bytes memory _other
+    )
+        internal
+        pure
+        returns (bool)
+    {
+        return keccak256(_bytes) == keccak256(_other);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html new file mode 100644 index 000000000..8e0c02eee --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html @@ -0,0 +1,356 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_ECDSAUtils.sol +

+
+
+ 100% + Statements + 9/9 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× + +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_ECDSAUtils
+ */
+library Lib_ECDSAUtils {
+ 
+    /**************************************
+     * Internal Functions: ECDSA Recovery *
+     **************************************/
+ 
+    /**
+     * Recovers a signed address given a message and signature.
+     * @param _message Message that was originally signed.
+     * @param _isEthSignedMessage Whether or not the user used the `Ethereum Signed Message` prefix.
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     * @return _sender Signer address.
+     */
+    function recover(
+        bytes memory _message,
+        bool _isEthSignedMessage,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        internal
+        pure
+        returns (
+            address _sender
+        )
+    {
+        bytes32 messageHash = getMessageHash(_message, _isEthSignedMessage);
+ 
+        return ecrecover(
+            messageHash,
+            _v + 27,
+            _r,
+            _s
+        );
+    }
+ 
+    function getMessageHash(
+        bytes memory _message,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (bytes32) {
+        if (_isEthSignedMessage) {
+            return getEthSignedMessageHash(_message);
+        }
+        return getNativeMessageHash(_message);
+    }
+ 
+ 
+    /*************************************
+     * Private Functions: ECDSA Recovery *
+     *************************************/
+ 
+    /**
+     * Gets the native message hash (simple keccak256) for a message.
+     * @param _message Message to hash.
+     * @return _messageHash Native message hash.
+     */
+    function getNativeMessageHash(
+        bytes memory _message
+    )
+        private
+        pure
+        returns (
+            bytes32 _messageHash
+        )
+    {
+        return keccak256(_message);
+    }
+ 
+    /**
+     * Gets the hash of a message with the `Ethereum Signed Message` prefix.
+     * @param _message Message to hash.
+     * @return _messageHash Prefixed message hash.
+     */
+    function getEthSignedMessageHash(
+        bytes memory _message
+    )
+        private
+        pure
+        returns (
+            bytes32 _messageHash
+        )
+    {
+        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
+        bytes32 messageHash = keccak256(_message);
+        return keccak256(abi.encodePacked(prefix, messageHash));
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html new file mode 100644 index 000000000..5be2cd548 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_ErrorUtils.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title Lib_ErrorUtils
+ */
+library Lib_ErrorUtils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Encodes an error string into raw solidity-style revert data.
+     * (i.e. ascii bytes, prefixed with bytes4(keccak("Error(string))"))
+     * Ref: https://docs.soliditylang.org/en/v0.8.2/control-structures.html?highlight=Error(string)#panic-via-assert-and-error-via-require
+     * @param _reason Reason for the reversion.
+     * @return Standard solidity revert data for the given reason.
+     */
+    function encodeRevertString(
+        string memory _reason
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodeWithSignature(
+            "Error(string)",
+            _reason
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html new file mode 100644 index 000000000..578273032 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html @@ -0,0 +1,629 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_EthUtils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_EthUtils.sol +

+
+
+ 83.33% + Statements + 10/12 +
+
+ 100% + Branches + 0/0 +
+
+ 85.71% + Functions + 6/7 +
+
+ 87.5% + Lines + 14/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +34× +  +  +  +  +  +  +34× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +212× +  +  +  +212× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +  +27× +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+import { Lib_Bytes32Utils } from "./Lib_Bytes32Utils.sol";
+ 
+/**
+ * @title Lib_EthUtils
+ */
+library Lib_EthUtils {
+ 
+    /***********************************
+     * Internal Functions: Code Access *
+     ***********************************/
+ 
+    /**
+     * Gets the code for a given address.
+     * @param _address Address to get code for.
+     * @param _offset Offset to start reading from.
+     * @param _length Number of bytes to read.
+     * @return _code Code read from the contract.
+     */
+    function getCode(
+        address _address,
+        uint256 _offset,
+        uint256 _length
+    )
+        internal
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        assembly {
+            _code := mload(0x40)
+            mstore(0x40, add(_code, add(_length, 0x20)))
+            mstore(_code, _length)
+            extcodecopy(_address, add(_code, 0x20), _offset, _length)
+        }
+ 
+        return _code;
+    }
+ 
+    /**
+     * Gets the full code for a given address.
+     * @param _address Address to get code for.
+     * @return _code Full code of the contract.
+     */
+    function getCode(
+        address _address
+    )
+        internal
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        return getCode(
+            _address,
+            0,
+            getCodeSize(_address)
+        );
+    }
+ 
+    /**
+     * Gets the size of a contract's code in bytes.
+     * @param _address Address to get code size for.
+     * @return _codeSize Size of the contract's code in bytes.
+     */
+    function getCodeSize(
+        address _address
+    )
+        internal
+        view
+        returns (
+            uint256 _codeSize
+        )
+    {
+        assembly {
+            _codeSize := extcodesize(_address)
+        }
+ 
+        return _codeSize;
+    }
+ 
+    /**
+     * Gets the hash of a contract's code.
+     * @param _address Address to get a code hash for.
+     * @return _codeHash Hash of the contract's code.
+     */
+    function getCodeHash(
+        address _address
+    )
+        internal
+        view
+        returns (
+            bytes32 _codeHash
+        )
+    {
+        assembly {
+            _codeHash := extcodehash(_address)
+        }
+ 
+        return _codeHash;
+    }
+ 
+ 
+    /*****************************************
+     * Internal Functions: Contract Creation *
+     *****************************************/
+ 
+    /**
+     * Creates a contract with some given initialization code.
+     * @param _code Contract initialization code.
+     * @return _created Address of the created contract.
+     */
+    function createContract(
+        bytes memory _code
+    )
+        internal
+        returns (
+            address _created
+        )
+    {
+        assembly {
+            _created := create(
+                0,
+                add(_code, 0x20),
+                mload(_code)
+            )
+        }
+ 
+        return _created;
+    }
+ 
+    /**
+     * Computes the address that would be generated by CREATE.
+     * @param _creator Address creating the contract.
+     * @param _nonce Creator's nonce.
+     * @return _address Address to be generated by CREATE.
+     */
+    function getAddressForCREATE(
+        address _creator,
+        uint256 _nonce
+    )
+        internal
+        pure
+        returns (
+            address _address
+        )
+    {
+        bytes[] memory encoded = new bytes[](2);
+        encoded[0] = Lib_RLPWriter.writeAddress(_creator);
+        encoded[1] = Lib_RLPWriter.writeUint(_nonce);
+ 
+        bytes memory encodedList = Lib_RLPWriter.writeList(encoded);
+        return Lib_Bytes32Utils.toAddress(keccak256(encodedList));
+    }
+ 
+    /**
+     * Computes the address that would be generated by CREATE2.
+     * @param _creator Address creating the contract.
+     * @param _bytecode Bytecode of the contract to be created.
+     * @param _salt 32 byte salt value mixed into the hash.
+     * @return _address Address to be generated by CREATE2.
+     */
+    function getAddressForCREATE2(
+        address _creator,
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        internal
+        pure
+        returns (address _address)
+    {
+        bytes32 hashedData = keccak256(abi.encodePacked(
+            byte(0xff),
+            _creator,
+            _salt,
+            keccak256(_bytecode)
+        ));
+ 
+        return Lib_Bytes32Utils.toAddress(hashedData);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Math.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Math.sol.html new file mode 100644 index 000000000..ff97d943c --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Math.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_Math.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_Math.sol +

+
+
+ 0% + Statements + 0/3 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_Math
+ */
+library Lib_Math {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Calculates the minumum of two numbers.
+     * @param _x First number to compare.
+     * @param _y Second number to compare.
+     * @return Lesser of the two numbers.
+     */
+    function min(
+        uint256 _x,
+        uint256 _y
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        if (_x < _y) {
+            return _x;
+        }
+ 
+        return _y;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html new file mode 100644 index 000000000..60fb172ca --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html @@ -0,0 +1,725 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_MerkleTree.sol +

+
+
+ 97.83% + Statements + 45/46 +
+
+ 90.91% + Branches + 20/22 +
+
+ 100% + Functions + 3/3 +
+
+ 97.96% + Lines + 48/49 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +124× +  +  +  +  +123× +  +  +  +123× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +123× +  +  +123× +123× +  +  +123× +  +  +123× +  +  +123× +123× +  +123× +321× +321× +  +321× +5814× +5814× +5814× +  +  +  +  +5814× +  +  +321× +45× +45× +45× +  +  +  +  +45× +  +  +321× +321× +  +  +123× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +102× +  +  +  +  +101× +  +  +  +  +100× +  +  +  +  +99× +  +99× +653× +146× +  +  +  +  +  +  +507× +  +  +  +  +  +  +  +653× +  +  +99× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +  +  +  +  +100× + +  +  +  +  +97× +97× +97× +776× +206× +206× +  +  +  +  +97× +70× +  +  +97× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_MerkleTree
+ * @author River Keefer
+ */
+library Lib_MerkleTree {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Calculates a merkle root for a list of 32-byte leaf hashes.  WARNING: If the number
+     * of leaves passed in is not a power of two, it pads out the tree with zero hashes.
+     * If you do not know the original length of elements for the tree you are verifying,
+     * then this may allow empty leaves past _elements.length to pass a verification check down the line.
+     * Note that the _elements argument is modified, therefore it must not be used again afterwards
+     * @param _elements Array of hashes from which to generate a merkle root.
+     * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).
+     */
+    function getMerkleRoot(
+        bytes32[] memory _elements
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        require(
+            _elements.length > 0,
+            "Lib_MerkleTree: Must provide at least one leaf hash."
+        );
+ 
+        Iif (_elements.length == 0) {
+            return _elements[0];
+        }
+ 
+        uint256[16] memory defaults = [
+            0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,
+            0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,
+            0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,
+            0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,
+            0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,
+            0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,
+            0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,
+            0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,
+            0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,
+            0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,
+            0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,
+            0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,
+            0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,
+            0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,
+            0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,
+            0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10
+        ];
+ 
+        // Reserve memory space for our hashes.
+        bytes memory buf = new bytes(64);
+ 
+        // We'll need to keep track of left and right siblings.
+        bytes32 leftSibling;
+        bytes32 rightSibling;
+ 
+        // Number of non-empty nodes at the current depth.
+        uint256 rowSize = _elements.length;
+ 
+        // Current depth, counting from 0 at the leaves
+        uint256 depth = 0;
+ 
+        // Common sub-expressions
+        uint256 halfRowSize;         // rowSize / 2
+        bool rowSizeIsOdd;           // rowSize % 2 == 1
+ 
+        while (rowSize > 1) {
+            halfRowSize = rowSize / 2;
+            rowSizeIsOdd = rowSize % 2 == 1;
+ 
+            for (uint256 i = 0; i < halfRowSize; i++) {
+                leftSibling  = _elements[(2 * i)    ];
+                rightSibling = _elements[(2 * i) + 1];
+                assembly {
+                    mstore(add(buf, 32), leftSibling )
+                    mstore(add(buf, 64), rightSibling)
+                }
+ 
+                _elements[i] = keccak256(buf);
+            }
+ 
+            if (rowSizeIsOdd) {
+                leftSibling  = _elements[rowSize - 1];
+                rightSibling = bytes32(defaults[depth]);
+                assembly {
+                    mstore(add(buf, 32), leftSibling)
+                    mstore(add(buf, 64), rightSibling)
+                }
+ 
+                _elements[halfRowSize] = keccak256(buf);
+            }
+ 
+            rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);
+            depth++;
+        }
+ 
+        return _elements[0];
+    }
+ 
+    /**
+     * Verifies a merkle branch for the given leaf hash.  Assumes the original length
+     * of leaves generated is a known, correct input, and does not return true for indices
+     * extending past that index (even if _siblings would be otherwise valid.)
+     * @param _root The Merkle root to verify against.
+     * @param _leaf The leaf hash to verify inclusion of.
+     * @param _index The index in the tree of this leaf.
+     * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
+     * @param _totalLeaves The total number of leaves originally passed into.
+     * @return Whether or not the merkle branch and leaf passes verification.
+     */
+    function verify(
+        bytes32 _root,
+        bytes32 _leaf,
+        uint256 _index,
+        bytes32[] memory _siblings,
+        uint256 _totalLeaves
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        require(
+            _totalLeaves > 0,
+            "Lib_MerkleTree: Total leaves must be greater than zero."
+        );
+ 
+        require(
+            _index < _totalLeaves,
+            "Lib_MerkleTree: Index out of bounds."
+        );
+ 
+        require(
+            _siblings.length == _ceilLog2(_totalLeaves),
+            "Lib_MerkleTree: Total siblings does not correctly correspond to total leaves."
+        );
+ 
+        bytes32 computedRoot = _leaf;
+ 
+        for (uint256 i = 0; i < _siblings.length; i++) {
+            if ((_index & 1) == 1) {
+                computedRoot = keccak256(
+                    abi.encodePacked(
+                        _siblings[i],
+                        computedRoot
+                    )
+                );
+            } else {
+                computedRoot = keccak256(
+                    abi.encodePacked(
+                        computedRoot,
+                        _siblings[i]
+                    )
+                );
+            }
+ 
+            _index >>= 1;
+        }
+ 
+        return _root == computedRoot;
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Calculates the integer ceiling of the log base 2 of an input.
+     * @param _in Unsigned input to calculate the log.
+     * @return ceil(log_base_2(_in))
+     */
+    function _ceilLog2(
+        uint256 _in
+    )
+        private
+        pure
+        returns (
+            uint256
+        )
+    {
+        Erequire(
+            _in > 0,
+            "Lib_MerkleTree: Cannot compute ceil(log_2) of 0."
+        );
+ 
+        if (_in == 1) {
+            return 0;
+        }
+ 
+        // Find the highest set bit (will be floor(log_2)).
+        // Borrowed with <3 from https://github.com/ethereum/solidity-examples
+        uint256 val = _in;
+        uint256 highest = 0;
+        for (uint8 i = 128; i >= 1; i >>= 1) {
+            if (val & (uint(1) << i) - 1 << i != 0) {
+                highest += i;
+                val >>= i;
+            }
+        }
+ 
+        // Increment by one if this is not a perfect logarithm.
+        if ((uint(1) << highest) != _in) {
+            highest += 1;
+        }
+ 
+        return highest;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html new file mode 100644 index 000000000..1ccf21bdd --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html @@ -0,0 +1,248 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_ReentrancyGuard.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +54× +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +14× +  +14× +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @dev Contract module that helps prevent reentrant calls to a function.
+ *
+ * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
+ * available, which can be applied to functions to make sure there are no nested
+ * (reentrant) calls to them.
+ *
+ * Note that because there is a single `nonReentrant` guard, functions marked as
+ * `nonReentrant` may not call one another. This can be worked around by making
+ * those functions `private`, and then adding `external` `nonReentrant` entry
+ * points to them.
+ *
+ * TIP: If you would like to learn more about reentrancy and alternative ways
+ * to protect against it, check out our blog post
+ * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
+ */
+abstract contract Lib_ReentrancyGuard {
+    // Booleans are more expensive than uint256 or any type that takes up a full
+    // word because each write operation emits an extra SLOAD to first read the
+    // slot's contents, replace the bits taken up by the boolean, and then write
+    // back. This is the compiler's defense against contract upgrades and
+    // pointer aliasing, and it cannot be disabled.
+ 
+    // The values being non-zero value makes deployment a bit more expensive,
+    // but in exchange the refund on every call to nonReentrant will be lower in
+    // amount. Since refunds are capped to a percentage of the total
+    // transaction's gas, it is best to keep them low in cases like this one, to
+    // increase the likelihood of the full refund coming into effect.
+    uint256 private constant _NOT_ENTERED = 1;
+    uint256 private constant _ENTERED = 2;
+ 
+    uint256 private _status;
+ 
+    constructor () {
+        _status = _NOT_ENTERED;
+    }
+ 
+    /**
+     * @dev Prevents a contract from calling itself, directly or indirectly.
+     * Calling a `nonReentrant` function from another `nonReentrant`
+     * function is not supported. It is possible to prevent this from happening
+     * by making the `nonReentrant` function external, and make it call a
+     * `private` function that does the actual work.
+     */
+    modifier nonReentrant() {
+        // On the first call to nonReentrant, _notEntered will be true
+        Erequire(_status != _ENTERED, "ReentrancyGuard: reentrant call");
+ 
+        // Any calls to nonReentrant after this point will fail
+        _status = _ENTERED;
+ 
+        _;
+ 
+        // By storing the original value once again, a refund is triggered (see
+        // https://eips.ethereum.org/EIPS/eip-2200)
+        _status = _NOT_ENTERED;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html new file mode 100644 index 000000000..57d0143ce --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html @@ -0,0 +1,1193 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_RingBuffer.sol +

+
+
+ 78.13% + Statements + 50/64 +
+
+ 54.17% + Branches + 13/24 +
+
+ 81.82% + Functions + 9/11 +
+
+ 77.46% + Lines + 55/71 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +578× +578× +  +  +578× +140× +  +  +  +578× +11× +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +578× +578× +  +  +578× +578× +578× +  +  +  +  +  +  +  +  +  +  +  +  +  +470× +  +470× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +538× +  +  +  +  +535× +535× +  +535× +  +  +535× +  +  +535× +  +  +  +  +535× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  + +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +453× +453× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +580× +580× +  +  +  +  +  +  +  +  +  +  +  +  +  +579× +579× +  +579× +579× +579× +  +  +  +  +579× +579× +579× +579× +  +  +  +  +  +579× +579× +  +  +579× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2620× +2620× +  +2620× +2620× +2620× +  +  +  +  +2620× +2620× +2620× +2620× +  +  +  +  +  +2620× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1648× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+library Lib_RingBuffer {
+    using Lib_RingBuffer for RingBuffer;
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct Buffer {
+        uint256 length;
+        mapping (uint256 => bytes32) buf;
+    }
+ 
+    struct RingBuffer {
+        bytes32 contextA;
+        bytes32 contextB;
+        Buffer bufferA;
+        Buffer bufferB;
+        uint256 nextOverwritableIndex;
+    }
+ 
+    struct RingBufferContext {
+        // contextA
+        uint40 globalIndex;
+        bytes27 extraData;
+ 
+        // contextB
+        uint64 currBufferIndex;
+        uint40 prevResetIndex;
+        uint40 currResetIndex;
+    }
+ 
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 constant MIN_CAPACITY = 16;
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Pushes a single element to the buffer.
+     * @param _self Buffer to access.
+     * @param _value Value to push to the buffer.
+     * @param _extraData Optional global extra data.
+     */
+    function push(
+        RingBuffer storage _self,
+        bytes32 _value,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
+ 
+        // Set a minimum capacity.
+        if (currBuffer.length == 0) {
+            currBuffer.length = MIN_CAPACITY;
+        }
+ 
+        // Check if we need to expand the buffer.
+        if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {
+            Iif (ctx.currResetIndex < _self.nextOverwritableIndex) {
+                // We're going to overwrite the inactive buffer.
+                // Bump the buffer index, reset the delete offset, and set our reset indices.
+                ctx.currBufferIndex++;
+                ctx.prevResetIndex = ctx.currResetIndex;
+                ctx.currResetIndex = ctx.globalIndex;
+ 
+                // Swap over to the next buffer.
+                currBuffer = _self.getBuffer(ctx.currBufferIndex);
+            } else {
+                // We're not overwriting yet, double the length of the current buffer.
+                currBuffer.length *= 2;
+            }
+        }
+ 
+        // Index to write to is the difference of the global and reset indices.
+        uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;
+        currBuffer.buf[writeHead] = _value;
+ 
+        // Bump the global index and insert our extra data, then save the context.
+        ctx.globalIndex++;
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Pushes a single element to the buffer.
+     * @param _self Buffer to access.
+     * @param _value Value to push to the buffer.
+     */
+    function push(
+        RingBuffer storage _self,
+        bytes32 _value
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        
+        _self.push(
+            _value,
+            ctx.extraData
+        );
+    }
+ 
+    /**
+     * Retrieves an element from the buffer.
+     * @param _self Buffer to access.
+     * @param _index Element index to retrieve.
+     * @return Value of the element at the given index.
+     */
+    function get(
+        RingBuffer storage _self,
+        uint256 _index
+    )
+        internal
+        view
+        returns (
+            bytes32    
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+ 
+        require(
+            _index < ctx.globalIndex,
+            "Index out of bounds."
+        );
+ 
+        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
+        Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);
+ 
+        Eif (_index >= ctx.currResetIndex) {
+            // We're trying to load an element from the current buffer.
+            // Relative index is just the difference from the reset index.
+            uint256 relativeIndex = _index - ctx.currResetIndex;
+ 
+            // Shouldn't happen but why not check.
+            Erequire(
+                relativeIndex < currBuffer.length,
+                "Index out of bounds."
+            );
+ 
+            return currBuffer.buf[relativeIndex];
+        } else {
+            // We're trying to load an element from the previous buffer.
+            // Relative index is the difference from the reset index in the other direction.
+            uint256 relativeIndex = ctx.currResetIndex - _index;
+ 
+            // Condition only fails in the case that we deleted and flipped buffers.
+            require(
+                ctx.currResetIndex > ctx.prevResetIndex,
+                "Index out of bounds."
+            );
+ 
+            // Make sure we're not trying to read beyond the array.
+            require(
+                relativeIndex <= prevBuffer.length,
+                "Index out of bounds."
+            );
+ 
+            return prevBuffer.buf[prevBuffer.length - relativeIndex];
+        }
+    }
+ 
+    /**
+     * Deletes all elements after (and including) a given index.
+     * @param _self Buffer to access.
+     * @param _index Index of the element to delete from (inclusive).
+     * @param _extraData Optional global extra data.
+     */
+    function deleteElementsAfterInclusive(
+        RingBuffer storage _self,
+        uint40 _index,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+ 
+        Erequire(
+            _index < ctx.globalIndex && _index >= ctx.prevResetIndex,
+            "Index out of bounds."
+        );
+ 
+        Iif (_index < ctx.currResetIndex) {
+            // We're switching back to the previous buffer.
+            // Reduce the buffer index, set the current reset index back to match the previous one.
+            // We use the equality of these two values to prevent reading beyond this buffer.
+            ctx.currBufferIndex--;
+            ctx.currResetIndex = ctx.prevResetIndex;
+        }
+ 
+        // Set our global index and extra data, save the context.
+        ctx.globalIndex = _index;
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Deletes all elements after (and including) a given index.
+     * @param _self Buffer to access.
+     * @param _index Index of the element to delete from (inclusive).
+     */
+    function deleteElementsAfterInclusive(
+        RingBuffer storage _self,
+        uint40 _index
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        _self.deleteElementsAfterInclusive(
+            _index,
+            ctx.extraData
+        );
+    }
+ 
+    /**
+     * Retrieves the current global index.
+     * @param _self Buffer to access.
+     * @return Current global index.
+     */
+    function getLength(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        return ctx.globalIndex;
+    }
+ 
+    /**
+     * Changes current global extra data.
+     * @param _self Buffer to access.
+     * @param _extraData New global extra data.
+     */
+    function setExtraData(
+        RingBuffer storage _self,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Retrieves the current global extra data.
+     * @param _self Buffer to access.
+     * @return Current global extra data.
+     */
+    function getExtraData(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            bytes27
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        return ctx.extraData;
+    }
+ 
+    /**
+     * Sets the current ring buffer context.
+     * @param _self Buffer to access.
+     * @param _ctx Current ring buffer context.
+     */
+    function setContext(
+        RingBuffer storage _self,
+        RingBufferContext memory _ctx
+    )
+        internal
+    {
+        bytes32 contextA;
+        bytes32 contextB;
+ 
+        uint40 globalIndex = _ctx.globalIndex;
+        bytes27 extraData = _ctx.extraData;
+        assembly {
+            contextA := globalIndex
+            contextA := or(contextA, extraData)
+        }
+ 
+        uint64 currBufferIndex = _ctx.currBufferIndex;
+        uint40 prevResetIndex = _ctx.prevResetIndex;
+        uint40 currResetIndex = _ctx.currResetIndex;
+        assembly {
+            contextB := currBufferIndex
+            contextB := or(contextB, shl(64, prevResetIndex))
+            contextB := or(contextB, shl(104, currResetIndex))
+        }
+ 
+        Eif (_self.contextA != contextA) {
+            _self.contextA = contextA;
+        }
+ 
+        Iif (_self.contextB != contextB) {
+            _self.contextB = contextB;
+        }
+    }
+ 
+    /**
+     * Retrieves the current ring buffer context.
+     * @param _self Buffer to access.
+     * @return Current ring buffer context.
+     */
+    function getContext(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            RingBufferContext memory
+        )
+    {
+        bytes32 contextA = _self.contextA;
+        bytes32 contextB = _self.contextB;
+ 
+        uint40 globalIndex;
+        bytes27 extraData;
+        assembly {
+            globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            extraData   := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)
+        }
+ 
+        uint64 currBufferIndex;
+        uint40 prevResetIndex;
+        uint40 currResetIndex;
+        assembly {
+            currBufferIndex :=          and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)
+            prevResetIndex  := shr(64,  and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))
+            currResetIndex  := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))
+        }
+ 
+        return RingBufferContext({
+            globalIndex: globalIndex,
+            extraData: extraData,
+            currBufferIndex: currBufferIndex,
+            prevResetIndex: prevResetIndex,
+            currResetIndex: currResetIndex
+        });
+    }
+ 
+    /**
+     * Retrieves the a buffer from the ring buffer by index.
+     * @param _self Buffer to access.
+     * @param _which Index of the sub buffer to access.
+     * @return Sub buffer for the index.
+     */
+    function getBuffer(
+        RingBuffer storage _self,
+        uint256 _which
+    )
+        internal
+        view
+        returns (
+            Buffer storage
+        )
+    {
+        return _which % 2 == 0 ? _self.bufferA : _self.bufferB;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/index.html new file mode 100644 index 000000000..a87d86505 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/utils/index.html @@ -0,0 +1,197 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/utils/ +

+
+
+ 89.07% + Statements + 163/183 +
+
+ 67.57% + Branches + 50/74 +
+
+ 91.11% + Functions + 41/45 +
+
+ 89.27% + Lines + 183/205 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_Bytes32Utils.sol
100%6/6100%0/0100%5/5100%7/7
Lib_BytesUtils.sol
100%38/3863.64%14/22100%11/11100%44/44
Lib_ECDSAUtils.sol
100%9/9100%2/2100%4/4100%9/9
Lib_ErrorUtils.sol
100%1/1100%0/0100%1/1100%1/1
Lib_EthUtils.sol
83.33%10/12100%0/085.71%6/787.5%14/16
Lib_Math.sol
0%0/30%0/20%0/10%0/3
Lib_MerkleTree.sol
97.83%45/4690.91%20/22100%3/397.96%48/49
Lib_ReentrancyGuard.sol
100%4/450%1/2100%2/2100%5/5
Lib_RingBuffer.sol
78.13%50/6454.17%13/2481.82%9/1177.46%55/71
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html new file mode 100644 index 000000000..864775242 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html @@ -0,0 +1,1205 @@ + + + + Code coverage report for optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/wrappers/ Lib_SafeExecutionManagerWrapper.sol +

+
+
+ 100% + Statements + 30/30 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 16/16 +
+
+ 96.77% + Lines + 30/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +41× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +43× +  +  +  +  +  +  +43× +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +146× +146× +  +  +  +  +146× + +  +  +  +  +  +  +  +144× +  +  +  +  +  +  +  +  +  +  +  +145× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_ErrorUtils } from "../utils/Lib_ErrorUtils.sol";
+ 
+/**
+ * @title Lib_SafeExecutionManagerWrapper
+ * @dev The Safe Execution Manager Wrapper provides functions which facilitate writing OVM safe 
+ * code using the standard solidity compiler, by routing all its operations through the Execution 
+ * Manager.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+library Lib_SafeExecutionManagerWrapper {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Performs a safe ovmCALL.
+     * @param _gasLimit Gas limit for the call.
+     * @param _target Address to call.
+     * @param _calldata Data to send to the call.
+     * @return _success Whether or not the call reverted.
+     * @return _returndata Data returned by the call.
+     */
+    function safeCALL(
+        uint256 _gasLimit,
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCALL(uint256,address,bytes)",
+                _gasLimit,
+                _target,
+                _calldata
+            )
+        );
+ 
+        return abi.decode(returndata, (bool, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmDELEGATECALL.
+     * @param _gasLimit Gas limit for the call.
+     * @param _target Address to call.
+     * @param _calldata Data to send to the call.
+     * @return _success Whether or not the call reverted.
+     * @return _returndata Data returned by the call.
+     */
+    function safeDELEGATECALL(
+        uint256 _gasLimit,
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmDELEGATECALL(uint256,address,bytes)",
+                _gasLimit,
+                _target,
+                _calldata
+            )
+        );
+ 
+        return abi.decode(returndata, (bool, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmCREATE call.
+     * @param _gasLimit Gas limit for the creation.
+     * @param _bytecode Code for the new contract.
+     * @return _contract Address of the created contract.
+     */
+    function safeCREATE(
+        uint256 _gasLimit,
+        bytes memory _bytecode
+    )
+        internal
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            _gasLimit,
+            abi.encodeWithSignature(
+                "ovmCREATE(bytes)",
+                _bytecode
+            )
+        );
+ 
+        return abi.decode(returndata, (address, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmEXTCODESIZE call.
+     * @param _contract Address of the contract to query the size of.
+     * @return _EXTCODESIZE Size of the requested contract in bytes.
+     */
+    function safeEXTCODESIZE(
+        address _contract
+    )
+        internal
+        returns (
+            uint256 _EXTCODESIZE
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmEXTCODESIZE(address)",
+                _contract
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmCHAINID call.
+     * @return _CHAINID Result of calling ovmCHAINID.
+     */
+    function safeCHAINID()
+        internal
+        returns (
+            uint256 _CHAINID
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCHAINID()"
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmCALLER call.
+     * @return _CALLER Result of calling ovmCALLER.
+     */
+    function safeCALLER()
+        internal
+        returns (
+            address _CALLER
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCALLER()"
+            )
+        );
+ 
+        return abi.decode(returndata, (address));
+    }
+ 
+    /**
+     * Performs a safe ovmADDRESS call.
+     * @return _ADDRESS Result of calling ovmADDRESS.
+     */
+    function safeADDRESS()
+        internal
+        returns (
+            address _ADDRESS
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmADDRESS()"
+            )
+        );
+ 
+        return abi.decode(returndata, (address));
+    }
+ 
+    /**
+     * Performs a safe ovmGETNONCE call.
+     * @return _nonce Result of calling ovmGETNONCE.
+     */
+    function safeGETNONCE()
+        internal
+        returns (
+            uint256 _nonce
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmGETNONCE()"
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmSETNONCE call.
+     * @param _nonce New account nonce.
+     */
+    function safeSETNONCE(
+        uint256 _nonce
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSETNONCE(uint256)",
+                _nonce
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe ovmCREATEEOA call.
+     * @param _messageHash Message hash which was signed by EOA
+     * @param _v v value of signature (0 or 1)
+     * @param _r r value of signature
+     * @param _s s value of signature
+     */
+    function safeCREATEEOA(
+        bytes32 _messageHash,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCREATEEOA(bytes32,uint8,bytes32,bytes32)",
+                _messageHash,
+                _v,
+                _r,
+                _s
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe REVERT.
+     * @param _reason String revert reason to pass along with the REVERT.
+     */
+    function safeREVERT(
+        string memory _reason
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmREVERT(bytes)",
+                Lib_ErrorUtils.encodeRevertString(
+                    _reason
+                )
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe "require".
+     * @param _condition Boolean condition that must be true or will revert.
+     * @param _reason String revert reason to pass along with the REVERT.
+     */
+    function safeREQUIRE(
+        bool _condition,
+        string memory _reason
+    )
+        internal
+    {
+        if (!_condition) {
+            safeREVERT(
+                _reason
+            );
+        }
+    }
+ 
+    /**
+     * Performs a safe ovmSLOAD call.
+     */
+    function safeSLOAD(
+        bytes32 _key
+    )
+        internal
+        returns (
+            bytes32
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSLOAD(bytes32)",
+                _key
+            )
+        );
+ 
+        return abi.decode(returndata, (bytes32));
+    }
+ 
+    /**
+     * Performs a safe ovmSSTORE call.
+     */
+    function safeSSTORE(
+        bytes32 _key,
+        bytes32 _value
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSSTORE(bytes32,bytes32)",
+                _key,
+                _value
+            )
+        );
+    }
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Performs an ovm interaction and the necessary safety checks.
+     * @param _gasLimit Gas limit for the interaction.
+     * @param _calldata Data to send to the OVM_ExecutionManager (encoded with sighash).
+     * @return _returndata Data sent back by the OVM_ExecutionManager.
+     */
+    function _safeExecutionManagerInteraction(
+        uint256 _gasLimit,
+        bytes memory _calldata
+    )
+        private
+        returns (
+            bytes memory _returndata
+        )
+    {
+        address ovmExecutionManager = msg.sender;
+        (
+            bool success,
+            bytes memory returndata
+        ) = ovmExecutionManager.call{gas: _gasLimit}(_calldata);
+ 
+        if (success == false) {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        } else Iif (returndata.length == 1) {
+            assembly {
+                return(0, 1)
+            }
+        } else {
+            return returndata;
+        }
+    }
+ 
+    function _safeExecutionManagerInteraction(
+        bytes memory _calldata
+    )
+        private
+        returns (
+            bytes memory _returndata
+        )
+    {
+        return _safeExecutionManagerInteraction(
+            gasleft(),
+            _calldata
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html new file mode 100644 index 000000000..5389cca3c --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html @@ -0,0 +1,566 @@ + + + + Code coverage report for optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/wrappers/ Lib_SafeMathWrapper.sol +

+
+
+ 21.05% + Statements + 4/19 +
+
+ 50% + Branches + 1/2 +
+
+ 12.5% + Functions + 1/8 +
+
+ 21.05% + Lines + 4/19 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// Pulled from @openzeppelin/contracts/math/SafeMath.sol
+// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_SafeExecutionManagerWrapper } from "./Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title Lib_SafeMathWrapper
+ */
+ 
+/**
+ * @dev Wrappers over Solidity's arithmetic operations with added overflow
+ * checks.
+ *
+ * Arithmetic operations in Solidity wrap on overflow. This can easily result
+ * in bugs, because programmers usually assume that an overflow raises an
+ * error, which is the standard behavior in high level programming languages.
+ * `SafeMath` restores this intuition by reverting the transaction when an
+ * operation overflows.
+ *
+ * Using this library instead of the unchecked operations eliminates an entire
+ * class of bugs, so it's recommended to use it always.
+ */
+ 
+library Lib_SafeMathWrapper {
+    /**
+     * @dev Returns the addition of two unsigned integers, reverting on
+     * overflow.
+     *
+     * Counterpart to Solidity's `+` operator.
+     *
+     * Requirements:
+     *
+     * - Addition cannot overflow.
+     */
+    function add(uint256 a, uint256 b) internal returns (uint256) {
+        uint256 c = a + b;
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c >= a, "Lib_SafeMathWrapper: addition overflow");
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the subtraction of two unsigned integers, reverting on
+     * overflow (when the result is negative).
+     *
+     * Counterpart to Solidity's `-` operator.
+     *
+     * Requirements:
+     *
+     * - Subtraction cannot overflow.
+     */
+    function sub(uint256 a, uint256 b) internal returns (uint256) {
+        return sub(a, b, "Lib_SafeMathWrapper: subtraction overflow");
+    }
+ 
+    /**
+     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
+     * overflow (when the result is negative).
+     *
+     * Counterpart to Solidity's `-` operator.
+     *
+     * Requirements:
+     *
+     * - Subtraction cannot overflow.
+     */
+    function sub(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b <= a, errorMessage);
+        uint256 c = a - b;
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the multiplication of two unsigned integers, reverting on
+     * overflow.
+     *
+     * Counterpart to Solidity's `*` operator.
+     *
+     * Requirements:
+     *
+     * - Multiplication cannot overflow.
+     */
+    function mul(uint256 a, uint256 b) internal returns (uint256) {
+        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
+        // benefit is lost if 'b' is also tested.
+        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
+        Iif (a == 0) {
+            return 0;
+        }
+ 
+        uint256 c = a * b;
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c / a == b, "Lib_SafeMathWrapper: multiplication overflow");
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the integer division of two unsigned integers. Reverts on
+     * division by zero. The result is rounded towards zero.
+     *
+     * Counterpart to Solidity's `/` operator. Note: this function uses a
+     * `revert` opcode (which leaves remaining gas untouched) while Solidity
+     * uses an invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function div(uint256 a, uint256 b) internal returns (uint256) {
+        return div(a, b, "Lib_SafeMathWrapper: division by zero");
+    }
+ 
+    /**
+     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
+     * division by zero. The result is rounded towards zero.
+     *
+     * Counterpart to Solidity's `/` operator. Note: this function uses a
+     * `revert` opcode (which leaves remaining gas untouched) while Solidity
+     * uses an invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function div(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b > 0, errorMessage);
+        uint256 c = a / b;
+        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+     * Reverts when dividing by zero.
+     *
+     * Counterpart to Solidity's `%` operator. This function uses a `revert`
+     * opcode (which leaves remaining gas untouched) while Solidity uses an
+     * invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function mod(uint256 a, uint256 b) internal returns (uint256) {
+        return mod(a, b, "Lib_SafeMathWrapper: modulo by zero");
+    }
+ 
+    /**
+     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+     * Reverts with custom message when dividing by zero.
+     *
+     * Counterpart to Solidity's `%` operator. This function uses a `revert`
+     * opcode (which leaves remaining gas untouched) while Solidity uses an
+     * invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function mod(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b != 0, errorMessage);
+        return a % b;
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/index.html new file mode 100644 index 000000000..4855727ba --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/libraries/wrappers/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/wrappers/ +

+
+
+ 69.39% + Statements + 34/49 +
+
+ 75% + Branches + 6/8 +
+
+ 70.83% + Functions + 17/24 +
+
+ 68% + Lines + 34/50 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_SafeExecutionManagerWrapper.sol
100%30/3083.33%5/6100%16/1696.77%30/31
Lib_SafeMathWrapper.sol
21.05%4/1950%1/212.5%1/821.05%4/19
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/index.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/index.html new file mode 100644 index 000000000..d48d74930 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/accounts/ + + + + + + + +
+
+

+ all files optimistic-ethereum/mockOVM/accounts/ +

+
+
+ 0% + Statements + 0/9 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/9 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
mockOVM_ECDSAContractAccount.sol
0%0/90%0/20%0/20%0/9
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..41a520f12 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html @@ -0,0 +1,350 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/mockOVM/accounts/ mockOVM_ECDSAContractAccount.sol +

+
+
+ 0% + Statements + 0/9 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title mockOVM_ECDSAContractAccount
+ */
+contract mockOVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Executes a signed transaction.
+     * @param _transaction Signed EOA transaction.
+     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
+     * param _v Signature `v` parameter.
+     * param _r Signature `r` parameter.
+     * param _s Signature `s` parameter.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8, // _v,
+        bytes32, // _r,
+        bytes32 // _s
+    )
+        override
+        public
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
+        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
+ 
+        // Need to make sure that the transaction nonce is right.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
+            "Transaction nonce does not match the expected nonce."
+        );
+ 
+        // Contract creations are signalled by sending a transaction to the zero address.
+        if (decodedTx.to == address(0)) {
+            (address created, ) = Lib_SafeExecutionManagerWrapper.safeCREATE(
+                decodedTx.gasLimit,
+                decodedTx.data
+            );
+ 
+            // If the created address is the ZERO_ADDRESS then we know the deployment failed, though not why
+            return (created != address(0), abi.encode(created));
+        } else {
+            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
+            // the nonce of the calling account. Normally an EOA would bump the nonce for both
+            // cases, but since this is a contract we'd end up bumping the nonce twice.
+            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
+ 
+            return Lib_SafeExecutionManagerWrapper.safeCALL(
+                decodedTx.gasLimit,
+                decodedTx.to,
+                decodedTx.data
+            );
+        }
+    }
+ 
+    function qall(
+        uint256 _gasLimit,
+        address _to,
+        bytes memory _data
+    )
+        public
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        return Lib_SafeExecutionManagerWrapper.safeCALL(
+            _gasLimit,
+            _to,
+            _data
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/index.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/index.html new file mode 100644 index 000000000..d1417a522 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/bridge/ + + + + + + + +
+
+

+ all files optimistic-ethereum/mockOVM/bridge/ +

+
+
+ 0% + Statements + 0/19 +
+
+ 0% + Branches + 0/8 +
+
+ 0% + Functions + 0/8 +
+
+ 0% + Lines + 0/19 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
mockOVM_CrossDomainMessenger.sol
0%0/140%0/60%0/60%0/14
mockOVM_GenericCrossDomainMessenger.sol
0%0/50%0/20%0/20%0/5
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html new file mode 100644 index 000000000..47e36cc0a --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html @@ -0,0 +1,500 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/mockOVM/bridge/ mockOVM_CrossDomainMessenger.sol +

+
+
+ 0% + Statements + 0/14 +
+
+ 0% + Branches + 0/6 +
+
+ 0% + Functions + 0/6 +
+
+ 0% + Lines + 0/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Contract Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title mockOVM_CrossDomainMessenger
+ */
+contract mockOVM_CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct ReceivedMessage {
+        uint256 timestamp;
+        address target;
+        address sender;
+        bytes message;
+        uint256 messageNonce;
+        uint32 gasLimit;
+    }
+ 
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    ReceivedMessage[] internal fullReceivedMessages;
+    address internal targetMessengerAddress;
+    uint256 internal lastRelayedMessage;
+    uint256 internal delay;
+    uint256 public messageNonce;
+    address override public xDomainMessageSender;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _delay Time in seconds before a message can be relayed.
+     */
+    constructor(
+        uint256 _delay
+    )
+    {
+        delay = _delay;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sets the target messenger address.
+     * @dev Currently, this function is public and therefore allows anyone to modify the target
+     *      messenger for a given xdomain messenger contract. Obviously this shouldn't be allowed,
+     *      but we still need to determine an adequate mechanism for updating this address.
+     * @param _targetMessengerAddress New messenger address.
+     */
+    function setTargetMessengerAddress(
+        address _targetMessengerAddress
+    )
+        public
+    {
+        targetMessengerAddress = _targetMessengerAddress;
+    }
+ 
+    /**
+     * Sends a message to another mock xdomain messenger.
+     * @param _target Target for the message.
+     * @param _message Message to send.
+     * @param _gasLimit Amount of gas to send with the call.
+     */
+    function sendMessage(
+        address _target,
+        bytes memory _message,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        mockOVM_CrossDomainMessenger targetMessenger = mockOVM_CrossDomainMessenger(
+            targetMessengerAddress
+        );
+ 
+        // Just send it over!
+        targetMessenger.receiveMessage(ReceivedMessage({
+            timestamp: block.timestamp,
+            target: _target,
+            sender: msg.sender,
+            message: _message,
+            messageNonce: messageNonce,
+            gasLimit: _gasLimit
+        }));
+ 
+        messageNonce += 1;
+    }
+ 
+    /**
+     * Receives a message to be sent later.
+     * @param _message Message to send later.
+     */
+    function receiveMessage(
+        ReceivedMessage memory _message
+    )
+        public
+    {
+        fullReceivedMessages.push(_message);
+    }
+ 
+    /**
+     * Checks whether we have messages to relay.
+     * @param _exists Whether or not we have more messages to relay.
+     */
+    function hasNextMessage()
+        public
+        view
+        returns (
+            bool _exists
+        )
+    {
+        return fullReceivedMessages.length > lastRelayedMessage;
+    }
+ 
+    /**
+     * Relays the last received message not yet relayed.
+     */
+    function relayNextMessage()
+        public
+    {
+        require(hasNextMessage(), "No pending messages to relay");
+        ReceivedMessage memory nextMessage = fullReceivedMessages[lastRelayedMessage];
+        require(nextMessage.timestamp + delay < block.timestamp, "Message is not ready to be relayed. The delay period is not up yet!");
+ 
+        xDomainMessageSender = nextMessage.sender;
+        (bool success,) = nextMessage.target.call{gas: nextMessage.gasLimit}(nextMessage.message);
+        require(success, "Cross-domain message call reverted. Did you set your gas limit high enough?");
+        lastRelayedMessage += 1;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html new file mode 100644 index 000000000..a584a996b --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html @@ -0,0 +1,206 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/mockOVM/bridge/ mockOVM_GenericCrossDomainMessenger.sol +

+
+
+ 0% + Statements + 0/5 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title mockOVM_GenericCrossDomainMessenger
+ * @dev An experimental alternative mock for local testing.
+ */
+contract mockOVM_GenericCrossDomainMessenger {
+    address public xDomainMessageSender;
+ 
+    event SentMessage(
+        address _sender,
+        address _target,
+        bytes _message,
+        uint256 _gasLimit
+    );
+ 
+    function sendMessage(
+        address _target,
+        bytes memory _message,
+        uint32 _gasLimit
+    )
+        public
+    {
+        emit SentMessage(
+            msg.sender,
+            _target,
+            _message,
+            _gasLimit
+        );
+    }
+ 
+    function relayMessage(
+        address _sender,
+        address _target,
+        bytes memory _message,
+        uint256 _gasLimit
+    )
+        public
+    {
+        xDomainMessageSender = _sender;
+        (bool success, ) = _target.call{gas: _gasLimit}(_message);
+        require(success, "Cross-domain message call reverted. Did you set your gas limit high enough?");
+        xDomainMessageSender = address(0);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/index.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/index.html new file mode 100644 index 000000000..f2db23491 --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/verification/ + + + + + + + +
+
+

+ all files optimistic-ethereum/mockOVM/verification/ +

+
+
+ 50% + Statements + 1/2 +
+
+ 100% + Branches + 0/0 +
+
+ 22.22% + Functions + 2/9 +
+
+ 50% + Lines + 1/2 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
mockOVM_BondManager.sol
50%1/2100%0/022.22%2/950%1/2
+
+
+ + + + + + + diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html new file mode 100644 index 000000000..e66f2c6fa --- /dev/null +++ b/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html @@ -0,0 +1,329 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/mockOVM/verification/ mockOVM_BondManager.sol +

+
+
+ 50% + Statements + 1/2 +
+
+ 100% + Branches + 0/0 +
+
+ 22.22% + Functions + 2/9 +
+
+ 50% + Lines + 1/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+ 
+/* Contract Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/**
+ * @title mockOVM_BondManager
+ */
+contract mockOVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    function recordGasSpent(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        address _who,
+        uint256 _gasSpent
+    )
+        override
+        public
+    {}
+ 
+    function finalize(
+        bytes32 _preStateRoot,
+        address _publisher,
+        uint256 _timestamp
+    )
+        override
+        public
+    {}
+ 
+    function deposit()
+        override
+        public
+    {}
+ 
+    function startWithdrawal()
+        override
+        public
+    {}
+ 
+    function finalizeWithdrawal()
+        override
+        public
+    {}
+ 
+    function claim(
+        address _who
+    )
+        override
+        public
+    {}
+ 
+    function isCollateralized(
+        address _who
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        // Only authenticate sequencer to submit state root batches.
+        return _who == resolve("OVM_Proposer");
+    }
+ 
+    function getGasSpent(
+        bytes32, // _preStateRoot,
+        address // _who
+    )
+        override
+        public
+        pure 
+        returns (
+            uint256
+        )
+    {
+        return 0;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css new file mode 100644 index 000000000..b317a7cda --- /dev/null +++ b/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js new file mode 100644 index 000000000..ef51e0386 --- /dev/null +++ b/coverage/lcov-report/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/lcov-report/sort-arrow-sprite.png b/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..03f704a609c6fd0dbfdac63466a7d7c958b5cbf3 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/coverage/lcov-report/test-helpers/Helper_GasMeasurer.sol.html b/coverage/lcov-report/test-helpers/Helper_GasMeasurer.sol.html new file mode 100644 index 000000000..e33773a59 --- /dev/null +++ b/coverage/lcov-report/test-helpers/Helper_GasMeasurer.sol.html @@ -0,0 +1,164 @@ + + + + Code coverage report for test-helpers/Helper_GasMeasurer.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_GasMeasurer.sol +

+
+
+ 100% + Statements + 7/7 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34  +  +  +  +  +  +  +  +  +  +  +  +47× +47× +  +47× +47× +47× +  +  +  +  +47× +47× +  +  +  +  +47× +  +47× +  +  + 
// SPDX-License-Identifier: UNLICENSED
+// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+contract Helper_GasMeasurer {
+    function measureCallGas(
+        address _target,
+        bytes memory _data
+    )
+        public
+        returns ( uint256 )
+    {
+        uint256 gasBefore;
+        uint256 gasAfter;
+ 
+        uint256 calldataStart;
+        uint256 calldataLength;
+        assembly {
+            calldataStart := add(_data,0x20)
+            calldataLength := mload(_data)
+        }
+ 
+        bool success;
+        assembly {
+            gasBefore := gas()
+            success := call(gas(), _target, 0, calldataStart, calldataLength, 0, 0)
+            gasAfter := gas()
+        }
+        Erequire(success, "Call failed, but calls we want to measure gas for should succeed!");
+ 
+        return gasBefore - gasAfter;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-helpers/Helper_ModifiableStorage.sol.html b/coverage/lcov-report/test-helpers/Helper_ModifiableStorage.sol.html new file mode 100644 index 000000000..f0c0291b2 --- /dev/null +++ b/coverage/lcov-report/test-helpers/Helper_ModifiableStorage.sol.html @@ -0,0 +1,233 @@ + + + + Code coverage report for test-helpers/Helper_ModifiableStorage.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_ModifiableStorage.sol +

+
+
+ 0% + Statements + 0/5 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+contract Helper_ModifiableStorage {
+    mapping (address => address) private target;
+ 
+    constructor(
+        address _target
+    )
+    {
+        target[address(this)] = _target;
+    }
+ 
+    fallback()
+        external
+    {
+        (bool success, bytes memory returndata) = target[address(this)].delegatecall(msg.data);
+ 
+        if (success) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+ 
+    function __setStorageSlot(
+        bytes32 _key,
+        bytes32 _value
+    )
+        public
+    {
+        assembly {
+            sstore(_key, _value)
+        }
+    }
+ 
+    function __getStorageSlot(
+        bytes32 _key
+    )
+        public
+        view
+        returns (
+            bytes32 _value
+        )
+    {
+        bytes32 value;
+        assembly {
+            value := sload(_key)
+        }
+        return value;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-helpers/Helper_PrecompileCaller.sol.html b/coverage/lcov-report/test-helpers/Helper_PrecompileCaller.sol.html new file mode 100644 index 000000000..1c17c6868 --- /dev/null +++ b/coverage/lcov-report/test-helpers/Helper_PrecompileCaller.sol.html @@ -0,0 +1,224 @@ + + + + Code coverage report for test-helpers/Helper_PrecompileCaller.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_PrecompileCaller.sol +

+
+
+ 75% + Statements + 9/12 +
+
+ 50% + Branches + 3/6 +
+
+ 100% + Functions + 3/3 +
+
+ 75% + Lines + 9/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54  +  +  +  +  +  +  +  +  +  +  +  +54× +54× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+import { Helper_SimpleProxy } from "./Helper_SimpleProxy.sol";
+ 
+contract Helper_PredeployCaller is Helper_SimpleProxy {
+    function callPredeploy(
+        address _predeploy,
+        bytes memory _data
+    )
+        public
+    {
+        Eif (msg.sender == owner) {
+            makeExternalCall(_predeploy, _data);
+        } else {
+            makeExternalCall(target, msg.data);
+        }
+    }
+ 
+    function callPredeployAbi(
+        address _predeploy,
+        bytes memory _data
+    )
+        public
+        returns (
+            bytes memory
+        )
+    {
+ 
+        bool success;
+        bytes memory returndata;
+        Eif (msg.sender == owner) {
+            (success, returndata) = _predeploy.call(_data);
+        } else {
+            (success, returndata) = target.call(msg.data);
+        }
+        Erequire(success, "Predeploy call reverted");
+        return returndata;
+    }
+ 
+    function getL1MessageSender(
+        address _predeploy,
+        bytes memory _data
+    )
+        public
+        returns (
+            address
+        )
+    {
+        callPredeploy(_predeploy, _data);
+        return address(0); // unused: silence compiler
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-helpers/Helper_SimpleProxy.sol.html b/coverage/lcov-report/test-helpers/Helper_SimpleProxy.sol.html new file mode 100644 index 000000000..431c71e0b --- /dev/null +++ b/coverage/lcov-report/test-helpers/Helper_SimpleProxy.sol.html @@ -0,0 +1,212 @@ + + + + Code coverage report for test-helpers/Helper_SimpleProxy.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_SimpleProxy.sol +

+
+
+ 85.71% + Statements + 6/7 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 4/4 +
+
+ 88.89% + Lines + 8/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50  +  +  +  +  +  +  +  +  +69× +  +  +  +  +  +271× +  +  +  +  +  +  +  +23× +23× +  +  +  +  +  +  +  +  +  +  +  +325× +  +325× +321× +  +  +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+contract Helper_SimpleProxy {
+    address internal owner;
+    address internal target;
+ 
+    constructor()
+    {
+        owner = msg.sender;
+    }
+ 
+    fallback()
+        external
+    {
+        makeExternalCall(target, msg.data);
+    }
+ 
+    function setTarget(
+        address _target
+    )
+        public
+    {
+        Eif (msg.sender == owner) {
+            target = _target;
+        } else {
+            makeExternalCall(target, msg.data);
+        }
+    }
+ 
+    function makeExternalCall(
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+    {
+        (bool success, bytes memory returndata) = _target.call(_calldata);
+ 
+        if (success) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-helpers/Helper_TestRunner.sol.html b/coverage/lcov-report/test-helpers/Helper_TestRunner.sol.html new file mode 100644 index 000000000..4034ff256 --- /dev/null +++ b/coverage/lcov-report/test-helpers/Helper_TestRunner.sol.html @@ -0,0 +1,647 @@ + + + + Code coverage report for test-helpers/Helper_TestRunner.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_TestRunner.sol +

+
+
+ 30.3% + Statements + 20/66 +
+
+ 66.67% + Branches + 16/24 +
+
+ 80% + Functions + 4/5 +
+
+ 33.8% + Lines + 24/71 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +161× +161× +  +  +  +  +  +161× + + +  +  +  +159× + +  +  +  +  +156× +  +156× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +156× + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +156× +17× +  +  +  +  +  +  +  +  +  +  +83× +87× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +  +  +  +  +  +  +14× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +18× +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Logging */
+import { console } from "hardhat/console.sol";
+ 
+/**
+ * @title Helper_TestRunner
+ */
+contract Helper_TestRunner {
+    struct TestStep {
+        string functionName;
+        bytes functionData;
+        bool expectedReturnStatus;
+        bytes expectedReturnData;
+        bool onlyValidateFlag;
+    }
+ 
+    function runSingleTestStep(
+        TestStep memory _step
+    )
+        public
+    {
+        bytes32 namehash = keccak256(abi.encodePacked(_step.functionName));
+        Iif (namehash == keccak256("evmRETURN")) {
+            bytes memory functionData = _step.functionData;
+            assembly {
+                return(add(functionData, 0x20), mload(functionData))
+            }
+        }
+        if (namehash == keccak256("evmREVERT")) {
+            bytes memory functionData = _step.functionData;
+            assembly {
+                revert(add(functionData, 0x20), mload(functionData))
+            }
+        }
+        if (namehash == keccak256("evmINVALID")) {
+            assembly {
+                invalid()
+            }
+        }
+ 
+        (bool success, bytes memory returndata) = address(msg.sender).call(_step.functionData);
+ 
+        Iif (success != _step.expectedReturnStatus) {
+            if (success == true) {
+                console.log("ERROR: Expected function to revert, but function returned successfully");
+                console.log("Offending Step: %s", _step.functionName);
+                console.log("Return Data:");
+                console.logBytes(returndata);
+                console.log("");
+            } else {
+                (
+                    uint256 _flag,
+                    uint256 _nuisanceGasLeft,
+                    uint256 _ovmGasRefund,
+                    bytes memory _data
+                ) = _decodeRevertData(returndata);
+ 
+                console.log("ERROR: Expected function to return successfully, but function reverted");
+                console.log("Offending Step: %s", _step.functionName);
+                console.log("Flag: %s", _flag);
+                console.log("Nuisance Gas Left: %s", _nuisanceGasLeft);
+                console.log("OVM Gas Refund: %s", _ovmGasRefund);
+                console.log("Extra Data:");
+                console.logBytes(_data);
+                console.log("");
+            }
+ 
+            _failStep();
+        }
+ 
+        if (keccak256(returndata) != keccak256(_step.expectedReturnData)) {
+            Iif (success == true) {
+                console.log("ERROR: Actual return data does not match expected return data");
+                console.log("Offending Step: %s", _step.functionName);
+                console.log("Expected:");
+                console.logBytes(_step.expectedReturnData);
+                console.log("Actual:");
+                console.logBytes(returndata);
+                console.log("");
+ 
+                _failStep();
+            } else {
+                (
+                    uint256 _expectedFlag,
+                    uint256 _expectedNuisanceGasLeft,
+                    uint256 _expectedOvmGasRefund,
+                    bytes memory _expectedData
+                ) = _decodeRevertData(_step.expectedReturnData);
+ 
+                (
+                    uint256 _flag,
+                    uint256 _nuisanceGasLeft,
+                    uint256 _ovmGasRefund,
+                    bytes memory _data
+                ) = _decodeRevertData(returndata);
+ 
+                Eif (
+                    _step.onlyValidateFlag
+                ) {
+                    Iif (
+                        _expectedFlag != _flag
+                    ) {
+                        console.log("ERROR: Actual revert flag does not match expected revert flag data");
+                        console.log("Offending Step: %s", _step.functionName);
+                        console.log("Expected Flag: %s", _expectedFlag);
+                        console.log("Actual Flag: %s", _flag);
+                        _failStep();
+                    }
+                } else {
+                    console.log("ERROR: Actual revert flag data does not match expected revert flag data");
+                    console.log("Offending Step: %s", _step.functionName);
+                    console.log("Expected Flag: %s", _expectedFlag);
+                    console.log("Actual Flag: %s", _flag);
+                    console.log("Expected Nuisance Gas Left: %s", _expectedNuisanceGasLeft);
+                    console.log("Actual Nuisance Gas Left: %s", _nuisanceGasLeft);
+                    console.log("Expected OVM Gas Refund: %s", _expectedOvmGasRefund);
+                    console.log("Actual OVM Gas Refund: %s", _ovmGasRefund);
+                    console.log("Expected Extra Data:");
+                    console.logBytes(_expectedData);
+                    console.log("Actual Extra Data:");
+                    console.logBytes(_data);
+                    console.log("");
+                    _failStep();
+                }
+            }
+        }
+ 
+        if (success == false) {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+ 
+    function runMultipleTestSteps(
+        TestStep[] memory _steps
+    )
+        public
+    {
+        for (uint256 i = 0; i < _steps.length; i++) {
+            runSingleTestStep(_steps[i]);
+        }
+    }
+ 
+    function _decodeRevertData(
+        bytes memory _revertdata
+    )
+        internal
+        pure
+        returns (
+            uint256 _flag,
+            uint256 _nuisanceGasLeft,
+            uint256 _ovmGasRefund,
+            bytes memory _data
+        )
+    {
+        Iif (_revertdata.length == 0) {
+            return (
+                0,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        return abi.decode(_revertdata, (uint256, uint256, uint256, bytes));
+    }
+ 
+    function _failStep()
+        internal
+        pure
+    {
+        revert("Test step failed.");
+    }
+}
+ 
+contract Helper_TestRunner_CREATE is Helper_TestRunner {
+    constructor(
+        bytes memory _bytecode,
+        TestStep[] memory _steps
+    )
+    {
+        if (_steps.length > 0) {
+            runMultipleTestSteps(_steps);
+        } else {
+            assembly {
+                return(add(_bytecode, 0x20), mload(_bytecode))
+            }
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-helpers/Mock_FraudVerifier.sol.html b/coverage/lcov-report/test-helpers/Mock_FraudVerifier.sol.html new file mode 100644 index 000000000..414282eb3 --- /dev/null +++ b/coverage/lcov-report/test-helpers/Mock_FraudVerifier.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for test-helpers/Mock_FraudVerifier.sol + + + + + + + +
+
+

+ all files / test-helpers/ Mock_FraudVerifier.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +46× +  +  +  +12× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+import { OVM_BondManager } from "./../optimistic-ethereum/OVM/verification/OVM_BondManager.sol";
+ 
+contract Mock_FraudVerifier {
+    OVM_BondManager bondManager;
+ 
+    mapping (bytes32 => address) transitioners;
+ 
+    function setBondManager(OVM_BondManager _bondManager) public {
+        bondManager = _bondManager;
+    }
+ 
+    function setStateTransitioner(bytes32 preStateRoot, bytes32 txHash, address addr) public {
+        transitioners[keccak256(abi.encodePacked(preStateRoot, txHash))] = addr;
+    }
+ 
+    function getStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        public
+        view
+        returns (
+            address
+        )
+    {
+        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
+    }
+ 
+    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) public {
+        bondManager.finalize(_preStateRoot, publisher, timestamp);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-helpers/TestERC20.sol.html b/coverage/lcov-report/test-helpers/TestERC20.sol.html new file mode 100644 index 000000000..8aac61ec3 --- /dev/null +++ b/coverage/lcov-report/test-helpers/TestERC20.sol.html @@ -0,0 +1,269 @@ + + + + Code coverage report for test-helpers/TestERC20.sol + + + + + + + +
+
+

+ all files / test-helpers/ TestERC20.sol +

+
+
+ 89.47% + Statements + 17/19 +
+
+ 37.5% + Branches + 3/8 +
+
+ 90% + Functions + 9/10 +
+
+ 89.47% + Lines + 17/19 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +21× +21× +  +  +  +18× +18× +  +  +  +25× +25× +25× +  +  +  +18× +18× +  +  +  + + +  +  +  +18× +  +  +18× +18× +  +  +  +  +  +67× +  +  +  +25× +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+// a test ERC20 token with an open mint function
+contract TestERC20 {
+    using SafeMath for uint;
+ 
+    string public constant name = 'Test';
+    string public constant symbol = 'TST';
+    uint8 public constant decimals = 18;
+    uint256  public totalSupply;
+    mapping(address => uint) public balanceOf;
+    mapping(address => mapping(address => uint)) public allowance;
+ 
+    event Approval(address indexed owner, address indexed spender, uint256 value);
+    event Transfer(address indexed from, address indexed to, uint256 value);
+ 
+    constructor() {}
+ 
+    function mint(address to, uint256 value) public {
+        totalSupply = totalSupply.add(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(address(0), to, value);
+    }
+ 
+    function _approve(address owner, address spender, uint256 value) private {
+        allowance[owner][spender] = value;
+        emit Approval(owner, spender, value);
+    }
+ 
+    function _transfer(address from, address to, uint256 value) private {
+        balanceOf[from] = balanceOf[from].sub(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(from, to, value);
+    }
+ 
+    function approve(address spender, uint256 value) external returns (bool) {
+        _approve(msg.sender, spender, value);
+        return true;
+    }
+ 
+    function transfer(address to, uint256 value) external returns (bool) {
+        _transfer(msg.sender, to, value);
+        return true;
+    }
+ 
+    function transferFrom(address from, address to, uint256 value) external returns (bool) {
+        Iif (allowance[from][msg.sender] != uint(-1)) {
+            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
+        }
+        _transfer(from, to, value);
+        return true;
+    }
+}
+ 
+library SafeMath {
+    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
+        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
+    }
+ 
+    function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
+        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
+    }
+ 
+    function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
+        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-helpers/index.html b/coverage/lcov-report/test-helpers/index.html new file mode 100644 index 000000000..d957a052c --- /dev/null +++ b/coverage/lcov-report/test-helpers/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for test-helpers/ + + + + + + + +
+
+

+ all files test-helpers/ +

+
+
+ 52.5% + Statements + 63/120 +
+
+ 56.52% + Branches + 26/46 +
+
+ 80.65% + Functions + 25/31 +
+
+ 53.38% + Lines + 71/133 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Helper_GasMeasurer.sol
100%7/750%1/2100%1/1100%9/9
Helper_ModifiableStorage.sol
0%0/50%0/20%0/40%0/9
Helper_PrecompileCaller.sol
75%9/1250%3/6100%3/375%9/12
Helper_SimpleProxy.sol
85.71%6/775%3/4100%4/488.89%8/9
Helper_TestRunner.sol
30.3%20/6666.67%16/2480%4/533.8%24/71
Mock_FraudVerifier.sol
100%4/4100%0/0100%4/4100%4/4
TestERC20.sol
89.47%17/1937.5%3/890%9/1089.47%17/19
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/codec/TestLib_OVMCodec.sol.html b/coverage/lcov-report/test-libraries/codec/TestLib_OVMCodec.sol.html new file mode 100644 index 000000000..3c1930eb7 --- /dev/null +++ b/coverage/lcov-report/test-libraries/codec/TestLib_OVMCodec.sol.html @@ -0,0 +1,245 @@ + + + + Code coverage report for test-libraries/codec/TestLib_OVMCodec.sol + + + + + + + +
+
+

+ all files / test-libraries/codec/ TestLib_OVMCodec.sol +

+
+
+ 0% + Statements + 0/4 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title TestLib_OVMCodec
+ */
+contract TestLib_OVMCodec {
+ 
+    function decodeEIP155Transaction(
+        bytes memory _transaction,
+        bool _isEthSignedMessage
+    )
+        public
+        pure
+        returns (
+            Lib_OVMCodec.EIP155Transaction memory _decoded
+        )
+    {
+        return Lib_OVMCodec.decodeEIP155Transaction(_transaction, _isEthSignedMessage);
+    }
+ 
+    function encodeTransaction(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        public
+        pure
+        returns (
+            bytes memory _encoded
+        )
+    {
+        return Lib_OVMCodec.encodeTransaction(_transaction);
+    }
+ 
+    function hashTransaction(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        public
+        pure
+        returns (
+            bytes32 _hash
+        )
+    {
+        return Lib_OVMCodec.hashTransaction(_transaction);
+    }
+ 
+    function decompressEIP155Transaction(
+        bytes memory _transaction
+    )
+        public
+        returns (
+            Lib_OVMCodec.EIP155Transaction memory _decompressed
+        )
+    {
+        return Lib_OVMCodec.decompressEIP155Transaction(_transaction);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/codec/index.html b/coverage/lcov-report/test-libraries/codec/index.html new file mode 100644 index 000000000..513c5a78e --- /dev/null +++ b/coverage/lcov-report/test-libraries/codec/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for test-libraries/codec/ + + + + + + + +
+
+

+ all files test-libraries/codec/ +

+
+
+ 0% + Statements + 0/4 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/4 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
TestLib_OVMCodec.sol
0%0/4100%0/00%0/40%0/4
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/rlp/TestLib_RLPReader.sol.html b/coverage/lcov-report/test-libraries/rlp/TestLib_RLPReader.sol.html new file mode 100644 index 000000000..946105c3c --- /dev/null +++ b/coverage/lcov-report/test-libraries/rlp/TestLib_RLPReader.sol.html @@ -0,0 +1,368 @@ + + + + Code coverage report for test-libraries/rlp/TestLib_RLPReader.sol + + + + + + + +
+
+

+ all files / test-libraries/rlp/ TestLib_RLPReader.sol +

+
+
+ 90.91% + Statements + 10/11 +
+
+ 100% + Branches + 0/0 +
+
+ 85.71% + Functions + 6/7 +
+
+ 90.91% + Lines + 10/11 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +62× +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPReader } from "../../optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol";
+ 
+/**
+ * @title TestLib_RLPReader
+ */
+contract TestLib_RLPReader {
+ 
+    function readList(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bytes[] memory
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_in);
+        bytes[] memory out = new bytes[](decoded.length);
+        for (uint256 i = 0; i < out.length; i++) {
+            out[i] = Lib_RLPReader.readRawBytes(decoded[i]);
+        }
+        return out;
+    }
+ 
+    function readString(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            string memory
+        )
+    {
+        return Lib_RLPReader.readString(_in);
+    }
+ 
+    function readBytes(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return Lib_RLPReader.readBytes(_in);
+    }
+ 
+    function readBytes32(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_RLPReader.readBytes32(_in);
+    }
+ 
+    function readUint256(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            uint256
+        )
+    {
+        return Lib_RLPReader.readUint256(_in);
+    }
+ 
+    function readBool(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_RLPReader.readBool(_in);
+    }
+ 
+    function readAddress(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            address
+        )
+    {
+        return Lib_RLPReader.readAddress(_in);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/rlp/TestLib_RLPWriter.sol.html b/coverage/lcov-report/test-libraries/rlp/TestLib_RLPWriter.sol.html new file mode 100644 index 000000000..1a3ca073f --- /dev/null +++ b/coverage/lcov-report/test-libraries/rlp/TestLib_RLPWriter.sol.html @@ -0,0 +1,356 @@ + + + + Code coverage report for test-libraries/rlp/TestLib_RLPWriter.sol + + + + + + + +
+
+

+ all files / test-libraries/rlp/ TestLib_RLPWriter.sol +

+
+
+ 62.5% + Statements + 5/8 +
+
+ 100% + Branches + 0/0 +
+
+ 57.14% + Functions + 4/7 +
+
+ 62.5% + Lines + 5/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +61× +  +  +  +  +  +  +  +  +  +  +  +139× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPWriter } from "../../optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol";
+import { TestERC20 } from "../../test-helpers/TestERC20.sol";
+ 
+/**
+ * @title TestLib_RLPWriter
+ */
+contract TestLib_RLPWriter {
+ 
+    function writeBytes(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeBytes(_in);
+    }
+ 
+    function writeList(
+        bytes[] memory _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeList(_in);
+    }
+ 
+    function writeString(
+        string memory _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeString(_in);
+    }
+ 
+    function writeAddress(
+        address _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeAddress(_in);
+    }
+ 
+    function writeUint(
+        uint256 _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeUint(_in);
+    }
+ 
+    function writeBool(
+        bool _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeBool(_in);
+    }
+ 
+    function writeAddressWithTaintedMemory(
+        address _in
+    )
+        public
+        returns (
+            bytes memory _out
+        )
+    {
+        new TestERC20();
+        return Lib_RLPWriter.writeAddress(_in);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/rlp/index.html b/coverage/lcov-report/test-libraries/rlp/index.html new file mode 100644 index 000000000..23f40f43d --- /dev/null +++ b/coverage/lcov-report/test-libraries/rlp/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for test-libraries/rlp/ + + + + + + + +
+
+

+ all files test-libraries/rlp/ +

+
+
+ 78.95% + Statements + 15/19 +
+
+ 100% + Branches + 0/0 +
+
+ 71.43% + Functions + 10/14 +
+
+ 78.95% + Lines + 15/19 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
TestLib_RLPReader.sol
90.91%10/11100%0/085.71%6/790.91%10/11
TestLib_RLPWriter.sol
62.5%5/8100%0/057.14%4/762.5%5/8
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/trie/TestLib_MerkleTrie.sol.html b/coverage/lcov-report/test-libraries/trie/TestLib_MerkleTrie.sol.html new file mode 100644 index 000000000..5ba93e048 --- /dev/null +++ b/coverage/lcov-report/test-libraries/trie/TestLib_MerkleTrie.sol.html @@ -0,0 +1,377 @@ + + + + Code coverage report for test-libraries/trie/TestLib_MerkleTrie.sol + + + + + + + +
+
+

+ all files / test-libraries/trie/ TestLib_MerkleTrie.sol +

+
+
+ 60% + Statements + 3/5 +
+
+ 100% + Branches + 0/0 +
+
+ 60% + Functions + 3/5 +
+
+ 60% + Lines + 3/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +32× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_MerkleTrie } from "../../optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol";
+ 
+/**
+ * @title TestLib_MerkleTrie
+ */
+contract TestLib_MerkleTrie {
+ 
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_MerkleTrie.verifyInclusionProof(
+            _key,
+            _value,
+            _proof,
+            _root
+        );
+    }
+ 
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_MerkleTrie.verifyExclusionProof(
+            _key,
+            _proof,
+            _root
+        );
+    }
+ 
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_MerkleTrie.update(
+            _key,
+            _value,
+            _proof,
+            _root
+        );
+    }
+ 
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        return Lib_MerkleTrie.get(
+            _key,
+            _proof,
+            _root
+        );
+    }
+ 
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_MerkleTrie.getSingleNodeRootHash(
+            _key,
+            _value
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html b/coverage/lcov-report/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html new file mode 100644 index 000000000..1735f3dbc --- /dev/null +++ b/coverage/lcov-report/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html @@ -0,0 +1,380 @@ + + + + Code coverage report for test-libraries/trie/TestLib_SecureMerkleTrie.sol + + + + + + + +
+
+

+ all files / test-libraries/trie/ TestLib_SecureMerkleTrie.sol +

+
+
+ 60% + Statements + 3/5 +
+
+ 100% + Branches + 0/0 +
+
+ 60% + Functions + 3/5 +
+
+ 60% + Lines + 3/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_SecureMerkleTrie } from "../../optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol";
+ 
+/**
+ * @title TestLib_SecureMerkleTrie
+ */
+contract TestLib_SecureMerkleTrie {
+ 
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_SecureMerkleTrie.verifyInclusionProof(
+            _key,
+            _value,
+            _proof,
+            _root
+        );
+    }
+ 
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_SecureMerkleTrie.verifyExclusionProof(
+            _key,
+            _proof,
+            _root
+        );
+    }
+ 
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_SecureMerkleTrie.update(
+            _key,
+            _value,
+            _proof,
+            _root
+        );
+    }
+ 
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        return Lib_SecureMerkleTrie.get(
+            _key,
+            _proof,
+            _root
+        );
+    }
+ 
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_SecureMerkleTrie.getSingleNodeRootHash(
+            _key,
+            _value
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/trie/index.html b/coverage/lcov-report/test-libraries/trie/index.html new file mode 100644 index 000000000..156eb46c8 --- /dev/null +++ b/coverage/lcov-report/test-libraries/trie/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for test-libraries/trie/ + + + + + + + +
+
+

+ all files test-libraries/trie/ +

+
+
+ 60% + Statements + 6/10 +
+
+ 100% + Branches + 0/0 +
+
+ 60% + Functions + 6/10 +
+
+ 60% + Lines + 6/10 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
TestLib_MerkleTrie.sol
60%3/5100%0/060%3/560%3/5
TestLib_SecureMerkleTrie.sol
60%3/5100%0/060%3/560%3/5
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_Bytes32Utils.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_Bytes32Utils.sol.html new file mode 100644 index 000000000..d74a5946d --- /dev/null +++ b/coverage/lcov-report/test-libraries/utils/TestLib_Bytes32Utils.sol.html @@ -0,0 +1,242 @@ + + + + Code coverage report for test-libraries/utils/TestLib_Bytes32Utils.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_Bytes32Utils.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol";
+ 
+/**
+ * @title TestLib_Byte32Utils
+ */
+contract TestLib_Bytes32Utils {
+ 
+    function toBool(
+        bytes32 _in
+    )
+        public
+        pure
+        returns (
+            bool _out
+        )
+    {
+        return Lib_Bytes32Utils.toBool(_in);
+    }
+ 
+    function fromBool(
+        bool _in
+    )
+        public
+        pure
+        returns (
+            bytes32 _out
+        )
+    {
+        return Lib_Bytes32Utils.fromBool(_in);
+    }
+ 
+    function toAddress(
+        bytes32 _in
+    )
+        public
+        pure
+        returns (
+            address _out
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(_in);
+    }
+ 
+    function fromAddress(
+        address _in
+    )
+        public
+        pure
+        returns (
+            bytes32 _out
+        )
+    {
+        return Lib_Bytes32Utils.fromAddress(_in);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_BytesUtils.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_BytesUtils.sol.html new file mode 100644 index 000000000..1da9a7b70 --- /dev/null +++ b/coverage/lcov-report/test-libraries/utils/TestLib_BytesUtils.sol.html @@ -0,0 +1,428 @@ + + + + Code coverage report for test-libraries/utils/TestLib_BytesUtils.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_BytesUtils.sol +

+
+
+ 88.89% + Statements + 8/9 +
+
+ 100% + Branches + 0/0 +
+
+ 87.5% + Functions + 7/8 +
+
+ 88.89% + Lines + 8/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../../optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol";
+import { TestERC20 } from "../../test-helpers/TestERC20.sol";
+ 
+/**
+ * @title TestLib_BytesUtils
+ */
+contract TestLib_BytesUtils {
+ 
+    function concat(
+        bytes memory _preBytes,
+        bytes memory _postBytes
+    )
+        public
+        pure
+        returns (bytes memory)
+    {
+        return abi.encodePacked(
+            _preBytes,
+            _postBytes
+        );
+    }
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start,
+        uint256 _length
+    )
+        public
+        pure
+        returns (bytes memory)
+    {
+        return Lib_BytesUtils.slice(
+            _bytes,
+            _start,
+            _length
+        );
+    }
+ 
+    function toBytes32(
+        bytes memory _bytes
+    )
+        public
+        pure
+        returns (bytes32)
+    {
+        return Lib_BytesUtils.toBytes32(
+            _bytes
+        );
+    }
+ 
+    function toUint256(
+        bytes memory _bytes
+    )
+        public
+        pure
+        returns (uint256)
+    {
+        return Lib_BytesUtils.toUint256(
+            _bytes
+        );
+    }
+ 
+    function toNibbles(
+        bytes memory _bytes
+    )
+        public
+        pure
+        returns (bytes memory)
+    {
+        return Lib_BytesUtils.toNibbles(
+            _bytes
+        );
+    }
+ 
+    function fromNibbles(
+        bytes memory _bytes
+    )
+        public
+        pure
+        returns (bytes memory)
+    {
+        return Lib_BytesUtils.fromNibbles(
+            _bytes
+        );
+    }
+ 
+    function equal(
+        bytes memory _bytes,
+        bytes memory _other
+    )
+        public
+        pure
+        returns (bool)
+    {
+        return Lib_BytesUtils.equal(
+            _bytes,
+            _other
+        );
+    }
+ 
+    function sliceWithTaintedMemory(
+        bytes memory _bytes,
+        uint256 _start,
+        uint256 _length
+    )
+        public
+        returns (bytes memory)
+    {
+        new TestERC20();
+        return Lib_BytesUtils.slice(
+            _bytes,
+            _start,
+            _length
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_ECDSAUtils.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_ECDSAUtils.sol.html new file mode 100644 index 000000000..9327fbbb2 --- /dev/null +++ b/coverage/lcov-report/test-libraries/utils/TestLib_ECDSAUtils.sol.html @@ -0,0 +1,164 @@ + + + + Code coverage report for test-libraries/utils/TestLib_ECDSAUtils.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_ECDSAUtils.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_ECDSAUtils } from "../../optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol";
+ 
+/**
+ * @title TestLib_ECDSAUtils
+ */
+contract TestLib_ECDSAUtils {
+ 
+    function recover(
+        bytes memory _message,
+        bool _isEthSignedMessage,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        public
+        pure
+        returns (
+            address _sender
+        )
+    {
+        return Lib_ECDSAUtils.recover(
+            _message,
+            _isEthSignedMessage,
+            _v,
+            _r,
+            _s
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_EthUtils.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_EthUtils.sol.html new file mode 100644 index 000000000..2bf8a5405 --- /dev/null +++ b/coverage/lcov-report/test-libraries/utils/TestLib_EthUtils.sol.html @@ -0,0 +1,419 @@ + + + + Code coverage report for test-libraries/utils/TestLib_EthUtils.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_EthUtils.sol +

+
+
+ 14.29% + Statements + 1/7 +
+
+ 100% + Branches + 0/0 +
+
+ 14.29% + Functions + 1/7 +
+
+ 14.29% + Lines + 1/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_EthUtils } from "../../optimistic-ethereum/libraries/utils/Lib_EthUtils.sol";
+ 
+/**
+ * @title TestLib_EthUtils
+ */
+contract TestLib_EthUtils {
+ 
+    function getCode(
+        address _address,
+        uint256 _offset,
+        uint256 _length
+    )
+        public
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        return Lib_EthUtils.getCode(
+            _address,
+            _offset,
+            _length
+        );
+    }
+ 
+    function getCode(
+        address _address
+    )
+        public
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        return Lib_EthUtils.getCode(
+            _address
+        );
+    }
+ 
+    function getCodeSize(
+        address _address
+    )
+        public
+        view
+        returns (
+            uint256 _codeSize
+        )
+    {
+        return Lib_EthUtils.getCodeSize(
+            _address
+        );
+    }
+ 
+    function getCodeHash(
+        address _address
+    )
+        public
+        view
+        returns (
+            bytes32 _codeHash
+        )
+    {
+        return Lib_EthUtils.getCodeHash(
+            _address
+        );
+    }
+ 
+    function createContract(
+        bytes memory _code
+    )
+        public
+        returns (
+            address _created
+        )
+    {
+        return Lib_EthUtils.createContract(
+            _code
+        );
+    }
+ 
+    function getAddressForCREATE(
+        address _creator,
+        uint256 _nonce
+    )
+        public
+        pure
+        returns (
+            address _address
+        )
+    {
+        return Lib_EthUtils.getAddressForCREATE(
+            _creator,
+            _nonce
+        );
+    }
+ 
+    function getAddressForCREATE2(
+        address _creator,
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        public
+        pure
+        returns (address _address)
+    {
+        return Lib_EthUtils.getAddressForCREATE2(
+            _creator,
+            _bytecode,
+            _salt
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_MerkleTree.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_MerkleTree.sol.html new file mode 100644 index 000000000..0e685493b --- /dev/null +++ b/coverage/lcov-report/test-libraries/utils/TestLib_MerkleTree.sol.html @@ -0,0 +1,209 @@ + + + + Code coverage report for test-libraries/utils/TestLib_MerkleTree.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_MerkleTree.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_MerkleTree } from "../../optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol";
+ 
+/**
+ * @title TestLib_MerkleTree
+ */
+contract TestLib_MerkleTree {
+ 
+    function getMerkleRoot(
+        bytes32[] memory _elements
+    )
+        public
+       pure 
+        returns (
+            bytes32
+        )
+    {
+        return Lib_MerkleTree.getMerkleRoot(
+            _elements
+        );
+    }
+ 
+    function verify(
+        bytes32 _root,
+        bytes32 _leaf,
+        uint256 _index,
+        bytes32[] memory _siblings,
+        uint256 _totalLeaves
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_MerkleTree.verify(
+            _root,
+            _leaf,
+            _index,
+            _siblings,
+            _totalLeaves
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_RingBuffer.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_RingBuffer.sol.html new file mode 100644 index 000000000..a958378e1 --- /dev/null +++ b/coverage/lcov-report/test-libraries/utils/TestLib_RingBuffer.sol.html @@ -0,0 +1,278 @@ + + + + Code coverage report for test-libraries/utils/TestLib_RingBuffer.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_RingBuffer.sol +

+
+
+ 0% + Statements + 0/5 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/5 +
+
+ 0% + Lines + 0/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RingBuffer } from "../../optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol";
+ 
+/**
+ * @title TestLib_RingBuffer
+ */
+contract TestLib_RingBuffer {
+    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
+    
+    Lib_RingBuffer.RingBuffer internal buf;
+ 
+    function push(
+        bytes32 _value,
+        bytes27 _extraData
+    )
+        public
+    {
+        buf.push(
+            _value,
+            _extraData
+        );
+    }
+ 
+    function get(
+        uint256 _index
+    )
+        public
+        view
+        returns (
+            bytes32    
+        )
+    {
+        return buf.get(_index);
+    }
+ 
+    function deleteElementsAfterInclusive(
+        uint40 _index,
+        bytes27 _extraData
+    )
+        internal
+    {
+        return buf.deleteElementsAfterInclusive(
+            _index,
+            _extraData
+        );
+    }
+ 
+    function getLength()
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        return buf.getLength();
+    }
+ 
+    function getExtraData()
+        internal
+        view
+        returns (
+            bytes27
+        )
+    {
+        return buf.getExtraData();
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test-libraries/utils/index.html b/coverage/lcov-report/test-libraries/utils/index.html new file mode 100644 index 000000000..9a77798b4 --- /dev/null +++ b/coverage/lcov-report/test-libraries/utils/index.html @@ -0,0 +1,158 @@ + + + + Code coverage report for test-libraries/utils/ + + + + + + + +
+
+

+ all files test-libraries/utils/ +

+
+
+ 57.14% + Statements + 16/28 +
+
+ 100% + Branches + 0/0 +
+
+ 55.56% + Functions + 15/27 +
+
+ 57.14% + Lines + 16/28 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
TestLib_Bytes32Utils.sol
100%4/4100%0/0100%4/4100%4/4
TestLib_BytesUtils.sol
88.89%8/9100%0/087.5%7/888.89%8/9
TestLib_ECDSAUtils.sol
100%1/1100%0/0100%1/1100%1/1
TestLib_EthUtils.sol
14.29%1/7100%0/014.29%1/714.29%1/7
TestLib_MerkleTree.sol
100%2/2100%0/0100%2/2100%2/2
TestLib_RingBuffer.sol
0%0/5100%0/00%0/50%0/5
+
+
+ + + + + + + diff --git a/coverage/lcov.info b/coverage/lcov.info new file mode 100644 index 000000000..136ee6d87 --- /dev/null +++ b/coverage/lcov.info @@ -0,0 +1,3736 @@ +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol +FN:20,constructor +FN:34,onlyFromCrossDomainAccount +FN:58,getCrossDomainMessenger +FN:74,sendCrossDomainMessage +FNF:4 +FNH:4 +FNDA:78,constructor +FNDA:9,onlyFromCrossDomainAccount +FNDA:22,getCrossDomainMessenger +FNDA:7,sendCrossDomainMessage +DA:23,78 +DA:37,9 +DA:42,6 +DA:47,3 +DA:65,22 +DA:79,7 +LF:6 +LH:6 +BRDA:37,1,0,6 +BRDA:37,1,1,3 +BRDA:42,2,0,3 +BRDA:42,2,1,3 +BRF:4 +BRH:4 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol +FN:109,decodeEIP155Transaction +FN:160,decompressEIP155Transaction +FN:185,encodeEIP155Transaction +FN:230,encodeTransaction +FN:255,hashTransaction +FN:272,toEVMAccount +FN:294,encodeEVMAccount +FN:329,decodeEVMAccount +FN:353,hashBatchHeader +FNF:9 +FNH:9 +FNDA:7,decodeEIP155Transaction +FNDA:5,decompressEIP155Transaction +FNDA:5,encodeEIP155Transaction +FNDA:25,encodeTransaction +FNDA:25,hashTransaction +FNDA:1,toEVMAccount +FNDA:1,encodeEVMAccount +FNDA:6,decodeEVMAccount +FNDA:107,hashBatchHeader +DA:119,7 +DA:120,1 +DA:131,1 +DA:141,6 +DA:143,6 +DA:168,5 +DA:195,5 +DA:196,2 +DA:205,3 +DA:207,3 +DA:208,3 +DA:209,3 +DA:210,3 +DA:211,1 +DA:213,2 +DA:215,3 +DA:216,3 +DA:217,3 +DA:218,3 +DA:219,3 +DA:221,3 +DA:239,25 +DA:264,25 +DA:281,1 +DA:303,1 +DA:308,1 +DA:313,1 +DA:318,1 +DA:319,1 +DA:321,1 +DA:338,6 +DA:340,6 +DA:362,107 +LF:33 +LH:33 +BRDA:119,1,0,1 +BRDA:119,1,1,6 +BRDA:195,2,0,2 +BRDA:195,2,1,3 +BRDA:210,3,0,1 +BRDA:210,3,1,2 +BRF:6 +BRH:6 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol +FN:37,setAddress +FN:43,getAddress +FN:58,_getNameHash +FNF:3 +FNH:3 +FNDA:379,setAddress +FNDA:2107,getAddress +FNDA:2486,_getNameHash +DA:39,379 +DA:40,379 +DA:50,2107 +DA:67,2486 +LF:4 +LH:4 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol +FN:26,constructor +FN:37,resolve +FNF:2 +FNH:2 +FNDA:1041,constructor +FNDA:2076,resolve +DA:29,1041 +DA:46,2076 +LF:2 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol +FN:31,constructor +FN:41,onlyOwner +FN:57,renounceOwnership +FN:66,transferOwnership +FNF:4 +FNH:2 +FNDA:120,constructor +FNDA:379,onlyOwner +FNDA:0,renounceOwnership +FNDA:0,transferOwnership +DA:32,120 +DA:33,120 +DA:42,379 +DA:46,379 +DA:59,0 +DA:60,0 +DA:68,0 +DA:73,0 +DA:74,0 +LF:9 +LH:4 +BRDA:42,1,0,379 +BRDA:42,1,1,0 +BRDA:68,2,0,0 +BRDA:68,2,1,0 +BRF:4 +BRH:1 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol +FN:37,constructor +FN:51, +FNF:2 +FNH:2 +FNDA:36,constructor +FNDA:31, +DA:42,36 +DA:43,36 +DA:54,31 +DA:55,31 +DA:60,31 +DA:62,31 +DA:63,22 +DA:67,9 +LF:8 +LH:8 +BRDA:55,1,0,31 +BRDA:55,1,1,0 +BRDA:62,2,0,22 +BRDA:62,2,1,9 +BRF:4 +BRH:3 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol +FN:46,toRLPItem +FN:71,readList +FN:135,readList +FN:154,readBytes +FN:182,readBytes +FN:201,readString +FN:218,readString +FN:237,readBytes32 +FN:281,readBytes32 +FN:300,readUint256 +FN:317,readUint256 +FN:336,readBool +FN:364,readBool +FN:383,readAddress +FN:409,readAddress +FN:428,readRawBytes +FN:452,_decodeLength +FN:557,_copy +FN:609,_copy +FNF:19 +FNH:18 +FNDA:512,toRLPItem +FNDA:450,readList +FNDA:450,readList +FNDA:651,readBytes +FNDA:4,readBytes +FNDA:5,readString +FNDA:5,readString +FNDA:68,readBytes32 +FNDA:0,readBytes32 +FNDA:56,readUint256 +FNDA:8,readUint256 +FNDA:2,readBool +FNDA:2,readBool +FNDA:7,readAddress +FNDA:1,readAddress +FNDA:776,readRawBytes +FNDA:5399,_decodeLength +FNDA:1427,_copy +FNDA:776,_copy +DA:55,512 +DA:56,512 +DA:60,512 +DA:80,450 +DA:86,446 +DA:95,446 +DA:97,446 +DA:98,446 +DA:99,446 +DA:100,4230 +DA:105,4230 +DA:113,4230 +DA:118,4230 +DA:119,4230 +DA:123,446 +DA:127,446 +DA:144,450 +DA:163,651 +DA:169,651 +DA:174,651 +DA:191,4 +DA:210,5 +DA:227,5 +DA:246,68 +DA:251,68 +DA:257,68 +DA:262,68 +DA:263,68 +DA:264,68 +DA:273,68 +DA:290,0 +DA:309,56 +DA:326,8 +DA:345,2 +DA:350,2 +DA:351,2 +DA:352,2 +DA:356,2 +DA:373,2 +DA:392,7 +DA:393,1 +DA:396,6 +DA:401,6 +DA:418,1 +DA:437,776 +DA:463,5399 +DA:468,5395 +DA:469,5395 +DA:470,5395 +DA:474,5395 +DA:477,33 +DA:481,4334 +DA:483,4334 +DA:488,4334 +DA:491,536 +DA:493,536 +DA:498,536 +DA:499,536 +DA:507,536 +DA:512,536 +DA:515,89 +DA:517,89 +DA:522,89 +DA:525,403 +DA:527,403 +DA:532,403 +DA:533,403 +DA:541,403 +DA:546,403 +DA:568,1427 +DA:569,1427 +DA:570,1 +DA:573,1426 +DA:574,1426 +DA:575,1426 +DA:580,1426 +DA:581,2634 +DA:585,2634 +DA:586,2634 +DA:590,1426 +DA:591,1426 +DA:601,1426 +DA:618,776 +LF:83 +LH:82 +BRDA:86,1,0,446 +BRDA:86,1,1,0 +BRDA:100,2,0,4230 +BRDA:100,2,1,0 +BRDA:169,3,0,651 +BRDA:169,3,1,0 +BRDA:246,4,0,68 +BRDA:246,4,1,0 +BRDA:257,5,0,68 +BRDA:257,5,1,0 +BRDA:345,6,0,2 +BRDA:345,6,1,0 +BRDA:392,7,0,1 +BRDA:392,7,1,6 +BRDA:396,8,0,6 +BRDA:396,8,1,0 +BRDA:463,9,0,5395 +BRDA:463,9,1,4 +BRDA:474,10,0,33 +BRDA:474,10,1,5362 +BRDA:478,11,0,4334 +BRDA:478,11,1,1028 +BRDA:483,12,0,4334 +BRDA:483,12,1,0 +BRDA:489,13,0,536 +BRDA:489,13,1,492 +BRDA:493,14,0,536 +BRDA:493,14,1,0 +BRDA:507,15,0,536 +BRDA:507,15,1,0 +BRDA:513,16,0,89 +BRDA:513,16,1,403 +BRDA:517,17,0,89 +BRDA:517,17,1,0 +BRDA:527,18,0,403 +BRDA:527,18,1,0 +BRDA:541,19,0,403 +BRDA:541,19,1,0 +BRDA:569,20,0,1 +BRDA:569,20,1,1426 +BRF:40 +BRH:27 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol +FN:23,writeBytes +FN:48,writeList +FN:66,writeString +FN:83,writeAddress +FN:100,writeUint +FN:117,writeBool +FN:142,_writeLength +FN:181,_toBinary +FN:214,_memcpy +FN:248,_flatten +FNF:10 +FNH:9 +FNDA:324,writeBytes +FNDA:157,writeList +FNDA:139,writeString +FNDA:30,writeAddress +FNDA:52,writeUint +FNDA:0,writeBool +FNDA:465,_writeLength +FNDA:52,_toBinary +FNDA:1030,_memcpy +FNDA:157,_flatten +DA:32,324 +DA:34,324 +DA:35,16 +DA:37,308 +DA:40,324 +DA:57,157 +DA:58,157 +DA:75,139 +DA:92,30 +DA:109,52 +DA:126,0 +DA:127,0 +DA:128,0 +DA:152,465 +DA:154,465 +DA:155,415 +DA:156,415 +DA:158,50 +DA:159,50 +DA:160,50 +DA:161,72 +DA:162,72 +DA:165,50 +DA:166,50 +DA:167,50 +DA:168,72 +DA:172,465 +DA:190,52 +DA:192,52 +DA:193,52 +DA:194,1643 +DA:195,24 +DA:199,52 +DA:200,52 +DA:201,45 +DA:204,52 +DA:222,1030 +DA:223,1030 +DA:224,1030 +DA:226,1030 +DA:227,420 +DA:230,420 +DA:231,420 +DA:234,1030 +DA:235,1030 +DA:257,157 +DA:258,8 +DA:261,149 +DA:262,149 +DA:263,149 +DA:264,1030 +DA:267,149 +DA:268,149 +DA:269,149 +DA:271,149 +DA:272,1030 +DA:274,1030 +DA:275,1030 +DA:277,1030 +DA:278,1030 +DA:281,149 +LF:61 +LH:58 +BRDA:34,1,0,16 +BRDA:34,1,1,308 +BRDA:154,2,0,415 +BRDA:154,2,1,50 +BRDA:194,3,0,24 +BRDA:194,3,1,1619 +BRDA:257,4,0,8 +BRDA:257,4,1,149 +BRF:8 +BRH:8 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol +FN:7,add +FN:11,sub +FN:15,mul +FNF:3 +FNH:2 +FNDA:6,add +FNDA:10,sub +FNDA:0,mul +DA:8,6 +DA:12,10 +DA:16,0 +LF:3 +LH:2 +BRDA:8,1,0,6 +BRDA:8,1,1,0 +BRDA:12,2,0,10 +BRDA:12,2,1,0 +BRDA:16,3,0,0 +BRDA:16,3,1,0 +BRF:6 +BRH:2 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol +FN:22,constructor +FN:44,_mint +FN:50,_burn +FN:56,_approve +FN:61,_transfer +FN:67,approve +FN:72,transfer +FN:77,transferFrom +FN:85,permit +FNF:9 +FNH:8 +FNDA:39,constructor +FNDA:1,_mint +FNDA:2,_burn +FNDA:2,_approve +FNDA:4,_transfer +FNDA:2,approve +FNDA:2,transfer +FNDA:2,transferFrom +FNDA:0,permit +DA:26,39 +DA:27,39 +DA:29,39 +DA:30,39 +DA:33,39 +DA:45,1 +DA:46,1 +DA:47,1 +DA:51,2 +DA:52,2 +DA:53,2 +DA:57,2 +DA:58,2 +DA:62,4 +DA:63,4 +DA:64,4 +DA:68,2 +DA:69,2 +DA:73,2 +DA:74,2 +DA:78,2 +DA:79,2 +DA:81,2 +DA:82,2 +DA:86,0 +DA:87,0 +DA:94,0 +DA:95,0 +DA:96,0 +LF:29 +LH:24 +BRDA:78,1,0,2 +BRDA:78,1,1,0 +BRDA:86,2,0,0 +BRDA:86,2,1,0 +BRDA:95,3,0,0 +BRDA:95,3,1,0 +BRF:6 +BRH:1 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol +FN:73,verifyInclusionProof +FN:105,verifyExclusionProof +FN:134,update +FN:166,get +FN:202,getSingleNodeRootHash +FN:232,_walkNodePath +FN:354,_getNewPath +FN:482,_getUpdatedTrieRoot +FN:546,_parseProof +FN:576,_getNodeID +FN:603,_getNodePath +FN:621,_getNodeKey +FN:638,_getNodeValue +FN:656,_getNodeHash +FN:677,_getNodeType +FN:709,_getSharedNibbleLength +FN:731,_makeNode +FN:753,_makeNode +FN:775,_makeExtensionNode +FN:801,_makeLeafNode +FN:822,_makeEmptyBranchNode +FN:842,_editBranchValue +FN:864,_editBranchIndex +FN:886,_addHexPrefix +FN:908,_removeHexPrefix +FN:934,_joinNodeArrays +FNF:26 +FNH:22 +FNDA:25,verifyInclusionProof +FNDA:0,verifyExclusionProof +FNDA:22,update +FNDA:77,get +FNDA:0,getSingleNodeRootHash +FNDA:95,_walkNodePath +FNDA:22,_getNewPath +FNDA:22,_getUpdatedTrieRoot +FNDA:99,_parseProof +FNDA:148,_getNodeID +FNDA:172,_getNodePath +FNDA:45,_getNodeKey +FNDA:51,_getNodeValue +FNDA:65,_getNodeHash +FNDA:87,_getNodeType +FNDA:82,_getSharedNibbleLength +FNDA:65,_makeNode +FNDA:42,_makeNode +FNDA:1,_makeExtensionNode +FNDA:22,_makeLeafNode +FNDA:0,_makeEmptyBranchNode +FNDA:0,_editBranchValue +FNDA:42,_editBranchIndex +FNDA:23,_addHexPrefix +FNDA:45,_removeHexPrefix +FNDA:22,_joinNodeArrays +DA:85,25 +DA:90,24 +DA:116,0 +DA:120,0 +DA:147,22 +DA:148,0 +DA:151,22 +DA:152,22 +DA:153,22 +DA:155,22 +DA:178,77 +DA:179,73 +DA:181,58 +DA:183,58 +DA:188,58 +DA:190,58 +DA:212,0 +DA:245,95 +DA:246,95 +DA:248,95 +DA:249,95 +DA:250,95 +DA:251,95 +DA:254,95 +DA:255,243 +DA:256,243 +DA:260,243 +DA:262,243 +DA:264,95 +DA:270,148 +DA:276,0 +DA:282,229 +DA:283,147 +DA:285,0 +DA:289,147 +DA:290,147 +DA:291,147 +DA:292,147 +DA:293,147 +DA:296,82 +DA:297,82 +DA:298,82 +DA:299,82 +DA:300,82 +DA:301,82 +DA:303,82 +DA:304,80 +DA:310,73 +DA:314,80 +DA:315,80 +DA:317,1 +DA:320,0 +DA:321,0 +DA:325,1 +DA:326,1 +DA:327,1 +DA:330,1 +DA:333,0 +DA:338,80 +DA:339,80 +DA:366,22 +DA:369,22 +DA:370,22 +DA:376,22 +DA:377,22 +DA:379,22 +DA:382,22 +DA:383,22 +DA:385,0 +DA:388,0 +DA:389,0 +DA:393,0 +DA:394,0 +DA:397,0 +DA:398,0 +DA:402,0 +DA:403,0 +DA:405,0 +DA:408,0 +DA:409,0 +DA:410,0 +DA:413,0 +DA:414,0 +DA:418,0 +DA:420,0 +DA:424,0 +DA:428,0 +DA:430,0 +DA:432,0 +DA:435,0 +DA:436,0 +DA:440,0 +DA:441,0 +DA:446,0 +DA:450,0 +DA:453,0 +DA:455,0 +DA:456,0 +DA:461,0 +DA:463,0 +DA:464,0 +DA:466,0 +DA:467,0 +DA:473,22 +DA:492,22 +DA:495,22 +DA:496,22 +DA:497,22 +DA:500,22 +DA:502,65 +DA:503,65 +DA:505,65 +DA:508,22 +DA:509,22 +DA:512,1 +DA:513,1 +DA:517,1 +DA:519,1 +DA:524,42 +DA:526,42 +DA:527,42 +DA:528,42 +DA:533,65 +DA:538,22 +DA:555,99 +DA:556,95 +DA:558,95 +DA:559,265 +DA:560,265 +DA:566,95 +DA:585,148 +DA:587,148 +DA:589,0 +DA:592,148 +DA:595,148 +DA:612,172 +DA:630,45 +DA:647,51 +DA:665,65 +DA:666,0 +DA:668,65 +DA:686,87 +DA:687,42 +DA:689,45 +DA:690,45 +DA:692,45 +DA:693,44 +DA:695,1 +DA:699,0 +DA:719,82 +DA:720,82 +DA:721,4991 +DA:723,82 +DA:740,65 +DA:742,65 +DA:762,42 +DA:763,42 +DA:764,714 +DA:766,42 +DA:785,1 +DA:786,1 +DA:787,1 +DA:788,1 +DA:789,1 +DA:811,22 +DA:812,22 +DA:813,22 +DA:814,22 +DA:815,22 +DA:829,0 +DA:830,0 +DA:831,0 +DA:833,0 +DA:852,0 +DA:853,0 +DA:854,0 +DA:875,42 +DA:876,42 +DA:877,42 +DA:896,23 +DA:897,23 +DA:898,23 +DA:899,23 +DA:900,23 +DA:917,45 +DA:918,26 +DA:920,19 +DA:946,22 +DA:949,22 +DA:950,43 +DA:954,22 +DA:955,22 +DA:958,22 +LF:193 +LH:139 +BRDA:147,1,0,0 +BRDA:147,1,1,22 +BRDA:183,2,0,58 +BRDA:183,2,1,0 +BRDA:262,3,0,95 +BRDA:262,3,1,148 +BRDA:264,4,0,88 +BRDA:264,4,1,7 +BRDA:268,5,0,148 +BRDA:268,5,1,0 +BRDA:270,6,0,141 +BRDA:270,6,1,7 +BRDA:276,7,0,0 +BRDA:276,7,1,0 +BRDA:282,8,0,147 +BRDA:282,8,1,82 +BRDA:283,9,0,0 +BRDA:283,9,1,147 +BRDA:295,10,0,82 +BRDA:295,10,1,0 +BRDA:303,11,0,80 +BRDA:303,11,1,2 +BRDA:304,12,0,73 +BRDA:304,12,1,7 +BRDA:316,13,0,1 +BRDA:316,13,1,1 +BRDA:317,14,0,0 +BRDA:317,14,1,1 +BRDA:379,15,0,22 +BRDA:379,15,1,0 +BRDA:384,16,0,0 +BRDA:384,16,1,0 +BRDA:385,17,0,0 +BRDA:385,17,1,0 +BRDA:405,18,0,0 +BRDA:405,18,1,0 +BRDA:420,19,0,0 +BRDA:420,19,1,0 +BRDA:432,20,0,0 +BRDA:432,20,1,0 +BRDA:437,21,0,0 +BRDA:437,21,1,0 +BRDA:450,22,0,0 +BRDA:450,22,1,0 +BRDA:505,23,0,22 +BRDA:505,23,1,43 +BRDA:510,24,0,1 +BRDA:510,24,1,42 +BRDA:517,25,0,1 +BRDA:517,25,1,0 +BRDA:521,26,0,42 +BRDA:521,26,1,0 +BRDA:524,27,0,42 +BRDA:524,27,1,0 +BRDA:587,28,0,0 +BRDA:587,28,1,148 +BRDA:665,29,0,0 +BRDA:665,29,1,65 +BRDA:686,30,0,42 +BRDA:686,30,1,45 +BRDA:688,31,0,45 +BRDA:688,31,1,0 +BRDA:692,32,0,44 +BRDA:692,32,1,1 +BRDA:694,33,0,1 +BRDA:694,33,1,0 +BRDA:917,34,0,26 +BRDA:917,34,1,19 +BRF:68 +BRH:38 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol +FN:29,verifyInclusionProof +FN:55,verifyExclusionProof +FN:81,update +FN:105,get +FN:127,getSingleNodeRootHash +FN:151,_getSecureKey +FNF:6 +FNH:4 +FNDA:15,verifyInclusionProof +FNDA:0,verifyExclusionProof +FNDA:12,update +FNDA:20,get +FNDA:0,getSingleNodeRootHash +FNDA:47,_getSecureKey +DA:41,15 +DA:42,15 +DA:66,0 +DA:67,0 +DA:93,12 +DA:94,12 +DA:117,20 +DA:118,20 +DA:137,0 +DA:138,0 +DA:160,47 +LF:11 +LH:7 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol +FN:18,toBool +FN:35,fromBool +FN:52,toAddress +FN:69,fromAddress +FN:86,removeLeadingZeros +FNF:5 +FNH:5 +FNDA:40,toBool +FNDA:2,fromBool +FNDA:31,toAddress +FNDA:19,fromAddress +FNDA:3,removeLeadingZeros +DA:27,40 +DA:44,2 +DA:61,31 +DA:78,19 +DA:95,3 +DA:97,3 +DA:115,3 +LF:7 +LH:7 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol +FN:13,slice +FN:84,slice +FN:99,toBytes32PadLeft +FN:114,toBytes32 +FN:132,toUint256 +FN:142,toUint24 +FN:154,toUint8 +FN:166,toAddress +FN:178,toNibbles +FN:195,fromNibbles +FN:211,equal +FNF:11 +FNH:11 +FNDA:311,slice +FNDA:299,slice +FNDA:1,toBytes32PadLeft +FNDA:164,toBytes32 +FNDA:3,toUint256 +FNDA:15,toUint24 +FNDA:12,toUint8 +FNDA:5,toAddress +FNDA:292,toNibbles +FNDA:26,fromNibbles +FNDA:26,equal +DA:22,311 +DA:23,311 +DA:24,311 +DA:26,308 +DA:28,308 +DA:81,308 +DA:92,299 +DA:93,73 +DA:96,226 +DA:106,1 +DA:107,1 +DA:108,1 +DA:111,1 +DA:121,164 +DA:122,2 +DA:123,2 +DA:126,2 +DA:129,162 +DA:139,3 +DA:143,15 +DA:144,15 +DA:145,15 +DA:147,15 +DA:151,15 +DA:155,12 +DA:156,12 +DA:157,12 +DA:159,12 +DA:163,12 +DA:167,5 +DA:168,5 +DA:169,5 +DA:171,5 +DA:175,5 +DA:185,292 +DA:187,292 +DA:188,9144 +DA:189,9144 +DA:192,292 +DA:202,26 +DA:204,26 +DA:205,708 +DA:208,26 +DA:219,26 +LF:44 +LH:44 +BRDA:22,1,0,311 +BRDA:22,1,1,0 +BRDA:23,2,0,311 +BRDA:23,2,1,0 +BRDA:24,3,0,308 +BRDA:24,3,1,3 +BRDA:92,4,0,73 +BRDA:92,4,1,226 +BRDA:121,5,0,2 +BRDA:121,5,1,162 +BRDA:143,6,0,15 +BRDA:143,6,1,0 +BRDA:144,7,0,15 +BRDA:144,7,1,0 +BRDA:155,8,0,12 +BRDA:155,8,1,0 +BRDA:156,9,0,12 +BRDA:156,9,1,0 +BRDA:167,10,0,5 +BRDA:167,10,1,0 +BRDA:168,11,0,5 +BRDA:168,11,1,0 +BRF:22 +BRH:14 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol +FN:22,recover +FN:45,getMessageHash +FN:68,getNativeMessageHash +FN:85,getEthSignedMessageHash +FNF:4 +FNH:4 +FNDA:22,recover +FNDA:24,getMessageHash +FNDA:15,getNativeMessageHash +FNDA:9,getEthSignedMessageHash +DA:35,22 +DA:37,22 +DA:52,24 +DA:53,9 +DA:55,15 +DA:77,15 +DA:94,9 +DA:95,9 +DA:96,9 +LF:9 +LH:9 +BRDA:52,1,0,9 +BRDA:52,1,1,15 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol +FN:21,encodeRevertString +FNF:1 +FNH:1 +FNDA:10,encodeRevertString +DA:30,10 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol +FN:26,getCode +FN:52,getCode +FN:73,getCodeSize +FN:94,getCodeHash +FN:120,createContract +FN:145,getAddressForCREATE +FN:170,getAddressForCREATE2 +FNF:7 +FNH:6 +FNDA:34,getCode +FNDA:18,getCode +FNDA:212,getCodeSize +FNDA:19,getCodeHash +FNDA:27,createContract +FNDA:27,getAddressForCREATE +FNDA:0,getAddressForCREATE2 +DA:37,34 +DA:44,34 +DA:61,18 +DA:82,212 +DA:86,212 +DA:103,19 +DA:107,19 +DA:128,27 +DA:136,27 +DA:155,27 +DA:156,27 +DA:157,27 +DA:159,27 +DA:160,27 +DA:179,0 +DA:186,0 +LF:16 +LH:14 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol +FN:19,min +FNF:1 +FNH:0 +FNDA:0,min +DA:29,0 +DA:30,0 +DA:33,0 +LF:3 +LH:0 +BRDA:29,1,0,0 +BRDA:29,1,1,0 +BRF:2 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol +FN:23,getMerkleRoot +FN:121,verify +FN:184,_ceilLog2 +FNF:3 +FNH:3 +FNDA:118,getMerkleRoot +FNDA:102,verify +FNDA:100,_ceilLog2 +DA:32,118 +DA:37,117 +DA:38,0 +DA:41,117 +DA:61,117 +DA:64,117 +DA:65,117 +DA:68,117 +DA:71,117 +DA:74,117 +DA:75,117 +DA:77,117 +DA:78,273 +DA:79,273 +DA:81,273 +DA:82,4620 +DA:83,4620 +DA:84,4620 +DA:89,4620 +DA:92,273 +DA:93,27 +DA:94,27 +DA:95,27 +DA:100,27 +DA:103,273 +DA:104,273 +DA:107,117 +DA:134,102 +DA:139,101 +DA:144,100 +DA:149,99 +DA:151,99 +DA:152,653 +DA:153,146 +DA:160,507 +DA:168,653 +DA:171,99 +DA:193,100 +DA:198,100 +DA:199,3 +DA:204,97 +DA:205,97 +DA:206,97 +DA:207,776 +DA:208,206 +DA:209,206 +DA:214,97 +DA:215,70 +DA:218,97 +LF:49 +LH:48 +BRDA:32,1,0,117 +BRDA:32,1,1,1 +BRDA:37,2,0,0 +BRDA:37,2,1,117 +BRDA:92,3,0,27 +BRDA:92,3,1,246 +BRDA:134,4,0,101 +BRDA:134,4,1,1 +BRDA:139,5,0,100 +BRDA:139,5,1,1 +BRDA:144,6,0,99 +BRDA:144,6,1,1 +BRDA:152,7,0,146 +BRDA:152,7,1,507 +BRDA:193,8,0,100 +BRDA:193,8,1,0 +BRDA:198,9,0,3 +BRDA:198,9,1,97 +BRDA:207,10,0,206 +BRDA:207,10,1,570 +BRDA:214,11,0,70 +BRDA:214,11,1,27 +BRF:22 +BRH:20 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol +FN:37,constructor +FN:48,nonReentrant +FNF:2 +FNH:2 +FNDA:54,constructor +FNDA:14,nonReentrant +DA:38,54 +DA:50,14 +DA:53,14 +DA:55,14 +DA:59,6 +LF:5 +LH:5 +BRDA:50,1,0,14 +BRDA:50,1,1,0 +BRF:2 +BRH:1 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol +FN:53,push +FN:100,push +FN:120,get +FN:179,deleteElementsAfterInclusive +FN:212,deleteElementsAfterInclusive +FN:230,getLength +FN:248,setExtraData +FN:264,getExtraData +FN:282,setContext +FN:321,getContext +FN:364,getBuffer +FNF:11 +FNH:9 +FNDA:572,push +FNDA:470,push +FNDA:538,get +FNDA:1,deleteElementsAfterInclusive +FNDA:0,deleteElementsAfterInclusive +FNDA:441,getLength +FNDA:0,setExtraData +FNDA:550,getExtraData +FNDA:573,setContext +FNDA:2572,getContext +FNDA:1642,getBuffer +DA:60,572 +DA:61,572 +DA:64,572 +DA:65,134 +DA:69,572 +DA:70,11 +DA:73,0 +DA:74,0 +DA:75,0 +DA:78,0 +DA:81,11 +DA:86,572 +DA:87,572 +DA:90,572 +DA:91,572 +DA:92,572 +DA:106,470 +DA:108,470 +DA:130,538 +DA:132,538 +DA:137,535 +DA:138,535 +DA:140,535 +DA:143,535 +DA:146,535 +DA:151,535 +DA:155,0 +DA:158,0 +DA:164,0 +DA:169,0 +DA:186,1 +DA:188,1 +DA:193,1 +DA:197,0 +DA:198,0 +DA:202,1 +DA:203,1 +DA:204,1 +DA:218,0 +DA:219,0 +DA:239,441 +DA:240,441 +DA:254,0 +DA:255,0 +DA:256,0 +DA:273,550 +DA:274,550 +DA:288,573 +DA:289,573 +DA:291,573 +DA:292,573 +DA:293,573 +DA:298,573 +DA:299,573 +DA:300,573 +DA:301,573 +DA:307,573 +DA:308,573 +DA:311,573 +DA:312,0 +DA:330,2572 +DA:331,2572 +DA:333,2572 +DA:334,2572 +DA:335,2572 +DA:340,2572 +DA:341,2572 +DA:342,2572 +DA:343,2572 +DA:349,2572 +DA:374,1642 +LF:71 +LH:55 +BRDA:64,1,0,134 +BRDA:64,1,1,438 +BRDA:69,2,0,11 +BRDA:69,2,1,561 +BRDA:70,3,0,0 +BRDA:70,3,1,11 +BRDA:132,4,0,535 +BRDA:132,4,1,3 +BRDA:140,5,0,535 +BRDA:140,5,1,0 +BRDA:146,6,0,535 +BRDA:146,6,1,0 +BRDA:158,7,0,0 +BRDA:158,7,1,0 +BRDA:164,8,0,0 +BRDA:164,8,1,0 +BRDA:188,9,0,1 +BRDA:188,9,1,0 +BRDA:193,10,0,0 +BRDA:193,10,1,1 +BRDA:307,11,0,573 +BRDA:307,11,1,0 +BRDA:311,12,0,0 +BRDA:311,12,1,573 +BRF:24 +BRH:13 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol +FN:30,safeCALL +FN:61,safeDELEGATECALL +FN:90,safeCREATE +FN:116,safeEXTCODESIZE +FN:138,safeCHAINID +FN:157,safeCALLER +FN:176,safeADDRESS +FN:195,safeGETNONCE +FN:214,safeSETNONCE +FN:234,safeCREATEEOA +FN:257,safeREVERT +FN:277,safeREQUIRE +FN:293,safeSLOAD +FN:314,safeSSTORE +FN:339,_safeExecutionManagerInteraction +FN:367,_safeExecutionManagerInteraction +FNF:16 +FNH:16 +FNDA:18,safeCALL +FNDA:2,safeDELEGATECALL +FNDA:1,safeCREATE +FNDA:5,safeEXTCODESIZE +FNDA:12,safeCHAINID +FNDA:11,safeCALLER +FNDA:9,safeADDRESS +FNDA:7,safeGETNONCE +FNDA:6,safeSETNONCE +FNDA:2,safeCREATEEOA +FNDA:9,safeREVERT +FNDA:41,safeREQUIRE +FNDA:43,safeSLOAD +FNDA:21,safeSSTORE +FNDA:146,_safeExecutionManagerInteraction +FNDA:145,_safeExecutionManagerInteraction +DA:41,18 +DA:50,18 +DA:72,2 +DA:81,2 +DA:100,1 +DA:108,1 +DA:124,5 +DA:131,5 +DA:144,12 +DA:150,12 +DA:163,11 +DA:169,11 +DA:182,9 +DA:188,9 +DA:201,7 +DA:207,7 +DA:219,6 +DA:242,2 +DA:262,9 +DA:283,41 +DA:284,7 +DA:301,43 +DA:308,43 +DA:320,21 +DA:348,146 +DA:349,146 +DA:354,146 +DA:355,2 +DA:359,0 +DA:363,144 +DA:375,145 +LF:31 +LH:30 +BRDA:283,1,0,7 +BRDA:283,1,1,34 +BRDA:354,2,0,2 +BRDA:354,2,1,144 +BRDA:358,3,0,0 +BRDA:358,3,1,144 +BRF:6 +BRH:5 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol +FN:38,add +FN:55,sub +FN:69,sub +FN:86,mul +FN:112,div +FN:128,div +FN:148,mod +FN:164,mod +FNF:8 +FNH:1 +FNDA:0,add +FNDA:0,sub +FNDA:0,sub +FNDA:7,mul +FNDA:0,div +FNDA:0,div +FNDA:0,mod +FNDA:0,mod +DA:39,0 +DA:40,0 +DA:42,0 +DA:56,0 +DA:70,0 +DA:71,0 +DA:73,0 +DA:90,7 +DA:91,0 +DA:94,7 +DA:95,7 +DA:97,7 +DA:113,0 +DA:129,0 +DA:130,0 +DA:133,0 +DA:149,0 +DA:165,0 +DA:166,0 +LF:19 +LH:4 +BRDA:90,1,0,0 +BRDA:90,1,1,7 +BRF:2 +BRH:1 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol +FN:49,execute +FNF:1 +FNH:1 +FNDA:7,execute +DA:63,7 +DA:69,7 +DA:80,7 +DA:83,7 +DA:89,7 +DA:102,7 +DA:103,7 +DA:104,7 +DA:109,7 +DA:115,7 +DA:116,1 +DA:122,1 +DA:123,1 +DA:125,0 +DA:131,6 +DA:133,6 +LF:16 +LH:15 +BRDA:115,1,0,1 +BRDA:115,1,1,6 +BRDA:122,2,0,1 +BRDA:122,2,1,0 +BRF:4 +BRH:3 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol +FN:35,constructor +FN:47, +FN:76,upgrade +FN:93,getImplementation +FN:111,_setImplementation +FNF:5 +FNH:5 +FNDA:13,constructor +FNDA:1, +FNDA:2,upgrade +FNDA:2,getImplementation +FNDA:15,_setImplementation +DA:39,13 +DA:50,1 +DA:56,1 +DA:57,1 +DA:61,0 +DA:81,2 +DA:86,2 +DA:99,2 +DA:116,15 +LF:9 +LH:8 +BRDA:56,1,0,1 +BRDA:56,1,1,0 +BRF:2 +BRH:1 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol +FN:44,constructor +FN:46,xDomainMessageSender +FN:57,sendMessage +FN:91,_getXDomainCalldata +FN:117,_sendXDomainMessage +FNF:5 +FNH:4 +FNDA:54,constructor +FNDA:4,xDomainMessageSender +FNDA:7,sendMessage +FNDA:21,_getXDomainCalldata +FNDA:0,_sendXDomainMessage +DA:47,4 +DA:48,0 +DA:65,7 +DA:72,7 +DA:73,7 +DA:75,7 +DA:76,7 +DA:103,21 +DA:124,0 +LF:9 +LH:7 +BRDA:47,1,0,0 +BRDA:47,1,1,4 +BRF:2 +BRH:1 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol +FN:39,constructor +FN:45,initialize +FN:63,onlyRelayer +FN:93,relayMessage +FN:144,replayMessage +FN:180,_verifyXDomainMessage +FN:201,_verifyStateRootProof +FN:228,_verifyStorageProof +FN:281,_sendXDomainMessage +FNF:9 +FNH:9 +FNDA:36,constructor +FNDA:12,initialize +FNDA:9,onlyRelayer +FNDA:8,relayMessage +FNDA:2,replayMessage +FNDA:8,_verifyXDomainMessage +FNDA:8,_verifyStateRootProof +FNDA:6,_verifyStorageProof +FNDA:5,_sendXDomainMessage +DA:50,12 +DA:51,12 +DA:52,12 +DA:64,9 +DA:65,9 +DA:66,1 +DA:71,8 +DA:95,8 +DA:102,8 +DA:110,4 +DA:112,4 +DA:117,3 +DA:118,3 +DA:119,3 +DA:123,3 +DA:124,3 +DA:125,3 +DA:130,3 +DA:137,3 +DA:154,2 +DA:161,2 +DA:166,1 +DA:190,8 +DA:210,8 +DA:212,8 +DA:238,6 +DA:250,6 +DA:259,5 +DA:264,5 +DA:268,5 +DA:288,5 +LF:31 +LH:31 +BRDA:50,1,0,12 +BRDA:50,1,1,0 +BRDA:65,2,0,1 +BRDA:65,2,1,8 +BRDA:66,3,0,0 +BRDA:66,3,1,1 +BRDA:102,4,0,4 +BRDA:102,4,1,4 +BRDA:112,5,0,3 +BRDA:112,5,1,1 +BRDA:123,6,0,3 +BRDA:123,6,1,0 +BRDA:161,7,0,1 +BRDA:161,7,1,1 +BRDA:259,8,0,5 +BRDA:259,8,1,0 +BRF:16 +BRH:12 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol +FN:30,constructor +FN:37,onlyBatchRelayer +FN:56,batchRelayMessages +FNF:3 +FNH:3 +FNDA:6,constructor +FNDA:2,onlyBatchRelayer +FNDA:1,batchRelayMessages +DA:38,2 +DA:42,1 +DA:58,1 +DA:59,1 +DA:60,3 +DA:61,3 +LF:6 +LH:6 +BRDA:38,1,0,1 +BRDA:38,1,1,1 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol +FN:37,constructor +FN:56,relayMessage +FN:110,_verifyXDomainMessage +FN:127,_sendXDomainMessage +FNF:4 +FNH:4 +FNDA:18,constructor +FNDA:5,relayMessage +FNDA:5,_verifyXDomainMessage +FNDA:3,_sendXDomainMessage +DA:59,5 +DA:64,4 +DA:71,4 +DA:73,4 +DA:78,3 +DA:79,3 +DA:80,3 +DA:84,3 +DA:85,3 +DA:86,3 +DA:91,3 +DA:98,3 +DA:117,5 +DA:134,3 +LF:14 +LH:14 +BRDA:59,1,0,4 +BRDA:59,1,1,1 +BRDA:73,2,0,3 +BRDA:73,2,1,1 +BRDA:84,3,0,3 +BRDA:84,3,1,0 +BRF:6 +BRH:5 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol +FN:46,constructor +FN:65,_handleFinalizeWithdrawal +FN:83,_handleInitiateDeposit +FN:100,getFinalizeDepositL2Gas +FN:118,deposit +FN:132,depositTo +FN:150,_initiateDeposit +FN:199,finalizeWithdrawal +FNF:8 +FNH:6 +FNDA:24,constructor +FNDA:0,_handleFinalizeWithdrawal +FNDA:0,_handleInitiateDeposit +FNDA:2,getFinalizeDepositL2Gas +FNDA:1,deposit +FNDA:1,depositTo +FNDA:2,_initiateDeposit +FNDA:1,finalizeWithdrawal +DA:48,24 +DA:72,0 +DA:91,0 +DA:107,2 +DA:124,1 +DA:139,1 +DA:158,2 +DA:165,2 +DA:172,2 +DA:178,2 +DA:202,1 +DA:207,1 +LF:12 +LH:10 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol +FN:48,constructor +FN:59,init +FN:75,onlyInitialized +FN:95,_handleInitiateWithdrawal +FN:112,_handleFinalizeDeposit +FN:128,getFinalizeWithdrawalL1Gas +FN:153,withdraw +FN:169,withdrawTo +FN:180,_initiateWithdrawal +FN:225,finalizeDeposit +FNF:10 +FNH:8 +FNDA:30,constructor +FNDA:8,init +FNDA:5,onlyInitialized +FNDA:0,_handleInitiateWithdrawal +FNDA:0,_handleFinalizeDeposit +FNDA:9,getFinalizeWithdrawalL1Gas +FNDA:1,withdraw +FNDA:1,withdrawTo +FNDA:2,_initiateWithdrawal +FNDA:1,finalizeDeposit +DA:64,8 +DA:66,8 +DA:68,8 +DA:76,5 +DA:77,5 +DA:102,0 +DA:119,0 +DA:136,9 +DA:155,1 +DA:171,1 +DA:187,2 +DA:190,2 +DA:197,2 +DA:203,2 +DA:227,1 +DA:228,1 +LF:16 +LH:14 +BRDA:64,1,0,8 +BRDA:64,1,1,0 +BRDA:76,2,0,5 +BRDA:76,2,1,0 +BRF:4 +BRH:2 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol +FN:49,constructor +FN:67,_handleInitiateDeposit +FN:90,_handleFinalizeWithdrawal +FNF:3 +FNH:3 +FNDA:24,constructor +FNDA:2,_handleInitiateDeposit +FNDA:1,_handleFinalizeWithdrawal +DA:51,24 +DA:76,2 +DA:98,1 +LF:3 +LH:3 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol +FN:48,constructor +FN:68,deposit +FN:80,depositTo +FN:96,_initiateDeposit +FN:138,finalizeWithdrawal +FN:155,_safeTransferETH +FNF:6 +FNH:6 +FNDA:24,constructor +FNDA:2,deposit +FNDA:1,depositTo +FNDA:3,_initiateDeposit +FNDA:1,finalizeWithdrawal +FNDA:1,_safeTransferETH +DA:50,24 +DA:51,24 +DA:62,0 +DA:73,2 +DA:87,1 +DA:103,3 +DA:111,3 +DA:117,3 +DA:140,1 +DA:142,1 +DA:161,1 +DA:162,1 +LF:12 +LH:11 +BRDA:162,1,0,1 +BRDA:162,1,1,0 +BRF:2 +BRH:1 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol +FN:43,constructor +FN:47,_handleInitiateWithdrawal +FN:58,_handleFinalizeDeposit +FNF:3 +FNH:3 +FNDA:30,constructor +FNDA:2,_handleInitiateWithdrawal +FNDA:1,_handleFinalizeDeposit +DA:54,2 +DA:65,1 +LF:2 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol +FN:71,constructor +FN:87,batches +FN:104,queue +FN:121,getTotalElements +FN:137,getTotalBatches +FN:152,getNextQueueIndex +FN:168,getLastTimestamp +FN:184,getLastBlockNumber +FN:201,getQueueElement +FN:221,getNumPendingQueueElements +FN:237,getQueueLength +FN:256,enqueue +FN:337,appendQueueBatch +FN:393,appendSequencerBatch +FN:574,verifyTransaction +FN:614,_getBatchContext +FN:649,_getBatchExtraData +FN:689,_makeBatchExtraData +FN:718,_getQueueLeafHash +FN:743,_getQueueElement +FN:778,_getQueueLength +FN:800,_getSequencerLeafHash +FN:846,_getSequencerLeafHash +FN:891,_appendBatch +FN:934,_validateFirstBatchContext +FN:974,_validateContextBeforeEnqueue +FN:1013,_validateNextBatchContext +FN:1050,_validateFinalBatchContext +FN:1077,_hashTransactionChainElement +FN:1105,_verifySequencerTransaction +FN:1152,_verifyQueueTransaction +FN:1201,_verifyElement +FNF:32 +FNH:27 +FNDA:222,constructor +FNDA:559,batches +FNDA:382,queue +FNDA:291,getTotalElements +FNDA:0,getTotalBatches +FNDA:100,getNextQueueIndex +FNDA:0,getLastTimestamp +FNDA:0,getLastBlockNumber +FNDA:47,getQueueElement +FNDA:0,getNumPendingQueueElements +FNDA:0,getQueueLength +FNDA:239,enqueue +FNDA:1,appendQueueBatch +FNDA:104,appendSequencerBatch +FNDA:2,verifyTransaction +FNDA:232,_getBatchContext +FNDA:476,_getBatchExtraData +FNDA:81,_makeBatchExtraData +FNDA:179,_getQueueLeafHash +FNDA:267,_getQueueElement +FNDA:100,_getQueueLength +FNDA:439,_getSequencerLeafHash +FNDA:1,_getSequencerLeafHash +FNDA:81,_appendBatch +FNDA:100,_validateFirstBatchContext +FNDA:178,_validateContextBeforeEnqueue +FNDA:226,_validateNextBatchContext +FNDA:88,_validateFinalBatchContext +FNDA:179,_hashTransactionChainElement +FNDA:1,_verifySequencerTransaction +FNDA:1,_verifyQueueTransaction +FNDA:2,_verifyElement +DA:73,222 +DA:74,222 +DA:75,222 +DA:95,559 +DA:112,382 +DA:129,291 +DA:130,291 +DA:145,0 +DA:160,100 +DA:161,100 +DA:176,0 +DA:177,0 +DA:192,0 +DA:193,0 +DA:211,47 +DA:229,0 +DA:245,0 +DA:264,239 +DA:269,238 +DA:274,237 +DA:282,236 +DA:283,236 +DA:287,236 +DA:294,235 +DA:295,235 +DA:296,37600 +DA:299,235 +DA:308,235 +DA:309,235 +DA:314,235 +DA:316,235 +DA:317,235 +DA:322,235 +DA:323,235 +DA:345,1 +DA:397,104 +DA:398,104 +DA:399,104 +DA:400,104 +DA:406,104 +DA:411,103 +DA:416,102 +DA:421,101 +DA:426,100 +DA:428,100 +DA:436,100 +DA:437,100 +DA:442,100 +DA:445,100 +DA:448,100 +DA:451,100 +DA:455,100 +DA:457,100 +DA:458,100 +DA:459,232 +DA:461,232 +DA:463,100 +DA:467,226 +DA:475,221 +DA:478,221 +DA:479,439 +DA:480,439 +DA:484,439 +DA:491,439 +DA:492,439 +DA:493,439 +DA:497,221 +DA:498,179 +DA:503,178 +DA:504,178 +DA:505,178 +DA:509,88 +DA:516,82 +DA:521,81 +DA:527,81 +DA:528,81 +DA:529,81 +DA:530,81 +DA:532,39 +DA:533,39 +DA:539,42 +DA:544,42 +DA:545,42 +DA:551,81 +DA:559,81 +DA:587,2 +DA:588,1 +DA:595,1 +DA:623,232 +DA:624,232 +DA:625,232 +DA:626,232 +DA:627,232 +DA:629,232 +DA:636,232 +DA:659,476 +DA:661,476 +DA:662,476 +DA:663,476 +DA:664,476 +DA:665,476 +DA:673,476 +DA:701,81 +DA:702,81 +DA:710,81 +DA:727,179 +DA:756,267 +DA:757,267 +DA:758,265 +DA:760,265 +DA:761,265 +DA:762,265 +DA:767,265 +DA:790,100 +DA:813,439 +DA:814,419 +DA:817,439 +DA:818,439 +DA:820,439 +DA:821,439 +DA:838,439 +DA:855,1 +DA:856,1 +DA:858,1 +DA:859,1 +DA:860,1 +DA:862,1 +DA:863,1 +DA:880,1 +DA:900,81 +DA:901,81 +DA:903,81 +DA:911,81 +DA:919,81 +DA:920,81 +DA:927,81 +DA:942,100 +DA:943,4 +DA:945,4 +DA:950,2 +DA:957,96 +DA:962,95 +DA:982,178 +DA:988,177 +DA:995,176 +DA:1000,174 +DA:1023,226 +DA:1028,225 +DA:1034,224 +DA:1035,175 +DA:1060,88 +DA:1061,3 +DA:1068,85 +DA:1069,83 +DA:1086,179 +DA:1117,1 +DA:1118,1 +DA:1119,1 +DA:1121,1 +DA:1130,1 +DA:1141,1 +DA:1164,1 +DA:1166,1 +DA:1175,1 +DA:1184,1 +DA:1185,1 +DA:1192,1 +DA:1212,2 +DA:1217,2 +DA:1228,2 +LF:170 +LH:163 +BRDA:264,1,0,238 +BRDA:264,1,1,1 +BRDA:269,2,0,237 +BRDA:269,2,1,1 +BRDA:274,3,0,236 +BRDA:274,3,1,1 +BRDA:287,4,0,235 +BRDA:287,4,1,1 +BRDA:406,5,0,103 +BRDA:406,5,1,1 +BRDA:411,6,0,102 +BRDA:411,6,1,1 +BRDA:416,7,0,101 +BRDA:416,7,1,1 +BRDA:421,8,0,100 +BRDA:421,8,1,1 +BRDA:428,9,0,100 +BRDA:428,9,1,0 +BRDA:461,10,0,100 +BRDA:461,10,1,132 +BRDA:498,11,0,178 +BRDA:498,11,1,1 +BRDA:516,12,0,81 +BRDA:516,12,1,1 +BRDA:521,13,0,81 +BRDA:521,13,1,0 +BRDA:530,14,0,39 +BRDA:530,14,1,42 +BRDA:587,15,0,1 +BRDA:587,15,1,1 +BRDA:813,16,0,419 +BRDA:813,16,1,20 +BRDA:942,17,0,4 +BRDA:942,17,1,96 +BRDA:945,18,0,2 +BRDA:945,18,1,2 +BRDA:950,19,0,0 +BRDA:950,19,1,2 +BRDA:957,20,0,95 +BRDA:957,20,1,1 +BRDA:962,21,0,94 +BRDA:962,21,1,1 +BRDA:988,22,0,176 +BRDA:988,22,1,1 +BRDA:995,23,0,174 +BRDA:995,23,1,2 +BRDA:1000,24,0,172 +BRDA:1000,24,1,2 +BRDA:1023,25,0,225 +BRDA:1023,25,1,1 +BRDA:1028,26,0,224 +BRDA:1028,26,1,1 +BRDA:1034,27,0,175 +BRDA:1034,27,1,49 +BRDA:1060,28,0,3 +BRDA:1060,28,1,85 +BRDA:1068,29,0,83 +BRDA:1068,29,1,2 +BRDA:1069,30,0,82 +BRDA:1069,30,1,1 +BRDA:1121,31,0,1 +BRDA:1121,31,1,0 +BRDA:1130,32,0,1 +BRDA:1130,32,1,0 +BRDA:1166,33,0,1 +BRDA:1166,33,1,0 +BRDA:1185,34,0,1 +BRDA:1185,34,1,0 +BRDA:1212,35,0,2 +BRDA:1212,35,1,0 +BRDA:1217,36,0,2 +BRDA:1217,36,1,0 +BRF:72 +BRH:63 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol +FN:54,constructor +FN:64,onlyOwner +FN:85,setGlobalMetadata +FN:93,getGlobalMetadata +FN:107,length +FN:126,push +FN:140,push +FN:148,get +FN:169,deleteElementsAfterInclusive +FN:185,deleteElementsAfterInclusive +FN:201,setNextOverwritableIndex +FNF:11 +FNH:8 +FNDA:504,constructor +FNDA:573,onlyOwner +FNDA:0,setGlobalMetadata +FNDA:550,getGlobalMetadata +FNDA:441,length +FNDA:470,push +FNDA:102,push +FNDA:538,get +FNDA:0,deleteElementsAfterInclusive +FNDA:1,deleteElementsAfterInclusive +FNDA:0,setNextOverwritableIndex +DA:56,504 +DA:65,573 +DA:69,573 +DA:87,0 +DA:101,550 +DA:115,441 +DA:128,470 +DA:142,102 +DA:158,538 +DA:171,0 +DA:187,1 +DA:203,0 +LF:12 +LH:9 +BRDA:65,1,0,573 +BRDA:65,1,1,0 +BRF:2 +BRH:1 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol +FN:52,constructor +FN:67,batches +FN:82,getTotalElements +FN:97,getTotalBatches +FN:111,getLastSequencerTimestamp +FN:126,appendStateBatch +FN:167,deleteStateBatch +FN:194,verifyStateCommitment +FN:228,insideFraudProofWindow +FN:260,_getBatchExtraData +FN:290,_makeBatchExtraData +FN:315,_appendBatch +FN:369,_deleteBatch +FN:403,_isValidBatchHeader +FNF:14 +FNH:12 +FNDA:60,constructor +FNDA:125,batches +FNDA:52,getTotalElements +FNDA:24,getTotalBatches +FNDA:0,getLastSequencerTimestamp +FNDA:25,appendStateBatch +FNDA:4,deleteStateBatch +FNDA:0,verifyStateCommitment +FNDA:1,insideFraudProofWindow +FNDA:74,_getBatchExtraData +FNDA:22,_makeBatchExtraData +FNDA:22,_appendBatch +FNDA:1,_deleteBatch +FNDA:4,_isValidBatchHeader +DA:54,60 +DA:55,60 +DA:74,125 +DA:90,52 +DA:91,52 +DA:105,24 +DA:119,0 +DA:120,0 +DA:135,25 +DA:141,24 +DA:146,24 +DA:151,23 +DA:158,22 +DA:173,4 +DA:178,3 +DA:183,1 +DA:188,1 +DA:206,0 +DA:211,0 +DA:222,0 +DA:238,1 +DA:243,1 +DA:247,1 +DA:268,74 +DA:270,74 +DA:271,74 +DA:272,74 +DA:278,74 +DA:300,22 +DA:301,22 +DA:307,22 +DA:321,22 +DA:322,22 +DA:324,22 +DA:325,20 +DA:331,2 +DA:340,21 +DA:348,21 +DA:356,21 +DA:374,1 +DA:379,1 +DA:384,1 +DA:392,1 +DA:412,4 +LF:44 +LH:39 +BRDA:135,1,0,24 +BRDA:135,1,1,1 +BRDA:141,2,0,24 +BRDA:141,2,1,0 +BRDA:146,3,0,23 +BRDA:146,3,1,1 +BRDA:151,4,0,22 +BRDA:151,4,1,1 +BRDA:173,5,0,3 +BRDA:173,5,1,1 +BRDA:178,6,0,1 +BRDA:178,6,1,2 +BRDA:183,7,0,1 +BRDA:183,7,1,0 +BRDA:206,8,0,0 +BRDA:206,8,1,0 +BRDA:211,9,0,0 +BRDA:211,9,1,0 +BRDA:243,10,0,1 +BRDA:243,10,1,0 +BRDA:324,11,0,20 +BRDA:324,11,1,2 +BRDA:331,12,0,1 +BRDA:331,12,1,1 +BRDA:374,13,0,1 +BRDA:374,13,1,0 +BRDA:379,14,0,1 +BRDA:379,14,1,0 +BRF:28 +BRH:19 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol +FN:83,constructor +FN:101,netGasCost +FN:119,fixedGasDiscount +FN:138,notStatic +FN:155,run +FN:223,ovmCALLER +FN:238,ovmADDRESS +FN:253,ovmTIMESTAMP +FN:268,ovmNUMBER +FN:283,ovmGASLIMIT +FN:298,ovmCHAINID +FN:317,ovmL1QUEUEORIGIN +FN:332,ovmL1TXORIGIN +FN:351,ovmREVERT +FN:377,ovmCREATE +FN:416,ovmCREATE2 +FN:451,ovmGETNONCE +FN:470,ovmSETNONCE +FN:494,ovmCREATEEOA +FN:563,ovmCALL +FN:597,ovmSTATICCALL +FN:632,ovmDELEGATECALL +FN:664,ovmSLOAD +FN:690,ovmSSTORE +FN:714,ovmEXTCODECOPY +FN:744,ovmEXTCODESIZE +FN:763,ovmEXTCODEHASH +FN:781,getMaxTransactionGasLimit +FN:800,_checkDeployerAllowed +FN:830,_createContract +FN:875,_callContract +FN:924,_handleExternalMessage +FN:1035,_handleContractCreation +FN:1127,_hasAccount +FN:1144,_hasEmptyAccount +FN:1161,_setAccountNonce +FN:1176,_getAccountNonce +FN:1193,_getAccountEthAddress +FN:1209,_initPendingAccount +FN:1229,_commitPendingAccount +FN:1250,_getContractStorage +FN:1269,_putContractStorage +FN:1294,_checkAccountLoad +FN:1329,_checkAccountChange +FN:1360,_checkContractStorageLoad +FN:1402,_checkContractStorageChange +FN:1441,_encodeRevertData +FN:1485,_decodeRevertData +FN:1516,_revertWithFlag +FN:1537,_revertWithFlag +FN:1558,_getNuisanceGasLimit +FN:1574,_useNuisanceGas +FN:1597,_checkNeedsNewEpoch +FN:1635,_isValidGasLimit +FN:1681,_updateCumulativeGas +FN:1710,_getGasMetadata +FN:1729,_putGasMetadata +FN:1752,_switchMessageContext +FN:1778,_initContext +FN:1796,_resetContext +FN:1825,simulateMessage +FNF:61 +FNH:51 +FNDA:27,constructor +FNDA:55,netGasCost +FNDA:201,fixedGasDiscount +FNDA:42,notStatic +FNDA:0,run +FNDA:4,ovmCALLER +FNDA:150,ovmADDRESS +FNDA:1,ovmTIMESTAMP +FNDA:1,ovmNUMBER +FNDA:1,ovmGASLIMIT +FNDA:1,ovmCHAINID +FNDA:1,ovmL1QUEUEORIGIN +FNDA:1,ovmL1TXORIGIN +FNDA:6,ovmREVERT +FNDA:28,ovmCREATE +FNDA:1,ovmCREATE2 +FNDA:3,ovmGETNONCE +FNDA:1,ovmSETNONCE +FNDA:1,ovmCREATEEOA +FNDA:154,ovmCALL +FNDA:8,ovmSTATICCALL +FNDA:10,ovmDELEGATECALL +FNDA:48,ovmSLOAD +FNDA:7,ovmSSTORE +FNDA:2,ovmEXTCODECOPY +FNDA:3,ovmEXTCODESIZE +FNDA:2,ovmEXTCODEHASH +FNDA:0,getMaxTransactionGasLimit +FNDA:29,_checkDeployerAllowed +FNDA:27,_createContract +FNDA:172,_callContract +FNDA:196,_handleExternalMessage +FNDA:27,_handleContractCreation +FNDA:0,_hasAccount +FNDA:28,_hasEmptyAccount +FNDA:29,_setAccountNonce +FNDA:57,_getAccountNonce +FNDA:369,_getAccountEthAddress +FNDA:28,_initPendingAccount +FNDA:17,_commitPendingAccount +FNDA:55,_getContractStorage +FNDA:7,_putContractStorage +FNDA:535,_checkAccountLoad +FNDA:53,_checkAccountChange +FNDA:62,_checkContractStorageLoad +FNDA:7,_checkContractStorageChange +FNDA:20,_encodeRevertData +FNDA:23,_decodeRevertData +FNDA:19,_revertWithFlag +FNDA:13,_revertWithFlag +FNDA:196,_getNuisanceGasLimit +FNDA:244,_useNuisanceGas +FNDA:0,_checkNeedsNewEpoch +FNDA:0,_isValidGasLimit +FNDA:0,_updateCumulativeGas +FNDA:0,_getGasMetadata +FNDA:0,_putGasMetadata +FNDA:392,_switchMessageContext +FNDA:0,_initContext +FNDA:27,_resetContext +FNDA:0,simulateMessage +DA:85,27 +DA:86,27 +DA:87,27 +DA:88,27 +DA:104,55 +DA:105,55 +DA:106,55 +DA:109,55 +DA:110,46 +DA:122,201 +DA:123,201 +DA:124,192 +DA:127,192 +DA:128,165 +DA:131,27 +DA:139,42 +DA:140,4 +DA:142,38 +DA:162,0 +DA:165,0 +DA:170,0 +DA:178,0 +DA:186,0 +DA:187,0 +DA:188,0 +DA:196,0 +DA:208,0 +DA:211,0 +DA:231,4 +DA:246,150 +DA:261,1 +DA:276,1 +DA:291,1 +DA:306,1 +DA:325,1 +DA:340,1 +DA:357,6 +DA:384,28 +DA:388,28 +DA:391,27 +DA:396,27 +DA:423,1 +DA:427,1 +DA:430,0 +DA:436,0 +DA:458,3 +DA:472,1 +DA:501,1 +DA:510,1 +DA:511,0 +DA:515,1 +DA:516,0 +DA:520,1 +DA:523,1 +DA:524,1 +DA:528,1 +DA:531,1 +DA:534,1 +DA:540,1 +DA:570,154 +DA:571,154 +DA:572,154 +DA:574,154 +DA:604,8 +DA:605,8 +DA:606,8 +DA:607,8 +DA:609,8 +DA:639,10 +DA:641,10 +DA:670,48 +DA:672,48 +DA:693,7 +DA:695,7 +DA:730,2 +DA:732,2 +DA:753,3 +DA:772,2 +DA:789,0 +DA:807,29 +DA:812,29 +DA:814,29 +DA:815,2 +DA:841,27 +DA:845,27 +DA:846,27 +DA:847,27 +DA:851,27 +DA:860,24 +DA:889,172 +DA:894,1 +DA:898,171 +DA:903,169 +DA:938,196 +DA:939,196 +DA:945,196 +DA:946,196 +DA:947,196 +DA:955,196 +DA:961,196 +DA:965,196 +DA:969,196 +DA:970,23 +DA:980,23 +DA:981,5 +DA:987,18 +DA:993,14 +DA:998,18 +DA:1002,10 +DA:1004,8 +DA:1012,18 +DA:1016,191 +DA:1018,191 +DA:1047,27 +DA:1050,0 +DA:1060,27 +DA:1061,0 +DA:1071,27 +DA:1074,27 +DA:1076,27 +DA:1079,10 +DA:1080,10 +DA:1081,10 +DA:1082,10 +DA:1090,10 +DA:1095,17 +DA:1096,17 +DA:1097,1 +DA:1108,16 +DA:1115,16 +DA:1135,0 +DA:1136,0 +DA:1152,28 +DA:1153,28 +DA:1167,29 +DA:1168,29 +DA:1184,57 +DA:1185,57 +DA:1201,369 +DA:1202,367 +DA:1217,28 +DA:1218,28 +DA:1236,17 +DA:1237,17 +DA:1259,55 +DA:1260,55 +DA:1281,7 +DA:1282,0 +DA:1285,7 +DA:1286,7 +DA:1300,535 +DA:1301,0 +DA:1305,535 +DA:1306,2 +DA:1311,533 +DA:1317,533 +DA:1318,144 +DA:1336,53 +DA:1340,53 +DA:1346,53 +DA:1347,47 +DA:1348,47 +DA:1372,62 +DA:1373,0 +DA:1379,62 +DA:1380,0 +DA:1385,62 +DA:1391,62 +DA:1392,46 +DA:1410,7 +DA:1414,7 +DA:1420,7 +DA:1423,7 +DA:1425,7 +DA:1426,7 +DA:1452,20 +DA:1455,0 +DA:1459,20 +DA:1460,7 +DA:1469,13 +DA:1498,23 +DA:1499,3 +DA:1508,20 +DA:1523,19 +DA:1528,19 +DA:1542,13 +DA:1567,196 +DA:1581,244 +DA:1582,0 +DA:1585,244 +DA:1602,0 +DA:1608,0 +DA:1613,0 +DA:1620,0 +DA:1646,0 +DA:1647,0 +DA:1651,0 +DA:1652,0 +DA:1656,0 +DA:1687,0 +DA:1688,0 +DA:1689,0 +DA:1691,0 +DA:1694,0 +DA:1718,0 +DA:1735,0 +DA:1759,392 +DA:1760,202 +DA:1764,392 +DA:1765,308 +DA:1769,392 +DA:1770,16 +DA:1783,0 +DA:1784,0 +DA:1785,0 +DA:1786,0 +DA:1787,0 +DA:1788,0 +DA:1790,0 +DA:1799,27 +DA:1800,27 +DA:1801,27 +DA:1802,27 +DA:1803,27 +DA:1804,27 +DA:1806,27 +DA:1808,27 +DA:1809,27 +DA:1810,27 +DA:1812,27 +DA:1837,0 +DA:1839,0 +DA:1840,0 +DA:1841,0 +DA:1843,0 +DA:1845,0 +DA:1846,0 +DA:1847,0 +DA:1848,0 +DA:1849,0 +DA:1853,0 +DA:1856,0 +LF:242 +LH:182 +BRDA:109,1,0,46 +BRDA:109,1,1,9 +BRDA:127,2,0,165 +BRDA:127,2,1,27 +BRDA:139,3,0,4 +BRDA:139,3,1,38 +BRDA:162,4,0,0 +BRDA:162,4,1,0 +BRDA:170,5,0,0 +BRDA:170,5,1,0 +BRDA:186,6,0,0 +BRDA:186,6,1,0 +BRDA:510,7,0,0 +BRDA:510,7,1,1 +BRDA:515,8,0,0 +BRDA:515,8,1,1 +BRDA:814,9,0,2 +BRDA:814,9,1,27 +BRDA:889,10,0,1 +BRDA:889,10,1,171 +BRDA:969,11,0,23 +BRDA:969,11,1,173 +BRDA:980,12,0,5 +BRDA:980,12,1,18 +BRDA:987,13,0,14 +BRDA:987,13,1,4 +BRDA:998,14,0,10 +BRDA:998,14,1,8 +BRDA:1047,15,0,0 +BRDA:1047,15,1,27 +BRDA:1060,16,0,0 +BRDA:1060,16,1,27 +BRDA:1076,17,0,10 +BRDA:1076,17,1,17 +BRDA:1096,18,0,1 +BRDA:1096,18,1,16 +BRDA:1281,19,0,0 +BRDA:1281,19,1,7 +BRDA:1300,20,0,0 +BRDA:1300,20,1,535 +BRDA:1305,21,0,2 +BRDA:1305,21,1,533 +BRDA:1317,22,0,144 +BRDA:1317,22,1,389 +BRDA:1346,23,0,47 +BRDA:1346,23,1,6 +BRDA:1372,24,0,0 +BRDA:1372,24,1,62 +BRDA:1379,25,0,0 +BRDA:1379,25,1,62 +BRDA:1391,26,0,46 +BRDA:1391,26,1,16 +BRDA:1420,27,0,7 +BRDA:1420,27,1,0 +BRDA:1452,28,0,0 +BRDA:1452,28,1,20 +BRDA:1459,29,0,7 +BRDA:1459,29,1,13 +BRDA:1498,30,0,3 +BRDA:1498,30,1,20 +BRDA:1581,31,0,0 +BRDA:1581,31,1,244 +BRDA:1602,32,0,0 +BRDA:1602,32,1,0 +BRDA:1646,33,0,0 +BRDA:1646,33,1,0 +BRDA:1651,34,0,0 +BRDA:1651,34,1,0 +BRDA:1688,35,0,0 +BRDA:1688,35,1,0 +BRDA:1759,36,0,202 +BRDA:1759,36,1,190 +BRDA:1764,37,0,308 +BRDA:1764,37,1,84 +BRDA:1769,38,0,16 +BRDA:1769,38,1,376 +BRDA:1837,39,0,0 +BRDA:1837,39,1,0 +BRDA:1846,40,0,0 +BRDA:1846,40,1,0 +BRDA:1848,41,0,0 +BRDA:1848,41,1,0 +BRF:82 +BRH:51 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol +FN:31,isBytecodeSafe +FNF:1 +FNH:1 +FNDA:277,isBytecodeSafe +DA:43,277 +DA:54,277 +DA:56,277 +DA:58,277 +DA:60,277 +DA:61,277 +DA:62,277 +DA:65,277 +DA:66,277 +DA:146,152 +LF:10 +LH:10 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol +FN:53,constructor +FN:69,authenticated +FN:87,isAuthenticated +FN:109,setExecutionManager +FN:125,putAccount +FN:139,putEmptyAccount +FN:151,getAccount +FN:169,hasAccount +FN:187,hasEmptyAccount +FN:214,setAccountNonce +FN:224,getAccountNonce +FN:242,getAccountEthAddress +FN:260,getAccountStorageRoot +FN:282,initPendingAccount +FN:304,commitPendingAccount +FN:321,testAndSetAccountLoaded +FN:342,testAndSetAccountChanged +FN:363,commitAccount +FN:385,incrementTotalUncommittedAccounts +FN:394,getTotalUncommittedAccounts +FN:410,wasAccountChanged +FN:429,wasAccountCommitted +FN:461,putContractStorage +FN:484,getContractStorage +FN:514,hasContractStorage +FN:540,testAndSetContractStorageLoaded +FN:563,testAndSetContractStorageChanged +FN:586,commitContractStorage +FN:608,incrementTotalUncommittedContractStorage +FN:617,getTotalUncommittedContractStorage +FN:634,wasContractStorageChanged +FN:655,wasContractStorageCommitted +FN:680,_getItemHash +FN:698,_getItemHash +FN:721,_testAndSetItemState +FNF:35 +FNH:28 +FNDA:207,constructor +FNDA:921,authenticated +FNDA:0,isAuthenticated +FNDA:12,setExecutionManager +FNDA:12,putAccount +FNDA:0,putEmptyAccount +FNDA:4,getAccount +FNDA:537,hasAccount +FNDA:31,hasEmptyAccount +FNDA:31,setAccountNonce +FNDA:60,getAccountNonce +FNDA:369,getAccountEthAddress +FNDA:0,getAccountStorageRoot +FNDA:30,initPendingAccount +FNDA:18,commitPendingAccount +FNDA:538,testAndSetAccountLoaded +FNDA:61,testAndSetAccountChanged +FNDA:7,commitAccount +FNDA:70,incrementTotalUncommittedAccounts +FNDA:5,getTotalUncommittedAccounts +FNDA:0,wasAccountChanged +FNDA:0,wasAccountCommitted +FNDA:14,putContractStorage +FNDA:57,getContractStorage +FNDA:74,hasContractStorage +FNDA:69,testAndSetContractStorageLoaded +FNDA:19,testAndSetContractStorageChanged +FNDA:9,commitContractStorage +FNDA:30,incrementTotalUncommittedContractStorage +FNDA:5,getTotalUncommittedContractStorage +FNDA:0,wasContractStorageChanged +FNDA:0,wasContractStorageCommitted +FNDA:606,_getItemHash +FNDA:97,_getItemHash +FNDA:687,_testAndSetItemState +DA:57,207 +DA:71,921 +DA:75,920 +DA:97,0 +DA:111,12 +DA:127,12 +DA:141,0 +DA:142,0 +DA:143,0 +DA:161,4 +DA:179,537 +DA:197,31 +DA:216,31 +DA:234,60 +DA:252,369 +DA:270,0 +DA:284,30 +DA:285,30 +DA:286,30 +DA:287,30 +DA:288,30 +DA:306,18 +DA:307,18 +DA:308,18 +DA:326,538 +DA:347,61 +DA:368,7 +DA:369,7 +DA:370,3 +DA:373,4 +DA:374,4 +DA:376,4 +DA:387,70 +DA:402,5 +DA:420,0 +DA:421,0 +DA:439,0 +DA:440,0 +DA:466,14 +DA:473,14 +DA:474,8 +DA:497,57 +DA:501,6 +DA:505,51 +DA:525,74 +DA:545,69 +DA:568,19 +DA:591,9 +DA:592,9 +DA:593,3 +DA:596,6 +DA:597,6 +DA:599,6 +DA:610,30 +DA:625,5 +DA:645,0 +DA:646,0 +DA:666,0 +DA:667,0 +DA:689,606 +DA:708,97 +DA:730,687 +DA:732,687 +DA:733,268 +DA:736,687 +LF:65 +LH:52 +BRDA:71,1,0,920 +BRDA:71,1,1,1 +BRDA:369,2,0,3 +BRDA:369,2,1,4 +BRDA:473,3,0,8 +BRDA:473,3,1,6 +BRDA:497,4,0,6 +BRDA:497,4,1,51 +BRDA:592,5,0,3 +BRDA:592,5,1,6 +BRDA:732,6,0,268 +BRDA:732,6,1,419 +BRF:12 +BRH:12 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol +FN:30,create +FNF:1 +FNH:0 +FNDA:0,create +DA:39,0 +LF:1 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol +FN:56,getInterfaceImplementer +FN:73,setInterfaceImplementer +FN:93,setManager +FN:102,getManager +FN:114,interfaceHash +FN:124,updateERC165Cache +FN:137,implementsERC165Interface +FN:148,implementsERC165InterfaceNoCache +FN:172,isERC165Interface +FN:177,noThrowCall +FNF:10 +FNH:0 +FNDA:0,getInterfaceImplementer +FNDA:0,setInterfaceImplementer +FNDA:0,setManager +FNDA:0,getManager +FNDA:0,interfaceHash +FNDA:0,updateERC165Cache +FNDA:0,implementsERC165Interface +FNDA:0,implementsERC165InterfaceNoCache +FNDA:0,isERC165Interface +FNDA:0,noThrowCall +DA:57,0 +DA:58,0 +DA:59,0 +DA:60,0 +DA:62,0 +DA:74,0 +DA:75,0 +DA:77,0 +DA:78,0 +DA:79,0 +DA:85,0 +DA:86,0 +DA:94,0 +DA:95,0 +DA:96,0 +DA:104,0 +DA:105,0 +DA:107,0 +DA:115,0 +DA:125,0 +DA:127,0 +DA:138,0 +DA:139,0 +DA:141,0 +DA:149,0 +DA:150,0 +DA:152,0 +DA:153,0 +DA:154,0 +DA:157,0 +DA:158,0 +DA:159,0 +DA:162,0 +DA:163,0 +DA:164,0 +DA:166,0 +DA:173,0 +DA:180,0 +DA:182,0 +LF:39 +LH:0 +BRDA:58,1,0,0 +BRDA:58,1,1,0 +BRDA:75,2,0,0 +BRDA:75,2,1,0 +BRDA:77,3,0,0 +BRDA:77,3,1,0 +BRDA:78,4,0,0 +BRDA:78,4,1,0 +BRDA:79,5,0,0 +BRDA:79,5,1,0 +BRDA:94,6,0,0 +BRDA:94,6,1,0 +BRDA:104,7,0,0 +BRDA:104,7,1,0 +BRDA:138,8,0,0 +BRDA:138,8,1,0 +BRDA:153,9,0,0 +BRDA:153,9,1,0 +BRDA:158,10,0,0 +BRDA:158,10,1,0 +BRDA:163,11,0,0 +BRDA:163,11,1,0 +BRF:22 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol +FN:39,onlyOwner +FN:63,initialize +FN:95,getOwner +FN:120,setWhitelistedDeployer +FN:137,setOwner +FN:154,setAllowArbitraryDeployment +FN:168,enableArbitraryContractDeployment +FN:179,isDeployerAllowed +FNF:8 +FNH:1 +FNDA:0,onlyOwner +FNDA:0,initialize +FNDA:0,getOwner +FNDA:0,setWhitelistedDeployer +FNDA:0,setOwner +FNDA:0,setAllowArbitraryDeployment +FNDA:0,enableArbitraryContractDeployment +FNDA:29,isDeployerAllowed +DA:40,0 +DA:46,0 +DA:50,0 +DA:70,0 +DA:74,0 +DA:75,0 +DA:78,0 +DA:82,0 +DA:86,0 +DA:102,0 +DA:122,0 +DA:139,0 +DA:156,0 +DA:170,0 +DA:171,0 +DA:188,29 +DA:192,29 +DA:193,25 +DA:196,4 +DA:200,4 +DA:201,1 +DA:204,3 +DA:210,3 +LF:23 +LH:8 +BRDA:74,1,0,0 +BRDA:74,1,1,0 +BRDA:192,2,0,25 +BRDA:192,2,1,4 +BRDA:200,3,0,1 +BRDA:200,3,1,3 +BRF:6 +BRH:4 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol +FN:30,constructor +FNF:1 +FNH:0 +FNDA:0,constructor +DA:32,0 +LF:1 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol +FN:32,getL1MessageSender +FNF:1 +FNH:1 +FNDA:1,getL1MessageSender +DA:41,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol +FN:34,passMessageToL1 +FNF:1 +FNH:1 +FNDA:31,passMessageToL1 +DA:43,31 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol +FN:22, +FN:37,init +FN:51,upgrade +FN:69,_setImplementation +FN:80,_getImplementation +FN:93,_setOwner +FN:104,_getOwner +FNF:7 +FNH:7 +FNDA:1, +FNDA:2,init +FNDA:2,upgrade +FNDA:4,_setImplementation +FNDA:1,_getImplementation +FNDA:2,_setOwner +FNDA:4,_getOwner +DA:25,1 +DA:43,2 +DA:47,2 +DA:48,2 +DA:56,2 +DA:61,2 +DA:74,4 +DA:86,1 +DA:98,2 +DA:110,4 +LF:10 +LH:10 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol +FN:49, +FN:109,_getTransactionType +FNF:2 +FNH:2 +FNDA:7, +FNDA:7,_getTransactionType +DA:52,7 +DA:54,5 +DA:55,5 +DA:56,5 +DA:59,5 +DA:60,5 +DA:63,5 +DA:68,5 +DA:76,5 +DA:78,2 +DA:79,2 +DA:83,5 +DA:92,5 +DA:117,7 +DA:118,3 +DA:120,2 +DA:122,2 +LF:17 +LH:17 +BRDA:76,1,0,2 +BRDA:76,1,1,3 +BRDA:117,2,0,3 +BRDA:117,2,1,4 +BRDA:119,3,0,2 +BRDA:119,3,1,2 +BRF:6 +BRH:6 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol +FN:12,contributesToFraudProof +FNF:1 +FNH:1 +FNDA:28,contributesToFraudProof +DA:13,28 +DA:14,28 +DA:15,14 +DA:16,14 +LF:4 +LH:4 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol +FN:67,constructor +FN:78,recordGasSpent +FN:89,finalize +FN:132,deposit +FN:143,startWithdrawal +FN:153,finalizeWithdrawal +FN:174,claim +FN:200,isCollateralized +FN:205,getGasSpent +FNF:9 +FNH:9 +FNDA:63,constructor +FNDA:46,recordGasSpent +FNDA:13,finalize +FNDA:18,deposit +FNDA:7,startWithdrawal +FNDA:5,finalizeWithdrawal +FNDA:6,claim +FNDA:3,isCollateralized +FNDA:2,getGasSpent +DA:69,63 +DA:80,46 +DA:81,46 +DA:83,45 +DA:84,45 +DA:90,13 +DA:91,12 +DA:95,11 +DA:97,11 +DA:98,11 +DA:99,8 +DA:100,8 +DA:101,8 +DA:108,1 +DA:109,1 +DA:118,11 +DA:123,1 +DA:127,10 +DA:133,18 +DA:139,18 +DA:144,7 +DA:145,7 +DA:146,7 +DA:148,6 +DA:149,6 +DA:154,5 +DA:156,5 +DA:160,4 +DA:163,3 +DA:164,3 +DA:166,3 +DA:175,6 +DA:176,6 +DA:182,5 +DA:183,5 +DA:186,5 +DA:190,4 +DA:193,4 +DA:196,4 +DA:201,3 +DA:206,2 +LF:41 +LH:41 +BRDA:81,1,0,45 +BRDA:81,1,1,1 +BRDA:90,2,0,12 +BRDA:90,2,1,1 +BRDA:91,3,0,11 +BRDA:91,3,1,1 +BRDA:98,4,0,8 +BRDA:98,4,1,3 +BRDA:102,5,0,1 +BRDA:102,5,1,2 +BRDA:118,6,0,1 +BRDA:118,6,1,10 +BRDA:133,7,0,18 +BRDA:133,7,1,0 +BRDA:145,8,0,7 +BRDA:145,8,1,0 +BRDA:146,9,0,6 +BRDA:146,9,1,1 +BRDA:156,10,0,4 +BRDA:156,10,1,1 +BRDA:160,11,0,3 +BRDA:160,11,1,1 +BRDA:166,12,0,3 +BRDA:166,12,1,0 +BRDA:176,13,0,5 +BRDA:176,13,1,1 +BRDA:186,14,0,4 +BRDA:186,14,1,1 +BRDA:196,15,0,4 +BRDA:196,15,1,0 +BRF:30 +BRH:26 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol +FN:50,constructor +FN:63,getStateTransitioner +FN:103,initializeFraudVerification +FN:169,finalizeFraudVerification +FN:231,_hasStateTransitioner +FN:250,_deployTransitioner +FN:272,_cancelStateTransition +FNF:7 +FNH:7 +FNDA:33,constructor +FNDA:21,getStateTransitioner +FNDA:12,initializeFraudVerification +FNDA:6,finalizeFraudVerification +FNDA:12,_hasStateTransitioner +FNDA:9,_deployTransitioner +FNDA:1,_cancelStateTransition +DA:74,21 +DA:105,12 +DA:107,12 +DA:108,0 +DA:111,12 +DA:112,12 +DA:114,12 +DA:123,11 +DA:133,10 +DA:138,9 +DA:140,9 +DA:171,6 +DA:172,6 +DA:174,6 +DA:179,5 +DA:184,4 +DA:193,3 +DA:203,2 +DA:208,1 +DA:211,1 +DA:213,1 +DA:241,12 +DA:257,9 +DA:278,1 +DA:279,1 +DA:282,1 +DA:287,1 +DA:290,1 +LF:28 +LH:27 +BRDA:107,1,0,0 +BRDA:107,1,1,12 +BRDA:114,2,0,11 +BRDA:114,2,1,1 +BRDA:123,3,0,10 +BRDA:123,3,1,1 +BRDA:133,4,0,9 +BRDA:133,4,1,1 +BRDA:174,5,0,5 +BRDA:174,5,1,1 +BRDA:179,6,0,4 +BRDA:179,6,1,1 +BRDA:184,7,0,3 +BRDA:184,7,1,1 +BRDA:193,8,0,2 +BRDA:193,8,1,1 +BRDA:203,9,0,1 +BRDA:203,9,1,1 +BRF:18 +BRH:17 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol +FN:95,constructor +FN:114,onlyDuringPhase +FN:133,getPreStateRoot +FN:148,getPostStateRoot +FN:163,isComplete +FN:193,proveContractState +FN:265,proveStorageSlot +FN:329,applyTransaction +FN:377,commitContractState +FN:420,commitStorageSlot +FN:459,completeTransition +FNF:11 +FNH:10 +FNDA:42,constructor +FNDA:13,onlyDuringPhase +FNDA:0,getPreStateRoot +FNDA:1,getPostStateRoot +FNDA:1,isComplete +FNDA:2,proveContractState +FNDA:3,proveStorageSlot +FNDA:1,applyTransaction +FNDA:2,commitContractState +FNDA:2,commitStorageSlot +FNDA:3,completeTransition +DA:97,42 +DA:98,42 +DA:99,42 +DA:100,42 +DA:102,42 +DA:117,13 +DA:121,13 +DA:141,0 +DA:156,1 +DA:171,1 +DA:196,2 +DA:205,2 +DA:214,1 +DA:216,1 +DA:220,1 +DA:221,1 +DA:224,0 +DA:228,1 +DA:234,1 +DA:247,0 +DA:268,3 +DA:273,3 +DA:278,2 +DA:279,2 +DA:281,2 +DA:283,0 +DA:286,2 +DA:295,1 +DA:298,1 +DA:303,0 +DA:307,1 +DA:331,1 +DA:340,0 +DA:345,0 +DA:350,0 +DA:355,0 +DA:357,0 +DA:379,2 +DA:384,2 +DA:389,1 +DA:391,1 +DA:401,1 +DA:422,2 +DA:427,1 +DA:428,1 +DA:430,1 +DA:439,1 +DA:442,1 +DA:461,3 +DA:466,2 +DA:471,1 +LF:51 +LH:41 +BRDA:117,1,0,13 +BRDA:117,1,1,0 +BRDA:196,2,0,2 +BRDA:196,2,1,0 +BRDA:214,3,0,1 +BRDA:214,3,1,0 +BRDA:221,4,0,0 +BRDA:221,4,1,1 +BRDA:228,5,0,1 +BRDA:228,5,1,0 +BRDA:268,6,0,3 +BRDA:268,6,1,0 +BRDA:273,7,0,2 +BRDA:273,7,1,1 +BRDA:281,8,0,0 +BRDA:281,8,1,2 +BRDA:295,9,0,1 +BRDA:295,9,1,0 +BRDA:331,10,0,0 +BRDA:331,10,1,1 +BRDA:340,11,0,0 +BRDA:340,11,1,0 +BRDA:379,12,0,2 +BRDA:379,12,1,0 +BRDA:384,13,0,1 +BRDA:384,13,1,1 +BRDA:422,14,0,1 +BRDA:422,14,1,1 +BRDA:461,15,0,2 +BRDA:461,15,1,1 +BRDA:466,16,0,1 +BRDA:466,16,1,1 +BRF:32 +BRH:20 +end_of_record +TN: +SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol +FN:29,constructor +FN:44,create +FNF:2 +FNH:2 +FNDA:3,constructor +FNDA:1,create +DA:56,1 +DA:60,0 +LF:2 +LH:1 +BRDA:56,1,0,0 +BRDA:56,1,1,1 +BRF:2 +BRH:1 +end_of_record diff --git a/coverage/libraries/bridge/OVM_CrossDomainEnabled.sol.html b/coverage/libraries/bridge/OVM_CrossDomainEnabled.sol.html new file mode 100644 index 000000000..c4c3bfaff --- /dev/null +++ b/coverage/libraries/bridge/OVM_CrossDomainEnabled.sol.html @@ -0,0 +1,308 @@ + + + + Code coverage report for libraries/bridge/OVM_CrossDomainEnabled.sol + + + + + + + +
+
+

+ all files / libraries/bridge/ OVM_CrossDomainEnabled.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +78× +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_CrossDomainEnabled
+ * @dev Helper contract for contracts performing cross-domain communications
+ *
+ * Compiler used: defined by inheriting contract
+ * Runtime target: defined by inheriting contract
+ */
+contract OVM_CrossDomainEnabled {
+    // Messenger contract used to send and recieve messages from the other domain.
+    address public messenger;
+ 
+    /***************
+     * Constructor *
+     ***************/    
+    constructor(
+        address _messenger
+    ) {
+        messenger = _messenger;
+    }
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * @notice Enforces that the modified function is only callable by a specific cross-domain account.
+     * @param _sourceDomainAccount The only account on the originating domain which is authenticated to call this function.
+     */
+    modifier onlyFromCrossDomainAccount(
+        address _sourceDomainAccount
+    ) {
+        require(
+            msg.sender == address(getCrossDomainMessenger()),
+            "OVM_XCHAIN: messenger contract unauthenticated"
+        );
+ 
+        require(
+            getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,
+            "OVM_XCHAIN: wrong sender of cross-domain message"
+        );
+ 
+        _;
+    }
+    
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Gets the messenger, usually from storage.  This function is exposed in case a child contract needs to override.
+     * @return The address of the cross-domain messenger contract which should be used. 
+     */
+    function getCrossDomainMessenger()
+        internal
+        virtual
+        returns(
+            iAbs_BaseCrossDomainMessenger
+        )
+    {
+        return iAbs_BaseCrossDomainMessenger(messenger);
+    }
+ 
+    /**
+     * @notice Sends a message to an account on another domain
+     * @param _crossDomainTarget The intended recipient on the destination domain
+     * @param _data The data to send to the target (usually calldata to a function with `onlyFromCrossDomainAccount()`)
+     * @param _gasLimit The gasLimit for the receipt of the message on the target domain.
+     */
+    function sendCrossDomainMessage(
+        address _crossDomainTarget,
+        bytes memory _data,
+        uint32 _gasLimit
+    ) internal {
+        getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/bridge/index.html b/coverage/libraries/bridge/index.html new file mode 100644 index 000000000..0b17ee495 --- /dev/null +++ b/coverage/libraries/bridge/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for libraries/bridge/ + + + + + + + +
+
+

+ all files libraries/bridge/ +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 6/6 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_CrossDomainEnabled.sol
100%5/5100%4/4100%4/4100%6/6
+
+
+ + + + + + + diff --git a/coverage/libraries/codec/Lib_OVMCodec.sol.html b/coverage/libraries/codec/Lib_OVMCodec.sol.html new file mode 100644 index 000000000..925baaa05 --- /dev/null +++ b/coverage/libraries/codec/Lib_OVMCodec.sol.html @@ -0,0 +1,1178 @@ + + + + Code coverage report for libraries/codec/Lib_OVMCodec.sol + + + + + + + +
+
+

+ all files / libraries/codec/ Lib_OVMCodec.sol +

+
+
+ 100% + Statements + 33/33 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 33/33 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  + +  + + + + + +  + +  + + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +107× +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+import { Lib_Bytes32Utils } from "../utils/Lib_Bytes32Utils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title Lib_OVMCodec
+ */
+library Lib_OVMCodec {
+ 
+    /*********
+     * Enums *
+     *********/
+ 
+    enum EOASignatureType {
+        EIP155_TRANSACTON,
+        ETH_SIGNED_MESSAGE
+    }
+ 
+    enum QueueOrigin {
+        SEQUENCER_QUEUE,
+        L1TOL2_QUEUE
+    }
+ 
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct Account {
+        uint256 nonce;
+        uint256 balance;
+        bytes32 storageRoot;
+        bytes32 codeHash;
+        address ethAddress;
+        bool isFresh;
+    }
+ 
+    struct EVMAccount {
+        uint256 nonce;
+        uint256 balance;
+        bytes32 storageRoot;
+        bytes32 codeHash;
+    }
+ 
+    struct ChainBatchHeader {
+        uint256 batchIndex;
+        bytes32 batchRoot;
+        uint256 batchSize;
+        uint256 prevTotalElements;
+        bytes extraData;
+    }
+ 
+    struct ChainInclusionProof {
+        uint256 index;
+        bytes32[] siblings;
+    }
+ 
+    struct Transaction {
+        uint256 timestamp;
+        uint256 blockNumber;
+        QueueOrigin l1QueueOrigin;
+        address l1TxOrigin;
+        address entrypoint;
+        uint256 gasLimit;
+        bytes data;
+    }
+ 
+    struct TransactionChainElement {
+        bool isSequenced;
+        uint256 queueIndex;  // QUEUED TX ONLY
+        uint256 timestamp;   // SEQUENCER TX ONLY
+        uint256 blockNumber; // SEQUENCER TX ONLY
+        bytes txData;        // SEQUENCER TX ONLY
+    }
+ 
+    struct QueueElement {
+        bytes32 transactionHash;
+        uint40 timestamp;
+        uint40 blockNumber;
+    }
+ 
+    struct EIP155Transaction {
+        uint256 nonce;
+        uint256 gasPrice;
+        uint256 gasLimit;
+        address to;
+        uint256 value;
+        bytes data;
+        uint256 chainId;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Decodes an EOA transaction (i.e., native Ethereum RLP encoding).
+     * @param _transaction Encoded EOA transaction.
+     * @return Transaction decoded into a struct.
+     */
+    function decodeEIP155Transaction(
+        bytes memory _transaction,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (
+            EIP155Transaction memory
+        )
+    {
+        if (_isEthSignedMessage) {
+            (
+                uint256 _nonce,
+                uint256 _gasLimit,
+                uint256 _gasPrice,
+                uint256 _chainId,
+                address _to,
+                bytes memory _data
+            ) = abi.decode(
+                _transaction,
+                (uint256, uint256, uint256, uint256, address ,bytes)
+            );
+            return EIP155Transaction({
+                nonce: _nonce,
+                gasPrice: _gasPrice,
+                gasLimit: _gasLimit,
+                to: _to,
+                value: 0,
+                data: _data,
+                chainId: _chainId
+            });
+        } else {
+            Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);
+ 
+            return EIP155Transaction({
+                nonce: Lib_RLPReader.readUint256(decoded[0]),
+                gasPrice: Lib_RLPReader.readUint256(decoded[1]),
+                gasLimit: Lib_RLPReader.readUint256(decoded[2]),
+                to: Lib_RLPReader.readAddress(decoded[3]),
+                value: Lib_RLPReader.readUint256(decoded[4]),
+                data: Lib_RLPReader.readBytes(decoded[5]),
+                chainId:  Lib_RLPReader.readUint256(decoded[6])
+            });
+        }
+    }
+ 
+    /**
+     * Decompresses a compressed EIP155 transaction.
+     * @param _transaction Compressed EIP155 transaction bytes.
+     * @return Transaction parsed into a struct.
+     */
+    function decompressEIP155Transaction(
+        bytes memory _transaction
+    )
+        internal
+        returns (
+            EIP155Transaction memory
+        )
+    {
+        return EIP155Transaction({
+            gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),
+            gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,
+            nonce: Lib_BytesUtils.toUint24(_transaction, 6),
+            to: Lib_BytesUtils.toAddress(_transaction, 9),
+            data: Lib_BytesUtils.slice(_transaction, 29),
+            chainId: Lib_SafeExecutionManagerWrapper.safeCHAINID(),
+            value: 0
+        });
+    }
+ 
+    /**
+     * Encodes an EOA transaction back into the original transaction.
+     * @param _transaction EIP155transaction to encode.
+     * @param _isEthSignedMessage Whether or not this was an eth signed message.
+     * @return Encoded transaction.
+     */
+    function encodeEIP155Transaction(
+        EIP155Transaction memory _transaction,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        if (_isEthSignedMessage) {
+            return abi.encode(
+                _transaction.nonce,
+                _transaction.gasLimit,
+                _transaction.gasPrice,
+                _transaction.chainId,
+                _transaction.to,
+                _transaction.data
+            );
+        } else {
+            bytes[] memory raw = new bytes[](9);
+ 
+            raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
+            raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
+            raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
+            if (_transaction.to == address(0)) {
+                raw[3] = Lib_RLPWriter.writeBytes('');
+            } else {
+                raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
+            }
+            raw[4] = Lib_RLPWriter.writeUint(0);
+            raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
+            raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
+            raw[7] = Lib_RLPWriter.writeBytes(bytes(''));
+            raw[8] = Lib_RLPWriter.writeBytes(bytes(''));
+ 
+            return Lib_RLPWriter.writeList(raw);
+        }
+    }
+ 
+    /**
+     * Encodes a standard OVM transaction.
+     * @param _transaction OVM transaction to encode.
+     * @return Encoded transaction bytes.
+     */
+    function encodeTransaction(
+        Transaction memory _transaction
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodePacked(
+            _transaction.timestamp,
+            _transaction.blockNumber,
+            _transaction.l1QueueOrigin,
+            _transaction.l1TxOrigin,
+            _transaction.entrypoint,
+            _transaction.gasLimit,
+            _transaction.data
+        );
+    }
+ 
+    /**
+     * Hashes a standard OVM transaction.
+     * @param _transaction OVM transaction to encode.
+     * @return Hashed transaction
+     */
+    function hashTransaction(
+        Transaction memory _transaction
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(encodeTransaction(_transaction));
+    }
+ 
+    /**
+     * Converts an OVM account to an EVM account.
+     * @param _in OVM account to convert.
+     * @return Converted EVM account.
+     */
+    function toEVMAccount(
+        Account memory _in
+    )
+        internal
+        pure
+        returns (
+            EVMAccount memory
+        )
+    {
+        return EVMAccount({
+            nonce: _in.nonce,
+            balance: _in.balance,
+            storageRoot: _in.storageRoot,
+            codeHash: _in.codeHash
+        });
+    }
+ 
+    /**
+     * @notice RLP-encodes an account state struct.
+     * @param _account Account state struct.
+     * @return RLP-encoded account state.
+     */
+    function encodeEVMAccount(
+        EVMAccount memory _account
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes[] memory raw = new bytes[](4);
+ 
+        // Unfortunately we can't create this array outright because
+        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning
+        // index-by-index circumvents this issue.
+        raw[0] = Lib_RLPWriter.writeBytes(
+            Lib_Bytes32Utils.removeLeadingZeros(
+                bytes32(_account.nonce)
+            )
+        );
+        raw[1] = Lib_RLPWriter.writeBytes(
+            Lib_Bytes32Utils.removeLeadingZeros(
+                bytes32(_account.balance)
+            )
+        );
+        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));
+        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));
+ 
+        return Lib_RLPWriter.writeList(raw);
+    }
+ 
+    /**
+     * @notice Decodes an RLP-encoded account state into a useful struct.
+     * @param _encoded RLP-encoded account state.
+     * @return Account state struct.
+     */
+    function decodeEVMAccount(
+        bytes memory _encoded
+    )
+        internal
+        pure
+        returns (
+            EVMAccount memory
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);
+ 
+        return EVMAccount({
+            nonce: Lib_RLPReader.readUint256(accountState[0]),
+            balance: Lib_RLPReader.readUint256(accountState[1]),
+            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),
+            codeHash: Lib_RLPReader.readBytes32(accountState[3])
+        });
+    }
+ 
+    /**
+     * Calculates a hash for a given batch header.
+     * @param _batchHeader Header to hash.
+     * @return Hash of the header.
+     */
+    function hashBatchHeader(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(
+            abi.encode(
+                _batchHeader.batchRoot,
+                _batchHeader.batchSize,
+                _batchHeader.prevTotalElements,
+                _batchHeader.extraData
+            )
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/codec/index.html b/coverage/libraries/codec/index.html new file mode 100644 index 000000000..938f11b95 --- /dev/null +++ b/coverage/libraries/codec/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for libraries/codec/ + + + + + + + +
+
+

+ all files libraries/codec/ +

+
+
+ 100% + Statements + 33/33 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 33/33 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_OVMCodec.sol
100%33/33100%6/6100%9/9100%33/33
+
+
+ + + + + + + diff --git a/coverage/libraries/resolver/Lib_AddressManager.sol.html b/coverage/libraries/resolver/Lib_AddressManager.sol.html new file mode 100644 index 000000000..2a868eb60 --- /dev/null +++ b/coverage/libraries/resolver/Lib_AddressManager.sol.html @@ -0,0 +1,272 @@ + + + + Code coverage report for libraries/resolver/Lib_AddressManager.sol + + + + + + + +
+
+

+ all files / libraries/resolver/ Lib_AddressManager.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +379× +379× +  +  +  +  +  +  +  +  +  +2107× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2486× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { Ownable } from "./Lib_Ownable.sol";
+ 
+/**
+ * @title Lib_AddressManager
+ */
+contract Lib_AddressManager is Ownable {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event AddressSet(
+        string _name,
+        address _newAddress
+    );
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    mapping (bytes32 => address) private addresses;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function setAddress(
+        string memory _name,
+        address _address
+    )
+        public
+        onlyOwner
+    {
+        emit AddressSet(_name, _address);
+        addresses[_getNameHash(_name)] = _address;
+    }
+ 
+    function getAddress(
+        string memory _name
+    )
+        public
+        view
+        returns (address)
+    {
+        return addresses[_getNameHash(_name)];
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _getNameHash(
+        string memory _name
+    )
+        internal
+        pure
+        returns (
+            bytes32 _hash
+        )
+    {
+        return keccak256(abi.encodePacked(_name));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/resolver/Lib_AddressResolver.sol.html b/coverage/libraries/resolver/Lib_AddressResolver.sol.html new file mode 100644 index 000000000..c16b6c033 --- /dev/null +++ b/coverage/libraries/resolver/Lib_AddressResolver.sol.html @@ -0,0 +1,209 @@ + + + + Code coverage report for libraries/resolver/Lib_AddressResolver.sol + + + + + + + +
+
+

+ all files / libraries/resolver/ Lib_AddressResolver.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1041× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2076× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressManager } from "./Lib_AddressManager.sol";
+ 
+/**
+ * @title Lib_AddressResolver
+ */
+abstract contract Lib_AddressResolver {
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    Lib_AddressManager internal libAddressManager;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Lib_AddressManager.
+     */
+    constructor(
+        address _libAddressManager
+    )  {
+        libAddressManager = Lib_AddressManager(_libAddressManager);
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function resolve(
+        string memory _name
+    )
+        public
+        view
+        returns (
+            address _contract
+        )
+    {
+        return libAddressManager.getAddress(_name);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/resolver/Lib_Ownable.sol.html b/coverage/libraries/resolver/Lib_Ownable.sol.html new file mode 100644 index 000000000..8b947582e --- /dev/null +++ b/coverage/libraries/resolver/Lib_Ownable.sol.html @@ -0,0 +1,293 @@ + + + + Code coverage report for libraries/resolver/Lib_Ownable.sol + + + + + + + +
+
+

+ all files / libraries/resolver/ Lib_Ownable.sol +

+
+
+ 37.5% + Statements + 3/8 +
+
+ 25% + Branches + 1/4 +
+
+ 50% + Functions + 2/4 +
+
+ 44.44% + Lines + 4/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +120× +120× +  +  +  +  +  +  +  +  +379× +  +  +  +379× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Ownable
+ * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
+ */
+abstract contract Ownable {
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    address public owner;
+ 
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event OwnershipTransferred(
+        address indexed previousOwner,
+        address indexed newOwner
+    );
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    constructor() {
+        owner = msg.sender;
+        emit OwnershipTransferred(address(0), owner);
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyOwner() {
+        Erequire(
+            owner == msg.sender,
+            "Ownable: caller is not the owner"
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function renounceOwnership()
+        public
+        virtual
+        onlyOwner
+    {
+        emit OwnershipTransferred(owner, address(0));
+        owner = address(0);
+    }
+ 
+    function transferOwnership(address _newOwner)
+        public
+        virtual
+        onlyOwner
+    {
+        require(
+            _newOwner != address(0),
+            "Ownable: new owner cannot be the zero address"
+        );
+ 
+        emit OwnershipTransferred(owner, _newOwner);
+        owner = _newOwner;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html b/coverage/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html new file mode 100644 index 000000000..dfa334ef9 --- /dev/null +++ b/coverage/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html @@ -0,0 +1,281 @@ + + + + Code coverage report for libraries/resolver/Lib_ResolvedDelegateProxy.sol + + + + + + + +
+
+

+ all files / libraries/resolver/ Lib_ResolvedDelegateProxy.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 8/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +36× +36× +  +  +  +  +  +  +  +  +  +  +31× +31× +  +  +  +  +31× +  +31× +22× +  +  +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressManager } from "./Lib_AddressManager.sol";
+ 
+/**
+ * @title Lib_ResolvedDelegateProxy
+ */
+contract Lib_ResolvedDelegateProxy {
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+ 
+    // Using mappings to store fields to avoid overwriting storage slots in the
+    // implementation contract. For example, instead of storing these fields at
+    // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.
+    // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html
+    // NOTE: Do not use this code in your own contract system. 
+    //      There is a known flaw in this contract, and we will remove it from the repository
+    //      in the near future. Due to the very limited way that we are using it, this flaw is
+    //      not an issue in our system. 
+    mapping(address=>string) private implementationName;
+    mapping(address=>Lib_AddressManager) private addressManager;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Lib_AddressManager.
+     * @param _implementationName implementationName of the contract to proxy to.
+     */
+    constructor(
+        address _libAddressManager,
+        string memory _implementationName
+    )
+    {
+        addressManager[address(this)] = Lib_AddressManager(_libAddressManager);
+        implementationName[address(this)] = _implementationName;
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        address target = addressManager[address(this)].getAddress((implementationName[address(this)]));
+        Erequire(
+            target != address(0),
+            "Target address must be initialized."
+        );
+ 
+        (bool success, bytes memory returndata) = target.delegatecall(msg.data);
+ 
+        if (success == true) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/resolver/index.html b/coverage/libraries/resolver/index.html new file mode 100644 index 000000000..0b43123ea --- /dev/null +++ b/coverage/libraries/resolver/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for libraries/resolver/ + + + + + + + +
+
+

+ all files libraries/resolver/ +

+
+
+ 75% + Statements + 15/20 +
+
+ 50% + Branches + 4/8 +
+
+ 81.82% + Functions + 9/11 +
+
+ 78.26% + Lines + 18/23 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_AddressManager.sol
100%4/4100%0/0100%3/3100%4/4
Lib_AddressResolver.sol
100%2/2100%0/0100%2/2100%2/2
Lib_Ownable.sol
37.5%3/825%1/450%2/444.44%4/9
Lib_ResolvedDelegateProxy.sol
100%6/675%3/4100%2/2100%8/8
+
+
+ + + + + + + diff --git a/coverage/libraries/rlp/Lib_RLPReader.sol.html b/coverage/libraries/rlp/Lib_RLPReader.sol.html new file mode 100644 index 000000000..490fb050e --- /dev/null +++ b/coverage/libraries/rlp/Lib_RLPReader.sol.html @@ -0,0 +1,1925 @@ + + + + Code coverage report for libraries/rlp/Lib_RLPReader.sol + + + + + + + +
+
+

+ all files / libraries/rlp/ Lib_RLPReader.sol +

+
+
+ 98.68% + Statements + 75/76 +
+
+ 67.5% + Branches + 27/40 +
+
+ 94.74% + Functions + 18/19 +
+
+ 98.8% + Lines + 82/83 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +512× +512× +  +  +  +512× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +450× +  +  +  +  +  +446× +  +  +  +  +  +  +  +  +446× +  +446× +446× +446× +4230× +  +  +  +  +4230× +  +  +  +  +  +  +  +4230× +  +  +  +  +4230× +4230× +  +  +  +446× +  +  +  +446× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +450× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +651× +  +  +  +  +  +651× +  +  +  +  +651× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +68× +  +  +  +  +68× +  +  +  +  +  +68× +  +  +  +  +68× +68× +68× +  +  +  +  +  +  +  +  +68× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +56× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +776× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5399× +  +  +  +  +5395× +5395× +5395× +  +  +  +5395× +  +  +33× +  +  +  +4334× +  +4334× +  +  +  +  +4334× +  +  +536× +  +536× +  +  +  +  +536× +536× +  +  +  +  +  +  +  +536× +  +  +  +  +536× +  +  +89× +  +89× +  +  +  +  +89× +  +  +403× +  +403× +  +  +  +  +403× +403× +  +  +  +  +  +  +  +403× +  +  +  +  +403× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1427× +1427× + +  +  +1426× +1426× +1426× +  +  +  +  +1426× +2634× +  +  +  +2634× +2634× +  +  +  +1426× +1426× +  +  +  +  +  +  +  +  +  +1426× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +776× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_RLPReader
+ * @dev Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).
+ */
+library Lib_RLPReader {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 constant internal MAX_LIST_LENGTH = 32;
+ 
+ 
+    /*********
+     * Enums *
+     *********/
+ 
+    enum RLPItemType {
+        DATA_ITEM,
+        LIST_ITEM
+    }
+ 
+    
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct RLPItem {
+        uint256 length;
+        uint256 ptr;
+    }
+    
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+    
+    /**
+     * Converts bytes to a reference to memory position and length.
+     * @param _in Input bytes to convert.
+     * @return Output memory reference.
+     */
+    function toRLPItem(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem memory
+        )
+    {
+        uint256 ptr;
+        assembly {
+            ptr := add(_in, 32)
+        }
+ 
+        return RLPItem({
+            length: _in.length,
+            ptr: ptr
+        });
+    }
+ 
+    /**
+     * Reads an RLP list value into a list of RLP items.
+     * @param _in RLP list value.
+     * @return Decoded RLP list items.
+     */
+    function readList(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem[] memory
+        )
+    {
+        (
+            uint256 listOffset,
+            ,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.LIST_ITEM,
+            "Invalid RLP list value."
+        );
+ 
+        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by
+        // writing to the length. Since we can't know the number of RLP items without looping over
+        // the entire input, we'd have to loop twice to accurately size this array. It's easier to
+        // simply set a reasonable maximum list length and decrease the size before we finish.
+        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);
+ 
+        uint256 itemCount = 0;
+        uint256 offset = listOffset;
+        while (offset < _in.length) {
+            Erequire(
+                itemCount < MAX_LIST_LENGTH,
+                "Provided RLP list exceeds max list length."
+            );
+ 
+            (
+                uint256 itemOffset,
+                uint256 itemLength,
+            ) = _decodeLength(RLPItem({
+                length: _in.length - offset,
+                ptr: _in.ptr + offset
+            }));
+ 
+            out[itemCount] = RLPItem({
+                length: itemLength + itemOffset,
+                ptr: _in.ptr + offset
+            });
+ 
+            itemCount += 1;
+            offset += itemOffset + itemLength;
+        }
+ 
+        // Decrease the array size to match the actual item count.
+        assembly {
+            mstore(out, itemCount)
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Reads an RLP list value into a list of RLP items.
+     * @param _in RLP list value.
+     * @return Decoded RLP list items.
+     */
+    function readList(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem[] memory
+        )
+    {
+        return readList(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bytes value into bytes.
+     * @param _in RLP bytes value.
+     * @return Decoded bytes.
+     */
+    function readBytes(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        (
+            uint256 itemOffset,
+            uint256 itemLength,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.DATA_ITEM,
+            "Invalid RLP bytes value."
+        );
+ 
+        return _copy(_in.ptr, itemOffset, itemLength);
+    }
+ 
+    /**
+     * Reads an RLP bytes value into bytes.
+     * @param _in RLP bytes value.
+     * @return Decoded bytes.
+     */
+    function readBytes(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return readBytes(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP string value into a string.
+     * @param _in RLP string value.
+     * @return Decoded string.
+     */
+    function readString(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            string memory
+        )
+    {
+        return string(readBytes(_in));
+    }
+ 
+    /**
+     * Reads an RLP string value into a string.
+     * @param _in RLP string value.
+     * @return Decoded string.
+     */
+    function readString(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            string memory
+        )
+    {
+        return readString(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bytes32 value into a bytes32.
+     * @param _in RLP bytes32 value.
+     * @return Decoded bytes32.
+     */
+    function readBytes32(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        Erequire(
+            _in.length <= 33,
+            "Invalid RLP bytes32 value."
+        );
+ 
+        (
+            uint256 itemOffset,
+            uint256 itemLength,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.DATA_ITEM,
+            "Invalid RLP bytes32 value."
+        );
+ 
+        uint256 ptr = _in.ptr + itemOffset;
+        bytes32 out;
+        assembly {
+            out := mload(ptr)
+ 
+            // Shift the bytes over to match the item size.
+            if lt(itemLength, 32) {
+                out := div(out, exp(256, sub(32, itemLength)))
+            }
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Reads an RLP bytes32 value into a bytes32.
+     * @param _in RLP bytes32 value.
+     * @return Decoded bytes32.
+     */
+    function readBytes32(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return readBytes32(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP uint256 value into a uint256.
+     * @param _in RLP uint256 value.
+     * @return Decoded uint256.
+     */
+    function readUint256(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        return uint256(readBytes32(_in));
+    }
+ 
+    /**
+     * Reads an RLP uint256 value into a uint256.
+     * @param _in RLP uint256 value.
+     * @return Decoded uint256.
+     */
+    function readUint256(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        return readUint256(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bool value into a bool.
+     * @param _in RLP bool value.
+     * @return Decoded bool.
+     */
+    function readBool(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        Erequire(
+            _in.length == 1,
+            "Invalid RLP boolean value."
+        );
+ 
+        uint256 ptr = _in.ptr;
+        uint256 out;
+        assembly {
+            out := byte(0, mload(ptr))
+        }
+ 
+        return out != 0;
+    }
+ 
+    /**
+     * Reads an RLP bool value into a bool.
+     * @param _in RLP bool value.
+     * @return Decoded bool.
+     */
+    function readBool(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        return readBool(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP address value into a address.
+     * @param _in RLP address value.
+     * @return Decoded address.
+     */
+    function readAddress(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        if (_in.length == 1) {
+            return address(0);
+        }
+ 
+        Erequire(
+            _in.length == 21,
+            "Invalid RLP address value."
+        );
+ 
+        return address(readUint256(_in));
+    }
+ 
+    /**
+     * Reads an RLP address value into a address.
+     * @param _in RLP address value.
+     * @return Decoded address.
+     */
+    function readAddress(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        return readAddress(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads the raw bytes of an RLP item.
+     * @param _in RLP item to read.
+     * @return Raw RLP bytes.
+     */
+    function readRawBytes(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return _copy(_in);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Decodes the length of an RLP item.
+     * @param _in RLP item to decode.
+     * @return Offset of the encoded data.
+     * @return Length of the encoded data.
+     * @return RLP item type (LIST_ITEM or DATA_ITEM).
+     */
+    function _decodeLength(
+        RLPItem memory _in
+    )
+        private
+        pure
+        returns (
+            uint256,
+            uint256,
+            RLPItemType
+        )
+    {
+        require(
+            _in.length > 0,
+            "RLP item cannot be null."
+        );
+ 
+        uint256 ptr = _in.ptr;
+        uint256 prefix;
+        assembly {
+            prefix := byte(0, mload(ptr))
+        }
+ 
+        if (prefix <= 0x7f) {
+            // Single byte.
+ 
+            return (0, 1, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xb7) {
+            // Short string.
+ 
+            uint256 strLen = prefix - 0x80;
+            
+            Erequire(
+                _in.length > strLen,
+                "Invalid RLP short string."
+            );
+ 
+            return (1, strLen, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xbf) {
+            // Long string.
+            uint256 lenOfStrLen = prefix - 0xb7;
+ 
+            Erequire(
+                _in.length > lenOfStrLen,
+                "Invalid RLP long string length."
+            );
+ 
+            uint256 strLen;
+            assembly {
+                // Pick out the string length.
+                strLen := div(
+                    mload(add(ptr, 1)),
+                    exp(256, sub(32, lenOfStrLen))
+                )
+            }
+ 
+            Erequire(
+                _in.length > lenOfStrLen + strLen,
+                "Invalid RLP long string."
+            );
+ 
+            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xf7) {
+            // Short list.
+            uint256 listLen = prefix - 0xc0;
+ 
+            Erequire(
+                _in.length > listLen,
+                "Invalid RLP short list."
+            );
+ 
+            return (1, listLen, RLPItemType.LIST_ITEM);
+        } else {
+            // Long list.
+            uint256 lenOfListLen = prefix - 0xf7;
+ 
+            Erequire(
+                _in.length > lenOfListLen,
+                "Invalid RLP long list length."
+            );
+ 
+            uint256 listLen;
+            assembly {
+                // Pick out the list length.
+                listLen := div(
+                    mload(add(ptr, 1)),
+                    exp(256, sub(32, lenOfListLen))
+                )
+            }
+ 
+            Erequire(
+                _in.length > lenOfListLen + listLen,
+                "Invalid RLP long list."
+            );
+ 
+            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);
+        }
+    }
+ 
+    /**
+     * Copies the bytes from a memory location.
+     * @param _src Pointer to the location to read from.
+     * @param _offset Offset to start reading from.
+     * @param _length Number of bytes to read.
+     * @return Copied bytes.
+     */
+    function _copy(
+        uint256 _src,
+        uint256 _offset,
+        uint256 _length
+    )
+        private
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes memory out = new bytes(_length);
+        if (out.length == 0) {
+            return out;
+        }
+ 
+        uint256 src = _src + _offset;
+        uint256 dest;
+        assembly {
+            dest := add(out, 32)
+        }
+ 
+        // Copy over as many complete words as we can.
+        for (uint256 i = 0; i < _length / 32; i++) {
+            assembly {
+                mstore(dest, mload(src))
+            }
+ 
+            src += 32;
+            dest += 32;
+        }
+ 
+        // Pick out the remaining bytes.
+        uint256 mask = 256 ** (32 - (_length % 32)) - 1;
+        assembly {
+            mstore(
+                dest,
+                or(
+                    and(mload(src), not(mask)),
+                    and(mload(dest), mask)
+                )
+            )
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Copies an RLP item into bytes.
+     * @param _in RLP item to copy.
+     * @return Copied bytes.
+     */
+    function _copy(
+        RLPItem memory _in
+    )
+        private
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return _copy(_in.ptr, 0, _in.length);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/rlp/Lib_RLPWriter.sol.html b/coverage/libraries/rlp/Lib_RLPWriter.sol.html new file mode 100644 index 000000000..dee20330d --- /dev/null +++ b/coverage/libraries/rlp/Lib_RLPWriter.sol.html @@ -0,0 +1,911 @@ + + + + Code coverage report for libraries/rlp/Lib_RLPWriter.sol + + + + + + + +
+
+

+ all files / libraries/rlp/ Lib_RLPWriter.sol +

+
+
+ 94.55% + Statements + 52/55 +
+
+ 100% + Branches + 8/8 +
+
+ 90% + Functions + 9/10 +
+
+ 95.08% + Lines + 58/61 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +324× +  +324× +16× +  +308× +  +  +324× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +157× +157× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +139× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +465× +  +465× +415× +415× +  +50× +50× +50× +72× +72× +  +  +50× +50× +50× +72× +  +  +  +465× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +  +52× +52× +1643× +24× +  +  +  +52× +52× +45× +  +  +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1030× +1030× +1030× +  +1030× +420× +  +  +420× +420× +  +  +1030× +1030× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +157× + +  +  +149× +149× +149× +1030× +  +  +149× +149× +149× +  +149× +1030× +  +1030× +1030× +  +1030× +1030× +  +  +149× +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+ 
+/**
+ * @title Lib_RLPWriter
+ * @author Bakaoh (with modifications)
+ */
+library Lib_RLPWriter {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * RLP encodes a byte string.
+     * @param _in The byte string to encode.
+     * @return _out The RLP encoded string in bytes.
+     */
+    function writeBytes(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory encoded;
+ 
+        if (_in.length == 1 && uint8(_in[0]) < 128) {
+            encoded = _in;
+        } else {
+            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);
+        }
+ 
+        return encoded;
+    }
+ 
+    /**
+     * RLP encodes a list of RLP encoded byte byte strings.
+     * @param _in The list of RLP encoded byte strings.
+     * @return _out The RLP encoded list of items in bytes.
+     */
+    function writeList(
+        bytes[] memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory list = _flatten(_in);
+        return abi.encodePacked(_writeLength(list.length, 192), list);
+    }
+ 
+    /**
+     * RLP encodes a string.
+     * @param _in The string to encode.
+     * @return _out The RLP encoded string in bytes.
+     */
+    function writeString(
+        string memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(bytes(_in));
+    }
+ 
+    /**
+     * RLP encodes an address.
+     * @param _in The address to encode.
+     * @return _out The RLP encoded address in bytes.
+     */
+    function writeAddress(
+        address _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(abi.encodePacked(_in));
+    }
+ 
+    /**
+     * RLP encodes a uint.
+     * @param _in The uint256 to encode.
+     * @return _out The RLP encoded uint256 in bytes.
+     */
+    function writeUint(
+        uint256 _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(_toBinary(_in));
+    }
+ 
+    /**
+     * RLP encodes a bool.
+     * @param _in The bool to encode.
+     * @return _out The RLP encoded bool in bytes.
+     */
+    function writeBool(
+        bool _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory encoded = new bytes(1);
+        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));
+        return encoded;
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.
+     * @param _len The length of the string or the payload.
+     * @param _offset 128 if item is string, 192 if item is list.
+     * @return _encoded RLP encoded bytes.
+     */
+    function _writeLength(
+        uint256 _len,
+        uint256 _offset
+    )
+        private
+        pure
+        returns (
+            bytes memory _encoded
+        )
+    {
+        bytes memory encoded;
+ 
+        if (_len < 56) {
+            encoded = new bytes(1);
+            encoded[0] = byte(uint8(_len) + uint8(_offset));
+        } else {
+            uint256 lenLen;
+            uint256 i = 1;
+            while (_len / i != 0) {
+                lenLen++;
+                i *= 256;
+            }
+ 
+            encoded = new bytes(lenLen + 1);
+            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);
+            for(i = 1; i <= lenLen; i++) {
+                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));
+            }
+        }
+ 
+        return encoded;
+    }
+ 
+    /**
+     * Encode integer in big endian binary form with no leading zeroes.
+     * @notice TODO: This should be optimized with assembly to save gas costs.
+     * @param _x The integer to encode.
+     * @return _binary RLP encoded bytes.
+     */
+    function _toBinary(
+        uint256 _x
+    )
+        private
+        pure
+        returns (
+            bytes memory _binary
+        )
+    {
+        bytes memory b = abi.encodePacked(_x);
+ 
+        uint256 i = 0;
+        for (; i < 32; i++) {
+            if (b[i] != 0) {
+                break;
+            }
+        }
+ 
+        bytes memory res = new bytes(32 - i);
+        for (uint256 j = 0; j < res.length; j++) {
+            res[j] = b[i++];
+        }
+ 
+        return res;
+    }
+ 
+    /**
+     * Copies a piece of memory to another location.
+     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.
+     * @param _dest Destination location.
+     * @param _src Source location.
+     * @param _len Length of memory to copy.
+     */
+    function _memcpy(
+        uint256 _dest,
+        uint256 _src,
+        uint256 _len
+    )
+        private
+        pure
+    {
+        uint256 dest = _dest;
+        uint256 src = _src;
+        uint256 len = _len;
+ 
+        for(; len >= 32; len -= 32) {
+            assembly {
+                mstore(dest, mload(src))
+            }
+            dest += 32;
+            src += 32;
+        }
+ 
+        uint256 mask = 256 ** (32 - len) - 1;
+        assembly {
+            let srcpart := and(mload(src), not(mask))
+            let destpart := and(mload(dest), mask)
+            mstore(dest, or(destpart, srcpart))
+        }
+    }
+ 
+    /**
+     * Flattens a list of byte strings into one byte string.
+     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.
+     * @param _list List of byte strings to flatten.
+     * @return _flattened The flattened byte string.
+     */
+    function _flatten(
+        bytes[] memory _list
+    )
+        private
+        pure
+        returns (
+            bytes memory _flattened
+        )
+    {
+        if (_list.length == 0) {
+            return new bytes(0);
+        }
+ 
+        uint256 len;
+        uint256 i = 0;
+        for (; i < _list.length; i++) {
+            len += _list[i].length;
+        }
+ 
+        bytes memory flattened = new bytes(len);
+        uint256 flattenedPtr;
+        assembly { flattenedPtr := add(flattened, 0x20) }
+ 
+        for(i = 0; i < _list.length; i++) {
+            bytes memory item = _list[i];
+ 
+            uint256 listPtr;
+            assembly { listPtr := add(item, 0x20)}
+ 
+            _memcpy(flattenedPtr, listPtr, item.length);
+            flattenedPtr += _list[i].length;
+        }
+ 
+        return flattened;
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/libraries/rlp/index.html b/coverage/libraries/rlp/index.html new file mode 100644 index 000000000..bcae97d2c --- /dev/null +++ b/coverage/libraries/rlp/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for libraries/rlp/ + + + + + + + +
+
+

+ all files libraries/rlp/ +

+
+
+ 96.95% + Statements + 127/131 +
+
+ 72.92% + Branches + 35/48 +
+
+ 93.1% + Functions + 27/29 +
+
+ 97.22% + Lines + 140/144 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_RLPReader.sol
98.68%75/7667.5%27/4094.74%18/1998.8%82/83
Lib_RLPWriter.sol
94.55%52/55100%8/890%9/1095.08%58/61
+
+
+ + + + + + + diff --git a/coverage/libraries/standards/IUniswapV2ERC20.sol.html b/coverage/libraries/standards/IUniswapV2ERC20.sol.html new file mode 100644 index 000000000..76e84e00c --- /dev/null +++ b/coverage/libraries/standards/IUniswapV2ERC20.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for libraries/standards/IUniswapV2ERC20.sol + + + + + + + +
+
+

+ all files / libraries/standards/ IUniswapV2ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+interface IUniswapV2ERC20 {
+    event Approval(address indexed owner, address indexed spender, uint value);
+    event Transfer(address indexed from, address indexed to, uint value);
+ 
+    function name() external view returns (string memory);
+    function symbol() external view returns (string memory);
+    function decimals() external view returns (uint8);
+    function totalSupply() external view returns (uint);
+    function balanceOf(address owner) external view returns (uint);
+    function allowance(address owner, address spender) external view returns (uint);
+ 
+    function approve(address spender, uint value) external returns (bool);
+    function transfer(address to, uint value) external returns (bool);
+    function transferFrom(address from, address to, uint value) external returns (bool);
+ 
+    function DOMAIN_SEPARATOR() external view returns (bytes32);
+    function PERMIT_TYPEHASH() external pure returns (bytes32);
+    function nonces(address owner) external view returns (uint);
+ 
+    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/standards/UniSafeMath.sol.html b/coverage/libraries/standards/UniSafeMath.sol.html new file mode 100644 index 000000000..72011637e --- /dev/null +++ b/coverage/libraries/standards/UniSafeMath.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for libraries/standards/UniSafeMath.sol + + + + + + + +
+
+

+ all files / libraries/standards/ UniSafeMath.sol +

+
+
+ 66.67% + Statements + 2/3 +
+
+ 33.33% + Branches + 2/6 +
+
+ 66.67% + Functions + 2/3 +
+
+ 66.67% + Lines + 2/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  + +  +  +  +10× +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
+ 
+library UniSafeMath {
+    function add(uint x, uint y) internal pure returns (uint z) {
+        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
+    }
+ 
+    function sub(uint x, uint y) internal pure returns (uint z) {
+        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
+    }
+ 
+    function mul(uint x, uint y) internal pure returns (uint z) {
+        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/standards/UniswapV2ERC20.sol.html b/coverage/libraries/standards/UniswapV2ERC20.sol.html new file mode 100644 index 000000000..a80601a95 --- /dev/null +++ b/coverage/libraries/standards/UniswapV2ERC20.sol.html @@ -0,0 +1,359 @@ + + + + Code coverage report for libraries/standards/UniswapV2ERC20.sol + + + + + + + +
+
+

+ all files / libraries/standards/ UniswapV2ERC20.sol +

+
+
+ 82.14% + Statements + 23/28 +
+
+ 16.67% + Branches + 1/6 +
+
+ 88.89% + Functions + 8/9 +
+
+ 82.76% + Lines + 24/29 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +39× +39× +  +39× +39× +  +  +39× +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  + + + +  +  +  + + +  +  +  + + + +  +  +  + + +  +  +  + + +  +  +  + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+import './IUniswapV2ERC20.sol';
+import './UniSafeMath.sol';
+ 
+contract UniswapV2ERC20 is IUniswapV2ERC20 {
+    using UniSafeMath for uint;
+ 
+    string public override name;
+    string public override symbol;
+    uint8 public constant override decimals = 18;
+    uint public override totalSupply;
+    mapping(address => uint) public override balanceOf;
+    mapping(address => mapping(address => uint)) public override allowance;
+ 
+    bytes32 public override DOMAIN_SEPARATOR;
+    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
+    bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
+    mapping(address => uint) public override nonces;
+ 
+    constructor(
+    string memory _name,
+        string memory _symbol
+    ) {
+        name = _name;
+        symbol = _symbol;
+ 
+        uint chainId;
+        assembly {
+            chainId := chainid()
+        }
+        DOMAIN_SEPARATOR = keccak256(
+            abi.encode(
+                keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
+                keccak256(bytes(name)),
+                keccak256(bytes('1')),
+                chainId,
+                address(this)
+            )
+        );
+    }
+ 
+    function _mint(address to, uint value) internal {
+        totalSupply = totalSupply.add(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(address(0), to, value);
+    }
+ 
+    function _burn(address from, uint value) internal {
+        balanceOf[from] = balanceOf[from].sub(value);
+        totalSupply = totalSupply.sub(value);
+        emit Transfer(from, address(0), value);
+    }
+ 
+    function _approve(address owner, address spender, uint value) private {
+        allowance[owner][spender] = value;
+        emit Approval(owner, spender, value);
+    }
+ 
+    function _transfer(address from, address to, uint value) private {
+        balanceOf[from] = balanceOf[from].sub(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(from, to, value);
+    }
+ 
+    function approve(address spender, uint value) external override returns (bool) {
+        _approve(msg.sender, spender, value);
+        return true;
+    }
+ 
+    function transfer(address to, uint value) external override returns (bool) {
+        _transfer(msg.sender, to, value);
+        return true;
+    }
+ 
+    function transferFrom(address from, address to, uint value) external override returns (bool) {
+        Eif (allowance[from][msg.sender] != uint(-1)) {
+            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
+        }
+        _transfer(from, to, value);
+        return true;
+    }
+ 
+    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override {
+        require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
+        bytes32 digest = keccak256(
+            abi.encodePacked(
+                '\x19\x01',
+                DOMAIN_SEPARATOR,
+                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
+            )
+        );
+        address recoveredAddress = ecrecover(digest, v, r, s);
+        require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
+        _approve(owner, spender, value);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/standards/index.html b/coverage/libraries/standards/index.html new file mode 100644 index 000000000..220cb4426 --- /dev/null +++ b/coverage/libraries/standards/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for libraries/standards/ + + + + + + + +
+
+

+ all files libraries/standards/ +

+
+
+ 80.65% + Statements + 25/31 +
+
+ 25% + Branches + 3/12 +
+
+ 83.33% + Functions + 10/12 +
+
+ 81.25% + Lines + 26/32 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
IUniswapV2ERC20.sol
100%0/0100%0/0100%0/0100%0/0
UniSafeMath.sol
66.67%2/333.33%2/666.67%2/366.67%2/3
UniswapV2ERC20.sol
82.14%23/2816.67%1/688.89%8/982.76%24/29
+
+
+ + + + + + + diff --git a/coverage/libraries/trie/Lib_MerkleTrie.sol.html b/coverage/libraries/trie/Lib_MerkleTrie.sol.html new file mode 100644 index 000000000..cfc1241f8 --- /dev/null +++ b/coverage/libraries/trie/Lib_MerkleTrie.sol.html @@ -0,0 +1,2945 @@ + + + + Code coverage report for libraries/trie/Lib_MerkleTrie.sol + + + + + + + +
+
+

+ all files / libraries/trie/ Lib_MerkleTrie.sol +

+
+
+ 72.45% + Statements + 142/196 +
+
+ 55.88% + Branches + 38/68 +
+
+ 84.62% + Functions + 22/26 +
+
+ 72.02% + Lines + 139/193 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +22× +22× +22× +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +77× +73× +  +58× +  +58× +  +  +  +  +58× +  +58× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +95× +95× +  +95× +95× +95× +95× +  +  +95× +243× +243× +  +  +  +243× +  +243× +  +95× +  +  +  +  +  +148× +  +  +  +  +  +  +  +  +  +  +  +229× +147× +  +  +  +  +  +147× +147× +147× +147× +147× +  +  +82× +82× +82× +82× +82× +82× +  +82× +80× +  +  +  +  +  +73× +  +  +  +80× +80× +  + +  +  +  +  +  +  +  + + + +  +  + +  +  +  +  +  +  +  +80× +80× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +22× +  +  +  +  +  +22× +22× +  +22× +  +  +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +22× +22× +  +  +22× +  +65× +65× +  +65× +  +  +22× +22× +  +  + + +  +  +  + +  + +  +  +  +  +42× +  +42× +42× +42× +  +  +  +  +65× +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +99× +95× +  +95× +265× +265× +  +  +  +  +  +95× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +148× +  +148× +  +  +  +  +148× +  +  +148× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +172× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +51× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +65× +  +  +65× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +87× +42× +  +45× +45× +  +45× +44× +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +82× +82× +4991× +  +82× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +65× +  +65× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +714× +  +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +22× +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +23× +23× +23× +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +26× +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +43× +  +  +  +22× +22× +  +  +22× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+ 
+/**
+ * @title Lib_MerkleTrie
+ */
+library Lib_MerkleTrie {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum NodeType {
+        BranchNode,
+        ExtensionNode,
+        LeafNode
+    }
+ 
+    struct TrieNode {
+        bytes encoded;
+        Lib_RLPReader.RLPItem[] decoded;
+    }
+ 
+ 
+    /**********************
+     * Contract Constants *
+     **********************/
+ 
+    // TREE_RADIX determines the number of elements per branch node.
+    uint256 constant TREE_RADIX = 16;
+    // Branch nodes have TREE_RADIX elements plus an additional `value` slot.
+    uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;
+    // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.
+    uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;
+ 
+    // Prefixes are prepended to the `path` within a leaf or extension node and
+    // allow us to differentiate between the two node types. `ODD` or `EVEN` is
+    // determined by the number of nibbles within the unprefixed `path`. If the
+    // number of nibbles if even, we need to insert an extra padding nibble so
+    // the resulting prefixed `path` has an even number of nibbles.
+    uint8 constant PREFIX_EXTENSION_EVEN = 0;
+    uint8 constant PREFIX_EXTENSION_ODD = 1;
+    uint8 constant PREFIX_LEAF_EVEN = 2;
+    uint8 constant PREFIX_LEAF_ODD = 3;
+ 
+    // Just a utility constant. RLP represents `NULL` as 0x80.
+    bytes1 constant RLP_NULL = bytes1(0x80);
+    bytes constant RLP_NULL_BYTES = hex'80';
+    bytes32 constant internal KECCAK256_RLP_NULL_BYTES = keccak256(RLP_NULL_BYTES);
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Verifies a proof that a given key/value pair is present in the
+     * Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _value Value of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
+     * traditional Merkle trees, this proof is executed top-down and consists
+     * of a list of RLP-encoded nodes that make a path down to the target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
+     */
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        (
+            bool exists,
+            bytes memory value
+        ) = get(_key, _proof, _root);
+ 
+        return (
+            exists && Lib_BytesUtils.equal(_value, value)
+        );
+    }
+ 
+    /**
+     * @notice Verifies a proof that a given key is *not* present in
+     * the Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the key is absent in the trie, `false` otherwise.
+     */
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        (
+            bool exists,
+        ) = get(_key, _proof, _root);
+ 
+        return exists == false;
+    }
+ 
+    /**
+     * @notice Updates a Merkle trie and returns a new root hash.
+     * @param _key Key of the node to update, as a hex string.
+     * @param _value Value of the node to update, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node. If the key exists, we can simply update the value.
+     * Otherwise, we need to modify the trie to handle the new k/v pair.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _updatedRoot Root hash of the newly constructed trie.
+     */
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        // Special case when inserting the very first node.
+        Iif (_root == KECCAK256_RLP_NULL_BYTES) {
+            return getSingleNodeRootHash(_key, _value);
+        }
+ 
+        TrieNode[] memory proof = _parseProof(_proof);
+        (uint256 pathLength, bytes memory keyRemainder, ) = _walkNodePath(proof, _key, _root);
+        TrieNode[] memory newPath = _getNewPath(proof, pathLength, keyRemainder, _value);
+ 
+        return _getUpdatedTrieRoot(newPath, _key);
+    }
+ 
+    /**
+     * @notice Retrieves the value associated with a given key.
+     * @param _key Key to search for, as hex bytes.
+     * @param _proof Merkle trie inclusion proof for the key.
+     * @param _root Known root of the Merkle trie.
+     * @return _exists Whether or not the key exists.
+     * @return _value Value of the key if it exists.
+     */
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _exists,
+            bytes memory _value
+        )
+    {
+        TrieNode[] memory proof = _parseProof(_proof);
+        (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(proof, _key, _root);
+ 
+        bool exists = keyRemainder.length == 0;
+ 
+        Erequire(
+            exists || isFinalNode,
+            "Provided proof is invalid."
+        );
+ 
+        bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes('');
+ 
+        return (
+            exists,
+            value
+        );
+    }
+ 
+    /**
+     * Computes the root hash for a trie with a single node.
+     * @param _key Key for the single node.
+     * @param _value Value for the single node.
+     * @return _updatedRoot Hash of the trie.
+     */
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        return keccak256(_makeLeafNode(
+            Lib_BytesUtils.toNibbles(_key),
+            _value
+        ).encoded);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * @notice Walks through a proof using a provided key.
+     * @param _proof Inclusion proof to walk through.
+     * @param _key Key to use for the walk.
+     * @param _root Known root of the trie.
+     * @return _pathLength Length of the final path
+     * @return _keyRemainder Portion of the key remaining after the walk.
+     * @return _isFinalNode Whether or not we've hit a dead end.
+     */
+    function _walkNodePath(
+        TrieNode[] memory _proof,
+        bytes memory _key,
+        bytes32 _root
+    )
+        private
+        pure
+        returns (
+            uint256 _pathLength,
+            bytes memory _keyRemainder,
+            bool _isFinalNode
+        )
+    {
+        uint256 pathLength = 0;
+        bytes memory key = Lib_BytesUtils.toNibbles(_key);
+ 
+        bytes32 currentNodeID = _root;
+        uint256 currentKeyIndex = 0;
+        uint256 currentKeyIncrement = 0;
+        TrieNode memory currentNode;
+ 
+        // Proof is top-down, so we start at the first element (root).
+        for (uint256 i = 0; i < _proof.length; i++) {
+            currentNode = _proof[i];
+            currentKeyIndex += currentKeyIncrement;
+ 
+            // Keep track of the proof elements we actually need.
+            // It's expensive to resize arrays, so this simply reduces gas costs.
+            pathLength += 1;
+ 
+            if (currentKeyIndex == 0) {
+                // First proof element is always the root node.
+                require(
+                    keccak256(currentNode.encoded) == currentNodeID,
+                    "Invalid root hash"
+                );
+            } else Eif (currentNode.encoded.length >= 32) {
+                // Nodes 32 bytes or larger are hashed inside branch nodes.
+                require(
+                    keccak256(currentNode.encoded) == currentNodeID,
+                    "Invalid large internal hash"
+                );
+            } else {
+                // Nodes smaller than 31 bytes aren't hashed.
+                require(
+                    Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
+                    "Invalid internal node hash"
+                );
+            }
+ 
+            if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {
+                Iif (currentKeyIndex == key.length) {
+                    // We've hit the end of the key, meaning the value should be within this branch node.
+                    break;
+                } else {
+                    // We're not at the end of the key yet.
+                    // Figure out what the next node ID should be and continue.
+                    uint8 branchKey = uint8(key[currentKeyIndex]);
+                    Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
+                    currentNodeID = _getNodeID(nextNode);
+                    currentKeyIncrement = 1;
+                    continue;
+                }
+            } else Eif (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
+                bytes memory path = _getNodePath(currentNode);
+                uint8 prefix = uint8(path[0]);
+                uint8 offset = 2 - prefix % 2;
+                bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);
+                bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);
+                uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
+ 
+                if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
+                    if (
+                        pathRemainder.length == sharedNibbleLength &&
+                        keyRemainder.length == sharedNibbleLength
+                    ) {
+                        // The key within this leaf matches our key exactly.
+                        // Increment the key index to reflect that we have no remainder.
+                        currentKeyIndex += sharedNibbleLength;
+                    }
+ 
+                    // We've hit a leaf node, so our next node should be NULL.
+                    currentNodeID = bytes32(RLP_NULL);
+                    break;
+                } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
+                    Iif (sharedNibbleLength == 0) {
+                        // Our extension node doesn't share any part of our key.
+                        // We've hit the end of this path, updates will need to modify this extension.
+                        currentNodeID = bytes32(RLP_NULL);
+                        break;
+                    } else {
+                        // Our extension shares some nibbles.
+                        // Carry on to the next node.
+                        currentNodeID = _getNodeID(currentNode.decoded[1]);
+                        currentKeyIncrement = sharedNibbleLength;
+                        continue;
+                    }
+                } else {
+                    revert("Received a node with an unknown prefix");
+                }
+            } else {
+                revert("Received an unparseable node.");
+            }
+        }
+ 
+        // If our node ID is NULL, then we're at a dead end.
+        bool isFinalNode = currentNodeID == bytes32(RLP_NULL);
+        return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);
+    }
+ 
+    /**
+     * @notice Creates new nodes to support a k/v pair insertion into a given
+     * Merkle trie path.
+     * @param _path Path to the node nearest the k/v pair.
+     * @param _pathLength Length of the path. Necessary because the provided
+     * path may include additional nodes (e.g., it comes directly from a proof)
+     * and we can't resize in-memory arrays without costly duplication.
+     * @param _keyRemainder Portion of the initial key that must be inserted
+     * into the trie.
+     * @param _value Value to insert at the given key.
+     * @return _newPath A new path with the inserted k/v pair and extra supporting nodes.
+     */
+    function _getNewPath(
+        TrieNode[] memory _path,
+        uint256 _pathLength,
+        bytes memory _keyRemainder,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _newPath
+        )
+    {
+        bytes memory keyRemainder = _keyRemainder;
+ 
+        // Most of our logic depends on the status of the last node in the path.
+        TrieNode memory lastNode = _path[_pathLength - 1];
+        NodeType lastNodeType = _getNodeType(lastNode);
+ 
+        // Create an array for newly created nodes.
+        // We need up to three new nodes, depending on the contents of the last node.
+        // Since array resizing is expensive, we'll keep track of the size manually.
+        // We're using an explicit `totalNewNodes += 1` after insertions for clarity.
+        TrieNode[] memory newNodes = new TrieNode[](3);
+        uint256 totalNewNodes = 0;
+ 
+        Eif (keyRemainder.length == 0 && lastNodeType == NodeType.LeafNode) {
+            // We've found a leaf node with the given key.
+            // Simply need to update the value of the node to match.
+            newNodes[totalNewNodes] = _makeLeafNode(_getNodeKey(lastNode), _value);
+            totalNewNodes += 1;
+        } else if (lastNodeType == NodeType.BranchNode) {
+            if (keyRemainder.length == 0) {
+                // We've found a branch node with the given key.
+                // Simply need to update the value of the node to match.
+                newNodes[totalNewNodes] = _editBranchValue(lastNode, _value);
+                totalNewNodes += 1;
+            } else {
+                // We've found a branch node, but it doesn't contain our key.
+                // Reinsert the old branch for now.
+                newNodes[totalNewNodes] = lastNode;
+                totalNewNodes += 1;
+                // Create a new leaf node, slicing our remainder since the first byte points
+                // to our branch node.
+                newNodes[totalNewNodes] = _makeLeafNode(Lib_BytesUtils.slice(keyRemainder, 1), _value);
+                totalNewNodes += 1;
+            }
+        } else {
+            // Our last node is either an extension node or a leaf node with a different key.
+            bytes memory lastNodeKey = _getNodeKey(lastNode);
+            uint256 sharedNibbleLength = _getSharedNibbleLength(lastNodeKey, keyRemainder);
+ 
+            if (sharedNibbleLength != 0) {
+                // We've got some shared nibbles between the last node and our key remainder.
+                // We'll need to insert an extension node that covers these shared nibbles.
+                bytes memory nextNodeKey = Lib_BytesUtils.slice(lastNodeKey, 0, sharedNibbleLength);
+                newNodes[totalNewNodes] = _makeExtensionNode(nextNodeKey, _getNodeHash(_value));
+                totalNewNodes += 1;
+ 
+                // Cut down the keys since we've just covered these shared nibbles.
+                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, sharedNibbleLength);
+                keyRemainder = Lib_BytesUtils.slice(keyRemainder, sharedNibbleLength);
+            }
+ 
+            // Create an empty branch to fill in.
+            TrieNode memory newBranch = _makeEmptyBranchNode();
+ 
+            if (lastNodeKey.length == 0) {
+                // Key remainder was larger than the key for our last node.
+                // The value within our last node is therefore going to be shifted into
+                // a branch value slot.
+                newBranch = _editBranchValue(newBranch, _getNodeValue(lastNode));
+            } else {
+                // Last node key was larger than the key remainder.
+                // We're going to modify some index of our branch.
+                uint8 branchKey = uint8(lastNodeKey[0]);
+                // Move on to the next nibble.
+                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, 1);
+ 
+                if (lastNodeType == NodeType.LeafNode) {
+                    // We're dealing with a leaf node.
+                    // We'll modify the key and insert the old leaf node into the branch index.
+                    TrieNode memory modifiedLastNode = _makeLeafNode(lastNodeKey, _getNodeValue(lastNode));
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
+                } else if (lastNodeKey.length != 0) {
+                    // We're dealing with a shrinking extension node.
+                    // We need to modify the node to decrease the size of the key.
+                    TrieNode memory modifiedLastNode = _makeExtensionNode(lastNodeKey, _getNodeValue(lastNode));
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
+                } else {
+                    // We're dealing with an unnecessary extension node.
+                    // We're going to delete the node entirely.
+                    // Simply insert its current value into the branch index.
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeValue(lastNode));
+                }
+            }
+ 
+            if (keyRemainder.length == 0) {
+                // We've got nothing left in the key remainder.
+                // Simply insert the value into the branch value slot.
+                newBranch = _editBranchValue(newBranch, _value);
+                // Push the branch into the list of new nodes.
+                newNodes[totalNewNodes] = newBranch;
+                totalNewNodes += 1;
+            } else {
+                // We've got some key remainder to work with.
+                // We'll be inserting a leaf node into the trie.
+                // First, move on to the next nibble.
+                keyRemainder = Lib_BytesUtils.slice(keyRemainder, 1);
+                // Push the branch into the list of new nodes.
+                newNodes[totalNewNodes] = newBranch;
+                totalNewNodes += 1;
+                // Push a new leaf node for our k/v pair.
+                newNodes[totalNewNodes] = _makeLeafNode(keyRemainder, _value);
+                totalNewNodes += 1;
+            }
+        }
+ 
+        // Finally, join the old path with our newly created nodes.
+        // Since we're overwriting the last node in the path, we use `_pathLength - 1`.
+        return _joinNodeArrays(_path, _pathLength - 1, newNodes, totalNewNodes);
+    }
+ 
+    /**
+     * @notice Computes the trie root from a given path.
+     * @param _nodes Path to some k/v pair.
+     * @param _key Key for the k/v pair.
+     * @return _updatedRoot Root hash for the updated trie.
+     */
+    function _getUpdatedTrieRoot(
+        TrieNode[] memory _nodes,
+        bytes memory _key
+    )
+        private
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = Lib_BytesUtils.toNibbles(_key);
+ 
+        // Some variables to keep track of during iteration.
+        TrieNode memory currentNode;
+        NodeType currentNodeType;
+        bytes memory previousNodeHash;
+ 
+        // Run through the path backwards to rebuild our root hash.
+        for (uint256 i = _nodes.length; i > 0; i--) {
+            // Pick out the current node.
+            currentNode = _nodes[i - 1];
+            currentNodeType = _getNodeType(currentNode);
+ 
+            if (currentNodeType == NodeType.LeafNode) {
+                // Leaf nodes are already correctly encoded.
+                // Shift the key over to account for the nodes key.
+                bytes memory nodeKey = _getNodeKey(currentNode);
+                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
+            } else if (currentNodeType == NodeType.ExtensionNode) {
+                // Shift the key over to account for the nodes key.
+                bytes memory nodeKey = _getNodeKey(currentNode);
+                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
+ 
+                // If this node is the last element in the path, it'll be correctly encoded
+                // and we can skip this part.
+                Eif (previousNodeHash.length > 0) {
+                    // Re-encode the node based on the previous node.
+                    currentNode = _makeExtensionNode(nodeKey, previousNodeHash);
+                }
+            } else Eif (currentNodeType == NodeType.BranchNode) {
+                // If this node is the last element in the path, it'll be correctly encoded
+                // and we can skip this part.
+                Eif (previousNodeHash.length > 0) {
+                    // Re-encode the node based on the previous node.
+                    uint8 branchKey = uint8(key[key.length - 1]);
+                    key = Lib_BytesUtils.slice(key, 0, key.length - 1);
+                    currentNode = _editBranchIndex(currentNode, branchKey, previousNodeHash);
+                }
+            }
+ 
+            // Compute the node hash for the next iteration.
+            previousNodeHash = _getNodeHash(currentNode.encoded);
+        }
+ 
+        // Current node should be the root at this point.
+        // Simply return the hash of its encoding.
+        return keccak256(currentNode.encoded);
+    }
+ 
+    /**
+     * @notice Parses an RLP-encoded proof into something more useful.
+     * @param _proof RLP-encoded proof to parse.
+     * @return _parsed Proof parsed into easily accessible structs.
+     */
+    function _parseProof(
+        bytes memory _proof
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _parsed
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);
+        TrieNode[] memory proof = new TrieNode[](nodes.length);
+ 
+        for (uint256 i = 0; i < nodes.length; i++) {
+            bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);
+            proof[i] = TrieNode({
+                encoded: encoded,
+                decoded: Lib_RLPReader.readList(encoded)
+            });
+        }
+ 
+        return proof;
+    }
+ 
+    /**
+     * @notice Picks out the ID for a node. Node ID is referred to as the
+     * "hash" within the specification, but nodes < 32 bytes are not actually
+     * hashed.
+     * @param _node Node to pull an ID for.
+     * @return _nodeID ID for the node, depending on the size of its contents.
+     */
+    function _getNodeID(
+        Lib_RLPReader.RLPItem memory _node
+    )
+        private
+        pure
+        returns (
+            bytes32 _nodeID
+        )
+    {
+        bytes memory nodeID;
+ 
+        Iif (_node.length < 32) {
+            // Nodes smaller than 32 bytes are RLP encoded.
+            nodeID = Lib_RLPReader.readRawBytes(_node);
+        } else {
+            // Nodes 32 bytes or larger are hashed.
+            nodeID = Lib_RLPReader.readBytes(_node);
+        }
+ 
+        return Lib_BytesUtils.toBytes32(nodeID);
+    }
+ 
+    /**
+     * @notice Gets the path for a leaf or extension node.
+     * @param _node Node to get a path for.
+     * @return _path Node path, converted to an array of nibbles.
+     */
+    function _getNodePath(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _path
+        )
+    {
+        return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));
+    }
+ 
+    /**
+     * @notice Gets the key for a leaf or extension node. Keys are essentially
+     * just paths without any prefix.
+     * @param _node Node to get a key for.
+     * @return _key Node key, converted to an array of nibbles.
+     */
+    function _getNodeKey(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _key
+        )
+    {
+        return _removeHexPrefix(_getNodePath(_node));
+    }
+ 
+    /**
+     * @notice Gets the path for a node.
+     * @param _node Node to get a value for.
+     * @return _value Node value, as hex bytes.
+     */
+    function _getNodeValue(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _value
+        )
+    {
+        return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
+    }
+ 
+    /**
+     * @notice Computes the node hash for an encoded node. Nodes < 32 bytes
+     * are not hashed, all others are keccak256 hashed.
+     * @param _encoded Encoded node to hash.
+     * @return _hash Hash of the encoded node. Simply the input if < 32 bytes.
+     */
+    function _getNodeHash(
+        bytes memory _encoded
+    )
+        private
+        pure
+        returns (
+            bytes memory _hash
+        )
+    {
+        Iif (_encoded.length < 32) {
+            return _encoded;
+        } else {
+            return abi.encodePacked(keccak256(_encoded));
+        }
+    }
+ 
+    /**
+     * @notice Determines the type for a given node.
+     * @param _node Node to determine a type for.
+     * @return _type Type of the node; BranchNode/ExtensionNode/LeafNode.
+     */
+    function _getNodeType(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            NodeType _type
+        )
+    {
+        if (_node.decoded.length == BRANCH_NODE_LENGTH) {
+            return NodeType.BranchNode;
+        } else Eif (_node.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
+            bytes memory path = _getNodePath(_node);
+            uint8 prefix = uint8(path[0]);
+ 
+            if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
+                return NodeType.LeafNode;
+            } else Eif (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
+                return NodeType.ExtensionNode;
+            }
+        }
+ 
+        revert("Invalid node type");
+    }
+ 
+    /**
+     * @notice Utility; determines the number of nibbles shared between two
+     * nibble arrays.
+     * @param _a First nibble array.
+     * @param _b Second nibble array.
+     * @return _shared Number of shared nibbles.
+     */
+    function _getSharedNibbleLength(
+        bytes memory _a,
+        bytes memory _b
+    )
+        private
+        pure
+        returns (
+            uint256 _shared
+        )
+    {
+        uint256 i = 0;
+        while (_a.length > i && _b.length > i && _a[i] == _b[i]) {
+            i++;
+        }
+        return i;
+    }
+ 
+    /**
+     * @notice Utility; converts an RLP-encoded node into our nice struct.
+     * @param _raw RLP-encoded node to convert.
+     * @return _node Node as a TrieNode struct.
+     */
+    function _makeNode(
+        bytes[] memory _raw
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes memory encoded = Lib_RLPWriter.writeList(_raw);
+ 
+        return TrieNode({
+            encoded: encoded,
+            decoded: Lib_RLPReader.readList(encoded)
+        });
+    }
+ 
+    /**
+     * @notice Utility; converts an RLP-decoded node into our nice struct.
+     * @param _items RLP-decoded node to convert.
+     * @return _node Node as a TrieNode struct.
+     */
+    function _makeNode(
+        Lib_RLPReader.RLPItem[] memory _items
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](_items.length);
+        for (uint256 i = 0; i < _items.length; i++) {
+            raw[i] = Lib_RLPReader.readRawBytes(_items[i]);
+        }
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates a new extension node.
+     * @param _key Key for the extension node, unprefixed.
+     * @param _value Value for the extension node.
+     * @return _node New extension node with the given k/v pair.
+     */
+    function _makeExtensionNode(
+        bytes memory _key,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](2);
+        bytes memory key = _addHexPrefix(_key, false);
+        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
+        raw[1] = Lib_RLPWriter.writeBytes(_value);
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates a new leaf node.
+     * @dev This function is essentially identical to `_makeExtensionNode`.
+     * Although we could route both to a single method with a flag, it's
+     * more gas efficient to keep them separate and duplicate the logic.
+     * @param _key Key for the leaf node, unprefixed.
+     * @param _value Value for the leaf node.
+     * @return _node New leaf node with the given k/v pair.
+     */
+    function _makeLeafNode(
+        bytes memory _key,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](2);
+        bytes memory key = _addHexPrefix(_key, true);
+        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
+        raw[1] = Lib_RLPWriter.writeBytes(_value);
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates an empty branch node.
+     * @return _node Empty branch node as a TrieNode struct.
+     */
+    function _makeEmptyBranchNode()
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](BRANCH_NODE_LENGTH);
+        for (uint256 i = 0; i < raw.length; i++) {
+            raw[i] = RLP_NULL_BYTES;
+        }
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Modifies the value slot for a given branch.
+     * @param _branch Branch node to modify.
+     * @param _value Value to insert into the branch.
+     * @return _updatedNode Modified branch node.
+     */
+    function _editBranchValue(
+        TrieNode memory _branch,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _updatedNode
+        )
+    {
+        bytes memory encoded = Lib_RLPWriter.writeBytes(_value);
+        _branch.decoded[_branch.decoded.length - 1] = Lib_RLPReader.toRLPItem(encoded);
+        return _makeNode(_branch.decoded);
+    }
+ 
+    /**
+     * @notice Modifies a slot at an index for a given branch.
+     * @param _branch Branch node to modify.
+     * @param _index Slot index to modify.
+     * @param _value Value to insert into the slot.
+     * @return _updatedNode Modified branch node.
+     */
+    function _editBranchIndex(
+        TrieNode memory _branch,
+        uint8 _index,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _updatedNode
+        )
+    {
+        bytes memory encoded = _value.length < 32 ? _value : Lib_RLPWriter.writeBytes(_value);
+        _branch.decoded[_index] = Lib_RLPReader.toRLPItem(encoded);
+        return _makeNode(_branch.decoded);
+    }
+ 
+    /**
+     * @notice Utility; adds a prefix to a key.
+     * @param _key Key to prefix.
+     * @param _isLeaf Whether or not the key belongs to a leaf.
+     * @return _prefixedKey Prefixed key.
+     */
+    function _addHexPrefix(
+        bytes memory _key,
+        bool _isLeaf
+    )
+        private
+        pure
+        returns (
+            bytes memory _prefixedKey
+        )
+    {
+        uint8 prefix = _isLeaf ? uint8(0x02) : uint8(0x00);
+        uint8 offset = uint8(_key.length % 2);
+        bytes memory prefixed = new bytes(2 - offset);
+        prefixed[0] = bytes1(prefix + offset);
+        return abi.encodePacked(prefixed, _key);
+    }
+ 
+    /**
+     * @notice Utility; removes a prefix from a path.
+     * @param _path Path to remove the prefix from.
+     * @return _unprefixedKey Unprefixed key.
+     */
+    function _removeHexPrefix(
+        bytes memory _path
+    )
+        private
+        pure
+        returns (
+            bytes memory _unprefixedKey
+        )
+    {
+        if (uint8(_path[0]) % 2 == 0) {
+            return Lib_BytesUtils.slice(_path, 2);
+        } else {
+            return Lib_BytesUtils.slice(_path, 1);
+        }
+    }
+ 
+    /**
+     * @notice Utility; combines two node arrays. Array lengths are required
+     * because the actual lengths may be longer than the filled lengths.
+     * Array resizing is extremely costly and should be avoided.
+     * @param _a First array to join.
+     * @param _aLength Length of the first array.
+     * @param _b Second array to join.
+     * @param _bLength Length of the second array.
+     * @return _joined Combined node array.
+     */
+    function _joinNodeArrays(
+        TrieNode[] memory _a,
+        uint256 _aLength,
+        TrieNode[] memory _b,
+        uint256 _bLength
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _joined
+        )
+    {
+        TrieNode[] memory ret = new TrieNode[](_aLength + _bLength);
+ 
+        // Copy elements from the first array.
+        for (uint256 i = 0; i < _aLength; i++) {
+            ret[i] = _a[i];
+        }
+ 
+        // Copy elements from the second array.
+        for (uint256 i = 0; i < _bLength; i++) {
+            ret[i + _aLength] = _b[i];
+        }
+ 
+        return ret;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/trie/Lib_SecureMerkleTrie.sol.html b/coverage/libraries/trie/Lib_SecureMerkleTrie.sol.html new file mode 100644 index 000000000..14a776a75 --- /dev/null +++ b/coverage/libraries/trie/Lib_SecureMerkleTrie.sol.html @@ -0,0 +1,548 @@ + + + + Code coverage report for libraries/trie/Lib_SecureMerkleTrie.sol + + + + + + + +
+
+

+ all files / libraries/trie/ Lib_SecureMerkleTrie.sol +

+
+
+ 63.64% + Statements + 7/11 +
+
+ 100% + Branches + 0/0 +
+
+ 66.67% + Functions + 4/6 +
+
+ 63.64% + Lines + 7/11 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +47× +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_MerkleTrie } from "./Lib_MerkleTrie.sol";
+ 
+/**
+ * @title Lib_SecureMerkleTrie
+ */
+library Lib_SecureMerkleTrie {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Verifies a proof that a given key/value pair is present in the
+     * Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _value Value of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
+     * traditional Merkle trees, this proof is executed top-down and consists
+     * of a list of RLP-encoded nodes that make a path down to the target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
+     */
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
+    }
+ 
+    /**
+     * @notice Verifies a proof that a given key is *not* present in
+     * the Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the key is not present in the trie, `false` otherwise.
+     */
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.verifyExclusionProof(key, _proof, _root);
+    }
+ 
+    /**
+     * @notice Updates a Merkle trie and returns a new root hash.
+     * @param _key Key of the node to update, as a hex string.
+     * @param _value Value of the node to update, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node. If the key exists, we can simply update the value.
+     * Otherwise, we need to modify the trie to handle the new k/v pair.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _updatedRoot Root hash of the newly constructed trie.
+     */
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.update(key, _value, _proof, _root);
+    }
+ 
+    /**
+     * @notice Retrieves the value associated with a given key.
+     * @param _key Key to search for, as hex bytes.
+     * @param _proof Merkle trie inclusion proof for the key.
+     * @param _root Known root of the Merkle trie.
+     * @return _exists Whether or not the key exists.
+     * @return _value Value of the key if it exists.
+     */
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _exists,
+            bytes memory _value
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.get(key, _proof, _root);
+    }
+ 
+    /**
+     * Computes the root hash for a trie with a single node.
+     * @param _key Key for the single node.
+     * @param _value Value for the single node.
+     * @return _updatedRoot Hash of the trie.
+     */
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.getSingleNodeRootHash(key, _value);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Computes the secure counterpart to a key.
+     * @param _key Key to get a secure key from.
+     * @return _secureKey Secure version of the key.
+     */
+    function _getSecureKey(
+        bytes memory _key
+    )
+        private
+        pure
+        returns (
+            bytes memory _secureKey
+        )
+    {
+        return abi.encodePacked(keccak256(_key));
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/libraries/trie/index.html b/coverage/libraries/trie/index.html new file mode 100644 index 000000000..14d44409f --- /dev/null +++ b/coverage/libraries/trie/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for libraries/trie/ + + + + + + + +
+
+

+ all files libraries/trie/ +

+
+
+ 71.98% + Statements + 149/207 +
+
+ 55.88% + Branches + 38/68 +
+
+ 81.25% + Functions + 26/32 +
+
+ 71.57% + Lines + 146/204 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_MerkleTrie.sol
72.45%142/19655.88%38/6884.62%22/2672.02%139/193
Lib_SecureMerkleTrie.sol
63.64%7/11100%0/066.67%4/663.64%7/11
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/Lib_Bytes32Utils.sol.html b/coverage/libraries/utils/Lib_Bytes32Utils.sol.html new file mode 100644 index 000000000..23b140949 --- /dev/null +++ b/coverage/libraries/utils/Lib_Bytes32Utils.sol.html @@ -0,0 +1,416 @@ + + + + Code coverage report for libraries/utils/Lib_Bytes32Utils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_Bytes32Utils.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +40× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_Byte32Utils
+ */
+library Lib_Bytes32Utils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to "true."
+     * @param _in Input bytes32 value.
+     * @return Bytes32 as a boolean.
+     */
+    function toBool(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        return _in != 0;
+    }
+ 
+    /**
+     * Converts a boolean to a bytes32 value.
+     * @param _in Input boolean value.
+     * @return Boolean as a bytes32.
+     */
+    function fromBool(
+        bool _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return bytes32(uint256(_in ? 1 : 0));
+    }
+ 
+    /**
+     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.
+     * @param _in Input bytes32 value.
+     * @return Bytes32 as an address.
+     */
+    function toAddress(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        return address(uint160(uint256(_in)));
+    }
+ 
+    /**
+     * Converts an address to a bytes32.
+     * @param _in Input address value.
+     * @return Address as a bytes32.
+     */
+    function fromAddress(
+        address _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return bytes32(uint256(_in));
+    }
+ 
+    /**
+     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.
+     * @param _in Input bytes32 value.
+     * @return Bytes32 without any leading zeros.
+     */
+    function removeLeadingZeros(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes memory out;
+ 
+        assembly {
+            // Figure out how many leading zero bytes to remove.
+            let shift := 0
+            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {
+                shift := add(shift, 1)
+            }
+ 
+            // Reserve some space for our output and fix the free memory pointer.
+            out := mload(0x40)
+            mstore(0x40, add(out, 0x40))
+ 
+            // Shift the value and store it into the output bytes.
+            mstore(add(out, 0x20), shl(mul(shift, 8), _in))
+ 
+            // Store the new size (with leading zero bytes removed) in the output byte size.
+            mstore(out, sub(32, shift))
+        }
+ 
+        return out;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/Lib_BytesUtils.sol.html b/coverage/libraries/utils/Lib_BytesUtils.sol.html new file mode 100644 index 000000000..ebdd55e85 --- /dev/null +++ b/coverage/libraries/utils/Lib_BytesUtils.sol.html @@ -0,0 +1,728 @@ + + + + Code coverage report for libraries/utils/Lib_BytesUtils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_BytesUtils.sol +

+
+
+ 100% + Statements + 38/38 +
+
+ 63.64% + Branches + 14/22 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 44/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +311× +311× +311× +  +308× +  +308× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +308× +  +  +  +  +  +  +  +  +  +  +299× +73× +  +  +226× +  +  +  +  +  +  +  +  +  + + + +  +  + +  +  +  +  +  +  +  +  +  +164× + + +  +  + +  +  +162× +  +  +  +  +  +  +  +  +  + +  +  +  +15× +15× +15× +  +15× +  +  +  +15× +  +  +  +12× +12× +12× +  +12× +  +  +  +12× +  +  +  + + + +  + +  +  +  + +  +  +  +  +  +  +  +  +  +292× +  +292× +9144× +9144× +  +  +292× +  +  +  +  +  +  +  +  +  +26× +  +26× +708× +  +  +26× +  +  +  +  +  +  +  +  +  +  +26× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_BytesUtils
+ */
+library Lib_BytesUtils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start,
+        uint256 _length
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        Erequire(_length + 31 >= _length, "slice_overflow");
+        Erequire(_start + _length >= _start, "slice_overflow");
+        require(_bytes.length >= _start + _length, "slice_outOfBounds");
+ 
+        bytes memory tempBytes;
+ 
+        assembly {
+            switch iszero(_length)
+            case 0 {
+                // Get a location of some free memory and store it in tempBytes as
+                // Solidity does for memory variables.
+                tempBytes := mload(0x40)
+ 
+                // The first word of the slice result is potentially a partial
+                // word read from the original array. To read it, we calculate
+                // the length of that partial word and start copying that many
+                // bytes into the array. The first word we copy will start with
+                // data we don't care about, but the last `lengthmod` bytes will
+                // land at the beginning of the contents of the new array. When
+                // we're done copying, we overwrite the full first word with
+                // the actual length of the slice.
+                let lengthmod := and(_length, 31)
+ 
+                // The multiplication in the next line is necessary
+                // because when slicing multiples of 32 bytes (lengthmod == 0)
+                // the following copy loop was copying the origin's length
+                // and then ending prematurely not copying everything it should.
+                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
+                let end := add(mc, _length)
+ 
+                for {
+                    // The multiplication in the next line has the same exact purpose
+                    // as the one above.
+                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
+                } lt(mc, end) {
+                    mc := add(mc, 0x20)
+                    cc := add(cc, 0x20)
+                } {
+                    mstore(mc, mload(cc))
+                }
+ 
+                mstore(tempBytes, _length)
+ 
+                //update free-memory pointer
+                //allocating the array padded to 32 bytes like the compiler does now
+                mstore(0x40, and(add(mc, 31), not(31)))
+            }
+            //if we want a zero-length slice let's just return a zero-length array
+            default {
+                tempBytes := mload(0x40)
+ 
+                //zero out the 32 bytes slice we are about to return
+                //we need to do it because Solidity does not garbage collect
+                mstore(tempBytes, 0)
+ 
+                mstore(0x40, add(tempBytes, 0x20))
+            }
+        }
+ 
+        return tempBytes;
+    }
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        if (_bytes.length - _start == 0) {
+            return bytes('');
+        }
+ 
+        return slice(_bytes, _start, _bytes.length - _start);
+    }
+ 
+    function toBytes32PadLeft(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes32)
+    {
+        bytes32 ret;
+        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;
+        assembly {
+            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))
+        }
+        return ret;
+    }
+ 
+    function toBytes32(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes32)
+    {
+        if (_bytes.length < 32) {
+            bytes32 ret;
+            assembly {
+                ret := mload(add(_bytes, 32))
+            }
+            return ret;
+        }
+ 
+        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes
+    }
+ 
+    function toUint256(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (uint256)
+    {
+        return uint256(toBytes32(_bytes));
+    }
+ 
+    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
+        Erequire(_start + 3 >= _start, "toUint24_overflow");
+        Erequire(_bytes.length >= _start + 3 , "toUint24_outOfBounds");
+        uint24 tempUint;
+ 
+        assembly {
+            tempUint := mload(add(add(_bytes, 0x3), _start))
+        }
+ 
+        return tempUint;
+    }
+ 
+    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
+        Erequire(_start + 1 >= _start, "toUint8_overflow");
+        Erequire(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
+        uint8 tempUint;
+ 
+        assembly {
+            tempUint := mload(add(add(_bytes, 0x1), _start))
+        }
+ 
+        return tempUint;
+    }
+ 
+    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
+        Erequire(_start + 20 >= _start, "toAddress_overflow");
+        Erequire(_bytes.length >= _start + 20, "toAddress_outOfBounds");
+        address tempAddress;
+ 
+        assembly {
+            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
+        }
+ 
+        return tempAddress;
+    }
+ 
+    function toNibbles(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        bytes memory nibbles = new bytes(_bytes.length * 2);
+ 
+        for (uint256 i = 0; i < _bytes.length; i++) {
+            nibbles[i * 2] = _bytes[i] >> 4;
+            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);
+        }
+ 
+        return nibbles;
+    }
+ 
+    function fromNibbles(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        bytes memory ret = new bytes(_bytes.length / 2);
+ 
+        for (uint256 i = 0; i < ret.length; i++) {
+            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);
+        }
+ 
+        return ret;
+    }
+ 
+    function equal(
+        bytes memory _bytes,
+        bytes memory _other
+    )
+        internal
+        pure
+        returns (bool)
+    {
+        return keccak256(_bytes) == keccak256(_other);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/Lib_ECDSAUtils.sol.html b/coverage/libraries/utils/Lib_ECDSAUtils.sol.html new file mode 100644 index 000000000..713191c61 --- /dev/null +++ b/coverage/libraries/utils/Lib_ECDSAUtils.sol.html @@ -0,0 +1,356 @@ + + + + Code coverage report for libraries/utils/Lib_ECDSAUtils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_ECDSAUtils.sol +

+
+
+ 100% + Statements + 9/9 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× + +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_ECDSAUtils
+ */
+library Lib_ECDSAUtils {
+ 
+    /**************************************
+     * Internal Functions: ECDSA Recovery *
+     **************************************/
+ 
+    /**
+     * Recovers a signed address given a message and signature.
+     * @param _message Message that was originally signed.
+     * @param _isEthSignedMessage Whether or not the user used the `Ethereum Signed Message` prefix.
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     * @return _sender Signer address.
+     */
+    function recover(
+        bytes memory _message,
+        bool _isEthSignedMessage,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        internal
+        pure
+        returns (
+            address _sender
+        )
+    {
+        bytes32 messageHash = getMessageHash(_message, _isEthSignedMessage);
+ 
+        return ecrecover(
+            messageHash,
+            _v + 27,
+            _r,
+            _s
+        );
+    }
+ 
+    function getMessageHash(
+        bytes memory _message,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (bytes32) {
+        if (_isEthSignedMessage) {
+            return getEthSignedMessageHash(_message);
+        }
+        return getNativeMessageHash(_message);
+    }
+ 
+ 
+    /*************************************
+     * Private Functions: ECDSA Recovery *
+     *************************************/
+ 
+    /**
+     * Gets the native message hash (simple keccak256) for a message.
+     * @param _message Message to hash.
+     * @return _messageHash Native message hash.
+     */
+    function getNativeMessageHash(
+        bytes memory _message
+    )
+        private
+        pure
+        returns (
+            bytes32 _messageHash
+        )
+    {
+        return keccak256(_message);
+    }
+ 
+    /**
+     * Gets the hash of a message with the `Ethereum Signed Message` prefix.
+     * @param _message Message to hash.
+     * @return _messageHash Prefixed message hash.
+     */
+    function getEthSignedMessageHash(
+        bytes memory _message
+    )
+        private
+        pure
+        returns (
+            bytes32 _messageHash
+        )
+    {
+        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
+        bytes32 messageHash = keccak256(_message);
+        return keccak256(abi.encodePacked(prefix, messageHash));
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/Lib_ErrorUtils.sol.html b/coverage/libraries/utils/Lib_ErrorUtils.sol.html new file mode 100644 index 000000000..5f34eb479 --- /dev/null +++ b/coverage/libraries/utils/Lib_ErrorUtils.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for libraries/utils/Lib_ErrorUtils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_ErrorUtils.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title Lib_ErrorUtils
+ */
+library Lib_ErrorUtils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Encodes an error string into raw solidity-style revert data.
+     * (i.e. ascii bytes, prefixed with bytes4(keccak("Error(string))"))
+     * Ref: https://docs.soliditylang.org/en/v0.8.2/control-structures.html?highlight=Error(string)#panic-via-assert-and-error-via-require
+     * @param _reason Reason for the reversion.
+     * @return Standard solidity revert data for the given reason.
+     */
+    function encodeRevertString(
+        string memory _reason
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodeWithSignature(
+            "Error(string)",
+            _reason
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/Lib_EthUtils.sol.html b/coverage/libraries/utils/Lib_EthUtils.sol.html new file mode 100644 index 000000000..a7d7a6455 --- /dev/null +++ b/coverage/libraries/utils/Lib_EthUtils.sol.html @@ -0,0 +1,629 @@ + + + + Code coverage report for libraries/utils/Lib_EthUtils.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_EthUtils.sol +

+
+
+ 83.33% + Statements + 10/12 +
+
+ 100% + Branches + 0/0 +
+
+ 85.71% + Functions + 6/7 +
+
+ 87.5% + Lines + 14/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +34× +  +  +  +  +  +  +34× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +212× +  +  +  +212× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +  +27× +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+import { Lib_Bytes32Utils } from "./Lib_Bytes32Utils.sol";
+ 
+/**
+ * @title Lib_EthUtils
+ */
+library Lib_EthUtils {
+ 
+    /***********************************
+     * Internal Functions: Code Access *
+     ***********************************/
+ 
+    /**
+     * Gets the code for a given address.
+     * @param _address Address to get code for.
+     * @param _offset Offset to start reading from.
+     * @param _length Number of bytes to read.
+     * @return _code Code read from the contract.
+     */
+    function getCode(
+        address _address,
+        uint256 _offset,
+        uint256 _length
+    )
+        internal
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        assembly {
+            _code := mload(0x40)
+            mstore(0x40, add(_code, add(_length, 0x20)))
+            mstore(_code, _length)
+            extcodecopy(_address, add(_code, 0x20), _offset, _length)
+        }
+ 
+        return _code;
+    }
+ 
+    /**
+     * Gets the full code for a given address.
+     * @param _address Address to get code for.
+     * @return _code Full code of the contract.
+     */
+    function getCode(
+        address _address
+    )
+        internal
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        return getCode(
+            _address,
+            0,
+            getCodeSize(_address)
+        );
+    }
+ 
+    /**
+     * Gets the size of a contract's code in bytes.
+     * @param _address Address to get code size for.
+     * @return _codeSize Size of the contract's code in bytes.
+     */
+    function getCodeSize(
+        address _address
+    )
+        internal
+        view
+        returns (
+            uint256 _codeSize
+        )
+    {
+        assembly {
+            _codeSize := extcodesize(_address)
+        }
+ 
+        return _codeSize;
+    }
+ 
+    /**
+     * Gets the hash of a contract's code.
+     * @param _address Address to get a code hash for.
+     * @return _codeHash Hash of the contract's code.
+     */
+    function getCodeHash(
+        address _address
+    )
+        internal
+        view
+        returns (
+            bytes32 _codeHash
+        )
+    {
+        assembly {
+            _codeHash := extcodehash(_address)
+        }
+ 
+        return _codeHash;
+    }
+ 
+ 
+    /*****************************************
+     * Internal Functions: Contract Creation *
+     *****************************************/
+ 
+    /**
+     * Creates a contract with some given initialization code.
+     * @param _code Contract initialization code.
+     * @return _created Address of the created contract.
+     */
+    function createContract(
+        bytes memory _code
+    )
+        internal
+        returns (
+            address _created
+        )
+    {
+        assembly {
+            _created := create(
+                0,
+                add(_code, 0x20),
+                mload(_code)
+            )
+        }
+ 
+        return _created;
+    }
+ 
+    /**
+     * Computes the address that would be generated by CREATE.
+     * @param _creator Address creating the contract.
+     * @param _nonce Creator's nonce.
+     * @return _address Address to be generated by CREATE.
+     */
+    function getAddressForCREATE(
+        address _creator,
+        uint256 _nonce
+    )
+        internal
+        pure
+        returns (
+            address _address
+        )
+    {
+        bytes[] memory encoded = new bytes[](2);
+        encoded[0] = Lib_RLPWriter.writeAddress(_creator);
+        encoded[1] = Lib_RLPWriter.writeUint(_nonce);
+ 
+        bytes memory encodedList = Lib_RLPWriter.writeList(encoded);
+        return Lib_Bytes32Utils.toAddress(keccak256(encodedList));
+    }
+ 
+    /**
+     * Computes the address that would be generated by CREATE2.
+     * @param _creator Address creating the contract.
+     * @param _bytecode Bytecode of the contract to be created.
+     * @param _salt 32 byte salt value mixed into the hash.
+     * @return _address Address to be generated by CREATE2.
+     */
+    function getAddressForCREATE2(
+        address _creator,
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        internal
+        pure
+        returns (address _address)
+    {
+        bytes32 hashedData = keccak256(abi.encodePacked(
+            byte(0xff),
+            _creator,
+            _salt,
+            keccak256(_bytecode)
+        ));
+ 
+        return Lib_Bytes32Utils.toAddress(hashedData);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/Lib_Math.sol.html b/coverage/libraries/utils/Lib_Math.sol.html new file mode 100644 index 000000000..a1abd31af --- /dev/null +++ b/coverage/libraries/utils/Lib_Math.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for libraries/utils/Lib_Math.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_Math.sol +

+
+
+ 0% + Statements + 0/3 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_Math
+ */
+library Lib_Math {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Calculates the minumum of two numbers.
+     * @param _x First number to compare.
+     * @param _y Second number to compare.
+     * @return Lesser of the two numbers.
+     */
+    function min(
+        uint256 _x,
+        uint256 _y
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        if (_x < _y) {
+            return _x;
+        }
+ 
+        return _y;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/Lib_MerkleTree.sol.html b/coverage/libraries/utils/Lib_MerkleTree.sol.html new file mode 100644 index 000000000..ddc48113f --- /dev/null +++ b/coverage/libraries/utils/Lib_MerkleTree.sol.html @@ -0,0 +1,725 @@ + + + + Code coverage report for libraries/utils/Lib_MerkleTree.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_MerkleTree.sol +

+
+
+ 97.83% + Statements + 45/46 +
+
+ 90.91% + Branches + 20/22 +
+
+ 100% + Functions + 3/3 +
+
+ 97.96% + Lines + 48/49 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +118× +  +  +  +  +117× +  +  +  +117× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +117× +  +  +117× +117× +  +  +117× +  +  +117× +  +  +117× +117× +  +117× +273× +273× +  +273× +4620× +4620× +4620× +  +  +  +  +4620× +  +  +273× +27× +27× +27× +  +  +  +  +27× +  +  +273× +273× +  +  +117× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +102× +  +  +  +  +101× +  +  +  +  +100× +  +  +  +  +99× +  +99× +653× +146× +  +  +  +  +  +  +507× +  +  +  +  +  +  +  +653× +  +  +99× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +  +  +  +  +100× + +  +  +  +  +97× +97× +97× +776× +206× +206× +  +  +  +  +97× +70× +  +  +97× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_MerkleTree
+ * @author River Keefer
+ */
+library Lib_MerkleTree {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Calculates a merkle root for a list of 32-byte leaf hashes.  WARNING: If the number
+     * of leaves passed in is not a power of two, it pads out the tree with zero hashes.
+     * If you do not know the original length of elements for the tree you are verifying,
+     * then this may allow empty leaves past _elements.length to pass a verification check down the line.
+     * Note that the _elements argument is modified, therefore it must not be used again afterwards
+     * @param _elements Array of hashes from which to generate a merkle root.
+     * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).
+     */
+    function getMerkleRoot(
+        bytes32[] memory _elements
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        require(
+            _elements.length > 0,
+            "Lib_MerkleTree: Must provide at least one leaf hash."
+        );
+ 
+        Iif (_elements.length == 0) {
+            return _elements[0];
+        }
+ 
+        uint256[16] memory defaults = [
+            0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,
+            0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,
+            0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,
+            0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,
+            0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,
+            0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,
+            0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,
+            0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,
+            0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,
+            0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,
+            0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,
+            0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,
+            0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,
+            0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,
+            0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,
+            0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10
+        ];
+ 
+        // Reserve memory space for our hashes.
+        bytes memory buf = new bytes(64);
+ 
+        // We'll need to keep track of left and right siblings.
+        bytes32 leftSibling;
+        bytes32 rightSibling;
+ 
+        // Number of non-empty nodes at the current depth.
+        uint256 rowSize = _elements.length;
+ 
+        // Current depth, counting from 0 at the leaves
+        uint256 depth = 0;
+ 
+        // Common sub-expressions
+        uint256 halfRowSize;         // rowSize / 2
+        bool rowSizeIsOdd;           // rowSize % 2 == 1
+ 
+        while (rowSize > 1) {
+            halfRowSize = rowSize / 2;
+            rowSizeIsOdd = rowSize % 2 == 1;
+ 
+            for (uint256 i = 0; i < halfRowSize; i++) {
+                leftSibling  = _elements[(2 * i)    ];
+                rightSibling = _elements[(2 * i) + 1];
+                assembly {
+                    mstore(add(buf, 32), leftSibling )
+                    mstore(add(buf, 64), rightSibling)
+                }
+ 
+                _elements[i] = keccak256(buf);
+            }
+ 
+            if (rowSizeIsOdd) {
+                leftSibling  = _elements[rowSize - 1];
+                rightSibling = bytes32(defaults[depth]);
+                assembly {
+                    mstore(add(buf, 32), leftSibling)
+                    mstore(add(buf, 64), rightSibling)
+                }
+ 
+                _elements[halfRowSize] = keccak256(buf);
+            }
+ 
+            rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);
+            depth++;
+        }
+ 
+        return _elements[0];
+    }
+ 
+    /**
+     * Verifies a merkle branch for the given leaf hash.  Assumes the original length
+     * of leaves generated is a known, correct input, and does not return true for indices
+     * extending past that index (even if _siblings would be otherwise valid.)
+     * @param _root The Merkle root to verify against.
+     * @param _leaf The leaf hash to verify inclusion of.
+     * @param _index The index in the tree of this leaf.
+     * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
+     * @param _totalLeaves The total number of leaves originally passed into.
+     * @return Whether or not the merkle branch and leaf passes verification.
+     */
+    function verify(
+        bytes32 _root,
+        bytes32 _leaf,
+        uint256 _index,
+        bytes32[] memory _siblings,
+        uint256 _totalLeaves
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        require(
+            _totalLeaves > 0,
+            "Lib_MerkleTree: Total leaves must be greater than zero."
+        );
+ 
+        require(
+            _index < _totalLeaves,
+            "Lib_MerkleTree: Index out of bounds."
+        );
+ 
+        require(
+            _siblings.length == _ceilLog2(_totalLeaves),
+            "Lib_MerkleTree: Total siblings does not correctly correspond to total leaves."
+        );
+ 
+        bytes32 computedRoot = _leaf;
+ 
+        for (uint256 i = 0; i < _siblings.length; i++) {
+            if ((_index & 1) == 1) {
+                computedRoot = keccak256(
+                    abi.encodePacked(
+                        _siblings[i],
+                        computedRoot
+                    )
+                );
+            } else {
+                computedRoot = keccak256(
+                    abi.encodePacked(
+                        computedRoot,
+                        _siblings[i]
+                    )
+                );
+            }
+ 
+            _index >>= 1;
+        }
+ 
+        return _root == computedRoot;
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Calculates the integer ceiling of the log base 2 of an input.
+     * @param _in Unsigned input to calculate the log.
+     * @return ceil(log_base_2(_in))
+     */
+    function _ceilLog2(
+        uint256 _in
+    )
+        private
+        pure
+        returns (
+            uint256
+        )
+    {
+        Erequire(
+            _in > 0,
+            "Lib_MerkleTree: Cannot compute ceil(log_2) of 0."
+        );
+ 
+        if (_in == 1) {
+            return 0;
+        }
+ 
+        // Find the highest set bit (will be floor(log_2)).
+        // Borrowed with <3 from https://github.com/ethereum/solidity-examples
+        uint256 val = _in;
+        uint256 highest = 0;
+        for (uint8 i = 128; i >= 1; i >>= 1) {
+            if (val & (uint(1) << i) - 1 << i != 0) {
+                highest += i;
+                val >>= i;
+            }
+        }
+ 
+        // Increment by one if this is not a perfect logarithm.
+        if ((uint(1) << highest) != _in) {
+            highest += 1;
+        }
+ 
+        return highest;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/Lib_ReentrancyGuard.sol.html b/coverage/libraries/utils/Lib_ReentrancyGuard.sol.html new file mode 100644 index 000000000..f9285d350 --- /dev/null +++ b/coverage/libraries/utils/Lib_ReentrancyGuard.sol.html @@ -0,0 +1,248 @@ + + + + Code coverage report for libraries/utils/Lib_ReentrancyGuard.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_ReentrancyGuard.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +54× +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +14× +  +14× +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @dev Contract module that helps prevent reentrant calls to a function.
+ *
+ * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
+ * available, which can be applied to functions to make sure there are no nested
+ * (reentrant) calls to them.
+ *
+ * Note that because there is a single `nonReentrant` guard, functions marked as
+ * `nonReentrant` may not call one another. This can be worked around by making
+ * those functions `private`, and then adding `external` `nonReentrant` entry
+ * points to them.
+ *
+ * TIP: If you would like to learn more about reentrancy and alternative ways
+ * to protect against it, check out our blog post
+ * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
+ */
+abstract contract Lib_ReentrancyGuard {
+    // Booleans are more expensive than uint256 or any type that takes up a full
+    // word because each write operation emits an extra SLOAD to first read the
+    // slot's contents, replace the bits taken up by the boolean, and then write
+    // back. This is the compiler's defense against contract upgrades and
+    // pointer aliasing, and it cannot be disabled.
+ 
+    // The values being non-zero value makes deployment a bit more expensive,
+    // but in exchange the refund on every call to nonReentrant will be lower in
+    // amount. Since refunds are capped to a percentage of the total
+    // transaction's gas, it is best to keep them low in cases like this one, to
+    // increase the likelihood of the full refund coming into effect.
+    uint256 private constant _NOT_ENTERED = 1;
+    uint256 private constant _ENTERED = 2;
+ 
+    uint256 private _status;
+ 
+    constructor () {
+        _status = _NOT_ENTERED;
+    }
+ 
+    /**
+     * @dev Prevents a contract from calling itself, directly or indirectly.
+     * Calling a `nonReentrant` function from another `nonReentrant`
+     * function is not supported. It is possible to prevent this from happening
+     * by making the `nonReentrant` function external, and make it call a
+     * `private` function that does the actual work.
+     */
+    modifier nonReentrant() {
+        // On the first call to nonReentrant, _notEntered will be true
+        Erequire(_status != _ENTERED, "ReentrancyGuard: reentrant call");
+ 
+        // Any calls to nonReentrant after this point will fail
+        _status = _ENTERED;
+ 
+        _;
+ 
+        // By storing the original value once again, a refund is triggered (see
+        // https://eips.ethereum.org/EIPS/eip-2200)
+        _status = _NOT_ENTERED;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/Lib_RingBuffer.sol.html b/coverage/libraries/utils/Lib_RingBuffer.sol.html new file mode 100644 index 000000000..a0835844d --- /dev/null +++ b/coverage/libraries/utils/Lib_RingBuffer.sol.html @@ -0,0 +1,1193 @@ + + + + Code coverage report for libraries/utils/Lib_RingBuffer.sol + + + + + + + +
+
+

+ all files / libraries/utils/ Lib_RingBuffer.sol +

+
+
+ 78.13% + Statements + 50/64 +
+
+ 54.17% + Branches + 13/24 +
+
+ 81.82% + Functions + 9/11 +
+
+ 77.46% + Lines + 55/71 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +572× +572× +  +  +572× +134× +  +  +  +572× +11× +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +572× +572× +  +  +572× +572× +572× +  +  +  +  +  +  +  +  +  +  +  +  +  +470× +  +470× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +538× +  +  +  +  +535× +535× +  +535× +  +  +535× +  +  +535× +  +  +  +  +535× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  + +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +441× +441× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +550× +550× +  +  +  +  +  +  +  +  +  +  +  +  +  +573× +573× +  +573× +573× +573× +  +  +  +  +573× +573× +573× +573× +  +  +  +  +  +573× +573× +  +  +573× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2572× +2572× +  +2572× +2572× +2572× +  +  +  +  +2572× +2572× +2572× +2572× +  +  +  +  +  +2572× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1642× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+library Lib_RingBuffer {
+    using Lib_RingBuffer for RingBuffer;
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct Buffer {
+        uint256 length;
+        mapping (uint256 => bytes32) buf;
+    }
+ 
+    struct RingBuffer {
+        bytes32 contextA;
+        bytes32 contextB;
+        Buffer bufferA;
+        Buffer bufferB;
+        uint256 nextOverwritableIndex;
+    }
+ 
+    struct RingBufferContext {
+        // contextA
+        uint40 globalIndex;
+        bytes27 extraData;
+ 
+        // contextB
+        uint64 currBufferIndex;
+        uint40 prevResetIndex;
+        uint40 currResetIndex;
+    }
+ 
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 constant MIN_CAPACITY = 16;
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Pushes a single element to the buffer.
+     * @param _self Buffer to access.
+     * @param _value Value to push to the buffer.
+     * @param _extraData Optional global extra data.
+     */
+    function push(
+        RingBuffer storage _self,
+        bytes32 _value,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
+ 
+        // Set a minimum capacity.
+        if (currBuffer.length == 0) {
+            currBuffer.length = MIN_CAPACITY;
+        }
+ 
+        // Check if we need to expand the buffer.
+        if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {
+            Iif (ctx.currResetIndex < _self.nextOverwritableIndex) {
+                // We're going to overwrite the inactive buffer.
+                // Bump the buffer index, reset the delete offset, and set our reset indices.
+                ctx.currBufferIndex++;
+                ctx.prevResetIndex = ctx.currResetIndex;
+                ctx.currResetIndex = ctx.globalIndex;
+ 
+                // Swap over to the next buffer.
+                currBuffer = _self.getBuffer(ctx.currBufferIndex);
+            } else {
+                // We're not overwriting yet, double the length of the current buffer.
+                currBuffer.length *= 2;
+            }
+        }
+ 
+        // Index to write to is the difference of the global and reset indices.
+        uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;
+        currBuffer.buf[writeHead] = _value;
+ 
+        // Bump the global index and insert our extra data, then save the context.
+        ctx.globalIndex++;
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Pushes a single element to the buffer.
+     * @param _self Buffer to access.
+     * @param _value Value to push to the buffer.
+     */
+    function push(
+        RingBuffer storage _self,
+        bytes32 _value
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        
+        _self.push(
+            _value,
+            ctx.extraData
+        );
+    }
+ 
+    /**
+     * Retrieves an element from the buffer.
+     * @param _self Buffer to access.
+     * @param _index Element index to retrieve.
+     * @return Value of the element at the given index.
+     */
+    function get(
+        RingBuffer storage _self,
+        uint256 _index
+    )
+        internal
+        view
+        returns (
+            bytes32    
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+ 
+        require(
+            _index < ctx.globalIndex,
+            "Index out of bounds."
+        );
+ 
+        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
+        Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);
+ 
+        Eif (_index >= ctx.currResetIndex) {
+            // We're trying to load an element from the current buffer.
+            // Relative index is just the difference from the reset index.
+            uint256 relativeIndex = _index - ctx.currResetIndex;
+ 
+            // Shouldn't happen but why not check.
+            Erequire(
+                relativeIndex < currBuffer.length,
+                "Index out of bounds."
+            );
+ 
+            return currBuffer.buf[relativeIndex];
+        } else {
+            // We're trying to load an element from the previous buffer.
+            // Relative index is the difference from the reset index in the other direction.
+            uint256 relativeIndex = ctx.currResetIndex - _index;
+ 
+            // Condition only fails in the case that we deleted and flipped buffers.
+            require(
+                ctx.currResetIndex > ctx.prevResetIndex,
+                "Index out of bounds."
+            );
+ 
+            // Make sure we're not trying to read beyond the array.
+            require(
+                relativeIndex <= prevBuffer.length,
+                "Index out of bounds."
+            );
+ 
+            return prevBuffer.buf[prevBuffer.length - relativeIndex];
+        }
+    }
+ 
+    /**
+     * Deletes all elements after (and including) a given index.
+     * @param _self Buffer to access.
+     * @param _index Index of the element to delete from (inclusive).
+     * @param _extraData Optional global extra data.
+     */
+    function deleteElementsAfterInclusive(
+        RingBuffer storage _self,
+        uint40 _index,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+ 
+        Erequire(
+            _index < ctx.globalIndex && _index >= ctx.prevResetIndex,
+            "Index out of bounds."
+        );
+ 
+        Iif (_index < ctx.currResetIndex) {
+            // We're switching back to the previous buffer.
+            // Reduce the buffer index, set the current reset index back to match the previous one.
+            // We use the equality of these two values to prevent reading beyond this buffer.
+            ctx.currBufferIndex--;
+            ctx.currResetIndex = ctx.prevResetIndex;
+        }
+ 
+        // Set our global index and extra data, save the context.
+        ctx.globalIndex = _index;
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Deletes all elements after (and including) a given index.
+     * @param _self Buffer to access.
+     * @param _index Index of the element to delete from (inclusive).
+     */
+    function deleteElementsAfterInclusive(
+        RingBuffer storage _self,
+        uint40 _index
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        _self.deleteElementsAfterInclusive(
+            _index,
+            ctx.extraData
+        );
+    }
+ 
+    /**
+     * Retrieves the current global index.
+     * @param _self Buffer to access.
+     * @return Current global index.
+     */
+    function getLength(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        return ctx.globalIndex;
+    }
+ 
+    /**
+     * Changes current global extra data.
+     * @param _self Buffer to access.
+     * @param _extraData New global extra data.
+     */
+    function setExtraData(
+        RingBuffer storage _self,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Retrieves the current global extra data.
+     * @param _self Buffer to access.
+     * @return Current global extra data.
+     */
+    function getExtraData(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            bytes27
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        return ctx.extraData;
+    }
+ 
+    /**
+     * Sets the current ring buffer context.
+     * @param _self Buffer to access.
+     * @param _ctx Current ring buffer context.
+     */
+    function setContext(
+        RingBuffer storage _self,
+        RingBufferContext memory _ctx
+    )
+        internal
+    {
+        bytes32 contextA;
+        bytes32 contextB;
+ 
+        uint40 globalIndex = _ctx.globalIndex;
+        bytes27 extraData = _ctx.extraData;
+        assembly {
+            contextA := globalIndex
+            contextA := or(contextA, extraData)
+        }
+ 
+        uint64 currBufferIndex = _ctx.currBufferIndex;
+        uint40 prevResetIndex = _ctx.prevResetIndex;
+        uint40 currResetIndex = _ctx.currResetIndex;
+        assembly {
+            contextB := currBufferIndex
+            contextB := or(contextB, shl(64, prevResetIndex))
+            contextB := or(contextB, shl(104, currResetIndex))
+        }
+ 
+        Eif (_self.contextA != contextA) {
+            _self.contextA = contextA;
+        }
+ 
+        Iif (_self.contextB != contextB) {
+            _self.contextB = contextB;
+        }
+    }
+ 
+    /**
+     * Retrieves the current ring buffer context.
+     * @param _self Buffer to access.
+     * @return Current ring buffer context.
+     */
+    function getContext(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            RingBufferContext memory
+        )
+    {
+        bytes32 contextA = _self.contextA;
+        bytes32 contextB = _self.contextB;
+ 
+        uint40 globalIndex;
+        bytes27 extraData;
+        assembly {
+            globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            extraData   := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)
+        }
+ 
+        uint64 currBufferIndex;
+        uint40 prevResetIndex;
+        uint40 currResetIndex;
+        assembly {
+            currBufferIndex :=          and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)
+            prevResetIndex  := shr(64,  and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))
+            currResetIndex  := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))
+        }
+ 
+        return RingBufferContext({
+            globalIndex: globalIndex,
+            extraData: extraData,
+            currBufferIndex: currBufferIndex,
+            prevResetIndex: prevResetIndex,
+            currResetIndex: currResetIndex
+        });
+    }
+ 
+    /**
+     * Retrieves the a buffer from the ring buffer by index.
+     * @param _self Buffer to access.
+     * @param _which Index of the sub buffer to access.
+     * @return Sub buffer for the index.
+     */
+    function getBuffer(
+        RingBuffer storage _self,
+        uint256 _which
+    )
+        internal
+        view
+        returns (
+            Buffer storage
+        )
+    {
+        return _which % 2 == 0 ? _self.bufferA : _self.bufferB;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/utils/index.html b/coverage/libraries/utils/index.html new file mode 100644 index 000000000..c793f1883 --- /dev/null +++ b/coverage/libraries/utils/index.html @@ -0,0 +1,197 @@ + + + + Code coverage report for libraries/utils/ + + + + + + + +
+
+

+ all files libraries/utils/ +

+
+
+ 89.07% + Statements + 163/183 +
+
+ 67.57% + Branches + 50/74 +
+
+ 91.11% + Functions + 41/45 +
+
+ 89.27% + Lines + 183/205 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_Bytes32Utils.sol
100%6/6100%0/0100%5/5100%7/7
Lib_BytesUtils.sol
100%38/3863.64%14/22100%11/11100%44/44
Lib_ECDSAUtils.sol
100%9/9100%2/2100%4/4100%9/9
Lib_ErrorUtils.sol
100%1/1100%0/0100%1/1100%1/1
Lib_EthUtils.sol
83.33%10/12100%0/085.71%6/787.5%14/16
Lib_Math.sol
0%0/30%0/20%0/10%0/3
Lib_MerkleTree.sol
97.83%45/4690.91%20/22100%3/397.96%48/49
Lib_ReentrancyGuard.sol
100%4/450%1/2100%2/2100%5/5
Lib_RingBuffer.sol
78.13%50/6454.17%13/2481.82%9/1177.46%55/71
+
+
+ + + + + + + diff --git a/coverage/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html b/coverage/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html new file mode 100644 index 000000000..5e49d6ba8 --- /dev/null +++ b/coverage/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html @@ -0,0 +1,1205 @@ + + + + Code coverage report for libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol + + + + + + + +
+
+

+ all files / libraries/wrappers/ Lib_SafeExecutionManagerWrapper.sol +

+
+
+ 100% + Statements + 30/30 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 16/16 +
+
+ 96.77% + Lines + 30/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +41× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +43× +  +  +  +  +  +  +43× +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +146× +146× +  +  +  +  +146× + +  +  +  +  +  +  +  +144× +  +  +  +  +  +  +  +  +  +  +  +145× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_ErrorUtils } from "../utils/Lib_ErrorUtils.sol";
+ 
+/**
+ * @title Lib_SafeExecutionManagerWrapper
+ * @dev The Safe Execution Manager Wrapper provides functions which facilitate writing OVM safe 
+ * code using the standard solidity compiler, by routing all its operations through the Execution 
+ * Manager.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+library Lib_SafeExecutionManagerWrapper {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Performs a safe ovmCALL.
+     * @param _gasLimit Gas limit for the call.
+     * @param _target Address to call.
+     * @param _calldata Data to send to the call.
+     * @return _success Whether or not the call reverted.
+     * @return _returndata Data returned by the call.
+     */
+    function safeCALL(
+        uint256 _gasLimit,
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCALL(uint256,address,bytes)",
+                _gasLimit,
+                _target,
+                _calldata
+            )
+        );
+ 
+        return abi.decode(returndata, (bool, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmDELEGATECALL.
+     * @param _gasLimit Gas limit for the call.
+     * @param _target Address to call.
+     * @param _calldata Data to send to the call.
+     * @return _success Whether or not the call reverted.
+     * @return _returndata Data returned by the call.
+     */
+    function safeDELEGATECALL(
+        uint256 _gasLimit,
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmDELEGATECALL(uint256,address,bytes)",
+                _gasLimit,
+                _target,
+                _calldata
+            )
+        );
+ 
+        return abi.decode(returndata, (bool, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmCREATE call.
+     * @param _gasLimit Gas limit for the creation.
+     * @param _bytecode Code for the new contract.
+     * @return _contract Address of the created contract.
+     */
+    function safeCREATE(
+        uint256 _gasLimit,
+        bytes memory _bytecode
+    )
+        internal
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            _gasLimit,
+            abi.encodeWithSignature(
+                "ovmCREATE(bytes)",
+                _bytecode
+            )
+        );
+ 
+        return abi.decode(returndata, (address, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmEXTCODESIZE call.
+     * @param _contract Address of the contract to query the size of.
+     * @return _EXTCODESIZE Size of the requested contract in bytes.
+     */
+    function safeEXTCODESIZE(
+        address _contract
+    )
+        internal
+        returns (
+            uint256 _EXTCODESIZE
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmEXTCODESIZE(address)",
+                _contract
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmCHAINID call.
+     * @return _CHAINID Result of calling ovmCHAINID.
+     */
+    function safeCHAINID()
+        internal
+        returns (
+            uint256 _CHAINID
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCHAINID()"
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmCALLER call.
+     * @return _CALLER Result of calling ovmCALLER.
+     */
+    function safeCALLER()
+        internal
+        returns (
+            address _CALLER
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCALLER()"
+            )
+        );
+ 
+        return abi.decode(returndata, (address));
+    }
+ 
+    /**
+     * Performs a safe ovmADDRESS call.
+     * @return _ADDRESS Result of calling ovmADDRESS.
+     */
+    function safeADDRESS()
+        internal
+        returns (
+            address _ADDRESS
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmADDRESS()"
+            )
+        );
+ 
+        return abi.decode(returndata, (address));
+    }
+ 
+    /**
+     * Performs a safe ovmGETNONCE call.
+     * @return _nonce Result of calling ovmGETNONCE.
+     */
+    function safeGETNONCE()
+        internal
+        returns (
+            uint256 _nonce
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmGETNONCE()"
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmSETNONCE call.
+     * @param _nonce New account nonce.
+     */
+    function safeSETNONCE(
+        uint256 _nonce
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSETNONCE(uint256)",
+                _nonce
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe ovmCREATEEOA call.
+     * @param _messageHash Message hash which was signed by EOA
+     * @param _v v value of signature (0 or 1)
+     * @param _r r value of signature
+     * @param _s s value of signature
+     */
+    function safeCREATEEOA(
+        bytes32 _messageHash,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCREATEEOA(bytes32,uint8,bytes32,bytes32)",
+                _messageHash,
+                _v,
+                _r,
+                _s
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe REVERT.
+     * @param _reason String revert reason to pass along with the REVERT.
+     */
+    function safeREVERT(
+        string memory _reason
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmREVERT(bytes)",
+                Lib_ErrorUtils.encodeRevertString(
+                    _reason
+                )
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe "require".
+     * @param _condition Boolean condition that must be true or will revert.
+     * @param _reason String revert reason to pass along with the REVERT.
+     */
+    function safeREQUIRE(
+        bool _condition,
+        string memory _reason
+    )
+        internal
+    {
+        if (!_condition) {
+            safeREVERT(
+                _reason
+            );
+        }
+    }
+ 
+    /**
+     * Performs a safe ovmSLOAD call.
+     */
+    function safeSLOAD(
+        bytes32 _key
+    )
+        internal
+        returns (
+            bytes32
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSLOAD(bytes32)",
+                _key
+            )
+        );
+ 
+        return abi.decode(returndata, (bytes32));
+    }
+ 
+    /**
+     * Performs a safe ovmSSTORE call.
+     */
+    function safeSSTORE(
+        bytes32 _key,
+        bytes32 _value
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSSTORE(bytes32,bytes32)",
+                _key,
+                _value
+            )
+        );
+    }
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Performs an ovm interaction and the necessary safety checks.
+     * @param _gasLimit Gas limit for the interaction.
+     * @param _calldata Data to send to the OVM_ExecutionManager (encoded with sighash).
+     * @return _returndata Data sent back by the OVM_ExecutionManager.
+     */
+    function _safeExecutionManagerInteraction(
+        uint256 _gasLimit,
+        bytes memory _calldata
+    )
+        private
+        returns (
+            bytes memory _returndata
+        )
+    {
+        address ovmExecutionManager = msg.sender;
+        (
+            bool success,
+            bytes memory returndata
+        ) = ovmExecutionManager.call{gas: _gasLimit}(_calldata);
+ 
+        if (success == false) {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        } else Iif (returndata.length == 1) {
+            assembly {
+                return(0, 1)
+            }
+        } else {
+            return returndata;
+        }
+    }
+ 
+    function _safeExecutionManagerInteraction(
+        bytes memory _calldata
+    )
+        private
+        returns (
+            bytes memory _returndata
+        )
+    {
+        return _safeExecutionManagerInteraction(
+            gasleft(),
+            _calldata
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libraries/wrappers/Lib_SafeMathWrapper.sol.html b/coverage/libraries/wrappers/Lib_SafeMathWrapper.sol.html new file mode 100644 index 000000000..09c54906c --- /dev/null +++ b/coverage/libraries/wrappers/Lib_SafeMathWrapper.sol.html @@ -0,0 +1,566 @@ + + + + Code coverage report for libraries/wrappers/Lib_SafeMathWrapper.sol + + + + + + + +
+
+

+ all files / libraries/wrappers/ Lib_SafeMathWrapper.sol +

+
+
+ 21.05% + Statements + 4/19 +
+
+ 50% + Branches + 1/2 +
+
+ 12.5% + Functions + 1/8 +
+
+ 21.05% + Lines + 4/19 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// Pulled from @openzeppelin/contracts/math/SafeMath.sol
+// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_SafeExecutionManagerWrapper } from "./Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title Lib_SafeMathWrapper
+ */
+ 
+/**
+ * @dev Wrappers over Solidity's arithmetic operations with added overflow
+ * checks.
+ *
+ * Arithmetic operations in Solidity wrap on overflow. This can easily result
+ * in bugs, because programmers usually assume that an overflow raises an
+ * error, which is the standard behavior in high level programming languages.
+ * `SafeMath` restores this intuition by reverting the transaction when an
+ * operation overflows.
+ *
+ * Using this library instead of the unchecked operations eliminates an entire
+ * class of bugs, so it's recommended to use it always.
+ */
+ 
+library Lib_SafeMathWrapper {
+    /**
+     * @dev Returns the addition of two unsigned integers, reverting on
+     * overflow.
+     *
+     * Counterpart to Solidity's `+` operator.
+     *
+     * Requirements:
+     *
+     * - Addition cannot overflow.
+     */
+    function add(uint256 a, uint256 b) internal returns (uint256) {
+        uint256 c = a + b;
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c >= a, "Lib_SafeMathWrapper: addition overflow");
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the subtraction of two unsigned integers, reverting on
+     * overflow (when the result is negative).
+     *
+     * Counterpart to Solidity's `-` operator.
+     *
+     * Requirements:
+     *
+     * - Subtraction cannot overflow.
+     */
+    function sub(uint256 a, uint256 b) internal returns (uint256) {
+        return sub(a, b, "Lib_SafeMathWrapper: subtraction overflow");
+    }
+ 
+    /**
+     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
+     * overflow (when the result is negative).
+     *
+     * Counterpart to Solidity's `-` operator.
+     *
+     * Requirements:
+     *
+     * - Subtraction cannot overflow.
+     */
+    function sub(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b <= a, errorMessage);
+        uint256 c = a - b;
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the multiplication of two unsigned integers, reverting on
+     * overflow.
+     *
+     * Counterpart to Solidity's `*` operator.
+     *
+     * Requirements:
+     *
+     * - Multiplication cannot overflow.
+     */
+    function mul(uint256 a, uint256 b) internal returns (uint256) {
+        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
+        // benefit is lost if 'b' is also tested.
+        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
+        Iif (a == 0) {
+            return 0;
+        }
+ 
+        uint256 c = a * b;
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c / a == b, "Lib_SafeMathWrapper: multiplication overflow");
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the integer division of two unsigned integers. Reverts on
+     * division by zero. The result is rounded towards zero.
+     *
+     * Counterpart to Solidity's `/` operator. Note: this function uses a
+     * `revert` opcode (which leaves remaining gas untouched) while Solidity
+     * uses an invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function div(uint256 a, uint256 b) internal returns (uint256) {
+        return div(a, b, "Lib_SafeMathWrapper: division by zero");
+    }
+ 
+    /**
+     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
+     * division by zero. The result is rounded towards zero.
+     *
+     * Counterpart to Solidity's `/` operator. Note: this function uses a
+     * `revert` opcode (which leaves remaining gas untouched) while Solidity
+     * uses an invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function div(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b > 0, errorMessage);
+        uint256 c = a / b;
+        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+     * Reverts when dividing by zero.
+     *
+     * Counterpart to Solidity's `%` operator. This function uses a `revert`
+     * opcode (which leaves remaining gas untouched) while Solidity uses an
+     * invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function mod(uint256 a, uint256 b) internal returns (uint256) {
+        return mod(a, b, "Lib_SafeMathWrapper: modulo by zero");
+    }
+ 
+    /**
+     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+     * Reverts with custom message when dividing by zero.
+     *
+     * Counterpart to Solidity's `%` operator. This function uses a `revert`
+     * opcode (which leaves remaining gas untouched) while Solidity uses an
+     * invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function mod(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b != 0, errorMessage);
+        return a % b;
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/libraries/wrappers/index.html b/coverage/libraries/wrappers/index.html new file mode 100644 index 000000000..4fa651258 --- /dev/null +++ b/coverage/libraries/wrappers/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for libraries/wrappers/ + + + + + + + +
+
+

+ all files libraries/wrappers/ +

+
+
+ 69.39% + Statements + 34/49 +
+
+ 75% + Branches + 6/8 +
+
+ 70.83% + Functions + 17/24 +
+
+ 68% + Lines + 34/50 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_SafeExecutionManagerWrapper.sol
100%30/3083.33%5/6100%16/1696.77%30/31
Lib_SafeMathWrapper.sol
21.05%4/1950%1/212.5%1/821.05%4/19
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html b/coverage/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..bf9e75672 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html @@ -0,0 +1,485 @@ + + + + Code coverage report for optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/accounts/ OVM_ECDSAContractAccount.sol +

+
+
+ 93.75% + Statements + 15/16 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 1/1 +
+
+ 93.75% + Lines + 15/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + +  +  +  +  +  + + +  +  +  +  +  + + +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+import { Lib_SafeMathWrapper } from "../../libraries/wrappers/Lib_SafeMathWrapper.sol";
+ 
+/**
+ * @title OVM_ECDSAContractAccount
+ * @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the
+ * ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by 
+ * providing eth_sign and EIP155 formatted transaction encodings.
+ *
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    // TODO: should be the amount sufficient to cover the gas costs of all of the transactions up
+    // to and including the CALL/CREATE which forms the entrypoint of the transaction.
+    uint256 constant EXECUTION_VALIDATION_GAS_OVERHEAD = 25000;
+    address constant ETH_ERC20_ADDRESS = 0x4200000000000000000000000000000000000006;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Executes a signed transaction.
+     * @param _transaction Signed EOA transaction.
+     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     * @return Whether or not the call returned (rather than reverted).
+     * @return Data returned by the call.
+     */
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        override
+        public
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
+ 
+        // Address of this contract within the ovm (ovmADDRESS) should be the same as the
+        // recovered address of the user who signed this message. This is how we manage to shim
+        // account abstraction even though the user isn't a contract.
+        // Need to make sure that the transaction nonce is right and bump it if so.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_ECDSAUtils.recover(
+                _transaction,
+                isEthSign,
+                _v,
+                _r,
+                _s
+            ) == Lib_SafeExecutionManagerWrapper.safeADDRESS(),
+            "Signature provided for EOA transaction execution is invalid."
+        );
+ 
+        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
+ 
+        // Need to make sure that the transaction chainId is correct.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.chainId == Lib_SafeExecutionManagerWrapper.safeCHAINID(),
+            "Transaction chainId does not match expected OVM chainId."
+        );
+ 
+        // Need to make sure that the transaction nonce is right.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
+            "Transaction nonce does not match the expected nonce."
+        );
+ 
+        // TEMPORARY: Disable gas checks for mainnet.
+        // // Need to make sure that the gas is sufficient to execute the transaction.
+        // Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+        //    gasleft() >= Lib_SafeMathWrapper.add(decodedTx.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD),
+        //    "Gas is not sufficient to execute the transaction."
+        // );
+ 
+        // Transfer fee to relayer.
+        address relayer = Lib_SafeExecutionManagerWrapper.safeCALLER();
+        uint256 fee = Lib_SafeMathWrapper.mul(decodedTx.gasLimit, decodedTx.gasPrice);
+        (bool success, ) = Lib_SafeExecutionManagerWrapper.safeCALL(
+            gasleft(),
+            ETH_ERC20_ADDRESS,
+            abi.encodeWithSignature("transfer(address,uint256)", relayer, fee)
+        );
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            success == true,
+            "Fee was not transferred to relayer."
+        );
+ 
+        // Contract creations are signalled by sending a transaction to the zero address.
+        if (decodedTx.to == address(0)) {
+            (address created, bytes memory revertData) = Lib_SafeExecutionManagerWrapper.safeCREATE(
+                decodedTx.gasLimit,
+                decodedTx.data
+            );
+ 
+            // Return true if the contract creation succeeded, false w/ revertData otherwise.
+            Eif (created != address(0)) {
+                return (true, abi.encode(created));
+            } else {
+                return (false, revertData);
+            }
+        } else {
+            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
+            // the nonce of the calling account. Normally an EOA would bump the nonce for both
+            // cases, but since this is a contract we'd end up bumping the nonce twice.
+            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
+ 
+            return Lib_SafeExecutionManagerWrapper.safeCALL(
+                decodedTx.gasLimit,
+                decodedTx.to,
+                decodedTx.data
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html b/coverage/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html new file mode 100644 index 000000000..ff7ae303f --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html @@ -0,0 +1,428 @@ + + + + Code coverage report for optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/accounts/ OVM_ProxyEOA.sol +

+
+
+ 87.5% + Statements + 7/8 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 5/5 +
+
+ 88.89% + Lines + 8/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_ProxyEOA
+ * @dev The Proxy EOA contract uses a delegate call to execute the logic in an implementation contract.
+ * In combination with the logic implemented in the ECDSA Contract Account, this enables a form of upgradable 
+ * 'account abstraction' on layer 2. 
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ProxyEOA {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _implementation Address of the initial implementation contract.
+     */
+    constructor(
+        address _implementation
+    )
+    {
+        _setImplementation(_implementation);
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        (bool success, bytes memory returndata) = Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
+            gasleft(),
+            getImplementation(),
+            msg.data
+        );
+ 
+        Eif (success) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            Lib_SafeExecutionManagerWrapper.safeREVERT(
+                string(returndata)
+            );
+        }
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Changes the implementation address.
+     * @param _implementation New implementation address.
+     */
+    function upgrade(
+        address _implementation
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_SafeExecutionManagerWrapper.safeADDRESS() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
+            "EOAs can only upgrade their own EOA implementation"
+        );
+ 
+        _setImplementation(_implementation);
+    }
+ 
+    /**
+     * Gets the address of the current implementation.
+     * @return Current implementation address.
+     */
+    function getImplementation()
+        public
+        returns (
+            address
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                IMPLEMENTATION_KEY
+            )
+        );
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _setImplementation(
+        address _implementation
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            IMPLEMENTATION_KEY,
+            Lib_Bytes32Utils.fromAddress(_implementation)
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/accounts/index.html b/coverage/optimistic-ethereum/OVM/accounts/index.html new file mode 100644 index 000000000..83293fefa --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/accounts/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/OVM/accounts/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/accounts/ +

+
+
+ 91.67% + Statements + 22/24 +
+
+ 66.67% + Branches + 4/6 +
+
+ 100% + Functions + 6/6 +
+
+ 92% + Lines + 23/25 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_ECDSAContractAccount.sol
93.75%15/1675%3/4100%1/193.75%15/16
OVM_ProxyEOA.sol
87.5%7/850%1/2100%5/588.89%8/9
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html new file mode 100644 index 000000000..165d915d8 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html @@ -0,0 +1,443 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/messaging/ Abs_BaseCrossDomainMessenger.sol +

+
+
+ 77.78% + Statements + 7/9 +
+
+ 50% + Branches + 1/2 +
+
+ 80% + Functions + 4/5 +
+
+ 77.78% + Lines + 7/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/* Library Imports */
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/**
+ * @title Abs_BaseCrossDomainMessenger
+ * @dev The Base Cross Domain Messenger is an abstract contract providing the interface and common functionality used in the
+ * L1 and L2 Cross Domain Messengers. It can also serve as a template for developers wishing to implement a custom bridge 
+ * contract to suit their needs.
+ *
+ * Compiler used: defined by child contract
+ * Runtime target: defined by child contract
+ */
+abstract contract Abs_BaseCrossDomainMessenger is iAbs_BaseCrossDomainMessenger, Lib_ReentrancyGuard {
+    /**************
+     *  Constants *
+     **************/
+ 
+    // The default x-domain message sender being set to a non-zero value makes
+    // deployment a bit more expensive, but in exchange the refund on every call to
+    // `relayMessage` by the L1 and L2 messengers will be higher.
+    address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    mapping (bytes32 => bool) public relayedMessages;
+    mapping (bytes32 => bool) public successfulMessages;
+    mapping (bytes32 => bool) public sentMessages;
+    uint256 public messageNonce;
+    address internal xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    constructor() Lib_ReentrancyGuard() {}
+ 
+    function xDomainMessageSender() public override view returns (address) {
+        Irequire(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set");
+        return xDomainMsgSender;
+    }
+ 
+    /**
+     * Sends a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _message Message to send to the target.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function sendMessage(
+        address _target,
+        bytes memory _message,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            msg.sender,
+            _message,
+            messageNonce
+        );
+ 
+        messageNonce += 1;
+        sentMessages[keccak256(xDomainCalldata)] = true;
+ 
+        _sendXDomainMessage(xDomainCalldata, _gasLimit);
+        emit SentMessage(xDomainCalldata);
+    }
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Generates the correct cross domain calldata for a message.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @return ABI encoded cross domain calldata.
+     */
+    function _getXDomainCalldata(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodeWithSignature(
+            "relayMessage(address,address,bytes,uint256)",
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * param // Message to send.
+     * param // Gas limit for the provided message.
+     */
+    function _sendXDomainMessage(
+        bytes memory, // _message,
+        uint256 // _gasLimit
+    )
+        virtual
+        internal
+    {
+        revert("Implement me in child contracts!");
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html new file mode 100644 index 000000000..64986d93c --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html @@ -0,0 +1,947 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L1CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 30/30 +
+
+ 75% + Branches + 12/16 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 31/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  + +  +  +  +  + + + +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_AddressManager } from "../../../libraries/resolver/Lib_AddressManager.sol";
+import { Lib_SecureMerkleTrie } from "../../../libraries/trie/Lib_SecureMerkleTrie.sol";
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+import { iOVM_CanonicalTransactionChain } from "../../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_StateCommitmentChain } from "../../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+ 
+/* Contract Imports */
+import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_L1CrossDomainMessenger
+ * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. 
+ * In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted 
+ * via this contract's replay function. 
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * Pass a default zero address to the address resolver. This will be updated when initialized.
+     */
+    constructor()
+        Lib_AddressResolver(address(0))
+    {}
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    function initialize(
+        address _libAddressManager
+    )
+        public
+    {
+        Erequire(address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized.");
+        libAddressManager = Lib_AddressManager(_libAddressManager);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may successfully call a method.
+     */
+    modifier onlyRelayer() {
+        address relayer = resolve("OVM_L2MessageRelayer");
+        if (relayer != address(0)) {
+            Irequire(
+                msg.sender == relayer,
+                "Only OVM_L2MessageRelayer can relay L2-to-L1 messages."
+            );
+        }
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @inheritdoc iOVM_L1CrossDomainMessenger
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        L2MessageInclusionProof memory _proof
+    )
+        override
+        public
+        nonReentrant
+        onlyRelayer()
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        require(
+            _verifyXDomainMessage(
+                xDomainCalldata,
+                _proof
+            ) == true,
+            "Provided message could not be verified."
+        );
+ 
+        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
+ 
+        require(
+            successfulMessages[xDomainCalldataHash] == false,
+            "Provided message has already been received."
+        );
+ 
+        xDomainMsgSender = _sender;
+        (bool success, ) = _target.call(_message);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+        // Mark the message as received if the call was successful. Ensures that a message can be
+        // relayed multiple times in the case that the call reverted.
+        Eif (success == true) {
+            successfulMessages[xDomainCalldataHash] = true;
+            emit RelayedMessage(xDomainCalldataHash);
+        }
+ 
+        // Store an identifier that can be used to prove that the given message was relayed by some
+        // user. Gives us an easy way to pay relayers for their work.
+        bytes32 relayId = keccak256(
+            abi.encodePacked(
+                xDomainCalldata,
+                msg.sender,
+                block.number
+            )
+        );
+        relayedMessages[relayId] = true;
+    }
+ 
+    /**
+     * Replays a cross domain message to the target messenger.
+     * @inheritdoc iOVM_L1CrossDomainMessenger
+     */
+    function replayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        require(
+            sentMessages[keccak256(xDomainCalldata)] == true,
+            "Provided message has not already been sent."
+        );
+ 
+        _sendXDomainMessage(xDomainCalldata, _gasLimit);
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Verifies that the given message is valid.
+     * @param _xDomainCalldata Calldata to verify.
+     * @param _proof Inclusion proof for the message.
+     * @return Whether or not the provided message is valid.
+     */
+    function _verifyXDomainMessage(
+        bytes memory _xDomainCalldata,
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        return (
+            _verifyStateRootProof(_proof)
+            && _verifyStorageProof(_xDomainCalldata, _proof)
+        );
+    }
+ 
+    /**
+     * Verifies that the state root within an inclusion proof is valid.
+     * @param _proof Message inclusion proof.
+     * @return Whether or not the provided proof is valid.
+     */
+    function _verifyStateRootProof(
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+ 
+        return (
+            ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) == false
+            && ovmStateCommitmentChain.verifyStateCommitment(
+                _proof.stateRoot,
+                _proof.stateRootBatchHeader,
+                _proof.stateRootProof
+            )
+        );
+    }
+ 
+    /**
+     * Verifies that the storage proof within an inclusion proof is valid.
+     * @param _xDomainCalldata Encoded message calldata.
+     * @param _proof Message inclusion proof.
+     * @return Whether or not the provided proof is valid.
+     */
+    function _verifyStorageProof(
+        bytes memory _xDomainCalldata,
+        L2MessageInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 storageKey = keccak256(
+            abi.encodePacked(
+                keccak256(
+                    abi.encodePacked(
+                        _xDomainCalldata,
+                        resolve("OVM_L2CrossDomainMessenger")
+                    )
+                ),
+                uint256(0)
+            )
+        );
+ 
+        (
+            bool exists,
+            bytes memory encodedMessagePassingAccount
+        ) = Lib_SecureMerkleTrie.get(
+            abi.encodePacked(0x4200000000000000000000000000000000000000),
+            _proof.stateTrieWitness,
+            _proof.stateRoot
+        );
+ 
+        Erequire(
+            exists == true,
+            "Message passing predeploy has not been initialized or invalid proof provided."
+        );
+ 
+        Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
+            encodedMessagePassingAccount
+        );
+ 
+        return Lib_SecureMerkleTrie.verifyInclusionProof(
+            abi.encodePacked(storageKey),
+            abi.encodePacked(uint8(1)),
+            _proof.storageTrieWitness,
+            account.storageRoot
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * @param _message Message to send.
+     * @param _gasLimit OVM gas limit for the message.
+     */
+    function _sendXDomainMessage(
+        bytes memory _message,
+        uint256 _gasLimit
+    )
+        override
+        internal
+    {
+        iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).enqueue(
+            resolve("OVM_L2CrossDomainMessenger"),
+            _gasLimit,
+            _message
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html new file mode 100644 index 000000000..71f510689 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html @@ -0,0 +1,275 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L1MultiMessageRelayer.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+import { iOVM_L1MultiMessageRelayer } from "../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol";
+ 
+/* Contract Imports */
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+ 
+/**
+ * @title OVM_L1MultiMessageRelayer
+ * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the 
+ * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain
+ * Message Sender.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+    constructor(
+        address _libAddressManager
+    ) 
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyBatchRelayer() {
+        require(
+            msg.sender == resolve("OVM_L2BatchMessageRelayer"),
+            "OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer"
+        );
+        _;
+    }
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying
+     * @param _messages An array of L2 to L1 messages
+     */
+    function batchRelayMessages(L2ToL1Message[] calldata _messages) 
+        override
+        external
+        onlyBatchRelayer 
+    {
+        iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(resolve("Proxy__OVM_L1CrossDomainMessenger"));
+        for (uint256 i = 0; i < _messages.length; i++) {
+            L2ToL1Message memory message = _messages[i];
+            messenger.relayMessage(
+                message.target,
+                message.sender,
+                message.message,
+                message.messageNonce,
+                message.proof
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html new file mode 100644 index 000000000..a646692ae --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html @@ -0,0 +1,473 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L2CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  + +  + +  +  +  +  + + + +  +  +  + + + +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
+ 
+/* Interface Imports */
+import { iOVM_L2CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol";
+import { iOVM_L1MessageSender } from "../../../iOVM/predeploys/iOVM_L1MessageSender.sol";
+import { iOVM_L2ToL1MessagePasser } from "../../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
+ 
+/* Contract Imports */
+import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_L2CrossDomainMessenger
+ * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point
+ * for L2 messages sent via the L1 Cross Domain Messenger.
+ * 
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+  */
+contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @inheritdoc iOVM_L2CrossDomainMessenger
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    )
+        override
+        nonReentrant
+        public
+    {
+        require(
+            _verifyXDomainMessage() == true,
+            "Provided message could not be verified."
+        );
+ 
+        bytes memory xDomainCalldata = _getXDomainCalldata(
+            _target,
+            _sender,
+            _message,
+            _messageNonce
+        );
+ 
+        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
+ 
+        require(
+            successfulMessages[xDomainCalldataHash] == false,
+            "Provided message has already been received."
+        );
+ 
+        xDomainMsgSender = _sender;
+        (bool success, ) = _target.call(_message);
+        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
+ 
+        // Mark the message as received if the call was successful. Ensures that a message can be
+        // relayed multiple times in the case that the call reverted.
+        Eif (success == true) {
+            successfulMessages[xDomainCalldataHash] = true;
+            emit RelayedMessage(xDomainCalldataHash);
+        }
+ 
+        // Store an identifier that can be used to prove that the given message was relayed by some
+        // user. Gives us an easy way to pay relayers for their work.
+        bytes32 relayId = keccak256(
+            abi.encodePacked(
+                xDomainCalldata,
+                msg.sender,
+                block.number
+            )
+        );
+        relayedMessages[relayId] = true;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Verifies that a received cross domain message is valid.
+     * @return _valid Whether or not the message is valid.
+     */
+    function _verifyXDomainMessage()
+        view
+        internal
+        returns (
+            bool _valid
+        )
+    {
+        return (
+            iOVM_L1MessageSender(resolve("OVM_L1MessageSender")).getL1MessageSender() == resolve("OVM_L1CrossDomainMessenger")
+        );
+    }
+ 
+    /**
+     * Sends a cross domain message.
+     * @param _message Message to send.
+     * param _gasLimit Gas limit for the provided message.
+     */
+    function _sendXDomainMessage(
+        bytes memory _message,
+        uint256 // _gasLimit
+    )
+        override
+        internal
+    {
+        iOVM_L2ToL1MessagePasser(resolve("OVM_L2ToL1MessagePasser")).passMessageToL1(_message);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/index.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/index.html new file mode 100644 index 000000000..69677e4b5 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/messaging/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/messaging/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/bridge/messaging/ +

+
+
+ 96.55% + Statements + 56/58 +
+
+ 76.92% + Branches + 20/26 +
+
+ 95.24% + Functions + 20/21 +
+
+ 96.67% + Lines + 58/60 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_BaseCrossDomainMessenger.sol
77.78%7/950%1/280%4/577.78%7/9
OVM_L1CrossDomainMessenger.sol
100%30/3075%12/16100%9/9100%31/31
OVM_L1MultiMessageRelayer.sol
100%5/5100%2/2100%3/3100%6/6
OVM_L2CrossDomainMessenger.sol
100%14/1483.33%5/6100%4/4100%14/14
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html new file mode 100644 index 000000000..6be8e110e --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html @@ -0,0 +1,692 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ Abs_L1TokenGateway.sol +

+
+
+ 83.33% + Statements + 10/12 +
+
+ 100% + Branches + 0/0 +
+
+ 75% + Functions + 6/8 +
+
+ 83.33% + Lines + 10/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm 
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+ 
+/**
+ * @title Abs_L1TokenGateway
+ * @dev An L1 Token Gateway is a contract which stores deposited L1 funds that are in use on L2.
+ * It synchronizes a corresponding L2 representation of the "deposited token", informing it
+ * of new deposits and releasing L1 funds when there are newly finalized withdrawals.
+ *
+ * NOTE: This abstract contract gives all the core functionality of an L1 token gateway, 
+ * but provides easy hooks in case developers need extensions in child contracts.
+ * In many cases, the default OVM_L1ERC20Gateway will suffice.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+abstract contract Abs_L1TokenGateway is iOVM_L1TokenGateway, OVM_CrossDomainEnabled {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    address public l2DepositedToken;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l2DepositedToken iOVM_L2DepositedToken-compatible address on the chain being deposited into.
+     * @param _l1messenger L1 Messenger address being used for cross-chain communications.
+     */
+    constructor(
+        address _l2DepositedToken,
+        address _l1messenger 
+    )
+        OVM_CrossDomainEnabled(_l1messenger)
+    {
+        l2DepositedToken = _l2DepositedToken;
+    }
+ 
+    /********************************
+     * Overridable Accounting logic *
+     ********************************/
+ 
+    // Default gas value which can be overridden if more complex logic runs on L2.
+    uint32 public DEFAULT_FINALIZE_DEPOSIT_L2_GAS = 1200000;
+ 
+    /**
+     * @dev Core logic to be performed when a withdrawal is finalized on L1.
+     * In most cases, this will simply send locked funds to the withdrawer.
+     *
+     * param _to Address being withdrawn to.
+     * param _amount Amount being withdrawn.
+     */
+    function _handleFinalizeWithdrawal(
+        address, // _to,
+        uint256 // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Implement me in child contracts");
+    }
+ 
+    /**
+     * @dev Core logic to be performed when a deposit is initiated on L1.
+     * In most cases, this will simply send locked funds to the withdrawer.
+     *
+     * param _from Address being deposited from on L1.
+     * param _to Address being deposited into on L2.
+     * param _amount Amount being deposited.
+     */
+    function _handleInitiateDeposit(
+        address, // _from,
+        address, // _to,
+        uint256 // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Implement me in child contracts");
+    }
+ 
+    /**
+     * @dev Overridable getter for the L2 gas limit, in the case it may be
+     * dynamic, and the above public constant does not suffice.
+     *
+     */
+ 
+    function getFinalizeDepositL2Gas()
+        public
+        view
+        returns(
+            uint32
+        )
+    {
+        return DEFAULT_FINALIZE_DEPOSIT_L2_GAS;
+    }
+ 
+    /**************
+     * Depositing *
+     **************/
+ 
+    /**
+     * @dev deposit an amount of the ERC20 to the caller's balance on L2
+     * @param _amount Amount of the ERC20 to deposit
+     */
+    function deposit(
+        uint _amount
+    )
+        public
+        override
+    {
+        _initiateDeposit(msg.sender, msg.sender, _amount);
+    }
+ 
+    /**
+     * @dev deposit an amount of ERC20 to a recipients's balance on L2
+     * @param _to L2 address to credit the withdrawal to
+     * @param _amount Amount of the ERC20 to deposit
+     */
+    function depositTo(
+        address _to,
+        uint _amount
+    )
+        public
+        override
+    {
+        _initiateDeposit(msg.sender, _to, _amount);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by informing the L2 Deposited Token
+     * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)
+     *
+     * @param _from Account to pull the deposit from on L1
+     * @param _to Account to give the deposit to on L2
+     * @param _amount Amount of the ERC20 to deposit.
+     */
+    function _initiateDeposit(
+        address _from,
+        address _to,
+        uint _amount
+    )
+        internal
+    {
+        // Call our deposit accounting handler implemented by child contracts.
+        _handleInitiateDeposit(
+            _from,
+            _to,
+            _amount
+        );
+ 
+        // Construct calldata for l2DepositedToken.finalizeDeposit(_to, _amount)
+        bytes memory data = abi.encodeWithSelector(
+            iOVM_L2DepositedToken.finalizeDeposit.selector,
+            _to,
+            _amount
+        );
+ 
+        // Send calldata into L2
+        sendCrossDomainMessage(
+            l2DepositedToken,
+            data,
+            getFinalizeDepositL2Gas()
+        );
+ 
+        emit DepositInitiated(_from, _to, _amount);
+    }
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    /**
+     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the 
+     * L1 ERC20 token. 
+     * This call will fail if the initialized withdrawal from L2 has not been finalized. 
+     *
+     * @param _to L1 address to credit the withdrawal to
+     * @param _amount Amount of the ERC20 to withdraw
+     */
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external
+        override 
+        onlyFromCrossDomainAccount(l2DepositedToken)
+    {
+        // Call our withdrawal accounting handler implemented by child contracts.
+        _handleFinalizeWithdrawal(
+            _to,
+            _amount
+        );
+ 
+        emit WithdrawalFinalized(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html new file mode 100644 index 000000000..a16bb0653 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html @@ -0,0 +1,755 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ Abs_L2DepositedToken.sol +

+
+
+ 86.67% + Statements + 13/15 +
+
+ 50% + Branches + 2/4 +
+
+ 80% + Functions + 8/10 +
+
+ 87.5% + Lines + 14/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  + +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+ 
+/**
+ * @title Abs_L2DepositedToken
+ * @dev An L2 Deposited Token is an L2 representation of funds which were deposited from L1.
+ * Usually contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
+ * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
+ *
+ * NOTE: This abstract contract gives all the core functionality of a deposited token implementation except for the
+ * token's internal accounting itself.  This gives developers an easy way to implement children with their own token code.
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+abstract contract Abs_L2DepositedToken is iOVM_L2DepositedToken, OVM_CrossDomainEnabled {
+ 
+    /*******************
+     * Contract Events *
+     *******************/
+ 
+    event Initialized(iOVM_L1TokenGateway _l1TokenGateway);
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    iOVM_L1TokenGateway public l1TokenGateway;
+ 
+    /********************************
+     * Constructor & Initialization *
+     ********************************/
+ 
+    /**
+     * @param _l2CrossDomainMessenger L1 Messenger address being used for cross-chain communications.
+     */
+    constructor(
+        address _l2CrossDomainMessenger
+    )
+        OVM_CrossDomainEnabled(_l2CrossDomainMessenger)
+    {}
+ 
+    /**
+     * @dev Initialize this contract with the L1 token gateway address.
+     * The flow: 1) this contract gets deployed on L2, 2) the L1
+     * gateway is deployed with addr from (1), 3) L1 gateway address passed here.
+     *
+     * @param _l1TokenGateway Address of the corresponding L1 gateway deployed to the main chain
+     */
+ 
+    function init(
+        iOVM_L1TokenGateway _l1TokenGateway
+    )
+        public
+    {
+        Erequire(address(l1TokenGateway) == address(0), "Contract has already been initialized");
+ 
+        l1TokenGateway = _l1TokenGateway;
+        
+        emit Initialized(l1TokenGateway);
+    }
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyInitialized() {
+        Erequire(address(l1TokenGateway) != address(0), "Contract has not yet been initialized");
+        _;
+    }
+ 
+    /********************************
+     * Overridable Accounting logic *
+     ********************************/
+ 
+    // Default gas value which can be overridden if more complex logic runs on L2.
+    uint32 constant DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS = 100000;
+ 
+    /**
+     * @dev Core logic to be performed when a withdrawal from L2 is initialized.
+     * In most cases, this will simply burn the withdrawn L2 funds.
+     *
+     * param _to Address being withdrawn to
+     * param _amount Amount being withdrawn
+     */
+ 
+    function _handleInitiateWithdrawal(
+        address, // _to,
+        uint // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Accounting must be implemented by child contract.");
+    }
+ 
+    /**
+     * @dev Core logic to be performed when a deposit from L2 is finalized on L2.
+     * In most cases, this will simply _mint() to credit L2 funds to the recipient.
+     *
+     * param _to Address being deposited to on L2
+     * param _amount Amount which was deposited on L1
+     */
+    function _handleFinalizeDeposit(
+        address, // _to
+        uint // _amount
+    )
+        internal
+        virtual
+    {
+        revert("Accounting must be implemented by child contract.");
+    }
+ 
+    /**
+     * @dev Overridable getter for the *L1* gas limit of settling the withdrawal, in the case it may be
+     * dynamic, and the above public constant does not suffice.
+     *
+     */
+ 
+    function getFinalizeWithdrawalL1Gas()
+        public
+        view
+        virtual
+        returns(
+            uint32
+        )
+    {
+        return DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS;
+    }
+ 
+ 
+    /***************
+     * Withdrawing *
+     ***************/
+ 
+    /**
+     * @dev initiate a withdraw of some tokens to the caller's account on L1
+     * @param _amount Amount of the token to withdraw
+     */
+    function withdraw(
+        uint _amount
+    )
+        external
+        override
+        onlyInitialized()
+    {
+        _initiateWithdrawal(msg.sender, _amount);
+    }
+ 
+    /**
+     * @dev initiate a withdraw of some token to a recipient's account on L1
+     * @param _to L1 adress to credit the withdrawal to
+     * @param _amount Amount of the token to withdraw
+     */
+    function withdrawTo(
+        address _to,
+        uint _amount
+    )
+        external
+        override
+        onlyInitialized()
+    {
+        _initiateWithdrawal(_to, _amount);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by storing the token and informing the L2 token Gateway of the deposit.
+     *
+     * @param _to Account to give the withdrawal to on L1
+     * @param _amount Amount of the token to withdraw
+     */
+    function _initiateWithdrawal(
+        address _to,
+        uint _amount
+    )
+        internal
+    {
+        // Call our withdrawal accounting handler implemented by child contracts (usually a _burn)
+        _handleInitiateWithdrawal(_to, _amount);
+ 
+        // Construct calldata for l1TokenGateway.finalizeWithdrawal(_to, _amount)
+        bytes memory data = abi.encodeWithSelector(
+            iOVM_L1TokenGateway.finalizeWithdrawal.selector,
+            _to,
+            _amount
+        );
+ 
+        // Send message up to L1 gateway
+        sendCrossDomainMessage(
+            address(l1TokenGateway),
+            data,
+            getFinalizeWithdrawalL1Gas()
+        );
+ 
+        emit WithdrawalInitiated(msg.sender, _to, _amount);
+    }
+ 
+    /************************************
+     * Cross-chain Function: Depositing *
+     ************************************/
+ 
+    /**
+     * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this 
+     * L2 token. 
+     * This call will fail if it did not originate from a corresponding deposit in OVM_l1TokenGateway. 
+     *
+     * @param _to Address to receive the withdrawal at
+     * @param _amount Amount of the token to withdraw
+     */
+    function finalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        external
+        override 
+        onlyInitialized()
+        onlyFromCrossDomainAccount(address(l1TokenGateway))
+    {
+        _handleFinalizeDeposit(_to, _amount);
+        emit DepositFinalized(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html new file mode 100644 index 000000000..d1b1fb47f --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html @@ -0,0 +1,365 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L1ERC20Gateway.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 3/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm 
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+import { Abs_L1TokenGateway } from "./Abs_L1TokenGateway.sol";
+import { iOVM_ERC20 } from "../../../iOVM/predeploys/iOVM_ERC20.sol";
+ 
+/**
+ * @title OVM_L1ERC20Gateway
+ * @dev The L1 ERC20 Gateway is a contract which stores deposited L1 funds that are in use on L2.
+ * It synchronizes a corresponding L2 ERC20 Gateway, informing it of deposits, and listening to it
+ * for newly finalized withdrawals.
+ *
+ * NOTE: This contract extends Abs_L1TokenGateway, which is where we
+ * takes care of most of the initialization and the cross-chain logic.
+ * If you are looking to implement your own deposit/withdrawal contracts, you
+ * may also want to extend the abstract contract in a similar manner.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1ERC20Gateway is Abs_L1TokenGateway {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+    
+    iOVM_ERC20 public l1ERC20;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l1ERC20 L1 ERC20 address this contract stores deposits for
+     * @param _l2DepositedERC20 L2 Gateway address on the chain being deposited into
+     */
+    constructor(
+        iOVM_ERC20 _l1ERC20,
+        address _l2DepositedERC20,
+        address _l1messenger 
+    )
+        Abs_L1TokenGateway(
+            _l2DepositedERC20,
+            _l1messenger
+        )
+    {
+        l1ERC20 = _l1ERC20;
+    }
+ 
+ 
+    /**************
+     * Accounting *
+     **************/
+ 
+    /**
+     * @dev When a deposit is initiated on L1, the L1 Gateway
+     * transfers the funds to itself for future withdrawals
+     *
+     * @param _from L1 address ETH is being deposited from
+     * param _to L2 address that the ETH is being deposited to
+     * @param _amount Amount of ERC20 to send
+     */
+    function _handleInitiateDeposit(
+        address _from,
+        address, // _to,
+        uint256 _amount
+    )
+        internal
+        override
+    {
+         // Hold on to the newly deposited funds
+        l1ERC20.transferFrom(
+            _from,
+            address(this),
+            _amount
+        );
+    }
+ 
+    /**
+     * @dev When a withdrawal is finalized on L1, the L1 Gateway
+     * transfers the funds to the withdrawer
+     *
+     * @param _to L1 address that the ERC20 is being withdrawn to
+     * @param _amount Amount of ERC20 to send
+     */
+    function _handleFinalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        // Transfer withdrawn funds out to withdrawer
+        l1ERC20.transfer(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html new file mode 100644 index 000000000..64267feef --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html @@ -0,0 +1,557 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L1ETHGateway.sol +

+
+
+ 100% + Statements + 11/11 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 6/6 +
+
+ 91.67% + Lines + 11/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1ETHGateway } from "../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol";
+import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
+ 
+/* Library Imports */
+import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
+import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/**
+ * @title OVM_L1ETHGateway
+ * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {
+ 
+    /********************
+     * Public Constants *
+     ********************/
+ 
+    uint32 public constant override getFinalizeDepositL2Gas = 1200000;
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    address public ovmEth;
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address manager for this OE deployment
+     * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken
+     */
+    constructor(
+        address _libAddressManager,
+        address _ovmEth
+    )
+        OVM_CrossDomainEnabled(address(0)) // overridden in constructor code
+        Lib_AddressResolver(_libAddressManager)
+    {
+        ovmEth = _ovmEth;
+        messenger = resolve("Proxy__OVM_L1CrossDomainMessenger"); // overrides OVM_CrossDomainEnabled constructor setting because resolve() is not yet accessible
+    }
+ 
+    /**************
+     * Depositing *
+     **************/
+ 
+    receive()
+        external
+        payable
+    {
+        _initiateDeposit(msg.sender, msg.sender);
+    }
+ 
+    /**
+     * @dev deposit an amount of the ETH to the caller's balance on L2
+     */
+    function deposit() 
+        external
+        override
+        payable
+    {
+        _initiateDeposit(msg.sender, msg.sender);
+    }
+ 
+    /**
+     * @dev deposit an amount of ETH to a recipients's balance on L2
+     * @param _to L2 address to credit the withdrawal to
+     */
+    function depositTo(
+        address _to
+    )
+        external
+        override
+        payable
+    {
+        _initiateDeposit(msg.sender, _to);
+    }
+ 
+    /**
+     * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.
+     *
+     * @param _from Account to pull the deposit from on L1
+     * @param _to Account to give the deposit to on L2
+     */
+    function _initiateDeposit(
+        address _from,
+        address _to
+    )
+        internal
+    {
+        // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)
+        bytes memory data =
+            abi.encodeWithSelector(
+                iOVM_L2DepositedToken.finalizeDeposit.selector,
+                _to,
+                msg.value
+            );
+ 
+        // Send calldata into L2
+        sendCrossDomainMessage(
+            ovmEth,
+            data,
+            getFinalizeDepositL2Gas
+        );
+ 
+        emit DepositInitiated(_from, _to, msg.value);
+    }
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    /**
+     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the
+     * L1 ETH token.
+     * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized. 
+     *
+     * @param _to L1 address to credit the withdrawal to
+     * @param _amount Amount of the ETH to withdraw
+     */
+    function finalizeWithdrawal(
+        address _to,
+        uint256 _amount
+    )
+        external
+        override
+        onlyFromCrossDomainAccount(ovmEth)
+    {
+        _safeTransferETH(_to, _amount);
+ 
+        emit WithdrawalFinalized(_to, _amount);
+    }
+ 
+    /**********************************
+     * Internal Functions: Accounting *
+     **********************************/
+ 
+    /**
+     * @dev Internal accounting function for moving around L1 ETH.
+     *
+     * @param _to L1 address to transfer ETH to
+     * @param _value Amount of ETH to send to
+     */
+    function _safeTransferETH(
+        address _to,
+        uint256 _value
+    )
+        internal
+    {
+        (bool success, ) = _to.call{value: _value}(new bytes(0));
+        Erequire(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html new file mode 100644 index 000000000..703ace05a --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html @@ -0,0 +1,266 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L2DepositedERC20.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Contract Imports */
+import { UniswapV2ERC20 } from "../../../libraries/standards/UniswapV2ERC20.sol";
+ 
+/* Library Imports */
+import { Abs_L2DepositedToken } from "./Abs_L2DepositedToken.sol";
+ 
+/**
+ * @title OVM_L2DepositedERC20
+ * @dev The L2 Deposited ERC20 is an ERC20 implementation which represents L1 assets deposited into L2.
+ * This contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
+ * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
+ *
+ * NOTE: This contract implements the Abs_L2DepositedToken contract using Uniswap's ERC20 as the implementation.
+ * Alternative implementations can be used in this similar manner.
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract OVM_L2DepositedERC20 is Abs_L2DepositedToken, UniswapV2ERC20 {
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.
+     * @param _name ERC20 name
+     * @param _symbol ERC20 symbol
+     */
+    constructor(
+        address _l2CrossDomainMessenger,
+        string memory _name,
+        string memory _symbol
+    )
+        Abs_L2DepositedToken(_l2CrossDomainMessenger)
+        UniswapV2ERC20(_name, _symbol)
+    {}
+ 
+    // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2 usage.
+    function _handleInitiateWithdrawal(
+        address, // _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        _burn(msg.sender, _amount);
+    }
+ 
+    // When a deposit is finalized, we credit the account on L2 with the same amount of tokens.
+    function _handleFinalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        internal
+        override
+    {
+        _mint(_to, _amount);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/index.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/index.html new file mode 100644 index 000000000..6d14f7c59 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/bridge/tokens/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for optimistic-ethereum/OVM/bridge/tokens/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/bridge/tokens/ +

+
+
+ 90.7% + Statements + 39/43 +
+
+ 50% + Branches + 3/6 +
+
+ 86.67% + Functions + 26/30 +
+
+ 88.89% + Lines + 40/45 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_L1TokenGateway.sol
83.33%10/12100%0/075%6/883.33%10/12
Abs_L2DepositedToken.sol
86.67%13/1550%2/480%8/1087.5%14/16
OVM_L1ERC20Gateway.sol
100%3/3100%0/0100%3/3100%3/3
OVM_L1ETHGateway.sol
100%11/1150%1/2100%6/691.67%11/12
OVM_L2DepositedERC20.sol
100%2/2100%0/0100%3/3100%2/2
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html b/coverage/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html new file mode 100644 index 000000000..a87b5bba5 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html @@ -0,0 +1,3755 @@ + + + + Code coverage report for optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/chain/ OVM_CanonicalTransactionChain.sol +

+
+
+ 95.51% + Statements + 149/156 +
+
+ 87.5% + Branches + 63/72 +
+
+ 84.38% + Functions + 27/32 +
+
+ 95.88% + Lines + 163/170 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +228× +228× +228× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +595× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +388× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +309× +309× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +106× +106× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +47× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +239× +  +  +  +  +238× +  +  +  +  +237× +  +  +  +  +  +  +  +236× +236× +  +  +  +236× +  +  +  +  +  +  +235× +235× +37600× +  +  +235× +  +  +  +  +  +  +  +  +235× +235× +  +  +  +  +235× +  +235× +235× +  +  +  +  +235× +235× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +110× +110× +110× +110× +  +  +  +  +  +110× +  +  +  +  +109× +  +  +  +  +108× +  +  +  +  +107× +  +  +  +  +106× +  +106× +  +  +  +  +  +  +  +106× +106× +  +  +  +  +106× +  +  +106× +  +  +106× +  +  +106× +  +  +  +106× +  +106× +106× +835× +  +835× +  +106× +  +  +  +829× +  +  +  +  +  +  +  +824× +  +  +824× +1639× +1639× +  +  +  +1639× +  +  +  +  +  +  +1639× +1639× +1639× +  +  +  +824× +179× +  +  +  +  +178× +178× +178× +  +  +  +94× +  +  +  +  +  +  +88× +  +  +  +  +87× +  +  +  +  +  +87× +87× +87× +87× +  +45× +45× +  +  +  +  +  +42× +  +  +  +  +42× +42× +  +  +  +  +  +87× +  +  +  +  +  +  +  +87× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +835× +835× +835× +835× +835× +  +835× +  +  +  +  +  +  +835× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +506× +  +506× +506× +506× +506× +506× +  +  +  +  +  +  +  +506× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +87× +87× +  +  +  +  +  +  +  +87× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +179× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +267× +267× +265× +  +265× +265× +265× +  +  +  +  +265× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +106× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1639× +419× +  +  +1639× +1639× +  +1639× +1639× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1639× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +87× +87× +  +87× +  +  +  +  +  +  +  +87× +  +  +  +  +  +  +  +87× +87× +  +  +  +  +  +  +87× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +106× + +  + +  +  +  +  + +  +  +  +  +  +  +102× +  +  +  +  +101× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +178× +  +  +  +  +  +177× +  +  +  +  +  +  +176× +  +  +  +  +174× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +829× +  +  +  +  +828× +  +  +  +  +  +827× +175× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +94× + +  +  +  +  +  +  +91× +89× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +179× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
+import { Lib_Math } from "../../libraries/utils/Lib_Math.sol";
+ 
+/* Interface Imports */
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/* Contract Imports */
+import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
+ 
+ 
+/**
+ * @title OVM_CanonicalTransactionChain
+ * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions
+ * which must be applied to the rollup state. It defines the ordering of rollup transactions by
+ * writing them to the 'CTC:batches' instance of the Chain Storage Container.
+ * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer
+ * will eventually append it to the rollup state.
+ * If the Sequencer does not include an enqueued transaction within the 'force inclusion period',
+ * then any account may force it to be included by calling appendQueueBatch().
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_AddressResolver {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    // L2 tx gas-related
+    uint256 constant public MIN_ROLLUP_TX_GAS = 100000;
+    uint256 constant public MAX_ROLLUP_TX_SIZE = 10000;
+    uint256 constant public L2_GAS_DISCOUNT_DIVISOR = 32;
+ 
+    // Encoding-related (all in bytes)
+    uint256 constant internal BATCH_CONTEXT_SIZE = 16;
+    uint256 constant internal BATCH_CONTEXT_LENGTH_POS = 12;
+    uint256 constant internal BATCH_CONTEXT_START_POS = 15;
+    uint256 constant internal TX_DATA_HEADER_SIZE = 3;
+    uint256 constant internal BYTES_TILL_TX_DATA = 65;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    uint256 public forceInclusionPeriodSeconds;
+    uint256 public forceInclusionPeriodBlocks;
+    uint256 public maxTransactionGasLimit;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    constructor(
+        address _libAddressManager,
+        uint256 _forceInclusionPeriodSeconds,
+        uint256 _forceInclusionPeriodBlocks,
+        uint256 _maxTransactionGasLimit
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        forceInclusionPeriodSeconds = _forceInclusionPeriodSeconds;
+        forceInclusionPeriodBlocks = _forceInclusionPeriodBlocks;
+        maxTransactionGasLimit = _maxTransactionGasLimit;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        override
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:CTC:batches")
+        );
+    }
+ 
+    /**
+     * Accesses the queue storage container.
+     * @return Reference to the queue storage container.
+     */
+    function queue()
+        override
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:CTC:queue")
+        );
+    }
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        override
+        public
+        view
+        returns (
+            uint256 _totalElements
+        )
+    {
+        (uint40 totalElements,,,) = _getBatchExtraData();
+        return uint256(totalElements);
+    }
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        override
+        public
+        view
+        returns (
+            uint256 _totalBatches
+        )
+    {
+        return batches().length();
+    }
+ 
+    /**
+     * Returns the index of the next element to be enqueued.
+     * @return Index for the next queue element.
+     */
+    function getNextQueueIndex()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,uint40 nextQueueIndex,,) = _getBatchExtraData();
+        return nextQueueIndex;
+    }
+ 
+    /**
+     * Returns the timestamp of the last transaction.
+     * @return Timestamp for the last transaction.
+     */
+    function getLastTimestamp()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,,uint40 lastTimestamp,) = _getBatchExtraData();
+        return lastTimestamp;
+    }
+ 
+    /**
+     * Returns the blocknumber of the last transaction.
+     * @return Blocknumber for the last transaction.
+     */
+    function getLastBlockNumber()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        (,,,uint40 lastBlockNumber) = _getBatchExtraData();
+        return lastBlockNumber;
+    }
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function getQueueElement(
+        uint256 _index
+    )
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        )
+    {
+        return _getQueueElement(
+            _index,
+            queue()
+        );
+    }
+ 
+    /**
+     * Get the number of queue elements which have not yet been included.
+     * @return Number of pending queue elements.
+     */
+    function getNumPendingQueueElements()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        return getQueueLength() - getNextQueueIndex();
+    }
+ 
+   /**
+     * Retrieves the length of the queue, including
+     * both pending and canonical transactions.
+     * @return Length of the queue.
+     */
+    function getQueueLength()
+        override
+        public
+        view
+        returns (
+            uint40
+        )
+    {
+        return _getQueueLength(
+            queue()
+        );
+    }
+ 
+    /**
+     * Adds a transaction to the queue.
+     * @param _target Target L2 contract to send the transaction to.
+     * @param _gasLimit Gas limit for the enqueued L2 transaction.
+     * @param _data Transaction data.
+     */
+    function enqueue(
+        address _target,
+        uint256 _gasLimit,
+        bytes memory _data
+    )
+        override
+        public
+    {
+        require(
+            _data.length <= MAX_ROLLUP_TX_SIZE,
+            "Transaction data size exceeds maximum for rollup transaction."
+        );
+ 
+        require(
+            _gasLimit <= maxTransactionGasLimit,
+            "Transaction gas limit exceeds maximum for rollup transaction."
+        );
+ 
+        require(
+            _gasLimit >= MIN_ROLLUP_TX_GAS,
+            "Transaction gas limit too low to enqueue."
+        );
+ 
+        // We need to consume some amount of L1 gas in order to rate limit transactions going into
+        // L2. However, L2 is cheaper than L1 so we only need to burn some small proportion of the
+        // provided L1 gas.
+        uint256 gasToConsume = _gasLimit/L2_GAS_DISCOUNT_DIVISOR;
+        uint256 startingGas = gasleft();
+ 
+        // Although this check is not necessary (burn below will run out of gas if not true), it
+        // gives the user an explicit reason as to why the enqueue attempt failed.
+        require(
+            startingGas > gasToConsume,
+            "Insufficient gas for L2 rate limiting burn."
+        );
+ 
+        // Here we do some "dumb" work in order to burn gas, although we should probably replace
+        // this with something like minting gas token later on.
+        uint256 i;
+        while(startingGas - gasleft() < gasToConsume) {
+            i++;
+        }
+ 
+        bytes32 transactionHash = keccak256(
+            abi.encode(
+                msg.sender,
+                _target,
+                _gasLimit,
+                _data
+            )
+        );
+ 
+        bytes32 timestampAndBlockNumber;
+        assembly {
+            timestampAndBlockNumber := timestamp()
+            timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
+        }
+ 
+        iOVM_ChainStorageContainer queueRef = queue();
+ 
+        queueRef.push(transactionHash);
+        queueRef.push(timestampAndBlockNumber);
+ 
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the real queue length we need
+        // to divide by 2 and subtract 1.
+        uint256 queueIndex = queueRef.length() / 2 - 1;
+        emit TransactionEnqueued(
+            msg.sender,
+            _target,
+            _gasLimit,
+            _data,
+            queueIndex,
+            block.timestamp
+        );
+    }
+ 
+    /**
+     * Appends a given number of queued transactions as a single batch.
+     * param _numQueuedTransactions Number of transactions to append.
+     */
+    function appendQueueBatch(
+        uint256 // _numQueuedTransactions
+    )
+        override
+        public
+        pure
+    {
+        // TEMPORARY: Disable `appendQueueBatch` for minnet
+        revert("appendQueueBatch is currently disabled.");
+ 
+        // _numQueuedTransactions = Lib_Math.min(_numQueuedTransactions, getNumPendingQueueElements());
+        // require(
+        //     _numQueuedTransactions > 0,
+        //     "Must append more than zero transactions."
+        // );
+ 
+        // bytes32[] memory leaves = new bytes32[](_numQueuedTransactions);
+        // uint40 nextQueueIndex = getNextQueueIndex();
+ 
+        // for (uint256 i = 0; i < _numQueuedTransactions; i++) {
+        //     if (msg.sender != resolve("OVM_Sequencer")) {
+        //         Lib_OVMCodec.QueueElement memory el = getQueueElement(nextQueueIndex);
+        //         require(
+        //             el.timestamp + forceInclusionPeriodSeconds < block.timestamp,
+        //             "Queue transactions cannot be submitted during the sequencer inclusion period."
+        //         );
+        //     }
+        //     leaves[i] = _getQueueLeafHash(nextQueueIndex);
+        //     nextQueueIndex++;
+        // }
+ 
+        // Lib_OVMCodec.QueueElement memory lastElement = getQueueElement(nextQueueIndex - 1);
+ 
+        // _appendBatch(
+        //     Lib_MerkleTree.getMerkleRoot(leaves),
+        //     _numQueuedTransactions,
+        //     _numQueuedTransactions,
+        //     lastElement.timestamp,
+        //     lastElement.blockNumber
+        // );
+ 
+        // emit QueueBatchAppended(
+        //     nextQueueIndex - _numQueuedTransactions,
+        //     _numQueuedTransactions,
+        //     getTotalElements()
+        // );
+    }
+ 
+    /**
+     * Allows the sequencer to append a batch of transactions.
+     * @dev This function uses a custom encoding scheme for efficiency reasons.
+     * .param _shouldStartAtElement Specific batch we expect to start appending to.
+     * .param _totalElementsToAppend Total number of batch elements we expect to append.
+     * .param _contexts Array of batch contexts.
+     * .param _transactionDataFields Array of raw transaction data.
+     */
+    function appendSequencerBatch()
+        override
+        public
+    {
+        uint40 shouldStartAtElement;
+        uint24 totalElementsToAppend;
+        uint24 numContexts;
+        assembly {
+            shouldStartAtElement  := shr(216, calldataload(4))
+            totalElementsToAppend := shr(232, calldataload(9))
+            numContexts           := shr(232, calldataload(12))
+        }
+ 
+        require(
+            shouldStartAtElement == getTotalElements(),
+            "Actual batch start index does not match expected start index."
+        );
+ 
+        require(
+            msg.sender == resolve("OVM_Sequencer"),
+            "Function can only be called by the Sequencer."
+        );
+ 
+        require(
+            numContexts > 0,
+            "Must provide at least one batch context."
+        );
+ 
+        require(
+            totalElementsToAppend > 0,
+            "Must append at least one element."
+        );
+ 
+        uint40 nextTransactionPtr = uint40(BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts);
+ 
+        Erequire(
+            msg.data.length >= nextTransactionPtr,
+            "Not enough BatchContexts provided."
+        );
+ 
+        // Take a reference to the queue and its length so we don't have to keep resolving it.
+        // Length isn't going to change during the course of execution, so it's fine to simply
+        // resolve this once at the start. Saves gas.
+        iOVM_ChainStorageContainer queueRef = queue();
+        uint40 queueLength = _getQueueLength(queueRef);
+ 
+        // Reserve some memory to save gas on hashing later on. This is a relatively safe estimate
+        // for the average transaction size that will prevent having to resize this chunk of memory
+        // later on. Saves gas.
+        bytes memory hashMemory = new bytes((msg.data.length / totalElementsToAppend) * 2);
+ 
+        // Initialize the array of canonical chain leaves that we will append.
+        bytes32[] memory leaves = new bytes32[](totalElementsToAppend);
+ 
+        // Each leaf index corresponds to a tx, either sequenced or enqueued.
+        uint32 leafIndex = 0;
+ 
+        // Counter for number of sequencer transactions appended so far.
+        uint32 numSequencerTransactions = 0;
+ 
+        // We will sequentially append leaves which are pointers to the queue.
+        // The initial queue index is what is currently in storage.
+        uint40 nextQueueIndex = getNextQueueIndex();
+ 
+        BatchContext memory curContext;
+        for (uint32 i = 0; i < numContexts; i++) {
+            BatchContext memory nextContext = _getBatchContext(i);
+ 
+            if (i == 0) {
+                // Execute a special check for the first batch.
+                _validateFirstBatchContext(nextContext);
+            }
+ 
+            // Execute this check on every single batch, including the first one.
+            _validateNextBatchContext(
+                curContext,
+                nextContext,
+                nextQueueIndex,
+                queueRef
+            );
+ 
+            // Now we can update our current context.
+            curContext = nextContext;
+ 
+            // Process sequencer transactions first.
+            for (uint32 j = 0; j < curContext.numSequencedTransactions; j++) {
+                uint256 txDataLength;
+                assembly {
+                    txDataLength := shr(232, calldataload(nextTransactionPtr))
+                }
+ 
+                leaves[leafIndex] = _getSequencerLeafHash(
+                    curContext,
+                    nextTransactionPtr,
+                    txDataLength,
+                    hashMemory
+                );
+ 
+                nextTransactionPtr += uint40(TX_DATA_HEADER_SIZE + txDataLength);
+                numSequencerTransactions++;
+                leafIndex++;
+            }
+ 
+            // Now process any subsequent queue transactions.
+            for (uint32 j = 0; j < curContext.numSubsequentQueueTransactions; j++) {
+                require(
+                    nextQueueIndex < queueLength,
+                    "Not enough queued transactions to append."
+                );
+ 
+                leaves[leafIndex] = _getQueueLeafHash(nextQueueIndex);
+                nextQueueIndex++;
+                leafIndex++;
+            }
+        }
+ 
+        _validateFinalBatchContext(
+            curContext,
+            nextQueueIndex,
+            queueLength,
+            queueRef
+        );
+ 
+        require(
+            msg.data.length == nextTransactionPtr,
+            "Not all sequencer transactions were processed."
+        );
+ 
+        Erequire(
+            leafIndex == totalElementsToAppend,
+            "Actual transaction index does not match expected total elements to append."
+        );
+ 
+        // Generate the required metadata that we need to append this batch
+        uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
+        uint40 blockTimestamp;
+        uint40 blockNumber;
+        if (curContext.numSubsequentQueueTransactions == 0) {
+            // The last element is a sequencer tx, therefore pull timestamp and block number from the last context.
+            blockTimestamp = uint40(curContext.timestamp);
+            blockNumber = uint40(curContext.blockNumber);
+        } else {
+            // The last element is a queue tx, therefore pull timestamp and block number from the queue element.
+            // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at least one queue element.
+            // We increment nextQueueIndex after processing each queue element,
+            // so the index of the last element we processed is nextQueueIndex - 1.
+            Lib_OVMCodec.QueueElement memory lastElement = _getQueueElement(
+                nextQueueIndex - 1,
+                queueRef
+            );
+ 
+            blockTimestamp = lastElement.timestamp;
+            blockNumber = lastElement.blockNumber;
+        }
+ 
+        // For efficiency reasons getMerkleRoot modifies the `leaves` argument in place
+        // while calculating the root hash therefore any arguments passed to it must not
+        // be used again afterwards
+        _appendBatch(
+            Lib_MerkleTree.getMerkleRoot(leaves),
+            totalElementsToAppend,
+            numQueuedTransactions,
+            blockTimestamp,
+            blockNumber
+        );
+ 
+        emit SequencerBatchAppended(
+            nextQueueIndex - numQueuedTransactions,
+            numQueuedTransactions,
+            getTotalElements()
+        );
+    }
+ 
+    /**
+     * Verifies whether a transaction is included in the chain.
+     * @param _transaction Transaction to verify.
+     * @param _txChainElement Transaction chain element corresponding to the transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
+     * @return True if the transaction exists in the CTC, false if not.
+     */
+    function verifyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        if (_txChainElement.isSequenced == true) {
+            return _verifySequencerTransaction(
+                _transaction,
+                _txChainElement,
+                _batchHeader,
+                _inclusionProof
+            );
+        } else {
+            return _verifyQueueTransaction(
+                _transaction,
+                _txChainElement.queueIndex,
+                _batchHeader,
+                _inclusionProof
+            );
+        }
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Returns the BatchContext located at a particular index.
+     * @param _index The index of the BatchContext
+     * @return The BatchContext at the specified index.
+     */
+    function _getBatchContext(
+        uint256 _index
+    )
+        internal
+        pure
+        returns (
+            BatchContext memory
+        )
+    {
+        uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;
+        uint256 numSequencedTransactions;
+        uint256 numSubsequentQueueTransactions;
+        uint256 ctxTimestamp;
+        uint256 ctxBlockNumber;
+ 
+        assembly {
+            numSequencedTransactions       := shr(232, calldataload(contextPtr))
+            numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))
+            ctxTimestamp                   := shr(216, calldataload(add(contextPtr, 6)))
+            ctxBlockNumber                 := shr(216, calldataload(add(contextPtr, 11)))
+        }
+ 
+        return BatchContext({
+            numSequencedTransactions: numSequencedTransactions,
+            numSubsequentQueueTransactions: numSubsequentQueueTransactions,
+            timestamp: ctxTimestamp,
+            blockNumber: ctxBlockNumber
+        });
+    }
+ 
+    /**
+     * Parses the batch context from the extra data.
+     * @return Total number of elements submitted.
+     * @return Index of the next queue element.
+     */
+    function _getBatchExtraData()
+        internal
+        view
+        returns (
+            uint40,
+            uint40,
+            uint40,
+            uint40
+        )
+    {
+        bytes27 extraData = batches().getGlobalMetadata();
+ 
+        uint40 totalElements;
+        uint40 nextQueueIndex;
+        uint40 lastTimestamp;
+        uint40 lastBlockNumber;
+        assembly {
+            extraData       :=  shr(40, extraData)
+            totalElements   :=  and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            nextQueueIndex  :=  shr(40, and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000))
+            lastTimestamp   :=  shr(80, and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000))
+            lastBlockNumber :=  shr(120, and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000))
+        }
+ 
+        return (
+            totalElements,
+            nextQueueIndex,
+            lastTimestamp,
+            lastBlockNumber
+        );
+    }
+ 
+    /**
+     * Encodes the batch context for the extra data.
+     * @param _totalElements Total number of elements submitted.
+     * @param _nextQueueIndex Index of the next queue element.
+     * @param _timestamp Timestamp for the last batch.
+     * @param _blockNumber Block number of the last batch.
+     * @return Encoded batch context.
+     */
+    function _makeBatchExtraData(
+        uint40 _totalElements,
+        uint40 _nextQueueIndex,
+        uint40 _timestamp,
+        uint40 _blockNumber
+    )
+        internal
+        pure
+        returns (
+            bytes27
+        )
+    {
+        bytes27 extraData;
+        assembly {
+            extraData := _totalElements
+            extraData := or(extraData, shl(40, _nextQueueIndex))
+            extraData := or(extraData, shl(80, _timestamp))
+            extraData := or(extraData, shl(120, _blockNumber))
+            extraData := shl(40, extraData)
+        }
+ 
+        return extraData;
+    }
+ 
+    /**
+     * Retrieves the hash of a queue element.
+     * @param _index Index of the queue element to retrieve a hash for.
+     * @return Hash of the queue element.
+     */
+    function _getQueueLeafHash(
+        uint256 _index
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return _hashTransactionChainElement(
+            Lib_OVMCodec.TransactionChainElement({
+                isSequenced: false,
+                queueIndex: _index,
+                timestamp: 0,
+                blockNumber: 0,
+                txData: hex""
+            })
+        );
+    }
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function _getQueueElement(
+        uint256 _index,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        )
+    {
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the actual desired queue index
+        // we need to multiply by 2.
+        uint40 trueIndex = uint40(_index * 2);
+        bytes32 transactionHash = _queueRef.get(trueIndex);
+        bytes32 timestampAndBlockNumber = _queueRef.get(trueIndex + 1);
+ 
+        uint40 elementTimestamp;
+        uint40 elementBlockNumber;
+        assembly {
+            elementTimestamp   :=         and(timestampAndBlockNumber, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            elementBlockNumber := shr(40, and(timestampAndBlockNumber, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
+        }
+ 
+        return Lib_OVMCodec.QueueElement({
+            transactionHash: transactionHash,
+            timestamp: elementTimestamp,
+            blockNumber: elementBlockNumber
+        });
+    }
+ 
+    /**
+     * Retrieves the length of the queue.
+     * @return Length of the queue.
+     */
+    function _getQueueLength(
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        // The underlying queue data structure stores 2 elements
+        // per insertion, so to get the real queue length we need
+        // to divide by 2.
+        return uint40(_queueRef.length() / 2);
+    }
+ 
+    /**
+     * Retrieves the hash of a sequencer element.
+     * @param _context Batch context for the given element.
+     * @param _nextTransactionPtr Pointer to the next transaction in the calldata.
+     * @param _txDataLength Length of the transaction item.
+     * @return Hash of the sequencer element.
+     */
+    function _getSequencerLeafHash(
+        BatchContext memory _context,
+        uint256 _nextTransactionPtr,
+        uint256 _txDataLength,
+        bytes memory _hashMemory
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        // Only allocate more memory if we didn't reserve enough to begin with.
+        if (BYTES_TILL_TX_DATA + _txDataLength > _hashMemory.length) {
+            _hashMemory = new bytes(BYTES_TILL_TX_DATA + _txDataLength);
+        }
+ 
+        uint256 ctxTimestamp = _context.timestamp;
+        uint256 ctxBlockNumber = _context.blockNumber;
+ 
+        bytes32 leafHash;
+        assembly {
+            let chainElementStart := add(_hashMemory, 0x20)
+ 
+            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
+            // This distinguishes sequencer ChainElements from queue ChainElements because
+            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
+            // elements is always zero
+            mstore8(chainElementStart, 1)
+ 
+            mstore(add(chainElementStart, 1), ctxTimestamp)
+            mstore(add(chainElementStart, 33), ctxBlockNumber)
+ 
+            calldatacopy(add(chainElementStart, BYTES_TILL_TX_DATA), add(_nextTransactionPtr, 3), _txDataLength)
+ 
+            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, _txDataLength))
+        }
+ 
+        return leafHash;
+    }
+ 
+    /**
+     * Retrieves the hash of a sequencer element.
+     * @param _txChainElement The chain element which is hashed to calculate the leaf.
+     * @return Hash of the sequencer element.
+     */
+    function _getSequencerLeafHash(
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement
+    )
+        internal
+        view
+        returns(
+            bytes32
+        )
+    {
+        bytes memory txData = _txChainElement.txData;
+        uint256 txDataLength = _txChainElement.txData.length;
+ 
+        bytes memory chainElement = new bytes(BYTES_TILL_TX_DATA + txDataLength);
+        uint256 ctxTimestamp = _txChainElement.timestamp;
+        uint256 ctxBlockNumber = _txChainElement.blockNumber;
+ 
+        bytes32 leafHash;
+        assembly {
+            let chainElementStart := add(chainElement, 0x20)
+ 
+            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
+            // This distinguishes sequencer ChainElements from queue ChainElements because
+            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
+            // elements is always zero
+            mstore8(chainElementStart, 1)
+ 
+            mstore(add(chainElementStart, 1), ctxTimestamp)
+            mstore(add(chainElementStart, 33), ctxBlockNumber)
+ 
+            pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart, BYTES_TILL_TX_DATA), txDataLength))
+ 
+            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, txDataLength))
+        }
+ 
+        return leafHash;
+    }
+ 
+    /**
+     * Inserts a batch into the chain of batches.
+     * @param _transactionRoot Root of the transaction tree for this batch.
+     * @param _batchSize Number of elements in the batch.
+     * @param _numQueuedTransactions Number of queue transactions in the batch.
+     * @param _timestamp The latest batch timestamp.
+     * @param _blockNumber The latest batch blockNumber.
+     */
+    function _appendBatch(
+        bytes32 _transactionRoot,
+        uint256 _batchSize,
+        uint256 _numQueuedTransactions,
+        uint40 _timestamp,
+        uint40 _blockNumber
+    )
+        internal
+    {
+        iOVM_ChainStorageContainer batchesRef = batches();
+        (uint40 totalElements, uint40 nextQueueIndex,,) = _getBatchExtraData();
+ 
+        Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({
+            batchIndex: batchesRef.length(),
+            batchRoot: _transactionRoot,
+            batchSize: _batchSize,
+            prevTotalElements: totalElements,
+            extraData: hex""
+        });
+ 
+        emit TransactionBatchAppended(
+            header.batchIndex,
+            header.batchRoot,
+            header.batchSize,
+            header.prevTotalElements,
+            header.extraData
+        );
+ 
+        bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);
+        bytes27 latestBatchContext = _makeBatchExtraData(
+            totalElements + uint40(header.batchSize),
+            nextQueueIndex + uint40(_numQueuedTransactions),
+            _timestamp,
+            _blockNumber
+        );
+ 
+        batchesRef.push(batchHeaderHash, latestBatchContext);
+    }
+ 
+    /**
+     * Checks that the first batch context in a sequencer submission is valid
+     * @param _firstContext The batch context to validate.
+     */
+    function _validateFirstBatchContext(
+        BatchContext memory _firstContext
+    )
+        internal
+        view
+    {
+        // If there are existing elements, this batch must have the same context 
+        // or a later timestamp and block number.
+        if (getTotalElements() > 0) {
+            (,, uint40 lastTimestamp, uint40 lastBlockNumber) = _getBatchExtraData();
+ 
+            require(
+                _firstContext.blockNumber >= lastBlockNumber,
+                "Context block number is lower than last submitted."
+            );
+ 
+            Irequire(
+                _firstContext.timestamp >= lastTimestamp,
+                "Context timestamp is lower than last submitted."
+            );
+        }
+ 
+        // Sequencer cannot submit contexts which are more than the force inclusion period old.
+        require(
+            _firstContext.timestamp + forceInclusionPeriodSeconds >= block.timestamp,
+            "Context timestamp too far in the past."
+        );
+ 
+        require(
+            _firstContext.blockNumber + forceInclusionPeriodBlocks >= block.number,
+            "Context block number too far in the past."
+        );
+    }
+ 
+    /**
+     * Checks that a given batch context has a time context which is below a given que element
+     * @param _context The batch context to validate has values lower.
+     * @param _queueIndex Index of the queue element we are validating came later than the context.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateContextBeforeEnqueue(
+        BatchContext memory _context,
+        uint40 _queueIndex,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+            Lib_OVMCodec.QueueElement memory nextQueueElement = _getQueueElement(
+                _queueIndex,
+                _queueRef
+            );
+ 
+            // If the force inclusion period has passed for an enqueued transaction, it MUST be the next chain element.
+            require(
+                block.timestamp < nextQueueElement.timestamp + forceInclusionPeriodSeconds,
+                "Previously enqueued batches have expired and must be appended before a new sequencer batch."
+            );
+ 
+            // Just like sequencer transaction times must be increasing relative to each other,
+            // We also require that they be increasing relative to any interspersed queue elements.
+            require(
+                _context.timestamp <= nextQueueElement.timestamp,
+                "Sequencer transaction timestamp exceeds that of next queue element."
+            );
+ 
+            require(
+                _context.blockNumber <= nextQueueElement.blockNumber,
+                "Sequencer transaction blockNumber exceeds that of next queue element."
+            );
+    }
+ 
+    /**
+     * Checks that a given batch context is valid based on its previous context, and the next queue elemtent.
+     * @param _prevContext The previously validated batch context.
+     * @param _nextContext The batch context to validate with this call.
+     * @param _nextQueueIndex Index of the next queue element to process for the _nextContext's subsequentQueueElements.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateNextBatchContext(
+        BatchContext memory _prevContext,
+        BatchContext memory _nextContext,
+        uint40 _nextQueueIndex,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+        // All sequencer transactions' times must be greater than or equal to the previous ones.
+        require(
+            _nextContext.timestamp >= _prevContext.timestamp,
+            "Context timestamp values must monotonically increase."
+        );
+ 
+        require(
+            _nextContext.blockNumber >= _prevContext.blockNumber,
+            "Context blockNumber values must monotonically increase."
+        );
+ 
+        // If there is going to be a queue element pulled in from this context:
+        if (_nextContext.numSubsequentQueueTransactions > 0) {
+            _validateContextBeforeEnqueue(
+                _nextContext,
+                _nextQueueIndex,
+                _queueRef
+            );
+        }
+    }
+ 
+    /**
+     * Checks that the final batch context in a sequencer submission is valid.
+     * @param _finalContext The batch context to validate.
+     * @param _queueLength The length of the queue at the start of the batchAppend call.
+     * @param _nextQueueIndex The next element in the queue that will be pulled into the CTC.
+     * @param _queueRef The storage container for the queue.
+     */
+    function _validateFinalBatchContext(
+        BatchContext memory _finalContext,
+        uint40 _nextQueueIndex,
+        uint40 _queueLength,
+        iOVM_ChainStorageContainer _queueRef
+    )
+        internal
+        view
+    {
+        // If the queue is not now empty, check the mononoticity of whatever the next batch that will come in is.
+        if (_queueLength - _nextQueueIndex > 0 && _finalContext.numSubsequentQueueTransactions == 0) {
+            _validateContextBeforeEnqueue(
+                _finalContext,
+                _nextQueueIndex,
+                _queueRef
+            );
+        }
+        // Batches cannot be added from the future, or subsequent enqueue() contexts would violate monotonicity.
+        require(_finalContext.timestamp <= block.timestamp, "Context timestamp is from the future.");
+        require(_finalContext.blockNumber <= block.number, "Context block number is from the future.");
+    }
+ 
+    /**
+     * Hashes a transaction chain element.
+     * @param _element Chain element to hash.
+     * @return Hash of the chain element.
+     */
+    function _hashTransactionChainElement(
+        Lib_OVMCodec.TransactionChainElement memory _element
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(
+            abi.encode(
+                _element.isSequenced,
+                _element.queueIndex,
+                _element.timestamp,
+                _element.blockNumber,
+                _element.txData
+            )
+        );
+    }
+ 
+    /**
+     * Verifies a sequencer transaction, returning true if it was indeed included in the CTC
+     * @param _transaction The transaction we are verifying inclusion of.
+     * @param _txChainElement The chain element that the transaction is claimed to be a part of.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof An inclusion proof into the CTC at a particular index.
+     * @return True if the transaction was included in the specified location, else false.
+     */
+    function _verifySequencerTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        OVM_ExecutionManager ovmExecutionManager = OVM_ExecutionManager(resolve("OVM_ExecutionManager"));
+        uint256 gasLimit = ovmExecutionManager.getMaxTransactionGasLimit();
+        bytes32 leafHash = _getSequencerLeafHash(_txChainElement);
+ 
+        Erequire(
+            _verifyElement(
+                leafHash,
+                _batchHeader,
+                _inclusionProof
+            ),
+            "Invalid Sequencer transaction inclusion proof."
+        );
+ 
+        Erequire(
+            _transaction.blockNumber        == _txChainElement.blockNumber
+            && _transaction.timestamp       == _txChainElement.timestamp
+            && _transaction.entrypoint      == resolve("OVM_DecompressionPrecompileAddress")
+            && _transaction.gasLimit        == gasLimit
+            && _transaction.l1TxOrigin      == address(0)
+            && _transaction.l1QueueOrigin   == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
+            && keccak256(_transaction.data) == keccak256(_txChainElement.txData),
+            "Invalid Sequencer transaction."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * Verifies a queue transaction, returning true if it was indeed included in the CTC
+     * @param _transaction The transaction we are verifying inclusion of.
+     * @param _queueIndex The queueIndex of the queued transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof An inclusion proof into the CTC at a particular index (should point to queue tx).
+     * @return True if the transaction was included in the specified location, else false.
+     */
+    function _verifyQueueTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        uint256 _queueIndex,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 leafHash = _getQueueLeafHash(_queueIndex);
+ 
+        Erequire(
+            _verifyElement(
+                leafHash,
+                _batchHeader,
+                _inclusionProof
+            ),
+            "Invalid Queue transaction inclusion proof."
+        );
+ 
+        bytes32 transactionHash = keccak256(
+            abi.encode(
+                _transaction.l1TxOrigin,
+                _transaction.entrypoint,
+                _transaction.gasLimit,
+                _transaction.data
+            )
+        );
+ 
+        Lib_OVMCodec.QueueElement memory el = getQueueElement(_queueIndex);
+        Erequire(
+            el.transactionHash      == transactionHash
+            && el.timestamp   == _transaction.timestamp
+            && el.blockNumber == _transaction.blockNumber,
+            "Invalid Queue transaction."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * Verifies a batch inclusion proof.
+     * @param _element Hash of the element to verify a proof for.
+     * @param _batchHeader Header of the batch in which the element was included.
+     * @param _proof Merkle inclusion proof for the element.
+     */
+    function _verifyElement(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        Erequire(
+            Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(uint32(_batchHeader.batchIndex)),
+            "Invalid batch header."
+        );
+ 
+        Erequire(
+            Lib_MerkleTree.verify(
+                _batchHeader.batchRoot,
+                _element,
+                _proof.index,
+                _proof.siblings,
+                _batchHeader.batchSize
+            ),
+            "Invalid inclusion proof."
+        );
+ 
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html b/coverage/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html new file mode 100644 index 000000000..1e2bd3a07 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html @@ -0,0 +1,680 @@ + + + + Code coverage report for optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/chain/ OVM_ChainStorageContainer.sol +

+
+
+ 72.73% + Statements + 8/11 +
+
+ 50% + Branches + 1/2 +
+
+ 72.73% + Functions + 8/11 +
+
+ 75% + Lines + 9/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +516× +  +  +  +  +  +  +  +  +579× +  +  +  +579× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +580× +  +  +  +  +  +  +  +  +  +  +  +  +  +453× +  +  +  +  +  +  +  +  +  +  +  +  +470× +  +  +  +  +  +  +  +  +  +  +  +  +  +108× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_RingBuffer } from "../../libraries/utils/Lib_RingBuffer.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/**
+ * @title OVM_ChainStorageContainer
+ * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.
+ * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used
+ * in a fraud proof due to the fraud window having passed, and the associated chain state or
+ * transactions being finalized.
+ * Three distinct Chain Storage Containers will be deployed on Layer 1:
+ * 1. Stores transaction batches for the Canonical Transaction Chain
+ * 2. Stores queued transactions for the Canonical Transaction Chain
+ * 3. Stores chain state batches for the State Commitment Chain
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {
+ 
+    /*************
+     * Libraries *
+     *************/
+ 
+    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    string public owner;
+    Lib_RingBuffer.RingBuffer internal buffer;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _owner Name of the contract that owns this container (will be resolved later).
+     */
+    constructor(
+        address _libAddressManager,
+        string memory _owner
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        owner = _owner;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyOwner() {
+        Erequire(
+            msg.sender == resolve(owner),
+            "OVM_ChainStorageContainer: Function can only be called by the owner."
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function setGlobalMetadata(
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        return buffer.setExtraData(_globalMetadata);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function getGlobalMetadata()
+        override
+        public
+        view
+        returns (
+            bytes27
+        )
+    {
+        return buffer.getExtraData();
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function length()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return uint256(buffer.getLength());
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function push(
+        bytes32 _object
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.push(_object);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function push(
+        bytes32 _object,
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.push(_object, _globalMetadata);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function get(
+        uint256 _index
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        return buffer.get(uint40(_index));
+    }
+    
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.deleteElementsAfterInclusive(
+            uint40(_index)
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index,
+        bytes27 _globalMetadata
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.deleteElementsAfterInclusive(
+            uint40(_index),
+            _globalMetadata
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_ChainStorageContainer
+     */
+    function setNextOverwritableIndex(
+        uint256 _index
+    )
+        override
+        public
+        onlyOwner
+    {
+        buffer.nextOverwritableIndex = _index;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html b/coverage/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html new file mode 100644 index 000000000..8b0dbf3fb --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html @@ -0,0 +1,1307 @@ + + + + Code coverage report for optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/chain/ OVM_StateCommitmentChain.sol +

+
+
+ 88.1% + Statements + 37/42 +
+
+ 67.86% + Branches + 19/28 +
+
+ 85.71% + Functions + 12/14 +
+
+ 88.64% + Lines + 39/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +60× +60× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +125× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +24× +  +  +  +  +24× +  +  +  +  +23× +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +74× +  +74× +74× +74× +  +  +  +  +  +74× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +22× +20× +  +  +  +  +  + +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
+ 
+/* Interface Imports */
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
+ 
+/* External Imports */
+import '@openzeppelin/contracts/math/SafeMath.sol';
+ 
+/**
+ * @title OVM_StateCommitmentChain
+ * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which
+ * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).
+ * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique
+ * state root calculated off-chain by applying the canonical transactions one by one.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 public FRAUD_PROOF_WINDOW;
+    uint256 public SEQUENCER_PUBLISH_WINDOW;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager,
+        uint256 _fraudProofWindow,
+        uint256 _sequencerPublishWindow
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        FRAUD_PROOF_WINDOW = _fraudProofWindow;
+        SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        public
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        )
+    {
+        return iOVM_ChainStorageContainer(
+            resolve("OVM_ChainStorageContainer:SCC:batches")
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getTotalElements()
+        override
+        public
+        view
+        returns (
+            uint256 _totalElements
+        )
+    {
+        (uint40 totalElements, ) = _getBatchExtraData();
+        return uint256(totalElements);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getTotalBatches()
+        override
+        public
+        view
+        returns (
+            uint256 _totalBatches
+        )
+    {
+        return batches().length();
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function getLastSequencerTimestamp()
+        override
+        public
+        view
+        returns (
+            uint256 _lastSequencerTimestamp
+        )
+    {
+        (, uint40 lastSequencerTimestamp) = _getBatchExtraData();
+        return uint256(lastSequencerTimestamp);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function appendStateBatch(
+        bytes32[] memory _batch,
+        uint256 _shouldStartAtElement
+    )
+        override
+        public
+    {
+        // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the
+        // publication of batches by some other user.
+        require(
+            _shouldStartAtElement == getTotalElements(),
+            "Actual batch start index does not match expected start index."
+        );
+ 
+        // Proposers must have previously staked at the BondManager
+        Erequire(
+            iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender),
+            "Proposer does not have enough collateral posted"
+        );
+ 
+        require(
+            _batch.length > 0,
+            "Cannot submit an empty state batch."
+        );
+ 
+        require(
+            getTotalElements() + _batch.length <= iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(),
+            "Number of state roots cannot exceed the number of canonical transactions."
+        );
+ 
+        // Pass the block's timestamp and the publisher of the data
+        // to be used in the fraud proofs
+        _appendBatch(
+            _batch,
+            abi.encode(block.timestamp, msg.sender)
+        );
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function deleteStateBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        override
+        public
+    {
+        require(
+            msg.sender == resolve("OVM_FraudVerifier"),
+            "State batches can only be deleted by the OVM_FraudVerifier."
+        );
+ 
+        require(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        Erequire(
+            insideFraudProofWindow(_batchHeader),
+            "State batches can only be deleted within the fraud proof window."
+        );
+ 
+        _deleteBatch(_batchHeader);
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function verifyStateCommitment(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        require(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        require(
+            Lib_MerkleTree.verify(
+                _batchHeader.batchRoot,
+                _element,
+                _proof.index,
+                _proof.siblings,
+                _batchHeader.batchSize
+            ),
+            "Invalid inclusion proof."
+        );
+ 
+        return true;
+    }
+ 
+    /**
+     * @inheritdoc iOVM_StateCommitmentChain
+     */
+    function insideFraudProofWindow(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        override
+        public
+        view
+        returns (
+            bool _inside
+        )
+    {
+        (uint256 timestamp,) = abi.decode(
+            _batchHeader.extraData,
+            (uint256, address)
+        );
+ 
+        Erequire(
+            timestamp != 0,
+            "Batch header timestamp cannot be zero"
+        );
+        return SafeMath.add(timestamp, FRAUD_PROOF_WINDOW) > block.timestamp;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Parses the batch context from the extra data.
+     * @return Total number of elements submitted.
+     * @return Timestamp of the last batch submitted by the sequencer.
+     */
+    function _getBatchExtraData()
+        internal
+        view
+        returns (
+            uint40,
+            uint40
+        )
+    {
+        bytes27 extraData = batches().getGlobalMetadata();
+ 
+        uint40 totalElements;
+        uint40 lastSequencerTimestamp;
+        assembly {
+            extraData              := shr(40, extraData)
+            totalElements          :=         and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            lastSequencerTimestamp := shr(40, and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
+        }
+ 
+        return (
+            totalElements,
+            lastSequencerTimestamp
+        );
+    }
+ 
+    /**
+     * Encodes the batch context for the extra data.
+     * @param _totalElements Total number of elements submitted.
+     * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.
+     * @return Encoded batch context.
+     */
+    function _makeBatchExtraData(
+        uint40 _totalElements,
+        uint40 _lastSequencerTimestamp
+    )
+        internal
+        pure
+        returns (
+            bytes27
+        )
+    {
+        bytes27 extraData;
+        assembly {
+            extraData := _totalElements
+            extraData := or(extraData, shl(40, _lastSequencerTimestamp))
+            extraData := shl(40, extraData)
+        }
+ 
+        return extraData;
+    }
+ 
+    /**
+     * Appends a batch to the chain.
+     * @param _batch Elements within the batch.
+     * @param _extraData Any extra data to append to the batch.
+     */
+    function _appendBatch(
+        bytes32[] memory _batch,
+        bytes memory _extraData
+    )
+        internal
+    {
+        address sequencer = resolve("OVM_Proposer");
+        (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();
+ 
+        if (msg.sender == sequencer) {
+            lastSequencerTimestamp = uint40(block.timestamp);
+        } else {
+            // We keep track of the last batch submitted by the sequencer so there's a window in
+            // which only the sequencer can publish state roots. A window like this just reduces
+            // the chance of "system breaking" state roots being published while we're still in
+            // testing mode. This window should be removed or significantly reduced in the future.
+            require(
+                lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,
+                "Cannot publish state roots within the sequencer publication window."
+            );
+        }
+ 
+        // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place
+        // while calculating the root hash therefore any arguments passed to it must not
+        // be used again afterwards
+        Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({
+            batchIndex: getTotalBatches(),
+            batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),
+            batchSize: _batch.length,
+            prevTotalElements: totalElements,
+            extraData: _extraData
+        });
+ 
+        emit StateBatchAppended(
+            batchHeader.batchIndex,
+            batchHeader.batchRoot,
+            batchHeader.batchSize,
+            batchHeader.prevTotalElements,
+            batchHeader.extraData
+        );
+ 
+        batches().push(
+            Lib_OVMCodec.hashBatchHeader(batchHeader),
+            _makeBatchExtraData(
+                uint40(batchHeader.prevTotalElements + batchHeader.batchSize),
+                lastSequencerTimestamp
+            )
+        );
+    }
+ 
+    /**
+     * Removes a batch and all subsequent batches from the chain.
+     * @param _batchHeader Header of the batch to remove.
+     */
+    function _deleteBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+    {
+        Erequire(
+            _batchHeader.batchIndex < batches().length(),
+            "Invalid batch index."
+        );
+ 
+        Erequire(
+            _isValidBatchHeader(_batchHeader),
+            "Invalid batch header."
+        );
+ 
+        batches().deleteElementsAfterInclusive(
+            _batchHeader.batchIndex,
+            _makeBatchExtraData(
+                uint40(_batchHeader.prevTotalElements),
+                0
+            )
+        );
+ 
+        emit StateBatchDeleted(
+            _batchHeader.batchIndex,
+            _batchHeader.batchRoot
+        );
+    }
+ 
+    /**
+     * Checks that a batch header matches the stored hash for the given index.
+     * @param _batchHeader Batch header to validate.
+     * @return Whether or not the header matches the stored one.
+     */
+    function _isValidBatchHeader(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+        view
+        returns (
+            bool
+        )
+    {
+        return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/chain/index.html b/coverage/optimistic-ethereum/OVM/chain/index.html new file mode 100644 index 000000000..4929bf6b5 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/chain/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/OVM/chain/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/chain/ +

+
+
+ 92.82% + Statements + 194/209 +
+
+ 81.37% + Branches + 83/102 +
+
+ 82.46% + Functions + 47/57 +
+
+ 93.36% + Lines + 211/226 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_CanonicalTransactionChain.sol
95.51%149/15687.5%63/7284.38%27/3295.88%163/170
OVM_ChainStorageContainer.sol
72.73%8/1150%1/272.73%8/1175%9/12
OVM_StateCommitmentChain.sol
88.1%37/4267.86%19/2885.71%12/1488.64%39/44
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html b/coverage/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html new file mode 100644 index 000000000..89edc14b7 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html @@ -0,0 +1,5654 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/execution/ OVM_ExecutionManager.sol +

+
+
+ 82.2% + Statements + 194/236 +
+
+ 68.29% + Branches + 56/82 +
+
+ 88.52% + Functions + 54/61 +
+
+ 82.64% + Lines + 200/242 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244 +1245 +1246 +1247 +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1310 +1311 +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319 +1320 +1321 +1322 +1323 +1324 +1325 +1326 +1327 +1328 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1348 +1349 +1350 +1351 +1352 +1353 +1354 +1355 +1356 +1357 +1358 +1359 +1360 +1361 +1362 +1363 +1364 +1365 +1366 +1367 +1368 +1369 +1370 +1371 +1372 +1373 +1374 +1375 +1376 +1377 +1378 +1379 +1380 +1381 +1382 +1383 +1384 +1385 +1386 +1387 +1388 +1389 +1390 +1391 +1392 +1393 +1394 +1395 +1396 +1397 +1398 +1399 +1400 +1401 +1402 +1403 +1404 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1424 +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432 +1433 +1434 +1435 +1436 +1437 +1438 +1439 +1440 +1441 +1442 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +1458 +1459 +1460 +1461 +1462 +1463 +1464 +1465 +1466 +1467 +1468 +1469 +1470 +1471 +1472 +1473 +1474 +1475 +1476 +1477 +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489 +1490 +1491 +1492 +1493 +1494 +1495 +1496 +1497 +1498 +1499 +1500 +1501 +1502 +1503 +1504 +1505 +1506 +1507 +1508 +1509 +1510 +1511 +1512 +1513 +1514 +1515 +1516 +1517 +1518 +1519 +1520 +1521 +1522 +1523 +1524 +1525 +1526 +1527 +1528 +1529 +1530 +1531 +1532 +1533 +1534 +1535 +1536 +1537 +1538 +1539 +1540 +1541 +1542 +1543 +1544 +1545 +1546 +1547 +1548 +1549 +1550 +1551 +1552 +1553 +1554 +1555 +1556 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1576 +1577 +1578 +1579 +1580 +1581 +1582 +1583 +1584 +1585 +1586 +1587 +1588 +1589 +1590 +1591 +1592 +1593 +1594 +1595 +1596 +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609 +1610 +1611 +1612 +1613 +1614 +1615 +1616 +1617 +1618 +1619 +1620 +1621 +1622 +1623 +1624 +1625 +1626 +1627 +1628 +1629 +1630 +1631 +1632 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1652 +1653 +1654 +1655 +1656 +1657 +1658 +1659 +1660 +1661 +1662 +1663 +1664 +1665 +1666 +1667 +1668 +1669 +1670 +1671 +1672 +1673 +1674 +1675 +1676 +1677 +1678 +1679 +1680 +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688 +1689 +1690 +1691 +1692 +1693 +1694 +1695 +1696 +1697 +1698 +1699 +1700 +1701 +1702 +1703 +1704 +1705 +1706 +1707 +1708 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +1720 +1721 +1722 +1723 +1724 +1725 +1726 +1727 +1728 +1729 +1730 +1731 +1732 +1733 +1734 +1735 +1736 +1737 +1738 +1739 +1740 +1741 +1742 +1743 +1744 +1745 +1746 +1747 +1748 +1749 +1750 +1751 +1752 +1753 +1754 +1755 +1756 +1757 +1758 +1759 +1760 +1761 +1762 +1763 +1764 +1765 +1766 +1767 +1768 +1769 +1770 +1771 +1772 +1773 +1774 +1775 +1776 +1777 +1778 +1779 +1780 +1781 +1782 +1783 +1784 +1785 +1786 +1787 +1788 +1789 +1790 +1791 +1792 +1793 +1794 +1795 +1796 +1797 +1798 +1799 +1800 +1801 +1802 +1803 +1804 +1805 +1806 +1807 +1808 +1809 +1810 +1811 +1812 +1813 +1814 +1815 +1816 +1817 +1818 +1819 +1820 +1821 +1822 +1823 +1824 +1825 +1826 +1827 +1828 +1829 +1830 +1831 +1832 +1833 +1834 +1835 +1836 +1837 +1838 +1839 +1840 +1841 +1842 +1843 +1844 +1845 +1846 +1847 +1848 +1849 +1850 +1851 +1852 +1853 +1854 +1855 +1856 +1857 +1858 +1859 +1860 +1861 +1862 +1863 +1864  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +30× +30× +30× +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +55× +55× +55× +  +  +55× +46× +  +  +  +  +  +  +  +  +  +  +  +202× +202× +193× +  +  +193× +165× +  +  +28× +  +  +  +  +  +  +  +42× + +  +38× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +150× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +  +  +  +28× +  +  +27× +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  + + +  +  +  + +  +  + +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +155× +155× +155× +  +155× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +48× +  +48× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +  +29× +  +29× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +27× +27× +27× +  +  +  +27× +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +173× +  +  +  +  + +  +  +  +172× +  +  +  +  +170× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +197× +197× +  +  +  +  +  +197× +197× +197× +  +  +  +  +  +  +  +197× +  +  +  +  +  +197× +  +  +  +197× +  +  +  +197× +23× +  +  +  +  +  +  +  +  +  +23× + +  +  +  +  +  +18× +  +  +  +  +  +14× +  +  +  +  +18× +  +  +  +10× +  + +  +  +  +  +  +  +  +18× +  +  +  +192× +  +192× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +27× +  +  +27× +  +27× +  +  +10× +10× +10× +10× +  +  +  +  +  +  +  +10× +  +  +  +  +17× +17× + +  +  +  +  +  +  +  +  +  +  +16× +  +  +  +  +  +  +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +29× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +57× +57× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +370× +368× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +17× +17× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +55× +55× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +536× +  +  +  +  +536× + +  +  +  +  +534× +  +  +  +  +  +534× +144× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +53× +  +  +  +53× +  +  +  +  +  +53× +47× +47× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +62× +  +  +  +  +  +  +62× +  +  +  +  +  +62× +  +  +  +  +  +62× +46× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  + +  +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +20× + +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× + +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +198× +  +  +  +  +  +  +  +  +  +  +  +  +  +244× +  +  +  +244× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +394× +202× +  +  +  +394× +310× +  +  +  +394× +16× +  +  +  +  +  +  +  +  +  +  +  +  + + + + + + +  + +  +  +  +  +  +  +  +  +31× +31× +31× +31× +31× +31× +  +31× +  +31× +31× +31× +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
+import { Lib_ErrorUtils } from "../../libraries/utils/Lib_ErrorUtils.sol";
+ 
+/* Interface Imports */
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
+ 
+/* Contract Imports */
+import { OVM_ECDSAContractAccount } from "../accounts/OVM_ECDSAContractAccount.sol";
+import { OVM_ProxyEOA } from "../accounts/OVM_ProxyEOA.sol";
+import { OVM_DeployerWhitelist } from "../predeploys/OVM_DeployerWhitelist.sol";
+ 
+/**
+ * @title OVM_ExecutionManager
+ * @dev The Execution Manager (EM) is the core of our OVM implementation, and provides a sandboxed
+ * environment allowing us to execute OVM transactions deterministically on either Layer 1 or
+ * Layer 2.
+ * The EM's run() function is the first function called during the execution of any
+ * transaction on L2.
+ * For each context-dependent EVM operation the EM has a function which implements a corresponding
+ * OVM operation, which will read state from the State Manager contract.
+ * The EM relies on the Safety Checker to verify that code deployed to Layer 2 does not contain any
+ * context-dependent operations.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
+ 
+    /********************************
+     * External Contract References *
+     ********************************/
+ 
+    iOVM_SafetyChecker internal ovmSafetyChecker;
+    iOVM_StateManager internal ovmStateManager;
+ 
+ 
+    /*******************************
+     * Execution Context Variables *
+     *******************************/
+ 
+    GasMeterConfig internal gasMeterConfig;
+    GlobalContext internal globalContext;
+    TransactionContext internal transactionContext;
+    MessageContext internal messageContext;
+    TransactionRecord internal transactionRecord;
+    MessageRecord internal messageRecord;
+ 
+ 
+    /**************************
+     * Gas Metering Constants *
+     **************************/
+ 
+    address constant GAS_METADATA_ADDRESS = 0x06a506A506a506A506a506a506A506A506A506A5;
+    uint256 constant NUISANCE_GAS_SLOAD = 20000;
+    uint256 constant NUISANCE_GAS_SSTORE = 20000;
+    uint256 constant MIN_NUISANCE_GAS_PER_CONTRACT = 30000;
+    uint256 constant NUISANCE_GAS_PER_CONTRACT_BYTE = 100;
+    uint256 constant MIN_GAS_FOR_INVALID_STATE_ACCESS = 30000;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager,
+        GasMeterConfig memory _gasMeterConfig,
+        GlobalContext memory _globalContext
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        ovmSafetyChecker = iOVM_SafetyChecker(resolve("OVM_SafetyChecker"));
+        gasMeterConfig = _gasMeterConfig;
+        globalContext = _globalContext;
+        _resetContext();
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Applies dynamically-sized refund to a transaction to account for the difference in execution
+     * between L1 and L2, so that the overall cost of the ovmOPCODE is fixed.
+     * @param _cost Desired gas cost for the function after the refund.
+     */
+    modifier netGasCost(
+        uint256 _cost
+    ) {
+        uint256 gasProvided = gasleft();
+        _;
+        uint256 gasUsed = gasProvided - gasleft();
+ 
+        // We want to refund everything *except* the specified cost.
+        if (_cost < gasUsed) {
+            transactionRecord.ovmGasRefund += gasUsed - _cost;
+        }
+    }
+ 
+    /**
+     * Applies a fixed-size gas refund to a transaction to account for the difference in execution
+     * between L1 and L2, so that the overall cost of an ovmOPCODE can be lowered.
+     * @param _discount Amount of gas cost to refund for the ovmOPCODE.
+     */
+    modifier fixedGasDiscount(
+        uint256 _discount
+    ) {
+        uint256 gasProvided = gasleft();
+        _;
+        uint256 gasUsed = gasProvided - gasleft();
+ 
+        // We want to refund the specified _discount, unless this risks underflow.
+        if (_discount < gasUsed) {
+            transactionRecord.ovmGasRefund += _discount;
+        } else {
+            // refund all we can without risking underflow.
+            transactionRecord.ovmGasRefund += gasUsed;
+        }
+    }
+ 
+    /**
+     * Makes sure we're not inside a static context.
+     */
+    modifier notStatic() {
+        if (messageContext.isStatic == true) {
+            _revertWithFlag(RevertFlag.STATIC_VIOLATION);
+        }
+        _;
+    }
+ 
+ 
+    /************************************
+     * Transaction Execution Entrypoint *
+     ************************************/
+ 
+    /**
+     * Starts the execution of a transaction via the OVM_ExecutionManager.
+     * @param _transaction Transaction data to be executed.
+     * @param _ovmStateManager iOVM_StateManager implementation providing account state.
+     */
+    function run(
+        Lib_OVMCodec.Transaction memory _transaction,
+        address _ovmStateManager
+    )
+        override
+        public
+    {
+        Erequire(transactionContext.ovmNUMBER == 0, "Only be callable at the start of a transaction");
+        // Store our OVM_StateManager instance (significantly easier than attempting to pass the
+        // address around in calldata).
+        ovmStateManager = iOVM_StateManager(_ovmStateManager);
+ 
+        // Make sure this function can't be called by anyone except the owner of the
+        // OVM_StateManager (expected to be an OVM_StateTransitioner). We can revert here because
+        // this would make the `run` itself invalid.
+        Erequire(
+            // This method may return false during fraud proofs, but always returns true in L2 nodes' State Manager precompile.
+            ovmStateManager.isAuthenticated(msg.sender),
+            "Only authenticated addresses in ovmStateManager can call this function"
+        );
+ 
+        // Initialize the execution context, must be initialized before we perform any gas metering
+        // or we'll throw a nuisance gas error.
+        _initContext(_transaction);
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Check whether we need to start a new epoch, do so if necessary.
+        // _checkNeedsNewEpoch(_transaction.timestamp);
+ 
+        // Make sure the transaction's gas limit is valid. We don't revert here because we reserve
+        // reverts for INVALID_STATE_ACCESS.
+        Iif (_isValidGasLimit(_transaction.gasLimit, _transaction.l1QueueOrigin) == false) {
+            _resetContext();
+            return;
+        }
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Check gas right before the call to get total gas consumed by OVM transaction.
+        // uint256 gasProvided = gasleft();
+ 
+        // Run the transaction, make sure to meter the gas usage.
+        ovmCALL(
+            _transaction.gasLimit - gasMeterConfig.minTransactionGasLimit,
+            _transaction.entrypoint,
+            _transaction.data
+        );
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        // // Update the cumulative gas based on the amount of gas used.
+        // uint256 gasUsed = gasProvided - gasleft();
+        // _updateCumulativeGas(gasUsed, _transaction.l1QueueOrigin);
+ 
+        // Wipe the execution context.
+        _resetContext();
+ 
+        // Reset the ovmStateManager.
+        ovmStateManager = iOVM_StateManager(address(0));
+    }
+ 
+ 
+    /******************************
+     * Opcodes: Execution Context *
+     ******************************/
+ 
+    /**
+     * @notice Overrides CALLER.
+     * @return _CALLER Address of the CALLER within the current message context.
+     */
+    function ovmCALLER()
+        override
+        public
+        view
+        returns (
+            address _CALLER
+        )
+    {
+        return messageContext.ovmCALLER;
+    }
+ 
+    /**
+     * @notice Overrides ADDRESS.
+     * @return _ADDRESS Active ADDRESS within the current message context.
+     */
+    function ovmADDRESS()
+        override
+        public
+        view
+        returns (
+            address _ADDRESS
+        )
+    {
+        return messageContext.ovmADDRESS;
+    }
+ 
+    /**
+     * @notice Overrides TIMESTAMP.
+     * @return _TIMESTAMP Value of the TIMESTAMP within the transaction context.
+     */
+    function ovmTIMESTAMP()
+        override
+        public
+        view
+        returns (
+            uint256 _TIMESTAMP
+        )
+    {
+        return transactionContext.ovmTIMESTAMP;
+    }
+ 
+    /**
+     * @notice Overrides NUMBER.
+     * @return _NUMBER Value of the NUMBER within the transaction context.
+     */
+    function ovmNUMBER()
+        override
+        public
+        view
+        returns (
+            uint256 _NUMBER
+        )
+    {
+        return transactionContext.ovmNUMBER;
+    }
+ 
+    /**
+     * @notice Overrides GASLIMIT.
+     * @return _GASLIMIT Value of the block's GASLIMIT within the transaction context.
+     */
+    function ovmGASLIMIT()
+        override
+        public
+        view
+        returns (
+            uint256 _GASLIMIT
+        )
+    {
+        return transactionContext.ovmGASLIMIT;
+    }
+ 
+    /**
+     * @notice Overrides CHAINID.
+     * @return _CHAINID Value of the chain's CHAINID within the global context.
+     */
+    function ovmCHAINID()
+        override
+        public
+        view
+        returns (
+            uint256 _CHAINID
+        )
+    {
+        return globalContext.ovmCHAINID;
+    }
+ 
+    /*********************************
+     * Opcodes: L2 Execution Context *
+     *********************************/
+ 
+    /**
+     * @notice Specifies from which L1 rollup queue this transaction originated from.
+     * @return _queueOrigin Address of the ovmL1QUEUEORIGIN within the current message context.
+     */
+    function ovmL1QUEUEORIGIN()
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.QueueOrigin _queueOrigin
+        )
+    {
+        return transactionContext.ovmL1QUEUEORIGIN;
+    }
+ 
+    /**
+     * @notice Specifies which L1 account, if any, sent this transaction by calling enqueue().
+     * @return _l1TxOrigin Address of the account which sent the tx into L2 from L1.
+     */
+    function ovmL1TXORIGIN()
+        override
+        public
+        view
+        returns (
+            address _l1TxOrigin
+        )
+    {
+        return transactionContext.ovmL1TXORIGIN;
+    }
+ 
+    /********************
+     * Opcodes: Halting *
+     ********************/
+ 
+    /**
+     * @notice Overrides REVERT.
+     * @param _data Bytes data to pass along with the REVERT.
+     */
+    function ovmREVERT(
+        bytes memory _data
+    )
+        override
+        public
+    {
+        _revertWithFlag(RevertFlag.INTENTIONAL_REVERT, _data);
+    }
+ 
+ 
+    /******************************
+     * Opcodes: Contract Creation *
+     ******************************/
+ 
+    /**
+     * @notice Overrides CREATE.
+     * @param _bytecode Code to be used to CREATE a new contract.
+     * @return Address of the created contract.
+     * @return Revert data, if and only if the creation threw an exception.
+     */
+    function ovmCREATE(
+        bytes memory _bytecode
+    )
+        override
+        public
+        notStatic
+        fixedGasDiscount(40000)
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // Creator is always the current ADDRESS.
+        address creator = ovmADDRESS();
+ 
+        // Check that the deployer is whitelisted, or
+        // that arbitrary contract deployment has been enabled.
+        _checkDeployerAllowed(creator);
+ 
+        // Generate the correct CREATE address.
+        address contractAddress = Lib_EthUtils.getAddressForCREATE(
+            creator,
+            _getAccountNonce(creator)
+        );
+ 
+        return _createContract(
+            contractAddress,
+            _bytecode
+        );
+    }
+ 
+    /**
+     * @notice Overrides CREATE2.
+     * @param _bytecode Code to be used to CREATE2 a new contract.
+     * @param _salt Value used to determine the contract's address.
+     * @return Address of the created contract.
+     * @return Revert data, if and only if the creation threw an exception.
+     */
+    function ovmCREATE2(
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        override
+        public
+        notStatic
+        fixedGasDiscount(40000)
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // Creator is always the current ADDRESS.
+        address creator = ovmADDRESS();
+ 
+        // Check that the deployer is whitelisted, or
+        // that arbitrary contract deployment has been enabled.
+        _checkDeployerAllowed(creator);
+ 
+        // Generate the correct CREATE2 address.
+        address contractAddress = Lib_EthUtils.getAddressForCREATE2(
+            creator,
+            _bytecode,
+            _salt
+        );
+ 
+        return _createContract(
+            contractAddress,
+            _bytecode
+        );
+    }
+ 
+ 
+    /*******************************
+     * Account Abstraction Opcodes *
+     ******************************/
+ 
+    /**
+     * Retrieves the nonce of the current ovmADDRESS.
+     * @return _nonce Nonce of the current contract.
+     */
+    function ovmGETNONCE()
+        override
+        public
+        returns (
+            uint256 _nonce
+        )
+    {
+        return _getAccountNonce(ovmADDRESS());
+    }
+ 
+    /**
+     * Sets the nonce of the current ovmADDRESS.
+     * @param _nonce New nonce for the current contract.
+     */
+    function ovmSETNONCE(
+        uint256 _nonce
+    )
+        override
+        public
+        notStatic
+    {
+        _setAccountNonce(ovmADDRESS(), _nonce);
+    }
+ 
+    /**
+     * Creates a new EOA contract account, for account abstraction.
+     * @dev Essentially functions like ovmCREATE or ovmCREATE2, but we can bypass a lot of checks
+     *      because the contract we're creating is trusted (no need to do safety checking or to
+     *      handle unexpected reverts). Doesn't need to return an address because the address is
+     *      assumed to be the user's actual address.
+     * @param _messageHash Hash of a message signed by some user, for verification.
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     */
+    function ovmCREATEEOA(
+        bytes32 _messageHash,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        override
+        public
+        notStatic
+    {
+        // Recover the EOA address from the message hash and signature parameters. Since we do the
+        // hashing in advance, we don't have handle different message hashing schemes. Even if this
+        // function were to return the wrong address (rather than explicitly returning the zero
+        // address), the rest of the transaction would simply fail (since there's no EOA account to
+        // actually execute the transaction).
+        address eoa = ecrecover(
+            _messageHash,
+            _v + 27,
+            _r,
+            _s
+        );
+ 
+        // Invalid signature is a case we proactively handle with a revert. We could alternatively
+        // have this function return a `success` boolean, but this is just easier.
+        Iif (eoa == address(0)) {
+            ovmREVERT(bytes("Signature provided for EOA contract creation is invalid."));
+        }
+ 
+        // If the user already has an EOA account, then there's no need to perform this operation.
+        Iif (_hasEmptyAccount(eoa) == false) {
+            return;
+        }
+ 
+        // We always need to initialize the contract with the default account values.
+        _initPendingAccount(eoa);
+ 
+        // Temporarily set the current address so it's easier to access on L2.
+        address prevADDRESS = messageContext.ovmADDRESS;
+        messageContext.ovmADDRESS = eoa;
+ 
+        // Now actually create the account and get its bytecode. We're not worried about reverts
+        // (other than out of gas, which we can't capture anyway) because this contract is trusted.
+        OVM_ProxyEOA proxyEOA = new OVM_ProxyEOA(0x4200000000000000000000000000000000000003);
+ 
+        // Reset the address now that we're done deploying.
+        messageContext.ovmADDRESS = prevADDRESS;
+ 
+        // Commit the account with its final values.
+        _commitPendingAccount(
+            eoa,
+            address(proxyEOA),
+            keccak256(Lib_EthUtils.getCode(address(proxyEOA)))
+        );
+ 
+        _setAccountNonce(eoa, 0);
+    }
+ 
+ 
+    /*********************************
+     * Opcodes: Contract Interaction *
+     *********************************/
+ 
+    /**
+     * @notice Overrides CALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmCALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(100000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // CALL updates the CALLER and ADDRESS.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _address;
+ 
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+    /**
+     * @notice Overrides STATICCALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmSTATICCALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(80000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // STATICCALL updates the CALLER, updates the ADDRESS, and runs in a static context.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _address;
+        nextMessageContext.isStatic = true;
+ 
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+    /**
+     * @notice Overrides DELEGATECALL.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _address Address of the contract to call.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function ovmDELEGATECALL(
+        uint256 _gasLimit,
+        address _address,
+        bytes memory _calldata
+    )
+        override
+        public
+        fixedGasDiscount(40000)
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // DELEGATECALL does not change anything about the message context.
+        MessageContext memory nextMessageContext = messageContext;
+        
+        return _callContract(
+            nextMessageContext,
+            _gasLimit,
+            _address,
+            _calldata
+        );
+    }
+ 
+ 
+    /************************************
+     * Opcodes: Contract Storage Access *
+     ************************************/
+ 
+    /**
+     * @notice Overrides SLOAD.
+     * @param _key 32 byte key of the storage slot to load.
+     * @return _value 32 byte value of the requested storage slot.
+     */
+    function ovmSLOAD(
+        bytes32 _key
+    )
+        override
+        public
+        netGasCost(40000)
+        returns (
+            bytes32 _value
+        )
+    {
+        // We always SLOAD from the storage of ADDRESS.
+        address contractAddress = ovmADDRESS();
+ 
+        return _getContractStorage(
+            contractAddress,
+            _key
+        );
+    }
+ 
+    /**
+     * @notice Overrides SSTORE.
+     * @param _key 32 byte key of the storage slot to set.
+     * @param _value 32 byte value for the storage slot.
+     */
+    function ovmSSTORE(
+        bytes32 _key,
+        bytes32 _value
+    )
+        override
+        public
+        notStatic
+        netGasCost(60000)
+    {
+        // We always SSTORE to the storage of ADDRESS.
+        address contractAddress = ovmADDRESS();
+ 
+        _putContractStorage(
+            contractAddress,
+            _key,
+            _value
+        );
+    }
+ 
+ 
+    /*********************************
+     * Opcodes: Contract Code Access *
+     *********************************/
+ 
+    /**
+     * @notice Overrides EXTCODECOPY.
+     * @param _contract Address of the contract to copy code from.
+     * @param _offset Offset in bytes from the start of contract code to copy beyond.
+     * @param _length Total number of bytes to copy from the contract's code.
+     * @return _code Bytes of code copied from the requested contract.
+     */
+    function ovmEXTCODECOPY(
+        address _contract,
+        uint256 _offset,
+        uint256 _length
+    )
+        override
+        public
+        returns (
+            bytes memory _code
+        )
+    {
+        // `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of
+        // return data. By blocking reads of one byte, we're able to use the condition that an
+        // OVM_ExecutionManager function return value having a length of exactly one byte indicates
+        // an error without an explicit revert. If users were able to read a single byte, they
+        // could forcibly trigger behavior that should only be available to this contract.
+        uint256 length = _length == 1 ? 2 : _length;
+ 
+        return Lib_EthUtils.getCode(
+            _getAccountEthAddress(_contract),
+            _offset,
+            length
+        );
+    }
+ 
+    /**
+     * @notice Overrides EXTCODESIZE.
+     * @param _contract Address of the contract to query the size of.
+     * @return _EXTCODESIZE Size of the requested contract in bytes.
+     */
+    function ovmEXTCODESIZE(
+        address _contract
+    )
+        override
+        public
+        returns (
+            uint256 _EXTCODESIZE
+        )
+    {
+        return Lib_EthUtils.getCodeSize(
+            _getAccountEthAddress(_contract)
+        );
+    }
+ 
+    /**
+     * @notice Overrides EXTCODEHASH.
+     * @param _contract Address of the contract to query the hash of.
+     * @return _EXTCODEHASH Hash of the requested contract.
+     */
+    function ovmEXTCODEHASH(
+        address _contract
+    )
+        override
+        public
+        returns (
+            bytes32 _EXTCODEHASH
+        )
+    {
+        return Lib_EthUtils.getCodeHash(
+            _getAccountEthAddress(_contract)
+        );
+    }
+ 
+    /***************************************
+     * Public Functions: Execution Context *
+     ***************************************/
+ 
+    function getMaxTransactionGasLimit()
+        external
+        view
+        override
+        returns (
+            uint256 _maxTransactionGasLimit
+        )
+    {
+        return gasMeterConfig.maxTransactionGasLimit;
+    }
+ 
+    /********************************************
+     * Public Functions: Deployment Whitelisting *
+     ********************************************/
+ 
+    /**
+     * Checks whether the given address is on the whitelist to ovmCREATE/ovmCREATE2, and reverts if not.
+     * @param _deployerAddress Address attempting to deploy a contract.
+     */
+    function _checkDeployerAllowed(
+        address _deployerAddress
+    )
+        internal
+    {
+        // From an OVM semantics perspective, this will appear identical to
+        // the deployer ovmCALLing the whitelist.  This is fine--in a sense, we are forcing them to.
+        (bool success, bytes memory data) = ovmCALL(
+            gasleft(),
+            0x4200000000000000000000000000000000000002,
+            abi.encodeWithSignature("isDeployerAllowed(address)", _deployerAddress)
+        );
+        bool isAllowed = abi.decode(data, (bool));
+ 
+        if (!isAllowed || !success) {
+            _revertWithFlag(RevertFlag.CREATOR_NOT_ALLOWED);
+        }
+    }
+ 
+    /********************************************
+     * Internal Functions: Contract Interaction *
+     ********************************************/
+ 
+    /**
+     * Creates a new contract and associates it with some contract address.
+     * @param _contractAddress Address to associate the created contract with.
+     * @param _bytecode Bytecode to be used to create the contract.
+     * @return Final OVM contract address.
+     * @return Revertdata, if and only if the creation threw an exception.
+     */
+    function _createContract(
+        address _contractAddress,
+        bytes memory _bytecode
+    )
+        internal
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        // We always update the nonce of the creating account, even if the creation fails.
+        _setAccountNonce(ovmADDRESS(), _getAccountNonce(ovmADDRESS()) + 1);
+ 
+        // We're stepping into a CREATE or CREATE2, so we need to update ADDRESS to point
+        // to the contract's associated address and CALLER to point to the previous ADDRESS.
+        MessageContext memory nextMessageContext = messageContext;
+        nextMessageContext.ovmCALLER = messageContext.ovmADDRESS;
+        nextMessageContext.ovmADDRESS = _contractAddress;
+ 
+        // Run the common logic which occurs between call-type and create-type messages,
+        // passing in the creation bytecode and `true` to trigger create-specific logic.
+        (bool success, bytes memory data) = _handleExternalMessage(
+            nextMessageContext,
+            gasleft(),
+            _contractAddress,
+            _bytecode,
+            true
+        );
+ 
+        // Yellow paper requires that address returned is zero if the contract deployment fails.
+        return (
+            success ? _contractAddress : address(0),
+            data
+        );
+    }
+ 
+    /**
+     * Calls the deployed contract associated with a given address.
+     * @param _nextMessageContext Message context to be used for the call.
+     * @param _gasLimit Amount of gas to be passed into this call.
+     * @param _contract OVM address to be called.
+     * @param _calldata Data to send along with the call.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function _callContract(
+        MessageContext memory _nextMessageContext,
+        uint256 _gasLimit,
+        address _contract,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        // We reserve addresses of the form 0xdeaddeaddead...NNNN for the container contracts in L2 geth.
+        // So, we block calls to these addresses since they are not safe to run as an OVM contract itself.
+        if (
+            (uint256(_contract) & uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000))
+            == uint256(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000)
+        ) {
+            // EVM does not return data in the success case, see: https://github.com/ethereum/go-ethereum/blob/aae7660410f0ef90279e14afaaf2f429fdc2a186/core/vm/instructions.go#L600-L604
+            return (true, hex'');
+        }
+ 
+        // Both 0x0000... and the EVM precompiles have the same address on L1 and L2 --> no trie lookup needed.
+        address codeContractAddress =
+            uint(_contract) < 100
+            ? _contract
+            : _getAccountEthAddress(_contract);
+ 
+        return _handleExternalMessage(
+            _nextMessageContext,
+            _gasLimit,
+            codeContractAddress,
+            _calldata,
+            false
+        );
+    }
+ 
+    /**
+     * Handles all interactions which involve the execution manager calling out to untrusted code (both calls and creates).
+     * Ensures that OVM-related measures are enforced, including L2 gas refunds, nuisance gas, and flagged reversions.
+     * 
+     * @param _nextMessageContext Message context to be used for the external message.
+     * @param _gasLimit Amount of gas to be passed into this message.
+     * @param _contract OVM address being called or deployed to
+     * @param _data Data for the message (either calldata or creation code)
+     * @param _isCreate Whether this is a create-type message.
+     * @return Whether or not the message (either a call or deployment) succeeded.
+     * @return Data returned by the message.
+     */
+    function _handleExternalMessage(
+        MessageContext memory _nextMessageContext,
+        uint256 _gasLimit,
+        address _contract,
+        bytes memory _data,
+        bool _isCreate
+    )
+        internal
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        // We need to switch over to our next message context for the duration of this call.
+        MessageContext memory prevMessageContext = messageContext;
+        _switchMessageContext(prevMessageContext, _nextMessageContext);
+ 
+        // Nuisance gas is a system used to bound the ability for an attacker to make fraud proofs
+        // expensive by touching a lot of different accounts or storage slots. Since most contracts
+        // only use a few storage slots during any given transaction, this shouldn't be a limiting
+        // factor.
+        uint256 prevNuisanceGasLeft = messageRecord.nuisanceGasLeft;
+        uint256 nuisanceGasLimit = _getNuisanceGasLimit(_gasLimit);
+        messageRecord.nuisanceGasLeft = nuisanceGasLimit;
+ 
+        // Make the call and make sure to pass in the gas limit. Another instance of hidden
+        // complexity. `_contract` is guaranteed to be a safe contract, meaning its return/revert
+        // behavior can be controlled. In particular, we enforce that flags are passed through
+        // revert data as to retrieve execution metadata that would normally be reverted out of
+        // existence.
+ 
+        (bool success, bytes memory returndata) =
+            _isCreate
+            ? _handleContractCreation(_gasLimit, _data, _contract)
+            : _contract.call{gas: _gasLimit}(_data);
+ 
+        // Switch back to the original message context now that we're out of the call.
+        _switchMessageContext(_nextMessageContext, prevMessageContext);
+ 
+        // Assuming there were no reverts, the message record should be accurate here. We'll update
+        // this value in the case of a revert.
+        uint256 nuisanceGasLeft = messageRecord.nuisanceGasLeft;
+ 
+        // Reverts at this point are completely OK, but we need to make a few updates based on the
+        // information passed through the revert.
+        if (success == false) {
+            (
+                RevertFlag flag,
+                uint256 nuisanceGasLeftPostRevert,
+                uint256 ovmGasRefund,
+                bytes memory returndataFromFlag
+            ) = _decodeRevertData(returndata);
+ 
+            // INVALID_STATE_ACCESS is the only flag that triggers an immediate abort of the
+            // parent EVM message. This behavior is necessary because INVALID_STATE_ACCESS must
+            // halt any further transaction execution that could impact the execution result.
+            if (flag == RevertFlag.INVALID_STATE_ACCESS) {
+                _revertWithFlag(flag);
+            }
+ 
+            // INTENTIONAL_REVERT, UNSAFE_BYTECODE, STATIC_VIOLATION, and CREATOR_NOT_ALLOWED aren't
+            // dependent on the input state, so we can just handle them like standard reverts. Our only change here
+            // is to record the gas refund reported by the call (enforced by safety checking).
+            if (
+                flag == RevertFlag.INTENTIONAL_REVERT
+                || flag == RevertFlag.UNSAFE_BYTECODE
+                || flag == RevertFlag.STATIC_VIOLATION
+                || flag == RevertFlag.CREATOR_NOT_ALLOWED
+            ) {
+                transactionRecord.ovmGasRefund = ovmGasRefund;
+            }
+ 
+            // INTENTIONAL_REVERT needs to pass up the user-provided return data encoded into the
+            // flag, *not* the full encoded flag. All other revert types return no data.
+            if (
+                flag == RevertFlag.INTENTIONAL_REVERT
+                || _isCreate
+            ) {
+                returndata = returndataFromFlag;
+            } else {
+                returndata = hex'';
+            }
+ 
+            // Reverts mean we need to use up whatever "nuisance gas" was used by the call.
+            // EXCEEDS_NUISANCE_GAS explicitly reduces the remaining nuisance gas for this message
+            // to zero. OUT_OF_GAS is a "pseudo" flag given that messages return no data when they
+            // run out of gas, so we have to treat this like EXCEEDS_NUISANCE_GAS. All other flags
+            // will simply pass up the remaining nuisance gas.
+            nuisanceGasLeft = nuisanceGasLeftPostRevert;
+        }
+ 
+        // We need to reset the nuisance gas back to its original value minus the amount used here.
+        messageRecord.nuisanceGasLeft = prevNuisanceGasLeft - (nuisanceGasLimit - nuisanceGasLeft);
+ 
+        return (
+            success,
+            returndata
+        );
+    }
+ 
+    /**
+     * Handles the creation-specific safety measures required for OVM contract deployment.
+     * This function sanitizes the return types for creation messages to match calls (bool, bytes).
+     * This allows for consistent handling of both types of messages in _handleExternalMessage().
+     * 
+     * @param _gasLimit Amount of gas to be passed into this creation.
+     * @param _creationCode Code to pass into CREATE for deployment.
+     * @param _address OVM address being deployed to.
+     * @return Whether or not the call succeeded.
+     * @return If creation fails: revert data. Otherwise: empty.
+     */
+    function _handleContractCreation(
+        uint _gasLimit,
+        bytes memory _creationCode,
+        address _address
+    )
+        internal
+        returns(
+            bool,
+            bytes memory
+        )
+    {
+        // Check that there is not already code at this address.
+        Iif (_hasEmptyAccount(_address) == false) {
+            // Note: in the EVM, this case burns all allotted gas.  For improved
+            // developer experience, we do return the remaining ones.
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.CREATE_COLLISION,
+                    Lib_ErrorUtils.encodeRevertString("A contract has already been deployed to this address")
+                )
+            );
+        }
+ 
+        // Check the creation bytecode against the OVM_SafetyChecker.
+        Iif (ovmSafetyChecker.isBytecodeSafe(_creationCode) == false) {
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.UNSAFE_BYTECODE,
+                    Lib_ErrorUtils.encodeRevertString("Contract creation code contains unsafe opcodes. Did you use the right compiler or pass an unsafe constructor argument?")
+                )
+            );
+        }
+ 
+        // We always need to initialize the contract with the default account values.
+        _initPendingAccount(_address);
+ 
+        // Actually execute the EVM create message,
+        address ethAddress = Lib_EthUtils.createContract(_creationCode);
+        
+        if (ethAddress == address(0)) {
+            // If the creation fails, the EVM lets us grab its revert data. This may contain a revert flag
+            // to be used above in _handleExternalMessage.
+            uint256 revertDataSize;
+            assembly { revertDataSize := returndatasize() }
+            bytes memory revertdata = new bytes(revertDataSize);
+            assembly {
+                returndatacopy(
+                    add(revertdata, 0x20),
+                    0,
+                    revertDataSize
+                )
+            }
+            // Return that the creation failed, and the data it reverted with.
+            return (false, revertdata);
+        }
+ 
+        // Again simply checking that the deployed code is safe too. Contracts can generate
+        // arbitrary deployment code, so there's no easy way to analyze this beforehand.
+        bytes memory deployedCode = Lib_EthUtils.getCode(ethAddress);
+        if (ovmSafetyChecker.isBytecodeSafe(deployedCode) == false) {
+            return (
+                false,
+                _encodeRevertData(
+                    RevertFlag.UNSAFE_BYTECODE,
+                    Lib_ErrorUtils.encodeRevertString("Constructor attempted to deploy unsafe bytecode.")
+                )
+            );
+        }
+ 
+        // Contract creation didn't need to be reverted and the bytecode is safe. We finish up by
+        // associating the desired address with the newly created contract's code hash and address.
+        _commitPendingAccount(
+            _address,
+            ethAddress,
+            Lib_EthUtils.getCodeHash(ethAddress)
+        );
+ 
+        // Successful deployments will not give access to returndata, in both the EVM and the OVM.
+        return (true, hex'');
+    }
+ 
+    /******************************************
+     * Internal Functions: State Manipulation *
+     ******************************************/
+ 
+    /**
+     * Checks whether an account exists within the OVM_StateManager.
+     * @param _address Address of the account to check.
+     * @return _exists Whether or not the account exists.
+     */
+    function _hasAccount(
+        address _address
+    )
+        internal
+        returns (
+            bool _exists
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.hasAccount(_address);
+    }
+ 
+    /**
+     * Checks whether a known empty account exists within the OVM_StateManager.
+     * @param _address Address of the account to check.
+     * @return _exists Whether or not the account empty exists.
+     */
+    function _hasEmptyAccount(
+        address _address
+    )
+        internal
+        returns (
+            bool _exists
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.hasEmptyAccount(_address);
+    }
+ 
+    /**
+     * Sets the nonce of an account.
+     * @param _address Address of the account to modify.
+     * @param _nonce New account nonce.
+     */
+    function _setAccountNonce(
+        address _address,
+        uint256 _nonce
+    )
+        internal
+    {
+        _checkAccountChange(_address);
+        ovmStateManager.setAccountNonce(_address, _nonce);
+    }
+ 
+    /**
+     * Gets the nonce of an account.
+     * @param _address Address of the account to access.
+     * @return _nonce Nonce of the account.
+     */
+    function _getAccountNonce(
+        address _address
+    )
+        internal
+        returns (
+            uint256 _nonce
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.getAccountNonce(_address);
+    }
+ 
+    /**
+     * Retrieves the Ethereum address of an account.
+     * @param _address Address of the account to access.
+     * @return _ethAddress Corresponding Ethereum address.
+     */
+    function _getAccountEthAddress(
+        address _address
+    )
+        internal
+        returns (
+            address _ethAddress
+        )
+    {
+        _checkAccountLoad(_address);
+        return ovmStateManager.getAccountEthAddress(_address);
+    }
+ 
+    /**
+     * Creates the default account object for the given address.
+     * @param _address Address of the account create.
+     */
+    function _initPendingAccount(
+        address _address
+    )
+        internal
+    {
+        // Although it seems like `_checkAccountChange` would be more appropriate here, we don't
+        // actually consider an account "changed" until it's inserted into the state (in this case
+        // by `_commitPendingAccount`).
+        _checkAccountLoad(_address);
+        ovmStateManager.initPendingAccount(_address);
+    }
+ 
+    /**
+     * Stores additional relevant data for a new account, thereby "committing" it to the state.
+     * This function is only called during `ovmCREATE` and `ovmCREATE2` after a successful contract
+     * creation.
+     * @param _address Address of the account to commit.
+     * @param _ethAddress Address of the associated deployed contract.
+     * @param _codeHash Hash of the code stored at the address.
+     */
+    function _commitPendingAccount(
+        address _address,
+        address _ethAddress,
+        bytes32 _codeHash
+    )
+        internal
+    {
+        _checkAccountChange(_address);
+        ovmStateManager.commitPendingAccount(
+            _address,
+            _ethAddress,
+            _codeHash
+        );
+    }
+ 
+    /**
+     * Retrieves the value of a storage slot.
+     * @param _contract Address of the contract to query.
+     * @param _key 32 byte key of the storage slot.
+     * @return _value 32 byte storage slot value.
+     */
+    function _getContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+        returns (
+            bytes32 _value
+        )
+    {
+        _checkContractStorageLoad(_contract, _key);
+        return ovmStateManager.getContractStorage(_contract, _key);
+    }
+ 
+    /**
+     * Sets the value of a storage slot.
+     * @param _contract Address of the contract to modify.
+     * @param _key 32 byte key of the storage slot.
+     * @param _value 32 byte storage slot value.
+     */
+    function _putContractStorage(
+        address _contract,
+        bytes32 _key,
+        bytes32 _value
+    )
+        internal
+    {
+        // We don't set storage if the value didn't change. Although this acts as a convenient
+        // optimization, it's also necessary to avoid the case in which a contract with no storage
+        // attempts to store the value "0" at any key. Putting this value (and therefore requiring
+        // that the value be committed into the storage trie after execution) would incorrectly
+        // modify the storage root.
+        Iif (_getContractStorage(_contract, _key) == _value) {
+            return;
+        }
+ 
+        _checkContractStorageChange(_contract, _key);
+        ovmStateManager.putContractStorage(_contract, _key, _value);
+    }
+ 
+    /**
+     * Validation whenever a contract needs to be loaded. Checks that the account exists, charges
+     * nuisance gas if the account hasn't been loaded before.
+     * @param _address Address of the account to load.
+     */
+    function _checkAccountLoad(
+        address _address
+    )
+        internal
+    {
+        // See `_checkContractStorageLoad` for more information.
+        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
+            _revertWithFlag(RevertFlag.OUT_OF_GAS);
+        }
+ 
+        // See `_checkContractStorageLoad` for more information.
+        if (ovmStateManager.hasAccount(_address) == false) {
+            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
+        }
+ 
+        // Check whether the account has been loaded before and mark it as loaded if not. We need
+        // this because "nuisance gas" only applies to the first time that an account is loaded.
+        (
+            bool _wasAccountAlreadyLoaded
+        ) = ovmStateManager.testAndSetAccountLoaded(_address);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
+        // on the size of the contract code.
+        if (_wasAccountAlreadyLoaded == false) {
+            _useNuisanceGas(
+                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
+            );
+        }
+    }
+ 
+    /**
+     * Validation whenever a contract needs to be changed. Checks that the account exists, charges
+     * nuisance gas if the account hasn't been changed before.
+     * @param _address Address of the account to change.
+     */
+    function _checkAccountChange(
+        address _address
+    )
+        internal
+    {
+        // Start by checking for a load as we only want to charge nuisance gas proportional to
+        // contract size once.
+        _checkAccountLoad(_address);
+ 
+        // Check whether the account has been changed before and mark it as changed if not. We need
+        // this because "nuisance gas" only applies to the first time that an account is changed.
+        (
+            bool _wasAccountAlreadyChanged
+        ) = ovmStateManager.testAndSetAccountChanged(_address);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
+        // on the size of the contract code.
+        if (_wasAccountAlreadyChanged == false) {
+            ovmStateManager.incrementTotalUncommittedAccounts();
+            _useNuisanceGas(
+                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
+            );
+        }
+    }
+ 
+    /**
+     * Validation whenever a slot needs to be loaded. Checks that the account exists, charges
+     * nuisance gas if the slot hasn't been loaded before.
+     * @param _contract Address of the account to load from.
+     * @param _key 32 byte key to load.
+     */
+    function _checkContractStorageLoad(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+    {
+        // Another case of hidden complexity. If we didn't enforce this requirement, then a
+        // contract could pass in just enough gas to cause the INVALID_STATE_ACCESS check to fail
+        // on L1 but not on L2. A contract could use this behavior to prevent the
+        // OVM_ExecutionManager from detecting an invalid state access. Reverting with OUT_OF_GAS
+        // allows us to also charge for the full message nuisance gas, because you deserve that for
+        // trying to break the contract in this way.
+        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
+            _revertWithFlag(RevertFlag.OUT_OF_GAS);
+        }
+ 
+        // We need to make sure that the transaction isn't trying to access storage that hasn't
+        // been provided to the OVM_StateManager. We'll immediately abort if this is the case.
+        // We know that we have enough gas to do this check because of the above test.
+        Iif (ovmStateManager.hasContractStorage(_contract, _key) == false) {
+            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
+        }
+ 
+        // Check whether the slot has been loaded before and mark it as loaded if not. We need
+        // this because "nuisance gas" only applies to the first time that a slot is loaded.
+        (
+            bool _wasContractStorageAlreadyLoaded
+        ) = ovmStateManager.testAndSetContractStorageLoaded(_contract, _key);
+ 
+        // If we hadn't already loaded the account, then we'll need to charge some fixed amount of
+        // "nuisance gas".
+        if (_wasContractStorageAlreadyLoaded == false) {
+            _useNuisanceGas(NUISANCE_GAS_SLOAD);
+        }
+    }
+ 
+    /**
+     * Validation whenever a slot needs to be changed. Checks that the account exists, charges
+     * nuisance gas if the slot hasn't been changed before.
+     * @param _contract Address of the account to change.
+     * @param _key 32 byte key to change.
+     */
+    function _checkContractStorageChange(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+    {
+        // Start by checking for load to make sure we have the storage slot and that we charge the
+        // "nuisance gas" necessary to prove the storage slot state.
+        _checkContractStorageLoad(_contract, _key);
+ 
+        // Check whether the slot has been changed before and mark it as changed if not. We need
+        // this because "nuisance gas" only applies to the first time that a slot is changed.
+        (
+            bool _wasContractStorageAlreadyChanged
+        ) = ovmStateManager.testAndSetContractStorageChanged(_contract, _key);
+ 
+        // If we hadn't already changed the account, then we'll need to charge some fixed amount of
+        // "nuisance gas".
+        Eif (_wasContractStorageAlreadyChanged == false) {
+            // Changing a storage slot means that we're also going to have to change the
+            // corresponding account, so do an account change check.
+            _checkAccountChange(_contract);
+ 
+            ovmStateManager.incrementTotalUncommittedContractStorage();
+            _useNuisanceGas(NUISANCE_GAS_SSTORE);
+        }
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Revert Logic *
+     ************************************/
+ 
+    /**
+     * Simple encoding for revert data.
+     * @param _flag Flag to revert with.
+     * @param _data Additional user-provided revert data.
+     * @return _revertdata Encoded revert data.
+     */
+    function _encodeRevertData(
+        RevertFlag _flag,
+        bytes memory _data
+    )
+        internal
+        view
+        returns (
+            bytes memory _revertdata
+        )
+    {
+        // Out of gas and create exceptions will fundamentally return no data, so simulating it shouldn't either.
+        Iif (
+            _flag == RevertFlag.OUT_OF_GAS
+        ) {
+            return bytes('');
+        }
+ 
+        // INVALID_STATE_ACCESS doesn't need to return any data other than the flag.
+        if (_flag == RevertFlag.INVALID_STATE_ACCESS) {
+            return abi.encode(
+                _flag,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        // Just ABI encode the rest of the parameters.
+        return abi.encode(
+            _flag,
+            messageRecord.nuisanceGasLeft,
+            transactionRecord.ovmGasRefund,
+            _data
+        );
+    }
+ 
+    /**
+     * Simple decoding for revert data.
+     * @param _revertdata Revert data to decode.
+     * @return _flag Flag used to revert.
+     * @return _nuisanceGasLeft Amount of nuisance gas unused by the message.
+     * @return _ovmGasRefund Amount of gas refunded during the message.
+     * @return _data Additional user-provided revert data.
+     */
+    function _decodeRevertData(
+        bytes memory _revertdata
+    )
+        internal
+        pure
+        returns (
+            RevertFlag _flag,
+            uint256 _nuisanceGasLeft,
+            uint256 _ovmGasRefund,
+            bytes memory _data
+        )
+    {
+        // A length of zero means the call ran out of gas, just return empty data.
+        if (_revertdata.length == 0) {
+            return (
+                RevertFlag.OUT_OF_GAS,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        // ABI decode the incoming data.
+        return abi.decode(_revertdata, (RevertFlag, uint256, uint256, bytes));
+    }
+ 
+    /**
+     * Causes a message to revert or abort.
+     * @param _flag Flag to revert with.
+     * @param _data Additional user-provided data.
+     */
+    function _revertWithFlag(
+        RevertFlag _flag,
+        bytes memory _data
+    )
+        internal
+        view
+    {
+        bytes memory revertdata = _encodeRevertData(
+            _flag,
+            _data
+        );
+ 
+        assembly {
+            revert(add(revertdata, 0x20), mload(revertdata))
+        }
+    }
+ 
+    /**
+     * Causes a message to revert or abort.
+     * @param _flag Flag to revert with.
+     */
+    function _revertWithFlag(
+        RevertFlag _flag
+    )
+        internal
+    {
+        _revertWithFlag(_flag, bytes(''));
+    }
+ 
+ 
+    /******************************************
+     * Internal Functions: Nuisance Gas Logic *
+     ******************************************/
+ 
+    /**
+     * Computes the nuisance gas limit from the gas limit.
+     * @dev This function is currently using a naive implementation whereby the nuisance gas limit
+     *      is set to exactly equal the lesser of the gas limit or remaining gas. It's likely that
+     *      this implementation is perfectly fine, but we may change this formula later.
+     * @param _gasLimit Gas limit to compute from.
+     * @return _nuisanceGasLimit Computed nuisance gas limit.
+     */
+    function _getNuisanceGasLimit(
+        uint256 _gasLimit
+    )
+        internal
+        view
+        returns (
+            uint256 _nuisanceGasLimit
+        )
+    {
+        return _gasLimit < gasleft() ? _gasLimit : gasleft();
+    }
+ 
+    /**
+     * Uses a certain amount of nuisance gas.
+     * @param _amount Amount of nuisance gas to use.
+     */
+    function _useNuisanceGas(
+        uint256 _amount
+    )
+        internal
+    {
+        // Essentially the same as a standard OUT_OF_GAS, except we also retain a record of the gas
+        // refund to be given at the end of the transaction.
+        Iif (messageRecord.nuisanceGasLeft < _amount) {
+            _revertWithFlag(RevertFlag.EXCEEDS_NUISANCE_GAS);
+        }
+ 
+        messageRecord.nuisanceGasLeft -= _amount;
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Gas Metering *
+     ************************************/
+ 
+    /**
+     * Checks whether a transaction needs to start a new epoch and does so if necessary.
+     * @param _timestamp Transaction timestamp.
+     */
+    function _checkNeedsNewEpoch(
+        uint256 _timestamp
+    )
+        internal
+    {
+        if (
+            _timestamp >= (
+                _getGasMetadata(GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP)
+                + gasMeterConfig.secondsPerEpoch
+            )
+        ) {
+            _putGasMetadata(
+                GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP,
+                _timestamp
+            );
+ 
+            _putGasMetadata(
+                GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS,
+                _getGasMetadata(
+                    GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS
+                )
+            );
+ 
+            _putGasMetadata(
+                GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS,
+                _getGasMetadata(
+                    GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS
+                )
+            );
+        }
+    }
+ 
+    /**
+     * Validates the gas limit for a given transaction.
+     * @param _gasLimit Gas limit provided by the transaction.
+     * param _queueOrigin Queue from which the transaction originated.
+     * @return _valid Whether or not the gas limit is valid.
+     */
+    function _isValidGasLimit(
+        uint256 _gasLimit,
+        Lib_OVMCodec.QueueOrigin // _queueOrigin
+    )
+        view
+        internal
+        returns (
+            bool _valid
+        )
+    {
+        // Always have to be below the maximum gas limit.
+        Iif (_gasLimit > gasMeterConfig.maxTransactionGasLimit) {
+            return false;
+        }
+ 
+        // Always have to be above the minimum gas limit.
+        Iif (_gasLimit < gasMeterConfig.minTransactionGasLimit) {
+            return false;
+        }
+ 
+        // TEMPORARY: Gas metering is disabled for minnet.
+        return true;
+        // GasMetadataKey cumulativeGasKey;
+        // GasMetadataKey prevEpochGasKey;
+        // if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
+        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
+        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS;
+        // } else {
+        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
+        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS;
+        // }
+ 
+        // return (
+        //     (
+        //         _getGasMetadata(cumulativeGasKey)
+        //         - _getGasMetadata(prevEpochGasKey)
+        //         + _gasLimit
+        //     ) < gasMeterConfig.maxGasPerQueuePerEpoch
+        // );
+    }
+ 
+    /**
+     * Updates the cumulative gas after a transaction.
+     * @param _gasUsed Gas used by the transaction.
+     * @param _queueOrigin Queue from which the transaction originated.
+     */
+    function _updateCumulativeGas(
+        uint256 _gasUsed,
+        Lib_OVMCodec.QueueOrigin _queueOrigin
+    )
+        internal
+    {
+        GasMetadataKey cumulativeGasKey;
+        if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
+            cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
+        } else {
+            cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
+        }
+ 
+        _putGasMetadata(
+            cumulativeGasKey,
+            (
+                _getGasMetadata(cumulativeGasKey)
+                + gasMeterConfig.minTransactionGasLimit
+                + _gasUsed
+                - transactionRecord.ovmGasRefund
+            )
+        );
+    }
+ 
+    /**
+     * Retrieves the value of a gas metadata key.
+     * @param _key Gas metadata key to retrieve.
+     * @return _value Value stored at the given key.
+     */
+    function _getGasMetadata(
+        GasMetadataKey _key
+    )
+        internal
+        returns (
+            uint256 _value
+        )
+    {
+        return uint256(_getContractStorage(
+            GAS_METADATA_ADDRESS,
+            bytes32(uint256(_key))
+        ));
+    }
+ 
+    /**
+     * Sets the value of a gas metadata key.
+     * @param _key Gas metadata key to set.
+     * @param _value Value to store at the given key.
+     */
+    function _putGasMetadata(
+        GasMetadataKey _key,
+        uint256 _value
+    )
+        internal
+    {
+        _putContractStorage(
+            GAS_METADATA_ADDRESS,
+            bytes32(uint256(_key)),
+            bytes32(uint256(_value))
+        );
+    }
+ 
+ 
+    /*****************************************
+     * Internal Functions: Execution Context *
+     *****************************************/
+ 
+    /**
+     * Swaps over to a new message context.
+     * @param _prevMessageContext Context we're switching from.
+     * @param _nextMessageContext Context we're switching to.
+     */
+    function _switchMessageContext(
+        MessageContext memory _prevMessageContext,
+        MessageContext memory _nextMessageContext
+    )
+        internal
+    {
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.ovmCALLER != _nextMessageContext.ovmCALLER) {
+            messageContext.ovmCALLER = _nextMessageContext.ovmCALLER;
+        }
+ 
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.ovmADDRESS != _nextMessageContext.ovmADDRESS) {
+            messageContext.ovmADDRESS = _nextMessageContext.ovmADDRESS;
+        }
+ 
+        // Avoid unnecessary the SSTORE.
+        if (_prevMessageContext.isStatic != _nextMessageContext.isStatic) {
+            messageContext.isStatic = _nextMessageContext.isStatic;
+        }
+    }
+ 
+    /**
+     * Initializes the execution context.
+     * @param _transaction OVM transaction being executed.
+     */
+    function _initContext(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        internal
+    {
+        transactionContext.ovmTIMESTAMP = _transaction.timestamp;
+        transactionContext.ovmNUMBER = _transaction.blockNumber;
+        transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
+        transactionContext.ovmL1QUEUEORIGIN = _transaction.l1QueueOrigin;
+        transactionContext.ovmL1TXORIGIN = _transaction.l1TxOrigin;
+        transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
+ 
+        messageRecord.nuisanceGasLeft = _getNuisanceGasLimit(_transaction.gasLimit);
+    }
+ 
+    /**
+     * Resets the transaction and message context.
+     */
+    function _resetContext()
+        internal
+    {
+        transactionContext.ovmL1TXORIGIN = address(0);
+        transactionContext.ovmTIMESTAMP = 0;
+        transactionContext.ovmNUMBER = 0;
+        transactionContext.ovmGASLIMIT = 0;
+        transactionContext.ovmTXGASLIMIT = 0;
+        transactionContext.ovmL1QUEUEORIGIN = Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE;
+ 
+        transactionRecord.ovmGasRefund = 0;
+ 
+        messageContext.ovmCALLER = address(0);
+        messageContext.ovmADDRESS = address(0);
+        messageContext.isStatic = false;
+ 
+        messageRecord.nuisanceGasLeft = 0;
+    }
+ 
+    /*****************************
+     * L2-only Helper Functions *
+     *****************************/
+ 
+    /**
+     * Unreachable helper function for simulating eth_calls with an OVM message context.
+     * This function will throw an exception in all cases other than when used as a custom entrypoint in L2 Geth to simulate eth_call.
+     * @param _transaction the message transaction to simulate.
+     * @param _from the OVM account the simulated call should be from.
+     */
+    function simulateMessage(
+        Lib_OVMCodec.Transaction memory _transaction,
+        address _from,
+        iOVM_StateManager _ovmStateManager
+    )
+        external
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        // Prevent this call from having any effect unless in a custom-set VM frame
+        require(msg.sender == address(0));
+ 
+        ovmStateManager = _ovmStateManager;
+        _initContext(_transaction);
+        messageRecord.nuisanceGasLeft = uint(-1);
+ 
+        messageContext.ovmADDRESS = _from;
+ 
+        bool isCreate = _transaction.entrypoint == address(0);
+        if (isCreate) {
+            (address created, bytes memory revertData) = ovmCREATE(_transaction.data);
+            if (created == address(0)) {
+                return (false, revertData);
+            } else {
+                // The eth_call RPC endpoint for to = undefined will return the deployed bytecode 
+                // in the success case, differing from standard create messages.
+                return (true, Lib_EthUtils.getCode(created));
+            }
+        } else {
+            return ovmCALL(
+                _transaction.gasLimit,
+                _transaction.entrypoint,
+                _transaction.data
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html b/coverage/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html new file mode 100644 index 000000000..90baa02d9 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html @@ -0,0 +1,509 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/execution/ OVM_SafetyChecker.sol +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +277× +  +  +  +  +  +  +  +  +  +  +277× +  +277× +  +277× +  +277× +277× +277× +  +  +277× +277× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +152× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
+ 
+/**
+ * @title OVM_SafetyChecker
+ * @dev  The Safety Checker verifies that contracts deployed on L2 do not contain any
+ * "unsafe" operations. An operation is considered unsafe if it would access state variables which
+ * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used
+ * to "escape the sandbox" of the OVM, resulting in non-deterministic fraud proofs. 
+ * That is, an attacker would be able to "prove fraud" on an honestly applied transaction.
+ * Note that a "safe" contract requires opcodes to appear in a particular pattern;
+ * omission of "unsafe" opcodes is necessary, but not sufficient.
+ *
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_SafetyChecker is iOVM_SafetyChecker {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Returns whether or not all of the provided bytecode is safe.
+     * @param _bytecode The bytecode to safety check.
+     * @return `true` if the bytecode is safe, `false` otherwise.
+     */
+    function isBytecodeSafe(
+        bytes memory _bytecode
+    )
+        override
+        external
+        pure
+        returns (
+            bool
+        )
+    {
+        // autogenerated by gen_safety_checker_constants.py
+        // number of bytes to skip for each opcode
+        uint256[8] memory opcodeSkippableBytes = [
+            uint256(0x0001010101010101010101010000000001010101010101010101010101010000),
+            uint256(0x0100000000000000000000000000000000000000010101010101000000010100),
+            uint256(0x0000000000000000000000000000000001010101000000010101010100000000),
+            uint256(0x0203040500000000000000000000000000000000000000000000000000000000),
+            uint256(0x0101010101010101010101010101010101010101010101010101010101010101),
+            uint256(0x0101010101000000000000000000000000000000000000000000000000000000),
+            uint256(0x0000000000000000000000000000000000000000000000000000000000000000),
+            uint256(0x0000000000000000000000000000000000000000000000000000000000000000)
+        ];
+        // Mask to gate opcode specific cases
+        uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);
+        // Halting opcodes
+        uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);
+        // PUSH opcodes
+        uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);
+ 
+        uint256 codeLength;
+        uint256 _pc;
+        assembly {
+            _pc := add(_bytecode, 0x20)
+        }
+        codeLength = _pc + _bytecode.length;
+        do {
+            // current opcode: 0x00...0xff
+            uint256 opNum;
+ 
+            // inline assembly removes the extra add + bounds check
+            assembly {
+                let word := mload(_pc) //load the next 32 bytes at pc into word
+ 
+                // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord
+                // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4
+                // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).
+                // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,
+                // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.
+                let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
+                _pc := add(_pc, indexInWord)
+ 
+                opNum := byte(indexInWord, word)
+            }
+ 
+            // + push opcodes
+            // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]
+            // + caller opcode CALLER(0x33)
+            // + blacklisted opcodes
+            uint256 opBit = 1 << opNum;
+            if (opBit & opcodeGateMask == 0) {
+                if (opBit & opcodePushMask == 0) {
+                    // all pushes are valid opcodes
+                    // subsequent bytes are not opcodes. Skip them.
+                    _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to
+                    // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)
+                    continue;
+                } else if (opBit & opcodeHaltingMask == 0) {
+                    // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)
+                    // We are now inside unreachable code until we hit a JUMPDEST!
+                    do {
+                        _pc++;
+                        assembly {
+                            opNum := byte(0, mload(_pc))
+                        }
+                        // encountered a JUMPDEST
+                        if (opNum == 0x5b) break;
+                        // skip PUSHed bytes
+                        if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)
+                    } while (_pc < codeLength);
+                    // opNum is 0x5b, so we don't continue here since the pc++ is fine
+                } else if (opNum == 0x33) { // Caller opcode
+                    uint256 firstOps; // next 32 bytes of bytecode
+                    uint256 secondOps; // following 32 bytes of bytecode
+ 
+                    assembly {
+                        firstOps := mload(_pc)
+                        // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits
+                        secondOps := shr(216, mload(add(_pc, 0x20)))
+                    }
+ 
+                    // Call identity precompile
+                    // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL
+                    // 32 - 8 bytes = 24 bytes = 192
+                    if ((firstOps >> 192) == 0x3350600060045af1) {
+                        _pc += 8;
+                    // Call EM and abort execution if instructed
+                    // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST 
+                    } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {
+                        _pc += 37;
+                    } else {
+                        return false;
+                    }
+                    continue;
+                } else {
+                    // encountered a non-whitelisted opcode!
+                    return false;
+                }
+            }
+            _pc++;
+        } while (_pc < codeLength);
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html b/coverage/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html new file mode 100644 index 000000000..35ac577fa --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html @@ -0,0 +1,2279 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/OVM_StateManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/execution/ OVM_StateManager.sol +

+
+
+ 79.69% + Statements + 51/64 +
+
+ 100% + Branches + 12/12 +
+
+ 80% + Functions + 28/35 +
+
+ 80% + Lines + 52/65 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +348× +  +  +  +  +  +  +  +  +  +  +  +  +  +1041× +  +  +  +1040× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +58× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +33× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +35× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +62× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +371× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +32× +32× +32× +32× +32× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +19× +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +543× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +66× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +73× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +38× +  +  +  +  +  +  +38× +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +62× +  +  +  + +  +  +  +55× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +77× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +74× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +33× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +616× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +107× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +707× +  +707× +282× +  +  +707× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+ 
+/**
+ * @title OVM_StateManager
+ * @dev The State Manager contract holds all storage values for contracts in the OVM. It can only be written to by the
+ * the Execution Manager and State Transitioner. It runs on L1 during the setup and execution of a fraud proof.
+ * The same logic runs on L2, but has been implemented as a precompile in the L2 go-ethereum client
+ * (see https://github.com/ethereum-optimism/go-ethereum/blob/master/core/vm/ovm_state_manager.go).
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateManager is iOVM_StateManager {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 constant internal EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
+    bytes32 constant internal EMPTY_ACCOUNT_CODE_HASH =    0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
+    bytes32 constant internal STORAGE_XOR_VALUE =          0xFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEF;
+ 
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    address override public owner;
+    address override public ovmExecutionManager;
+    mapping (address => Lib_OVMCodec.Account) internal accounts;
+    mapping (address => mapping (bytes32 => bytes32)) internal contractStorage;
+    mapping (address => mapping (bytes32 => bool)) internal verifiedContractStorage;
+    mapping (bytes32 => ItemState) internal itemStates;
+    uint256 internal totalUncommittedAccounts;
+    uint256 internal totalUncommittedContractStorage;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _owner Address of the owner of this contract.
+     */
+    constructor(
+        address _owner
+    )
+    {
+        owner = _owner;
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Simple authentication, this contract should only be accessible to the owner (which is expected to be the State Transitioner during `PRE_EXECUTION` 
+     * or the OVM_ExecutionManager during transaction execution.
+     */
+    modifier authenticated() {
+        // owner is the State Transitioner
+        require(
+            msg.sender == owner || msg.sender == ovmExecutionManager,
+            "Function can only be called by authenticated addresses"
+        );
+        _;
+    }
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Checks whether a given address is allowed to modify this contract.
+     * @param _address Address to check.
+     * @return Whether or not the address can modify this contract.
+     */
+    function isAuthenticated(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return (_address == owner || _address == ovmExecutionManager);
+    }
+ 
+    /**
+     * Sets the address of the OVM_ExecutionManager.
+     * @param _ovmExecutionManager Address of the OVM_ExecutionManager.
+     */
+    function setExecutionManager(
+        address _ovmExecutionManager
+    )
+        override
+        public
+        authenticated
+    {
+        ovmExecutionManager = _ovmExecutionManager;
+    }
+ 
+    /**
+     * Inserts an account into the state.
+     * @param _address Address of the account to insert.
+     * @param _account Account to insert for the given address.
+     */
+    function putAccount(
+        address _address,
+        Lib_OVMCodec.Account memory _account
+    )
+        override
+        public
+        authenticated
+    {
+        accounts[_address] = _account;
+    }
+ 
+    /**
+     * Marks an account as empty.
+     * @param _address Address of the account to mark.
+     */
+    function putEmptyAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
+        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
+    }
+ 
+    /**
+     * Retrieves an account from the state.
+     * @param _address Address of the account to retrieve.
+     * @return Account for the given address.
+     */
+    function getAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            Lib_OVMCodec.Account memory
+        )
+    {
+        return accounts[_address];
+    }
+ 
+    /**
+     * Checks whether the state has a given account.
+     * @param _address Address of the account to check.
+     * @return Whether or not the state has the account.
+     */
+    function hasAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return accounts[_address].codeHash != bytes32(0);
+    }
+ 
+    /**
+     * Checks whether the state has a given known empty account.
+     * @param _address Address of the account to check.
+     * @return Whether or not the state has the empty account.
+     */
+    function hasEmptyAccount(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return (
+            accounts[_address].codeHash == EMPTY_ACCOUNT_CODE_HASH
+            && accounts[_address].nonce == 0
+        );
+    }
+ 
+    /**
+     * Sets the nonce of an account.
+     * @param _address Address of the account to modify.
+     * @param _nonce New account nonce.
+     */
+    function setAccountNonce(
+        address _address,
+        uint256 _nonce
+    )
+        override
+        public
+        authenticated
+    {
+        accounts[_address].nonce = _nonce;
+    }
+ 
+    /**
+     * Gets the nonce of an account.
+     * @param _address Address of the account to access.
+     * @return Nonce of the account.
+     */
+    function getAccountNonce(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return accounts[_address].nonce;
+    }
+ 
+    /**
+     * Retrieves the Ethereum address of an account.
+     * @param _address Address of the account to access.
+     * @return Corresponding Ethereum address.
+     */
+    function getAccountEthAddress(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            address
+        )
+    {
+        return accounts[_address].ethAddress;
+    }
+ 
+    /**
+     * Retrieves the storage root of an account.
+     * @param _address Address of the account to access.
+     * @return Corresponding storage root.
+     */
+    function getAccountStorageRoot(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        return accounts[_address].storageRoot;
+    }
+ 
+    /**
+     * Initializes a pending account (during CREATE or CREATE2) with the default values.
+     * @param _address Address of the account to initialize.
+     */
+    function initPendingAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.nonce = 1;
+        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
+        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
+        account.isFresh = true;
+    }
+ 
+    /**
+     * Finalizes the creation of a pending account (during CREATE or CREATE2).
+     * @param _address Address of the account to finalize.
+     * @param _ethAddress Address of the account's associated contract on Ethereum.
+     * @param _codeHash Hash of the account's code.
+     */
+    function commitPendingAccount(
+        address _address,
+        address _ethAddress,
+        bytes32 _codeHash
+    )
+        override
+        public
+        authenticated
+    {
+        Lib_OVMCodec.Account storage account = accounts[_address];
+        account.ethAddress = _ethAddress;
+        account.codeHash = _codeHash;
+    }
+ 
+    /**
+     * Checks whether an account has already been retrieved, and marks it as retrieved if not.
+     * @param _address Address of the account to check.
+     * @return Whether or not the account was already loaded.
+     */
+    function testAndSetAccountLoaded(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_address),
+            ItemState.ITEM_LOADED
+        );
+    }
+ 
+    /**
+     * Checks whether an account has already been modified, and marks it as modified if not.
+     * @param _address Address of the account to check.
+     * @return Whether or not the account was already modified.
+     */
+    function testAndSetAccountChanged(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_address),
+            ItemState.ITEM_CHANGED
+        );
+    }
+ 
+    /**
+     * Attempts to mark an account as committed.
+     * @param _address Address of the account to commit.
+     * @return Whether or not the account was committed.
+     */
+    function commitAccount(
+        address _address
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        if (itemStates[item] != ItemState.ITEM_CHANGED) {
+            return false;
+        }
+ 
+        itemStates[item] = ItemState.ITEM_COMMITTED;
+        totalUncommittedAccounts -= 1;
+ 
+        return true;
+    }
+ 
+    /**
+     * Increments the total number of uncommitted accounts.
+     */
+    function incrementTotalUncommittedAccounts()
+        override
+        public
+        authenticated
+    {
+        totalUncommittedAccounts += 1;
+    }
+ 
+    /**
+     * Gets the total number of uncommitted accounts.
+     * @return Total uncommitted accounts.
+     */
+    function getTotalUncommittedAccounts()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return totalUncommittedAccounts;
+    }
+ 
+    /**
+     * Checks whether a given account was changed during execution.
+     * @param _address Address to check.
+     * @return Whether or not the account was changed.
+     */
+    function wasAccountChanged(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        return itemStates[item] >= ItemState.ITEM_CHANGED;
+    }
+ 
+    /**
+     * Checks whether a given account was committed after execution.
+     * @param _address Address to check.
+     * @return Whether or not the account was committed.
+     */
+    function wasAccountCommitted(
+        address _address
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_address);
+        return itemStates[item] >= ItemState.ITEM_COMMITTED;
+    }
+ 
+ 
+    /************************************
+     * Public Functions: Storage Access *
+     ************************************/
+ 
+    /**
+     * Changes a contract storage slot value.
+     * @param _contract Address of the contract to modify.
+     * @param _key 32 byte storage slot key.
+     * @param _value 32 byte storage slot value.
+     */
+    function putContractStorage(
+        address _contract,
+        bytes32 _key,
+        bytes32 _value
+    )
+        override
+        public
+        authenticated
+    {
+        // A hilarious optimization. `SSTORE`ing a value of `bytes32(0)` is common enough that it's
+        // worth populating this with a non-zero value in advance (during the fraud proof
+        // initialization phase) to cut the execution-time cost down to 5000 gas.
+        contractStorage[_contract][_key] = _value ^ STORAGE_XOR_VALUE;
+ 
+        // Only used when initially populating the contract storage. OVM_ExecutionManager will
+        // perform a `hasContractStorage` INVALID_STATE_ACCESS check before putting any contract
+        // storage because writing to zero when the actual value is nonzero causes a gas
+        // discrepancy. Could be moved into a new `putVerifiedContractStorage` function, or
+        // something along those lines.
+        if (verifiedContractStorage[_contract][_key] == false) {
+            verifiedContractStorage[_contract][_key] = true;
+        }
+    }
+ 
+    /**
+     * Retrieves a contract storage slot value.
+     * @param _contract Address of the contract to access.
+     * @param _key 32 byte storage slot key.
+     * @return 32 byte storage slot value.
+     */
+    function getContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bytes32
+        )
+    {
+        // Storage XOR system doesn't work for newly created contracts that haven't set this
+        // storage slot value yet.
+        if (
+            verifiedContractStorage[_contract][_key] == false
+            && accounts[_contract].isFresh
+        ) {
+            return bytes32(0);
+        }
+ 
+        // See `putContractStorage` for more information about the XOR here.
+        return contractStorage[_contract][_key] ^ STORAGE_XOR_VALUE;
+    }
+ 
+    /**
+     * Checks whether a contract storage slot exists in the state.
+     * @param _contract Address of the contract to access.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the key was set in the state.
+     */
+    function hasContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        return verifiedContractStorage[_contract][_key] || accounts[_contract].isFresh;
+    }
+ 
+    /**
+     * Checks whether a storage slot has already been retrieved, and marks it as retrieved if not.
+     * @param _contract Address of the contract to check.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the slot was already loaded.
+     */
+    function testAndSetContractStorageLoaded(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_contract, _key),
+            ItemState.ITEM_LOADED
+        );
+    }
+ 
+    /**
+     * Checks whether a storage slot has already been modified, and marks it as modified if not.
+     * @param _contract Address of the contract to check.
+     * @param _key 32 byte storage slot key.
+     * @return Whether or not the slot was already modified.
+     */
+    function testAndSetContractStorageChanged(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        return _testAndSetItemState(
+            _getItemHash(_contract, _key),
+            ItemState.ITEM_CHANGED
+        );
+    }
+ 
+    /**
+     * Attempts to mark a storage slot as committed.
+     * @param _contract Address of the account to commit.
+     * @param _key 32 byte slot key to commit.
+     * @return Whether or not the slot was committed.
+     */
+    function commitContractStorage(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        authenticated
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        if (itemStates[item] != ItemState.ITEM_CHANGED) {
+            return false;
+        }
+ 
+        itemStates[item] = ItemState.ITEM_COMMITTED;
+        totalUncommittedContractStorage -= 1;
+ 
+        return true;
+    }
+ 
+    /**
+     * Increments the total number of uncommitted storage slots.
+     */
+    function incrementTotalUncommittedContractStorage()
+        override
+        public
+        authenticated
+    {
+        totalUncommittedContractStorage += 1;
+    }
+ 
+    /**
+     * Gets the total number of uncommitted storage slots.
+     * @return Total uncommitted storage slots.
+     */
+    function getTotalUncommittedContractStorage()
+        override
+        public
+        view
+        returns (
+            uint256
+        )
+    {
+        return totalUncommittedContractStorage;
+    }
+ 
+    /**
+     * Checks whether a given storage slot was changed during execution.
+     * @param _contract Address to check.
+     * @param _key Key of the storage slot to check.
+     * @return Whether or not the storage slot was changed.
+     */
+    function wasContractStorageChanged(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        return itemStates[item] >= ItemState.ITEM_CHANGED;
+    }
+ 
+    /**
+     * Checks whether a given storage slot was committed after execution.
+     * @param _contract Address to check.
+     * @param _key Key of the storage slot to check.
+     * @return Whether or not the storage slot was committed.
+     */
+    function wasContractStorageCommitted(
+        address _contract,
+        bytes32 _key
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        bytes32 item = _getItemHash(_contract, _key);
+        return itemStates[item] >= ItemState.ITEM_COMMITTED;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Generates a unique hash for an address.
+     * @param _address Address to generate a hash for.
+     * @return Unique hash for the given address.
+     */
+    function _getItemHash(
+        address _address
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(abi.encodePacked(_address));
+    }
+ 
+    /**
+     * Generates a unique hash for an address/key pair.
+     * @param _contract Address to generate a hash for.
+     * @param _key Key to generate a hash for.
+     * @return Unique hash for the given pair.
+     */
+    function _getItemHash(
+        address _contract,
+        bytes32 _key
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(abi.encodePacked(
+            _contract,
+            _key
+        ));
+    }
+ 
+    /**
+     * Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets the
+     * item to the provided state if not.
+     * @param _item 32 byte item ID to check.
+     * @param _minItemState Minimum state that must be satisfied by the item.
+     * @return Whether or not the item was already in the state.
+     */
+    function _testAndSetItemState(
+        bytes32 _item,
+        ItemState _minItemState
+    )
+        internal
+        returns (
+            bool
+        )
+    {
+        bool wasItemState = itemStates[_item] >= _minItemState;
+ 
+        if (wasItemState == false) {
+            itemStates[_item] = _minItemState;
+        }
+ 
+        return wasItemState;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html b/coverage/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html new file mode 100644 index 000000000..24ddc0ae5 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html @@ -0,0 +1,188 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/execution/ OVM_StateManagerFactory.sol +

+
+
+ 0% + Statements + 0/1 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
+ 
+/* Contract Imports */
+import { OVM_StateManager } from "./OVM_StateManager.sol";
+ 
+/**
+ * @title OVM_StateManagerFactory
+ * @dev The State Manager Factory is called by a State Transitioner's init code, to create a new
+ * State Manager for use in the Fraud Verification process.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateManagerFactory is iOVM_StateManagerFactory {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Creates a new OVM_StateManager
+     * @param _owner Owner of the created contract.
+     * @return New OVM_StateManager instance.
+     */
+    function create(
+        address _owner
+    )
+        override
+        public
+        returns (
+            iOVM_StateManager
+        )
+    {
+        return new OVM_StateManager(_owner);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/execution/index.html b/coverage/optimistic-ethereum/OVM/execution/index.html new file mode 100644 index 000000000..f8e89be66 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/execution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/OVM/execution/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/execution/ +

+
+
+ 81.88% + Statements + 253/309 +
+
+ 72.34% + Branches + 68/94 +
+
+ 84.69% + Functions + 83/98 +
+
+ 82.39% + Lines + 262/318 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_ExecutionManager.sol
82.2%194/23668.29%56/8288.52%54/6182.64%200/242
OVM_SafetyChecker.sol
100%8/8100%0/0100%1/1100%10/10
OVM_StateManager.sol
79.69%51/64100%12/1280%28/3580%52/65
OVM_StateManagerFactory.sol
0%0/1100%0/00%0/10%0/1
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html new file mode 100644 index 000000000..510331797 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html @@ -0,0 +1,662 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ ERC1820Registry.sol +

+
+
+ 0% + Statements + 0/38 +
+
+ 0% + Branches + 0/22 +
+
+ 0% + Functions + 0/10 +
+
+ 0% + Lines + 0/39 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: CC0-1.0
+/* ERC1820 Pseudo-introspection Registry Contract
+ * This standard defines a universal registry smart contract where any address (contract or regular account) can
+ * register which interface it supports and which smart contract is responsible for its implementation.
+ *
+ * Written in 2019 by Jordi Baylina and Jacques Dafflon
+ *
+ * To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to
+ * this software to the public domain worldwide. This software is distributed without any warranty.
+ *
+ * You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
+ * <http://creativecommons.org/publicdomain/zero/1.0/>.
+ */
+pragma solidity >0.5.0 <0.8.0;
+ 
+/// @dev The interface a contract MUST implement if it is the implementer of
+/// some (other) interface for any address other than itself.
+interface ERC1820ImplementerInterface {
+    /// @notice Indicates whether the contract implements the interface 'interfaceHash' for the address 'addr' or not.
+    /// @param interfaceHash keccak256 hash of the name of the interface
+    /// @param addr Address for which the contract will implement the interface
+    /// @return ERC1820_ACCEPT_MAGIC only if the contract implements 'interfaceHash' for the address 'addr'.
+    function canImplementInterfaceForAddress(bytes32 interfaceHash, address addr) external view returns(bytes32);
+}
+ 
+/**
+ * @title ERC1820 Pseudo-introspection Registry Contract
+ * @author Jordi Baylina and Jacques Dafflon
+ * @dev This contract is the official implementation of the ERC1820 Registry 
+ * For more details, see https://eips.ethereum.org/EIPS/eip-1820
+ *
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract ERC1820Registry {
+    bytes4 constant internal INVALID_ID = 0xffffffff;
+    bytes4 constant internal ERC165ID = 0x01ffc9a7;
+    bytes32 constant internal ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
+ 
+    mapping(address => mapping(bytes32 => address)) internal interfaces;
+    mapping(address => address) internal managers;
+    mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
+ 
+    /// @notice Indicates a contract is the 'implementer' of 'interfaceHash' for 'addr'.
+    event InterfaceImplementerSet(address indexed addr, bytes32 indexed interfaceHash, address indexed implementer);
+    /// @notice Indicates 'newManager' is the address of the new manager for 'addr'.
+    event ManagerChanged(address indexed addr, address indexed newManager);
+ 
+    /// @notice Query if an address implements an interface and through which contract.
+    /// @param _addr Address being queried for the implementer of an interface.
+    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
+    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
+    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
+    /// @return The address of the contract which implements the interface '_interfaceHash' for '_addr'
+    /// or '0' if '_addr' did not register an implementer for this interface.
+    function getInterfaceImplementer(address _addr, bytes32 _interfaceHash) external view returns (address) {
+        address addr = _addr == address(0) ? msg.sender : _addr;
+        if (isERC165Interface(_interfaceHash)) {
+            bytes4 erc165InterfaceHash = bytes4(_interfaceHash);
+            return implementsERC165Interface(addr, erc165InterfaceHash) ? addr : address(0);
+        }
+        return interfaces[addr][_interfaceHash];
+    }
+ 
+    /// @notice Sets the contract which implements a specific interface for an address.
+    /// Only the manager defined for that address can set it.
+    /// (Each address is the manager for itself until it sets a new manager.)
+    /// @param _addr Address for which to set the interface.
+    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
+    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
+    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
+    /// @param _implementer Contract address implementing '_interfaceHash' for '_addr'.
+    function setInterfaceImplementer(address _addr, bytes32 _interfaceHash, address _implementer) external {
+        address addr = _addr == address(0) ? msg.sender : _addr;
+        require(getManager(addr) == msg.sender, "Not the manager");
+ 
+        require(!isERC165Interface(_interfaceHash), "Must not be an ERC165 hash");
+        if (_implementer != address(0) && _implementer != msg.sender) {
+            require(
+                ERC1820ImplementerInterface(_implementer)
+                    .canImplementInterfaceForAddress(_interfaceHash, addr) == ERC1820_ACCEPT_MAGIC,
+                "Does not implement the interface"
+            );
+        }
+        interfaces[addr][_interfaceHash] = _implementer;
+        emit InterfaceImplementerSet(addr, _interfaceHash, _implementer);
+    }
+ 
+    /// @notice Sets '_newManager' as manager for '_addr'.
+    /// The new manager will be able to call 'setInterfaceImplementer' for '_addr'.
+    /// @param _addr Address for which to set the new manager.
+    /// @param _newManager Address of the new manager for 'addr'. (Pass '0x0' to reset the manager to '_addr'.)
+    function setManager(address _addr, address _newManager) external {
+        require(getManager(_addr) == msg.sender, "Not the manager");
+        managers[_addr] = _newManager == _addr ? address(0) : _newManager;
+        emit ManagerChanged(_addr, _newManager);
+    }
+ 
+    /// @notice Get the manager of an address.
+    /// @param _addr Address for which to return the manager.
+    /// @return Address of the manager for a given address.
+    function getManager(address _addr) public view returns(address) {
+        // By default the manager of an address is the same address
+        if (managers[_addr] == address(0)) {
+            return _addr;
+        } else {
+            return managers[_addr];
+        }
+    }
+ 
+    /// @notice Compute the keccak256 hash of an interface given its name.
+    /// @param _interfaceName Name of the interface.
+    /// @return The keccak256 hash of an interface name.
+    function interfaceHash(string calldata _interfaceName) external pure returns(bytes32) {
+        return keccak256(abi.encodePacked(_interfaceName));
+    }
+ 
+    /* --- ERC165 Related Functions --- */
+    /* --- Developed in collaboration with William Entriken. --- */
+ 
+    /// @notice Updates the cache with whether the contract implements an ERC165 interface or not.
+    /// @param _contract Address of the contract for which to update the cache.
+    /// @param _interfaceId ERC165 interface for which to update the cache.
+    function updateERC165Cache(address _contract, bytes4 _interfaceId) external {
+        interfaces[_contract][_interfaceId] = implementsERC165InterfaceNoCache(
+            _contract, _interfaceId) ? _contract : address(0);
+        erc165Cached[_contract][_interfaceId] = true;
+    }
+ 
+    /// @notice Checks whether a contract implements an ERC165 interface or not.
+    //  If the result is not cached a direct lookup on the contract address is performed.
+    //  If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
+    //  'updateERC165Cache' with the contract address.
+    /// @param _contract Address of the contract to check.
+    /// @param _interfaceId ERC165 interface to check.
+    /// @return True if '_contract' implements '_interfaceId', false otherwise.
+    function implementsERC165Interface(address _contract, bytes4 _interfaceId) public view returns (bool) {
+        if (!erc165Cached[_contract][_interfaceId]) {
+            return implementsERC165InterfaceNoCache(_contract, _interfaceId);
+        }
+        return interfaces[_contract][_interfaceId] == _contract;
+    }
+ 
+    /// @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
+    /// @param _contract Address of the contract to check.
+    /// @param _interfaceId ERC165 interface to check.
+    /// @return True if '_contract' implements '_interfaceId', false otherwise.
+    function implementsERC165InterfaceNoCache(address _contract, bytes4 _interfaceId) public view returns (bool) {
+        uint256 success;
+        uint256 result;
+ 
+        (success, result) = noThrowCall(_contract, ERC165ID);
+        if (success == 0 || result == 0) {
+            return false;
+        }
+ 
+        (success, result) = noThrowCall(_contract, INVALID_ID);
+        if (success == 0 || result != 0) {
+            return false;
+        }
+ 
+        (success, result) = noThrowCall(_contract, _interfaceId);
+        if (success == 1 && result == 1) {
+            return true;
+        }
+        return false;
+    }
+ 
+    /// @notice Checks whether the hash is a ERC165 interface (ending with 28 zeroes) or not.
+    /// @param _interfaceHash The hash to check.
+    /// @return True if '_interfaceHash' is an ERC165 interface (ending with 28 zeroes), false otherwise.
+    function isERC165Interface(bytes32 _interfaceHash) internal pure returns (bool) {
+        return _interfaceHash & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0;
+    }
+ 
+    /// @dev Make a call on a contract without throwing if the function does not exist.
+    function noThrowCall(address _contract, bytes4 _interfaceId)
+        internal view returns (uint256 success, uint256 result)
+    {
+        bytes4 erc165ID = ERC165ID;
+ 
+        assembly {
+            let x := mload(0x40)               // Find empty storage location using "free memory pointer"
+            mstore(x, erc165ID)                // Place signature at beginning of empty storage
+            mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
+ 
+            success := staticcall(
+                30000,                         // 30k gas
+                _contract,                     // To addr
+                x,                             // Inputs are stored at location x
+                0x24,                          // Inputs are 36 (4 + 32) bytes long
+                x,                             // Store output over input (saves space)
+                0x20                           // Outputs are 32 bytes long
+            )
+ 
+            result := mload(x)                 // Load the result
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html new file mode 100644 index 000000000..bf503a6c9 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html @@ -0,0 +1,701 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_DeployerWhitelist.sol +

+
+
+ 36.36% + Statements + 8/22 +
+
+ 66.67% + Branches + 4/6 +
+
+ 12.5% + Functions + 1/8 +
+
+ 34.78% + Lines + 8/23 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +29× +  +  +  +29× +25× +  +  + +  +  +  + + +  +  + +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+ 
+/* Interface Imports */
+import { iOVM_DeployerWhitelist } from "../../iOVM/predeploys/iOVM_DeployerWhitelist.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_DeployerWhitelist
+ * @dev The Deployer Whitelist is a temporary predeploy used to provide additional safety during the
+ * initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts
+ * which are allowed to deploy contracts on Layer2. The Execution Manager will only allow an 
+ * ovmCREATE or ovmCREATE2 operation to proceed if the deployer's address whitelisted.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_DeployerWhitelist is iOVM_DeployerWhitelist {
+ 
+    /**********************
+     * Contract Constants *
+     **********************/
+ 
+    bytes32 internal constant KEY_INITIALIZED =                0x0000000000000000000000000000000000000000000000000000000000000010;
+    bytes32 internal constant KEY_OWNER =                      0x0000000000000000000000000000000000000000000000000000000000000011;
+    bytes32 internal constant KEY_ALLOW_ARBITRARY_DEPLOYMENT = 0x0000000000000000000000000000000000000000000000000000000000000012;
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+    
+    /**
+     * Blocks functions to anyone except the contract owner.
+     */
+    modifier onlyOwner() {
+        address owner = Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                KEY_OWNER
+            )
+        );
+ 
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            Lib_SafeExecutionManagerWrapper.safeCALLER() == owner,
+            "Function can only be called by the owner of this contract."
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+    
+    /**
+     * Initializes the whitelist.
+     * @param _owner Address of the owner for this contract.
+     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
+     */
+    function initialize(
+        address _owner,
+        bool _allowArbitraryDeployment
+    )
+        override
+        public
+    {
+        bool initialized = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
+        );
+ 
+        if (initialized == true) {
+            return;
+        }
+ 
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_INITIALIZED,
+            Lib_Bytes32Utils.fromBool(true)
+        );
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_OWNER,
+            Lib_Bytes32Utils.fromAddress(_owner)
+        );
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
+            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
+        );
+    }
+ 
+    /**
+     * Gets the owner of the whitelist.
+     */
+    function getOwner()
+        override
+        public
+        returns(
+            address
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                KEY_OWNER
+            )
+        );
+    }
+ 
+    /**
+     * Adds or removes an address from the deployment whitelist.
+     * @param _deployer Address to update permissions for.
+     * @param _isWhitelisted Whether or not the address is whitelisted.
+     */
+    function setWhitelistedDeployer(
+        address _deployer,
+        bool _isWhitelisted
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            Lib_Bytes32Utils.fromAddress(_deployer),
+            Lib_Bytes32Utils.fromBool(_isWhitelisted)
+        );
+    }
+ 
+    /**
+     * Updates the owner of this contract.
+     * @param _owner Address of the new owner.
+     */
+    function setOwner(
+        address _owner
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_OWNER,
+            Lib_Bytes32Utils.fromAddress(_owner)
+        );
+    }
+ 
+    /**
+     * Updates the arbitrary deployment flag.
+     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
+     */
+    function setAllowArbitraryDeployment(
+        bool _allowArbitraryDeployment
+    )
+        override
+        public
+        onlyOwner
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
+            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
+        );
+    }
+ 
+    /**
+     * Permanently enables arbitrary contract deployment and deletes the owner.
+     */
+    function enableArbitraryContractDeployment()
+        override
+        public
+        onlyOwner
+    {
+        setAllowArbitraryDeployment(true);
+        setOwner(address(0));
+    }
+ 
+    /**
+     * Checks whether an address is allowed to deploy contracts.
+     * @param _deployer Address to check.
+     * @return _allowed Whether or not the address can deploy contracts.
+     */
+    function isDeployerAllowed(
+        address _deployer
+    )
+        override
+        public
+        returns (
+            bool _allowed
+        )
+    {
+        bool initialized = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
+        );
+ 
+        if (initialized == false) {
+            return true;
+        }
+ 
+        bool allowArbitraryDeployment = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_ALLOW_ARBITRARY_DEPLOYMENT)
+        );
+ 
+        if (allowArbitraryDeployment == true) {
+            return true;
+        }
+ 
+        bool isWhitelisted = Lib_Bytes32Utils.toBool(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                Lib_Bytes32Utils.fromAddress(_deployer)
+            )
+        );
+ 
+        return isWhitelisted;        
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html new file mode 100644 index 000000000..2aaa2721b --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html @@ -0,0 +1,167 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_ETH.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_ETH.sol +

+
+
+ 0% + Statements + 0/1 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_L1TokenGateway } from "../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
+ 
+/* Contract Imports */
+import { OVM_L2DepositedERC20 } from "../bridge/tokens/OVM_L2DepositedERC20.sol";
+ 
+/**
+ * @title OVM_ETH
+ * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that 
+ * unlike on Layer 1, Layer 2 accounts do not have a balance field.
+ * 
+ * Compiler used: optimistic-solc
+ * Runtime target: OVM
+ */
+contract OVM_ETH is OVM_L2DepositedERC20 {
+    constructor(
+        address _l2CrossDomainMessenger,
+        address _l1ETHGateway
+    ) 
+        OVM_L2DepositedERC20(
+            _l2CrossDomainMessenger,
+            "Ether",
+            "ETH"
+        )
+    {
+        init(iOVM_L1TokenGateway(_l1ETHGateway));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html new file mode 100644 index 000000000..cb471696f --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html @@ -0,0 +1,194 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_L1MessageSender.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_L1MessageSender } from "../../iOVM/predeploys/iOVM_L1MessageSender.sol";
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+ 
+/**
+ * @title OVM_L1MessageSender
+ * @dev The L1MessageSender is a predeploy contract running on L2. During the execution of cross 
+ * domain transaction from L1 to L2, it returns the address of the L1 account (either an EOA or
+ * contract) which sent the message to L2 via the Canonical Transaction Chain's `enqueue()` 
+ * function.
+ * 
+ * This contract exclusively serves as a getter for the ovmL1TXORIGIN operation. This is necessary 
+ * because there is no corresponding operation in the EVM which the the optimistic solidity compiler 
+ * can be replaced with a call to the ExecutionManager's ovmL1TXORIGIN() function.
+ *
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_L1MessageSender is iOVM_L1MessageSender {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * @return _l1MessageSender L1 message sender address (msg.sender).
+     */
+    function getL1MessageSender()
+        override
+        public
+        view
+        returns (
+            address _l1MessageSender
+        )
+    {
+        // Note that on L2 msg.sender (ie. evmCALLER) will always be the Execution Manager 
+        return iOVM_ExecutionManager(msg.sender).ovmL1TXORIGIN();
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html new file mode 100644 index 000000000..0795787c0 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html @@ -0,0 +1,215 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_L2ToL1MessagePasser.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_L2ToL1MessagePasser } from "../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
+ 
+/**
+ * @title OVM_L2ToL1MessagePasser
+ * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the 
+ * of a message on L2. The L1 Cross Domain Messenger performs this proof in its
+ * _verifyStorageProof function, which verifies the existence of the transaction hash in this 
+ * contract's `sentMessages` mapping.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    mapping (bytes32 => bool) public sentMessages;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Passes a message to L1.
+     * @param _message Message to pass to L1.
+     */
+    function passMessageToL1(
+        bytes memory _message
+    )
+        override
+        public
+    {
+        // Note: although this function is public, only messages sent from the OVM_L2CrossDomainMessenger 
+        // will be relayed by the OVM_L1CrossDomainMessenger. This is enforced by a check in 
+        // OVM_L1CrossDomainMessenger._verifyStorageProof().
+        sentMessages[keccak256(
+            abi.encodePacked(
+                _message,
+                msg.sender
+            )
+        )] = true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html new file mode 100644 index 000000000..e738ae32f --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html @@ -0,0 +1,413 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_ProxySequencerEntrypoint.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 7/7 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_ProxySequencerEntrypoint 
+ * @dev The Proxy Sequencer Entrypoint is a predeployed proxy to the implementation of the 
+ * Sequencer Entrypoint. This will enable the Optimism team to upgrade the Sequencer Entrypoint 
+ * contract.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_ProxySequencerEntrypoint {
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
+            gasleft(),
+            _getImplementation(),
+            msg.data
+        );
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function init(
+        address _implementation,
+        address _owner
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            _getOwner() == address(0),
+            "ProxySequencerEntrypoint has already been inited"
+        );
+        _setOwner(_owner);
+        _setImplementation(_implementation);
+    }
+ 
+    function upgrade(
+        address _implementation
+    )
+        external
+    {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            _getOwner() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
+            "Only owner can upgrade the Entrypoint"
+        );
+ 
+        _setImplementation(_implementation);
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _setImplementation(
+        address _implementation
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            bytes32(uint256(0)),
+            bytes32(uint256(uint160(_implementation)))
+        );
+    }
+ 
+    function _getImplementation()
+        internal
+        returns (
+            address _implementation
+        )
+    {
+        return address(uint160(uint256(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                bytes32(uint256(0))
+            )
+        )));
+    }
+ 
+    function _setOwner(
+        address _owner
+    )
+        internal
+    {
+        Lib_SafeExecutionManagerWrapper.safeSSTORE(
+            bytes32(uint256(1)),
+            bytes32(uint256(uint160(_owner)))
+        );
+    }
+ 
+    function _getOwner()
+        internal
+        returns (
+            address _owner
+        )
+    {
+        return address(uint160(uint256(
+            Lib_SafeExecutionManagerWrapper.safeSLOAD(
+                bytes32(uint256(1))
+            )
+        )));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html new file mode 100644 index 000000000..3d96f0a5e --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html @@ -0,0 +1,446 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/predeploys/ OVM_SequencerEntrypoint.sol +

+
+
+ 100% + Statements + 18/18 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 17/17 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + + +  +  + + +  +  + +  +  +  +  + +  +  +  +  +  +  +  + +  + + +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title OVM_SequencerEntrypoint
+ * @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by 
+ * any account. It accepts a more efficient compressed calldata format, which it decompresses and 
+ * encodes to the standard EIP155 transaction format.
+ * This contract is the implementation referenced by the Proxy Sequencer Entrypoint, thus enabling
+ * the Optimism team to upgrade the decompression of calldata from the Sequencer.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+contract OVM_SequencerEntrypoint {
+ 
+    /*********
+     * Enums *
+     *********/
+    
+    enum TransactionType {
+        NATIVE_ETH_TRANSACTION,
+        ETH_SIGNED_MESSAGE
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    /**
+     * Uses a custom "compressed" format to save on calldata gas:
+     * calldata[00:01]: transaction type (0 == EIP 155, 2 == Eth Sign Message)
+     * calldata[01:33]: signature "r" parameter
+     * calldata[33:65]: signature "s" parameter
+     * calldata[65:66]: signature "v" parameter
+     * calldata[66:69]: transaction gas limit
+     * calldata[69:72]: transaction gas price
+     * calldata[72:75]: transaction nonce
+     * calldata[75:95]: transaction target address
+     * calldata[95:XX]: transaction data
+     */
+    fallback()
+        external
+    {
+        TransactionType transactionType = _getTransactionType(Lib_BytesUtils.toUint8(msg.data, 0));
+ 
+        bytes32 r = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 1, 32));
+        bytes32 s = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 33, 32));
+        uint8 v = Lib_BytesUtils.toUint8(msg.data, 65);
+ 
+        // Remainder is the transaction to execute.
+        bytes memory compressedTx = Lib_BytesUtils.slice(msg.data, 66);
+        bool isEthSignedMessage = transactionType == TransactionType.ETH_SIGNED_MESSAGE;
+ 
+        // Need to decompress and then re-encode the transaction based on the original encoding.
+        bytes memory encodedTx = Lib_OVMCodec.encodeEIP155Transaction(
+            Lib_OVMCodec.decompressEIP155Transaction(compressedTx),
+            isEthSignedMessage
+        );
+ 
+        address target = Lib_ECDSAUtils.recover(
+            encodedTx,
+            isEthSignedMessage,
+            uint8(v),
+            r,
+            s
+        );
+ 
+        if (Lib_SafeExecutionManagerWrapper.safeEXTCODESIZE(target) == 0) {
+            // ProxyEOA has not yet been deployed for this EOA.
+            bytes32 messageHash = Lib_ECDSAUtils.getMessageHash(encodedTx, isEthSignedMessage);
+            Lib_SafeExecutionManagerWrapper.safeCREATEEOA(messageHash, uint8(v), r, s);
+        }
+ 
+        // ProxyEOA has been deployed for this EOA, continue to CALL.
+        bytes memory callbytes = abi.encodeWithSignature(
+            "execute(bytes,uint8,uint8,bytes32,bytes32)",
+            encodedTx,
+            isEthSignedMessage,
+            uint8(v),
+            r,
+            s
+        );
+ 
+        Lib_SafeExecutionManagerWrapper.safeCALL(
+            gasleft(),
+            target,
+            callbytes
+        );
+    }
+    
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Converts a uint256 into a TransactionType enum.
+     * @param _transactionType Transaction type index.
+     * @return _txType Transaction type enum value.
+     */
+    function _getTransactionType(
+        uint8 _transactionType
+    )
+        internal
+        returns (
+            TransactionType _txType
+        )
+    {
+        if (_transactionType == 0) {
+            return TransactionType.NATIVE_ETH_TRANSACTION;
+        } if (_transactionType == 2) {
+            return TransactionType.ETH_SIGNED_MESSAGE;
+        } else {
+            Lib_SafeExecutionManagerWrapper.safeREVERT(
+                "Transaction type must be 0 or 2"
+            );
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/predeploys/index.html b/coverage/optimistic-ethereum/OVM/predeploys/index.html new file mode 100644 index 000000000..82416007a --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/predeploys/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for optimistic-ethereum/OVM/predeploys/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/predeploys/ +

+
+
+ 41.76% + Statements + 38/91 +
+
+ 29.41% + Branches + 10/34 +
+
+ 40% + Functions + 12/30 +
+
+ 40.22% + Lines + 37/92 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ERC1820Registry.sol
0%0/380%0/220%0/100%0/39
OVM_DeployerWhitelist.sol
36.36%8/2266.67%4/612.5%1/834.78%8/23
OVM_ETH.sol
0%0/1100%0/00%0/10%0/1
OVM_L1MessageSender.sol
100%1/1100%0/0100%1/1100%1/1
OVM_L2ToL1MessagePasser.sol
100%1/1100%0/0100%1/1100%1/1
OVM_ProxySequencerEntrypoint.sol
100%10/10100%0/0100%7/7100%10/10
OVM_SequencerEntrypoint.sol
100%18/18100%6/6100%2/2100%17/17
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html b/coverage/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html new file mode 100644 index 000000000..23684e3af --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ Abs_FraudContributor.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +14× +14× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/// Minimal contract to be inherited by contracts consumed by users that provide
+/// data for fraud proofs
+abstract contract Abs_FraudContributor is Lib_AddressResolver {
+    /// Decorate your functions with this modifier to store how much total gas was
+    /// consumed by the sender, to reward users fairly
+    modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
+        uint256 startGas = gasleft();
+        _;
+        uint256 gasSpent = startGas - gasleft();
+        iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html b/coverage/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html new file mode 100644 index 000000000..1de4a2fa1 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html @@ -0,0 +1,689 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/OVM_BondManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ OVM_BondManager.sol +

+
+
+ 100% + Statements + 42/42 +
+
+ 86.67% + Branches + 26/30 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 41/41 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +63× +  +  +  +  +  +  +  +  +  +  +46× +46× +  +45× +45× +  +  +  +  +  +13× +12× +  +  +  +11× +  +11× +11× + + + +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +11× +  +  +  +  + +  +  +  +10× +  +  +  +  +  +18× +  +  +  +  +  +18× +  +  +  +  + + + +  + + +  +  +  +  + +  + +  +  +  + +  +  + + +  + +  +  +  +  +  +  +  +  + + +  +  +  +  +  + + +  +  + +  +  +  + +  +  + +  +  + +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_BondManager, Errors, ERC20 } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+ 
+/**
+ * @title OVM_BondManager
+ * @dev The Bond Manager contract handles deposits in the form of an ERC20 token from bonded 
+ * Proposers. It also handles the accounting of gas costs spent by a Verifier during the course of a
+ * fraud proof. In the event of a successful fraud proof, the fraudulent Proposer's bond is slashed, 
+ * and the Verifier's gas costs are refunded.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
+ 
+    /****************************
+     * Constants and Parameters *
+     ****************************/
+ 
+    /// The period to find the earliest fraud proof for a publisher
+    uint256 public constant multiFraudProofPeriod = 7 days;
+ 
+    /// The dispute period
+    uint256 public constant disputePeriodSeconds = 7 days;
+ 
+    /// The minimum collateral a sequencer must post
+    uint256 public constant requiredCollateral = 1 ether;
+ 
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    /// The bond token
+    ERC20 immutable public token;
+ 
+ 
+    /********************************************
+     * Contract Variables: Internal Accounting  *
+     *******************************************/
+ 
+    /// The bonds posted by each proposer
+    mapping(address => Bond) public bonds;
+ 
+    /// For each pre-state root, there's an array of witnessProviders that must be rewarded
+    /// for posting witnesses
+    mapping(bytes32 => Rewards) public witnessProviders;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /// Initializes with a ERC20 token to be used for the fidelity bonds
+    /// and with the Address Manager
+    constructor(
+        ERC20 _token,
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        token = _token;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /// Adds `who` to the list of witnessProviders for the provided `preStateRoot`.
+    function recordGasSpent(bytes32 _preStateRoot, bytes32 _txHash, address who, uint256 gasSpent) override public {
+        // The sender must be the transitioner that corresponds to the claimed pre-state root
+        address transitioner = address(iOVM_FraudVerifier(resolve("OVM_FraudVerifier")).getStateTransitioner(_preStateRoot, _txHash));
+        require(transitioner == msg.sender, Errors.ONLY_TRANSITIONER);
+ 
+        witnessProviders[_preStateRoot].total += gasSpent;
+        witnessProviders[_preStateRoot].gasSpent[who] += gasSpent;
+    }
+ 
+    /// Slashes + distributes rewards or frees up the sequencer's bond, only called by
+    /// `FraudVerifier.finalizeFraudVerification`
+    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) override public {
+        require(msg.sender == resolve("OVM_FraudVerifier"), Errors.ONLY_FRAUD_VERIFIER);
+        require(witnessProviders[_preStateRoot].canClaim == false, Errors.ALREADY_FINALIZED);
+ 
+        // allow users to claim from that state root's
+        // pool of collateral (effectively slashing the sequencer)
+        witnessProviders[_preStateRoot].canClaim = true;
+ 
+        Bond storage bond = bonds[publisher];
+        if (bond.firstDisputeAt == 0) {
+            bond.firstDisputeAt = block.timestamp;
+            bond.earliestDisputedStateRoot = _preStateRoot;
+            bond.earliestTimestamp = timestamp;
+        } else if (
+            // only update the disputed state root for the publisher if it's within
+            // the dispute period _and_ if it's before the previous one
+            block.timestamp < bond.firstDisputeAt + multiFraudProofPeriod &&
+            timestamp < bond.earliestTimestamp
+        ) {
+            bond.earliestDisputedStateRoot = _preStateRoot;
+            bond.earliestTimestamp = timestamp;
+        }
+ 
+        // if the fraud proof's dispute period does not intersect with the 
+        // withdrawal's timestamp, then the user should not be slashed
+        // e.g if a user at day 10 submits a withdrawal, and a fraud proof
+        // from day 1 gets published, the user won't be slashed since day 8 (1d + 7d)
+        // is before the user started their withdrawal. on the contrary, if the user
+        // had started their withdrawal at, say, day 6, they would be slashed
+        if (
+            bond.withdrawalTimestamp != 0 && 
+            uint256(bond.withdrawalTimestamp) > timestamp + disputePeriodSeconds &&
+            bond.state == State.WITHDRAWING
+        ) {
+            return;
+        }
+ 
+        // slash!
+        bond.state = State.NOT_COLLATERALIZED;
+    }
+ 
+    /// Sequencers call this function to post collateral which will be used for
+    /// the `appendBatch` call
+    function deposit() override public {
+        Erequire(
+            token.transferFrom(msg.sender, address(this), requiredCollateral),
+            Errors.ERC20_ERR
+        );
+ 
+        // This cannot overflow
+        bonds[msg.sender].state = State.COLLATERALIZED;
+    }
+ 
+    /// Starts the withdrawal for a publisher
+    function startWithdrawal() override public {
+        Bond storage bond = bonds[msg.sender];
+        Erequire(bond.withdrawalTimestamp == 0, Errors.WITHDRAWAL_PENDING);
+        require(bond.state == State.COLLATERALIZED, Errors.WRONG_STATE);
+ 
+        bond.state = State.WITHDRAWING;
+        bond.withdrawalTimestamp = uint32(block.timestamp);
+    }
+ 
+    /// Finalizes a pending withdrawal from a publisher
+    function finalizeWithdrawal() override public {
+        Bond storage bond = bonds[msg.sender];
+ 
+        require(
+            block.timestamp >= uint256(bond.withdrawalTimestamp) + disputePeriodSeconds, 
+            Errors.TOO_EARLY
+        );
+        require(bond.state == State.WITHDRAWING, Errors.SLASHED);
+        
+        // refunds!
+        bond.state = State.NOT_COLLATERALIZED;
+        bond.withdrawalTimestamp = 0;
+        
+        Erequire(
+            token.transfer(msg.sender, requiredCollateral),
+            Errors.ERC20_ERR
+        );
+    }
+ 
+    /// Claims the user's reward for the witnesses they provided for the earliest
+    /// disputed state root of the designated publisher
+    function claim(address who) override public {
+        Bond storage bond = bonds[who];
+        require(
+            block.timestamp >= bond.firstDisputeAt + multiFraudProofPeriod,
+            Errors.WAIT_FOR_DISPUTES
+        );
+ 
+        // reward the earliest state root for this publisher
+        bytes32 _preStateRoot = bond.earliestDisputedStateRoot;
+        Rewards storage rewards = witnessProviders[_preStateRoot];
+ 
+        // only allow claiming if fraud was proven in `finalize`
+        require(rewards.canClaim, Errors.CANNOT_CLAIM);
+ 
+        // proportional allocation - only reward 50% (rest gets locked in the
+        // contract forever
+        uint256 amount = (requiredCollateral * rewards.gasSpent[msg.sender]) / (2 * rewards.total);
+ 
+        // reset the user's spent gas so they cannot double claim
+        rewards.gasSpent[msg.sender] = 0;
+ 
+        // transfer
+        Erequire(token.transfer(msg.sender, amount), Errors.ERC20_ERR);
+    }
+ 
+    /// Checks if the user is collateralized
+    function isCollateralized(address who) override public view returns (bool) {
+        return bonds[who].state == State.COLLATERALIZED;
+    }
+ 
+    /// Gets how many witnesses the user has provided for the state root
+    function getGasSpent(bytes32 preStateRoot, address who) override public view returns (uint256) {
+        return witnessProviders[preStateRoot].gasSpent[who];
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html b/coverage/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html new file mode 100644 index 000000000..d513958f4 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html @@ -0,0 +1,953 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ OVM_FraudVerifier.sol +

+
+
+ 96.43% + Statements + 27/28 +
+
+ 94.44% + Branches + 17/18 +
+
+ 100% + Functions + 7/7 +
+
+ 96.43% + Lines + 27/28 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +12× +  +  +  +12× +12× +  +12× +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +10× +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  +  + +  +  + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
+import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
+ 
+/* Contract Imports */
+import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
+ 
+ 
+ 
+/**
+ * @title OVM_FraudVerifier
+ * @dev The Fraud Verifier contract coordinates the entire fraud proof verification process. 
+ * If the fraud proof was successful it prunes any state batches from State Commitment Chain
+ * which were published after the fraudulent state root.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_FraudVerifier is Lib_AddressResolver, Abs_FraudContributor, iOVM_FraudVerifier {
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    mapping (bytes32 => iOVM_StateTransitioner) internal transitioners;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     */
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+ 
+    /***************************************
+     * Public Functions: Transition Status *
+     ***************************************/
+ 
+    /**
+     * Retrieves the state transitioner for a given root.
+     * @param _preStateRoot State root to query a transitioner for.
+     * @return _transitioner Corresponding state transitioner contract.
+     */
+    function getStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        override
+        public
+        view
+        returns (
+            iOVM_StateTransitioner _transitioner
+        )
+    {
+        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
+    }
+ 
+ 
+    /****************************************
+     * Public Functions: Fraud Verification *
+     ****************************************/
+ 
+    /**
+     * Begins the fraud verification process.
+     * @param _preStateRoot State root before the fraudulent transaction.
+     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
+     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
+     * @param _transaction OVM transaction claimed to be fraudulent.
+     * @param _txChainElement OVM transaction chain element.
+     * @param _transactionBatchHeader Batch header for the provided transaction.
+     * @param _transactionProof Inclusion proof for the provided transaction.
+     */
+    function initializeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _transactionBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _transactionProof
+    )
+        override
+        public
+        contributesToFraudProof(_preStateRoot, Lib_OVMCodec.hashTransaction(_transaction))
+    {
+        bytes32 _txHash = Lib_OVMCodec.hashTransaction(_transaction);
+ 
+        Iif (_hasStateTransitioner(_preStateRoot, _txHash)) {
+            return;
+        }
+ 
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+        iOVM_CanonicalTransactionChain ovmCanonicalTransactionChain = iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain"));
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _preStateRoot,
+                _preStateRootBatchHeader,
+                _preStateRootProof
+            ),
+            "Invalid pre-state root inclusion proof."
+        );
+ 
+        require(
+            ovmCanonicalTransactionChain.verifyTransaction(
+                _transaction,
+                _txChainElement,
+                _transactionBatchHeader,
+                _transactionProof
+            ),
+            "Invalid transaction inclusion proof."
+        );
+ 
+        require (
+            _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1 == _transactionBatchHeader.prevTotalElements + _transactionProof.index,
+            "Pre-state root global index must equal to the transaction root global index."
+        );
+ 
+        _deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index);
+ 
+        emit FraudProofInitialized(
+            _preStateRoot,
+            _preStateRootProof.index,
+            _txHash,
+            msg.sender
+        );
+    }
+ 
+    /**
+     * Finalizes the fraud verification process.
+     * @param _preStateRoot State root before the fraudulent transaction.
+     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
+     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
+     * @param _txHash The transaction for the state root
+     * @param _postStateRoot State root after the fraudulent transaction.
+     * @param _postStateRootBatchHeader Batch header for the provided post-state root.
+     * @param _postStateRootProof Inclusion proof for the provided post-state root.
+     */
+    function finalizeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
+        bytes32 _txHash,
+        bytes32 _postStateRoot,
+        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _postStateRootProof
+    )
+        override
+        public
+        contributesToFraudProof(_preStateRoot, _txHash)
+    {
+        iOVM_StateTransitioner transitioner = getStateTransitioner(_preStateRoot, _txHash);
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+ 
+        require(
+            transitioner.isComplete() == true,
+            "State transition process must be completed prior to finalization."
+        );
+ 
+        require (
+            _postStateRootBatchHeader.prevTotalElements + _postStateRootProof.index == _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1,
+            "Post-state root global index must equal to the pre state root global index plus one."
+        );
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _preStateRoot,
+                _preStateRootBatchHeader,
+                _preStateRootProof
+            ),
+            "Invalid pre-state root inclusion proof."
+        );
+ 
+        require(
+            ovmStateCommitmentChain.verifyStateCommitment(
+                _postStateRoot,
+                _postStateRootBatchHeader,
+                _postStateRootProof
+            ),
+            "Invalid post-state root inclusion proof."
+        );
+ 
+        // If the post state root did not match, then there was fraud and we should delete the batch
+        require(
+            _postStateRoot != transitioner.getPostStateRoot(),
+            "State transition has not been proven fraudulent."
+        );
+        
+        _cancelStateTransition(_postStateRootBatchHeader, _preStateRoot);
+ 
+        // TEMPORARY: Remove the transitioner; for minnet.
+        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitioner(0x0000000000000000000000000000000000000000);
+ 
+        emit FraudProofFinalized(
+            _preStateRoot,
+            _preStateRootProof.index,
+            _txHash,
+            msg.sender
+        );
+    }
+ 
+ 
+    /************************************
+     * Internal Functions: Verification *
+     ************************************/
+ 
+    /**
+     * Checks whether a transitioner already exists for a given pre-state root.
+     * @param _preStateRoot Pre-state root to check.
+     * @return _exists Whether or not we already have a transitioner for the root.
+     */
+    function _hasStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        internal
+        view
+        returns (
+            bool _exists
+        )
+    {
+        return address(getStateTransitioner(_preStateRoot, _txHash)) != address(0);
+    }
+ 
+    /**
+     * Deploys a new state transitioner.
+     * @param _preStateRoot Pre-state root to initialize the transitioner with.
+     * @param _txHash Hash of the transaction this transitioner will execute.
+     * @param _stateTransitionIndex Index of the transaction in the chain.
+     */
+    function _deployTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        uint256 _stateTransitionIndex
+    )
+        internal
+    {
+        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitionerFactory(
+            resolve("OVM_StateTransitionerFactory")
+        ).create(
+            address(libAddressManager),
+            _stateTransitionIndex,
+            _preStateRoot,
+            _txHash
+        );
+    }
+ 
+    /**
+     * Removes a state transition from the state commitment chain.
+     * @param _postStateRootBatchHeader Header for the post-state root.
+     * @param _preStateRoot Pre-state root hash.
+     */
+    function _cancelStateTransition(
+        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
+        bytes32 _preStateRoot
+    )
+        internal
+    {
+        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
+        iOVM_BondManager ovmBondManager = iOVM_BondManager(resolve("OVM_BondManager"));
+ 
+        // Delete the state batch.
+        ovmStateCommitmentChain.deleteStateBatch(
+            _postStateRootBatchHeader
+        );
+ 
+        // Get the timestamp and publisher for that block.
+        (uint256 timestamp, address publisher) = abi.decode(_postStateRootBatchHeader.extraData, (uint256, address));
+ 
+        // Slash the bonds at the bond manager.
+        ovmBondManager.finalize(
+            _preStateRoot,
+            publisher,
+            timestamp
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html b/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html new file mode 100644 index 000000000..fe900da65 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html @@ -0,0 +1,1484 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ OVM_StateTransitioner.sol +

+
+
+ 80% + Statements + 40/50 +
+
+ 62.5% + Branches + 20/32 +
+
+ 90.91% + Functions + 10/11 +
+
+ 80.39% + Lines + 41/51 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +42× +42× +  +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +  +  +  +13× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  + +  +  +  + + +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
+import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
+import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
+import { Lib_SecureMerkleTrie } from "../../libraries/trie/Lib_SecureMerkleTrie.sol";
+import { Lib_RLPWriter } from "../../libraries/rlp/Lib_RLPWriter.sol";
+import { Lib_RLPReader } from "../../libraries/rlp/Lib_RLPReader.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
+import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
+import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
+ 
+/* Contract Imports */
+import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
+ 
+/**
+ * @title OVM_StateTransitioner
+ * @dev The State Transitioner coordinates the execution of a state transition during the evaluation of a
+ * fraud proof. It feeds verified input to the Execution Manager's run(), and controls a State Manager (which is
+ * uniquely created for each fraud proof).
+ * Once a fraud proof has been initialized, this contract is provided with the pre-state root and verifies
+ * that the OVM storage slots committed to the State Mangager are contained in that state
+ * This contract controls the State Manager and Execution Manager, and uses them to calculate the
+ * post-state root by applying the transaction. The Fraud Verifier can then check for fraud by comparing
+ * the calculated post-state root with the proposed post-state root.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateTransitioner is Lib_AddressResolver, Abs_FraudContributor, iOVM_StateTransitioner {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum TransitionPhase {
+        PRE_EXECUTION,
+        POST_EXECUTION,
+        COMPLETE
+    }
+ 
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    iOVM_StateManager public ovmStateManager;
+ 
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    bytes32 internal preStateRoot;
+    bytes32 internal postStateRoot;
+    TransitionPhase public phase;
+    uint256 internal stateTransitionIndex;
+    bytes32 internal transactionHash;
+ 
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    bytes32 internal constant EMPTY_ACCOUNT_CODE_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
+    bytes32 internal constant EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _stateTransitionIndex Index of the state transition being verified.
+     * @param _preStateRoot State root before the transition was executed.
+     * @param _transactionHash Hash of the executed transaction.
+     */
+    constructor(
+        address _libAddressManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {
+        stateTransitionIndex = _stateTransitionIndex;
+        preStateRoot = _preStateRoot;
+        postStateRoot = _preStateRoot;
+        transactionHash = _transactionHash;
+ 
+        ovmStateManager = iOVM_StateManagerFactory(resolve("OVM_StateManagerFactory")).create(address(this));
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * Checks that a function is only run during a specific phase.
+     * @param _phase Phase the function must run within.
+     */
+    modifier onlyDuringPhase(
+        TransitionPhase _phase
+    ) {
+        Erequire(
+            phase == _phase,
+            "Function must be called during the correct phase."
+        );
+        _;
+    }
+ 
+ 
+    /**********************************
+     * Public Functions: State Access *
+     **********************************/
+ 
+    /**
+     * Retrieves the state root before execution.
+     * @return _preStateRoot State root before execution.
+     */
+    function getPreStateRoot()
+        override
+        public
+        view
+        returns (
+            bytes32 _preStateRoot
+        )
+    {
+        return preStateRoot;
+    }
+ 
+    /**
+     * Retrieves the state root after execution.
+     * @return _postStateRoot State root after execution.
+     */
+    function getPostStateRoot()
+        override
+        public
+        view
+        returns (
+            bytes32 _postStateRoot
+        )
+    {
+        return postStateRoot;
+    }
+ 
+    /**
+     * Checks whether the transitioner is complete.
+     * @return _complete Whether or not the transition process is finished.
+     */
+    function isComplete()
+        override
+        public
+        view
+        returns (
+            bool _complete
+        )
+    {
+        return phase == TransitionPhase.COMPLETE;
+    }
+    
+ 
+    /***********************************
+     * Public Functions: Pre-Execution *
+     ***********************************/
+ 
+    /**
+     * Allows a user to prove the initial state of a contract.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _ethContractAddress Address of the corresponding contract on L1.
+     * @param _stateTrieWitness Proof of the account state.
+     */
+    function proveContractState(
+        address _ovmContractAddress,
+        address _ethContractAddress,
+        bytes memory _stateTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        // Exit quickly to avoid unnecessary work.
+        Erequire(
+            (
+                ovmStateManager.hasAccount(_ovmContractAddress) == false
+                && ovmStateManager.hasEmptyAccount(_ovmContractAddress) == false
+            ),
+            "Account state has already been proven."
+        );
+ 
+        // Function will fail if the proof is not a valid inclusion or exclusion proof.
+        (
+            bool exists,
+            bytes memory encodedAccount
+        ) = Lib_SecureMerkleTrie.get(
+            abi.encodePacked(_ovmContractAddress),
+            _stateTrieWitness,
+            preStateRoot
+        );
+ 
+        Eif (exists == true) {
+            // Account exists, this was an inclusion proof.
+            Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
+                encodedAccount
+            );
+ 
+            address ethContractAddress = _ethContractAddress;
+            Iif (account.codeHash == EMPTY_ACCOUNT_CODE_HASH) {
+                // Use a known empty contract to prevent an attack in which a user provides a
+                // contract address here and then later deploys code to it.
+                ethContractAddress = 0x0000000000000000000000000000000000000000;
+            } else {
+                // Otherwise, make sure that the code at the provided eth address matches the hash
+                // of the code stored on L2.
+                Erequire(
+                    Lib_EthUtils.getCodeHash(ethContractAddress) == account.codeHash,
+                    "OVM_StateTransitioner: Provided L1 contract code hash does not match L2 contract code hash."
+                );
+            }
+ 
+            ovmStateManager.putAccount(
+                _ovmContractAddress,
+                Lib_OVMCodec.Account({
+                    nonce: account.nonce,
+                    balance: account.balance,
+                    storageRoot: account.storageRoot,
+                    codeHash: account.codeHash,
+                    ethAddress: ethContractAddress,
+                    isFresh: false
+                })
+            );
+        } else {
+            // Account does not exist, this was an exclusion proof.
+            ovmStateManager.putEmptyAccount(_ovmContractAddress);
+        }
+    }
+ 
+    /**
+     * Allows a user to prove the initial state of a contract storage slot.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _key Claimed account slot key.
+     * @param _storageTrieWitness Proof of the storage slot.
+     */
+    function proveStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes memory _storageTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        // Exit quickly to avoid unnecessary work.
+        Erequire(
+            ovmStateManager.hasContractStorage(_ovmContractAddress, _key) == false,
+            "Storage slot has already been proven."
+        );
+ 
+        require(
+            ovmStateManager.hasAccount(_ovmContractAddress) == true,
+            "Contract must be verified before proving a storage slot."
+        );
+ 
+        bytes32 storageRoot = ovmStateManager.getAccountStorageRoot(_ovmContractAddress);
+        bytes32 value;
+ 
+        Iif (storageRoot == EMPTY_ACCOUNT_STORAGE_ROOT) {
+            // Storage trie was empty, so the user is always allowed to insert zero-byte values.
+            value = bytes32(0);
+        } else {
+            // Function will fail if the proof is not a valid inclusion or exclusion proof.
+            (
+                bool exists,
+                bytes memory encodedValue
+            ) = Lib_SecureMerkleTrie.get(
+                abi.encodePacked(_key),
+                _storageTrieWitness,
+                storageRoot
+            );
+ 
+            Eif (exists == true) {
+                // Inclusion proof.
+                // Stored values are RLP encoded, with leading zeros removed.
+                value = Lib_BytesUtils.toBytes32PadLeft(
+                    Lib_RLPReader.readBytes(encodedValue)
+                );
+            } else {
+                // Exclusion proof, can only be zero bytes.
+                value = bytes32(0);
+            }
+        }
+ 
+        ovmStateManager.putContractStorage(
+            _ovmContractAddress,
+            _key,
+            value
+        );
+    }
+ 
+ 
+    /*******************************
+     * Public Functions: Execution *
+     *******************************/
+ 
+    /**
+     * Executes the state transition.
+     * @param _transaction OVM transaction to execute.
+     */
+    function applyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        Irequire(
+            Lib_OVMCodec.hashTransaction(_transaction) == transactionHash,
+            "Invalid transaction provided."
+        );
+ 
+        // We require gas to complete the logic here in run() before/after execution,
+        // But must ensure the full _tx.gasLimit can be given to the ovmCALL (determinism)
+        // This includes 1/64 of the gas getting lost because of EIP-150 (lost twice--first 
+        // going into EM, then going into the code contract).
+        require(
+            gasleft() >= 100000 + _transaction.gasLimit * 1032 / 1000, // 1032/1000 = 1.032 = (64/63)^2 rounded up
+            "Not enough gas to execute transaction deterministically."
+        );
+ 
+        iOVM_ExecutionManager ovmExecutionManager = iOVM_ExecutionManager(resolve("OVM_ExecutionManager"));
+ 
+        // We call `setExecutionManager` right before `run` (and not earlier) just in case the
+        // OVM_ExecutionManager address was updated between the time when this contract was created
+        // and when `applyTransaction` was called.
+        ovmStateManager.setExecutionManager(address(ovmExecutionManager));
+ 
+        // `run` always succeeds *unless* the user hasn't provided enough gas to `applyTransaction`
+        // or an INVALID_STATE_ACCESS flag was triggered. Either way, we won't get beyond this line
+        // if that's the case.
+        ovmExecutionManager.run(_transaction, address(ovmStateManager));
+ 
+        phase = TransitionPhase.POST_EXECUTION;
+    }
+ 
+ 
+    /************************************
+     * Public Functions: Post-Execution *
+     ************************************/
+ 
+    /**
+     * Allows a user to commit the final state of a contract.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _stateTrieWitness Proof of the account state.
+     */
+    function commitContractState(
+        address _ovmContractAddress,
+        bytes memory _stateTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        Erequire(
+            ovmStateManager.getTotalUncommittedContractStorage() == 0,
+            "All storage must be committed before committing account states."
+        );
+ 
+        require (
+            ovmStateManager.commitAccount(_ovmContractAddress) == true,
+            "Account state wasn't changed or has already been committed."
+        );
+ 
+        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
+ 
+        postStateRoot = Lib_SecureMerkleTrie.update(
+            abi.encodePacked(_ovmContractAddress),
+            Lib_OVMCodec.encodeEVMAccount(
+                Lib_OVMCodec.toEVMAccount(account)
+            ),
+            _stateTrieWitness,
+            postStateRoot
+        );
+ 
+        // Emit an event to help clients figure out the proof ordering.
+        emit AccountCommitted(
+            _ovmContractAddress
+        );
+    }
+ 
+    /**
+     * Allows a user to commit the final state of a contract storage slot.
+     * @param _ovmContractAddress Address of the contract on the OVM.
+     * @param _key Claimed account slot key.
+     * @param _storageTrieWitness Proof of the storage slot.
+     */
+    function commitStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes memory _storageTrieWitness
+    )
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+        contributesToFraudProof(preStateRoot, transactionHash)
+    {
+        require(
+            ovmStateManager.commitContractStorage(_ovmContractAddress, _key) == true,
+            "Storage slot value wasn't changed or has already been committed."
+        );
+ 
+        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
+        bytes32 value = ovmStateManager.getContractStorage(_ovmContractAddress, _key);
+ 
+        account.storageRoot = Lib_SecureMerkleTrie.update(
+            abi.encodePacked(_key),
+            Lib_RLPWriter.writeBytes(
+                Lib_Bytes32Utils.removeLeadingZeros(value)
+            ),
+            _storageTrieWitness,
+            account.storageRoot
+        );
+ 
+        ovmStateManager.putAccount(_ovmContractAddress, account);
+ 
+        // Emit an event to help clients figure out the proof ordering.
+        emit ContractStorageCommitted(
+            _ovmContractAddress,
+            _key
+        );
+    }
+ 
+ 
+    /**********************************
+     * Public Functions: Finalization *
+     **********************************/
+ 
+    /**
+     * Finalizes the transition process.
+     */
+    function completeTransition()
+        override
+        public
+        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
+    {
+        require(
+            ovmStateManager.getTotalUncommittedAccounts() == 0,
+            "All accounts must be committed before completing a transition."
+        );
+ 
+        require(
+            ovmStateManager.getTotalUncommittedContractStorage() == 0,
+            "All storage must be committed before completing a transition."
+        );
+ 
+        phase = TransitionPhase.COMPLETE;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html b/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html new file mode 100644 index 000000000..6072bb685 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html @@ -0,0 +1,266 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/OVM/verification/ OVM_StateTransitionerFactory.sol +

+
+
+ 50% + Statements + 1/2 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 2/2 +
+
+ 50% + Lines + 1/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
+import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
+import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
+ 
+/* Contract Imports */
+import { OVM_StateTransitioner } from "./OVM_StateTransitioner.sol";
+ 
+/**
+ * @title OVM_StateTransitionerFactory
+ * @dev The State Transitioner Factory is used by the Fraud Verifier to create a new State 
+ * Transitioner during the initialization of a fraud proof.
+ * 
+ * Compiler used: solc
+ * Runtime target: EVM
+ */
+contract OVM_StateTransitionerFactory is iOVM_StateTransitionerFactory, Lib_AddressResolver {
+ 
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    /**
+     * Creates a new OVM_StateTransitioner
+     * @param _libAddressManager Address of the Address Manager.
+     * @param _stateTransitionIndex Index of the state transition being verified.
+     * @param _preStateRoot State root before the transition was executed.
+     * @param _transactionHash Hash of the executed transaction.
+     * @return _ovmStateTransitioner New OVM_StateTransitioner instance.
+     */
+    function create(
+        address _libAddressManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        override
+        public
+        returns (
+            iOVM_StateTransitioner _ovmStateTransitioner
+        )
+    {
+        Irequire(
+            msg.sender == resolve("OVM_FraudVerifier"),
+            "Create can only be done by the OVM_FraudVerifier."
+        );
+        return new OVM_StateTransitioner(
+            _libAddressManager,
+            _stateTransitionIndex,
+            _preStateRoot,
+            _transactionHash
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/OVM/verification/index.html b/coverage/optimistic-ethereum/OVM/verification/index.html new file mode 100644 index 000000000..e160dcf28 --- /dev/null +++ b/coverage/optimistic-ethereum/OVM/verification/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for optimistic-ethereum/OVM/verification/ + + + + + + + +
+
+

+ all files optimistic-ethereum/OVM/verification/ +

+
+
+ 90.4% + Statements + 113/125 +
+
+ 78.05% + Branches + 64/82 +
+
+ 96.67% + Functions + 29/30 +
+
+ 90.48% + Lines + 114/126 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Abs_FraudContributor.sol
100%3/3100%0/0100%1/1100%4/4
OVM_BondManager.sol
100%42/4286.67%26/30100%9/9100%41/41
OVM_FraudVerifier.sol
96.43%27/2894.44%17/18100%7/796.43%27/28
OVM_StateTransitioner.sol
80%40/5062.5%20/3290.91%10/1180.39%41/51
OVM_StateTransitionerFactory.sol
50%1/250%1/2100%2/250%1/2
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html b/coverage/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..cb0d9f22a --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/accounts/ iOVM_ECDSAContractAccount.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_ECDSAContractAccount
+ */
+interface iOVM_ECDSAContractAccount {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    ) external returns (bool _success, bytes memory _returndata);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/accounts/index.html b/coverage/optimistic-ethereum/iOVM/accounts/index.html new file mode 100644 index 000000000..ef910e5b5 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/accounts/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/accounts/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/accounts/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_ECDSAContractAccount.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html new file mode 100644 index 000000000..f21d38c1a --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html @@ -0,0 +1,173 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/messaging/ iAbs_BaseCrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iAbs_BaseCrossDomainMessenger
+ */
+interface iAbs_BaseCrossDomainMessenger {
+ 
+    /**********
+     * Events *
+     **********/
+    event SentMessage(bytes message);
+    event RelayedMessage(bytes32 msgHash);
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+    function xDomainMessageSender() external view returns (address);
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sends a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _message Message to send to the target.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function sendMessage(
+        address _target,
+        bytes calldata _message,
+        uint32 _gasLimit
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html new file mode 100644 index 000000000..da13fd02b --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html @@ -0,0 +1,257 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L1CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title iOVM_L1CrossDomainMessenger
+ */
+interface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    struct L2MessageInclusionProof {
+        bytes32 stateRoot;
+        Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;
+        Lib_OVMCodec.ChainInclusionProof stateRootProof;
+        bytes stateTrieWitness;
+        bytes storageTrieWitness;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @param _proof Inclusion proof for the given message.
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        L2MessageInclusionProof memory _proof
+    ) external;
+ 
+    /**
+     * Replays a cross domain message to the target messenger.
+     * @param _target Target contract address.
+     * @param _sender Original sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     * @param _gasLimit Gas limit for the provided message.
+     */
+    function replayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce,
+        uint32 _gasLimit
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html new file mode 100644 index 000000000..bb37bbe09 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L1MultiMessageRelayer.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
+interface iOVM_L1MultiMessageRelayer {
+ 
+    struct L2ToL1Message {
+        address target;
+        address sender;
+        bytes message;
+        uint256 messageNonce;
+        iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;
+    }
+ 
+    function batchRelayMessages(L2ToL1Message[] calldata _messages) external; 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html new file mode 100644 index 000000000..10a409698 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html @@ -0,0 +1,155 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L2CrossDomainMessenger.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title iOVM_L2CrossDomainMessenger
+ */
+interface iOVM_L2CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Relays a cross domain message to a contract.
+     * @param _target Target contract address.
+     * @param _sender Message sender address.
+     * @param _message Message to send to the target.
+     * @param _messageNonce Nonce for the provided message.
+     */
+    function relayMessage(
+        address _target,
+        address _sender,
+        bytes memory _message,
+        uint256 _messageNonce
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/index.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/index.html new file mode 100644 index 000000000..3d8e3efae --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/bridge/messaging/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/bridge/messaging/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iAbs_BaseCrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MultiMessageRelayer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html new file mode 100644 index 000000000..8f52453eb --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html @@ -0,0 +1,230 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L1ETHGateway.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L1ETHGateway
+ */
+interface iOVM_L1ETHGateway {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event DepositInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+ 
+    event WithdrawalFinalized(
+        address indexed _to,
+        uint256 _amount
+    );
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function deposit()
+        external
+        payable;
+ 
+    function depositTo(
+        address _to
+    )
+        external
+        payable;
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+    function getFinalizeDepositL2Gas()
+        external
+        view
+        returns(
+            uint32
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html new file mode 100644 index 000000000..4de6d7385 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html @@ -0,0 +1,218 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L1TokenGateway.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L1TokenGateway
+ */
+interface iOVM_L1TokenGateway {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event DepositInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+  
+    event WithdrawalFinalized(
+        address indexed _to,
+        uint256 _amount
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function deposit(
+        uint _amount
+    )
+        external;
+ 
+    function depositTo(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeWithdrawal(
+        address _to,
+        uint _amount
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html new file mode 100644 index 000000000..0b3777f82 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html @@ -0,0 +1,218 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L2DepositedToken.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title iOVM_L2DepositedToken
+ */
+interface iOVM_L2DepositedToken {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event WithdrawalInitiated(
+        address indexed _from,
+        address _to,
+        uint256 _amount
+    );
+ 
+    event DepositFinalized(
+        address indexed _to,
+        uint256 _amount
+    );    
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function withdraw(
+        uint _amount
+    )
+        external;
+ 
+    function withdrawTo(
+        address _to,
+        uint _amount
+    )
+        external;
+ 
+ 
+    /*************************
+     * Cross-chain Functions *
+     *************************/
+ 
+    function finalizeDeposit(
+        address _to,
+        uint _amount
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/bridge/tokens/index.html b/coverage/optimistic-ethereum/iOVM/bridge/tokens/index.html new file mode 100644 index 000000000..60ef990a9 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/bridge/tokens/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/bridge/tokens/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_L1ETHGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1TokenGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2DepositedToken.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html b/coverage/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html new file mode 100644 index 000000000..719bb7c7e --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html @@ -0,0 +1,782 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/chain/ iOVM_CanonicalTransactionChain.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_ChainStorageContainer } from "./iOVM_ChainStorageContainer.sol";
+ 
+/**
+ * @title iOVM_CanonicalTransactionChain
+ */
+interface iOVM_CanonicalTransactionChain {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event TransactionEnqueued(
+        address _l1TxOrigin,
+        address _target,
+        uint256 _gasLimit,
+        bytes _data,
+        uint256 _queueIndex,
+        uint256 _timestamp
+    );
+ 
+    event QueueBatchAppended(
+        uint256 _startingQueueIndex,
+        uint256 _numQueueElements,
+        uint256 _totalElements
+    );
+ 
+    event SequencerBatchAppended(
+        uint256 _startingQueueIndex,
+        uint256 _numQueueElements,
+        uint256 _totalElements
+    );
+ 
+    event TransactionBatchAppended(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot,
+        uint256 _batchSize,
+        uint256 _prevTotalElements,
+        bytes _extraData
+    );
+ 
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct BatchContext {
+        uint256 numSequencedTransactions;
+        uint256 numSubsequentQueueTransactions;
+        uint256 timestamp;
+        uint256 blockNumber;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+ 
+    /**
+     * Accesses the batch storage container.
+     * @return Reference to the batch storage container.
+     */
+    function batches()
+        external
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        );
+ 
+    /**
+     * Accesses the queue storage container.
+     * @return Reference to the queue storage container.
+     */
+    function queue()
+        external
+        view
+        returns (
+            iOVM_ChainStorageContainer
+        );
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        external
+        view
+        returns (
+            uint256 _totalElements
+        );
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        external
+        view
+        returns (
+            uint256 _totalBatches
+        );
+ 
+    /**
+     * Returns the index of the next element to be enqueued.
+     * @return Index for the next queue element.
+     */
+    function getNextQueueIndex()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Gets the queue element at a particular index.
+     * @param _index Index of the queue element to access.
+     * @return _element Queue element at the given index.
+     */
+    function getQueueElement(
+        uint256 _index
+    )
+        external
+        view
+        returns (
+            Lib_OVMCodec.QueueElement memory _element
+        );
+ 
+    /**
+     * Returns the timestamp of the last transaction.
+     * @return Timestamp for the last transaction.
+     */
+    function getLastTimestamp()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Returns the blocknumber of the last transaction.
+     * @return Blocknumber for the last transaction.
+     */
+    function getLastBlockNumber()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Get the number of queue elements which have not yet been included.
+     * @return Number of pending queue elements.
+     */
+    function getNumPendingQueueElements()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+    /**
+     * Retrieves the length of the queue, including
+     * both pending and canonical transactions.
+     * @return Length of the queue.
+     */
+    function getQueueLength()
+        external
+        view
+        returns (
+            uint40
+        );
+ 
+ 
+    /**
+     * Adds a transaction to the queue.
+     * @param _target Target contract to send the transaction to.
+     * @param _gasLimit Gas limit for the given transaction.
+     * @param _data Transaction data.
+     */
+    function enqueue(
+        address _target,
+        uint256 _gasLimit,
+        bytes memory _data
+    )
+        external;
+ 
+    /**
+     * Appends a given number of queued transactions as a single batch.
+     * @param _numQueuedTransactions Number of transactions to append.
+     */
+    function appendQueueBatch(
+        uint256 _numQueuedTransactions
+    )
+        external;
+ 
+    /**
+     * Allows the sequencer to append a batch of transactions.
+     * @dev This function uses a custom encoding scheme for efficiency reasons.
+     * .param _shouldStartAtElement Specific batch we expect to start appending to.
+     * .param _totalElementsToAppend Total number of batch elements we expect to append.
+     * .param _contexts Array of batch contexts.
+     * .param _transactionDataFields Array of raw transaction data.
+     */
+    function appendSequencerBatch(
+        // uint40 _shouldStartAtElement,
+        // uint24 _totalElementsToAppend,
+        // BatchContext[] _contexts,
+        // bytes[] _transactionDataFields
+    )
+        external;
+ 
+    /**
+     * Verifies whether a transaction is included in the chain.
+     * @param _transaction Transaction to verify.
+     * @param _txChainElement Transaction chain element corresponding to the transaction.
+     * @param _batchHeader Header of the batch the transaction was included in.
+     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
+     * @return True if the transaction exists in the CTC, false if not.
+     */
+    function verifyTransaction(
+        Lib_OVMCodec.Transaction memory _transaction,
+        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
+    )
+        external
+        view
+        returns (
+            bool
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html b/coverage/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html new file mode 100644 index 000000000..2a6ce20dc --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html @@ -0,0 +1,398 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/chain/ iOVM_ChainStorageContainer.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_ChainStorageContainer
+ */
+interface iOVM_ChainStorageContainer {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sets the container's global metadata field. We're using `bytes27` here because we use five
+     * bytes to maintain the length of the underlying data structure, meaning we have an extra
+     * 27 bytes to store arbitrary data.
+     * @param _globalMetadata New global metadata to set.
+     */
+    function setGlobalMetadata(
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Retrieves the container's global metadata field.
+     * @return Container global metadata field.
+     */
+    function getGlobalMetadata()
+        external
+        view
+        returns (
+            bytes27
+        );
+ 
+    /**
+     * Retrieves the number of objects stored in the container.
+     * @return Number of objects in the container.
+     */
+    function length()
+        external
+        view
+        returns (
+            uint256
+        );
+ 
+    /**
+     * Pushes an object into the container.
+     * @param _object A 32 byte value to insert into the container.
+     */
+    function push(
+        bytes32 _object
+    )
+        external;
+ 
+    /**
+     * Pushes an object into the container. Function allows setting the global metadata since
+     * we'll need to touch the "length" storage slot anyway, which also contains the global
+     * metadata (it's an optimization).
+     * @param _object A 32 byte value to insert into the container.
+     * @param _globalMetadata New global metadata for the container.
+     */
+    function push(
+        bytes32 _object,
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Retrieves an object from the container.
+     * @param _index Index of the particular object to access.
+     * @return 32 byte object value.
+     */
+    function get(
+        uint256 _index
+    )
+        external
+        view
+        returns (
+            bytes32
+        );
+ 
+    /**
+     * Removes all objects after and including a given index.
+     * @param _index Object index to delete from.
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index
+    )
+        external;
+ 
+    /**
+     * Removes all objects after and including a given index. Also allows setting the global
+     * metadata field.
+     * @param _index Object index to delete from.
+     * @param _globalMetadata New global metadata for the container.
+     */
+    function deleteElementsAfterInclusive(
+        uint256 _index,
+        bytes27 _globalMetadata
+    )
+        external;
+ 
+    /**
+     * Marks an index as overwritable, meaing the underlying buffer can start to write values over
+     * any objects before and including the given index.
+     */
+    function setNextOverwritableIndex(
+        uint256 _index
+    )
+        external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html b/coverage/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html new file mode 100644 index 000000000..a65b5ceef --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html @@ -0,0 +1,419 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/chain/ iOVM_StateCommitmentChain.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateCommitmentChain
+ */
+interface iOVM_StateCommitmentChain {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event StateBatchAppended(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot,
+        uint256 _batchSize,
+        uint256 _prevTotalElements,
+        bytes _extraData
+    );
+ 
+    event StateBatchDeleted(
+        uint256 indexed _batchIndex,
+        bytes32 _batchRoot
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Retrieves the total number of elements submitted.
+     * @return _totalElements Total submitted elements.
+     */
+    function getTotalElements()
+        external
+        view
+        returns (
+            uint256 _totalElements
+        );
+ 
+    /**
+     * Retrieves the total number of batches submitted.
+     * @return _totalBatches Total submitted batches.
+     */
+    function getTotalBatches()
+        external
+        view
+        returns (
+            uint256 _totalBatches
+        );
+ 
+    /**
+     * Retrieves the timestamp of the last batch submitted by the sequencer.
+     * @return _lastSequencerTimestamp Last sequencer batch timestamp.
+     */
+    function getLastSequencerTimestamp()
+        external
+        view
+        returns (
+            uint256 _lastSequencerTimestamp
+        );
+ 
+    /**
+     * Appends a batch of state roots to the chain.
+     * @param _batch Batch of state roots.
+     * @param _shouldStartAtElement Index of the element at which this batch should start.
+     */
+    function appendStateBatch(
+        bytes32[] calldata _batch,
+        uint256 _shouldStartAtElement
+    )
+        external;
+ 
+    /**
+     * Deletes all state roots after (and including) a given batch.
+     * @param _batchHeader Header of the batch to start deleting from.
+     */
+    function deleteStateBatch(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        external;
+ 
+    /**
+     * Verifies a batch inclusion proof.
+     * @param _element Hash of the element to verify a proof for.
+     * @param _batchHeader Header of the batch in which the element was included.
+     * @param _proof Merkle inclusion proof for the element.
+     */
+    function verifyStateCommitment(
+        bytes32 _element,
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
+        Lib_OVMCodec.ChainInclusionProof memory _proof
+    )
+        external
+        view
+        returns (
+            bool _verified
+        );
+ 
+    /**
+     * Checks whether a given batch is still inside its fraud proof window.
+     * @param _batchHeader Header of the batch to check.
+     * @return _inside Whether or not the batch is inside the fraud proof window.
+     */
+    function insideFraudProofWindow(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        external
+        view
+        returns (
+            bool _inside
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/chain/index.html b/coverage/optimistic-ethereum/iOVM/chain/index.html new file mode 100644 index 000000000..79692cb03 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/chain/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/chain/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/chain/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_CanonicalTransactionChain.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ChainStorageContainer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateCommitmentChain.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html b/coverage/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html new file mode 100644 index 000000000..caae9773f --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html @@ -0,0 +1,533 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/execution/ iOVM_ExecutionManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+interface iOVM_ExecutionManager {
+    /**********
+     * Enums *
+     *********/
+ 
+    enum RevertFlag {
+        OUT_OF_GAS,
+        INTENTIONAL_REVERT,
+        EXCEEDS_NUISANCE_GAS,
+        INVALID_STATE_ACCESS,
+        UNSAFE_BYTECODE,
+        CREATE_COLLISION,
+        STATIC_VIOLATION,
+        CREATOR_NOT_ALLOWED
+    }
+ 
+    enum GasMetadataKey {
+        CURRENT_EPOCH_START_TIMESTAMP,
+        CUMULATIVE_SEQUENCER_QUEUE_GAS,
+        CUMULATIVE_L1TOL2_QUEUE_GAS,
+        PREV_EPOCH_SEQUENCER_QUEUE_GAS,
+        PREV_EPOCH_L1TOL2_QUEUE_GAS
+    }
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct GasMeterConfig {
+        uint256 minTransactionGasLimit;
+        uint256 maxTransactionGasLimit;
+        uint256 maxGasPerQueuePerEpoch;
+        uint256 secondsPerEpoch;
+    }
+ 
+    struct GlobalContext {
+        uint256 ovmCHAINID;
+    }
+ 
+    struct TransactionContext {
+        Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;
+        uint256 ovmTIMESTAMP;
+        uint256 ovmNUMBER;
+        uint256 ovmGASLIMIT;
+        uint256 ovmTXGASLIMIT;
+        address ovmL1TXORIGIN;
+    }
+ 
+    struct TransactionRecord {
+        uint256 ovmGasRefund;
+    }
+ 
+    struct MessageContext {
+        address ovmCALLER;
+        address ovmADDRESS;
+        bool isStatic;
+    }
+ 
+    struct MessageRecord {
+        uint256 nuisanceGasLeft;
+    }
+ 
+ 
+    /************************************
+     * Transaction Execution Entrypoint *
+     ************************************/
+ 
+    function run(
+        Lib_OVMCodec.Transaction calldata _transaction,
+        address _txStateManager
+    ) external;
+ 
+ 
+    /*******************
+     * Context Opcodes *
+     *******************/
+ 
+    function ovmCALLER() external view returns (address _caller);
+    function ovmADDRESS() external view returns (address _address);
+    function ovmTIMESTAMP() external view returns (uint256 _timestamp);
+    function ovmNUMBER() external view returns (uint256 _number);
+    function ovmGASLIMIT() external view returns (uint256 _gasLimit);
+    function ovmCHAINID() external view returns (uint256 _chainId);
+ 
+ 
+    /**********************
+     * L2 Context Opcodes *
+     **********************/
+ 
+    function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
+    function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
+ 
+ 
+    /*******************
+     * Halting Opcodes *
+     *******************/
+ 
+    function ovmREVERT(bytes memory _data) external;
+ 
+ 
+    /*****************************
+     * Contract Creation Opcodes *
+     *****************************/
+ 
+    function ovmCREATE(bytes memory _bytecode) external returns (address _contract, bytes memory _revertdata);
+    function ovmCREATE2(bytes memory _bytecode, bytes32 _salt) external returns (address _contract, bytes memory _revertdata);
+ 
+ 
+    /*******************************
+     * Account Abstraction Opcodes *
+     ******************************/
+ 
+    function ovmGETNONCE() external returns (uint256 _nonce);
+    function ovmSETNONCE(uint256 _nonce) external;
+    function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
+ 
+ 
+    /****************************
+     * Contract Calling Opcodes *
+     ****************************/
+ 
+    function ovmCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+    function ovmSTATICCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+    function ovmDELEGATECALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
+ 
+ 
+    /****************************
+     * Contract Storage Opcodes *
+     ****************************/
+ 
+    function ovmSLOAD(bytes32 _key) external returns (bytes32 _value);
+    function ovmSSTORE(bytes32 _key, bytes32 _value) external;
+ 
+ 
+    /*************************
+     * Contract Code Opcodes *
+     *************************/
+ 
+    function ovmEXTCODECOPY(address _contract, uint256 _offset, uint256 _length) external returns (bytes memory _code);
+    function ovmEXTCODESIZE(address _contract) external returns (uint256 _size);
+    function ovmEXTCODEHASH(address _contract) external returns (bytes32 _hash);
+ 
+ 
+    /***************************************
+     * Public Functions: Execution Context *
+     ***************************************/
+ 
+    function getMaxTransactionGasLimit() external view returns (uint _maxTransactionGasLimit);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html b/coverage/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html new file mode 100644 index 000000000..2879de4b0 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html @@ -0,0 +1,107 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/execution/ iOVM_SafetyChecker.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_SafetyChecker
+ */
+interface iOVM_SafetyChecker {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html b/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html new file mode 100644 index 000000000..d50f8d0b1 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html @@ -0,0 +1,296 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/execution/ iOVM_StateManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateManager
+ */
+interface iOVM_StateManager {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum ItemState {
+        ITEM_UNTOUCHED,
+        ITEM_LOADED,
+        ITEM_CHANGED,
+        ITEM_COMMITTED
+    }
+ 
+    /***************************
+     * Public Functions: Misc *
+     ***************************/
+ 
+    function isAuthenticated(address _address) external view returns (bool);
+ 
+    /***************************
+     * Public Functions: Setup *
+     ***************************/
+ 
+    function owner() external view returns (address _owner);
+    function ovmExecutionManager() external view returns (address _ovmExecutionManager);
+    function setExecutionManager(address _ovmExecutionManager) external;
+ 
+ 
+    /************************************
+     * Public Functions: Account Access *
+     ************************************/
+ 
+    function putAccount(address _address, Lib_OVMCodec.Account memory _account) external;
+    function putEmptyAccount(address _address) external;
+    function getAccount(address _address) external view returns (Lib_OVMCodec.Account memory _account);
+    function hasAccount(address _address) external view returns (bool _exists);
+    function hasEmptyAccount(address _address) external view returns (bool _exists);
+    function setAccountNonce(address _address, uint256 _nonce) external;
+    function getAccountNonce(address _address) external view returns (uint256 _nonce);
+    function getAccountEthAddress(address _address) external view returns (address _ethAddress);
+    function getAccountStorageRoot(address _address) external view returns (bytes32 _storageRoot);
+    function initPendingAccount(address _address) external;
+    function commitPendingAccount(address _address, address _ethAddress, bytes32 _codeHash) external;
+    function testAndSetAccountLoaded(address _address) external returns (bool _wasAccountAlreadyLoaded);
+    function testAndSetAccountChanged(address _address) external returns (bool _wasAccountAlreadyChanged);
+    function commitAccount(address _address) external returns (bool _wasAccountCommitted);
+    function incrementTotalUncommittedAccounts() external;
+    function getTotalUncommittedAccounts() external view returns (uint256 _total);
+    function wasAccountChanged(address _address) external view returns (bool);
+    function wasAccountCommitted(address _address) external view returns (bool);
+ 
+ 
+    /************************************
+     * Public Functions: Storage Access *
+     ************************************/
+ 
+    function putContractStorage(address _contract, bytes32 _key, bytes32 _value) external;
+    function getContractStorage(address _contract, bytes32 _key) external view returns (bytes32 _value);
+    function hasContractStorage(address _contract, bytes32 _key) external view returns (bool _exists);
+    function testAndSetContractStorageLoaded(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyLoaded);
+    function testAndSetContractStorageChanged(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyChanged);
+    function commitContractStorage(address _contract, bytes32 _key) external returns (bool _wasContractStorageCommitted);
+    function incrementTotalUncommittedContractStorage() external;
+    function getTotalUncommittedContractStorage() external view returns (uint256 _total);
+    function wasContractStorageChanged(address _contract, bytes32 _key) external view returns (bool);
+    function wasContractStorageCommitted(address _contract, bytes32 _key) external view returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html b/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html new file mode 100644 index 000000000..ad5e6f218 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html @@ -0,0 +1,134 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/execution/ iOVM_StateManagerFactory.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { iOVM_StateManager } from "./iOVM_StateManager.sol";
+ 
+/**
+ * @title iOVM_StateManagerFactory
+ */
+interface iOVM_StateManagerFactory {
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    function create(
+        address _owner
+    )
+        external
+        returns (
+            iOVM_StateManager _ovmStateManager
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/execution/index.html b/coverage/optimistic-ethereum/iOVM/execution/index.html new file mode 100644 index 000000000..05e6abd73 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/execution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/execution/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/execution/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_ExecutionManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_SafetyChecker.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManagerFactory.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html new file mode 100644 index 000000000..eea280b9e --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html @@ -0,0 +1,125 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/predeploys/ iOVM_DeployerWhitelist.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_DeployerWhitelist
+ */
+interface iOVM_DeployerWhitelist {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function initialize(address _owner, bool _allowArbitraryDeployment) external;
+    function getOwner() external returns (address _owner);
+    function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;
+    function setOwner(address _newOwner) external;
+    function setAllowArbitraryDeployment(bool _allowArbitraryDeployment) external;
+    function enableArbitraryContractDeployment() external;
+    function isDeployerAllowed(address _deployer) external returns (bool _allowed);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html new file mode 100644 index 000000000..4015dddbb --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html @@ -0,0 +1,224 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/predeploys/ iOVM_ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_ERC20
+ */
+interface iOVM_ERC20 {
+    /* This is a slight change to the ERC20 base standard.
+    function totalSupply() constant returns (uint256 supply);
+    is replaced with:
+    uint256 public totalSupply;
+    This automatically creates a getter function for the totalSupply.
+    This is moved to the base contract since public getter functions are not
+    currently recognised as an implementation of the matching abstract
+    function by the compiler.
+    */
+    /// total amount of tokens
+    function totalSupply() external view returns (uint256);
+ 
+    /// @param _owner The address from which the balance will be retrieved
+    /// @return balance The balance
+    function balanceOf(address _owner) external view returns (uint256 balance);
+ 
+    /// @notice send `_value` token to `_to` from `msg.sender`
+    /// @param _to The address of the recipient
+    /// @param _value The amount of token to be transferred
+    /// @return success Whether the transfer was successful or not
+    function transfer(address _to, uint256 _value) external returns (bool success);
+ 
+    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
+    /// @param _from The address of the sender
+    /// @param _to The address of the recipient
+    /// @param _value The amount of token to be transferred
+    /// @return success Whether the transfer was successful or not
+    function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
+ 
+    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
+    /// @param _spender The address of the account able to transfer the tokens
+    /// @param _value The amount of tokens to be approved for transfer
+    /// @return success Whether the approval was successful or not
+    function approve(address _spender, uint256 _value) external returns (bool success);
+ 
+    /// @param _owner The address of the account owning tokens
+    /// @param _spender The address of the account able to transfer the tokens
+    /// @return remaining Amount of remaining tokens allowed to spent
+    function allowance(address _owner, address _spender) external view returns (uint256 remaining);
+ 
+    // solhint-disable-next-line no-simple-event-func-name
+    event Transfer(address indexed _from, address indexed _to, uint256 _value);
+    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
+    event Mint(address indexed _account, uint256 _amount);
+    event Burn(address indexed _account, uint256 _amount);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html new file mode 100644 index 000000000..2ee6275c9 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html @@ -0,0 +1,107 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/predeploys/ iOVM_L1MessageSender.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_L1MessageSender
+ */
+interface iOVM_L1MessageSender {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function getL1MessageSender() external view returns (address _l1MessageSender);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html new file mode 100644 index 000000000..3fbedd282 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html @@ -0,0 +1,140 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/predeploys/ iOVM_L2ToL1MessagePasser.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title iOVM_L2ToL1MessagePasser
+ */
+interface iOVM_L2ToL1MessagePasser {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event L2ToL1Message(
+        uint256 _nonce,
+        address _sender,
+        bytes _data
+    );
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function passMessageToL1(bytes calldata _message) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/index.html b/coverage/optimistic-ethereum/iOVM/predeploys/index.html new file mode 100644 index 000000000..fc65f5166 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/predeploys/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/predeploys/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/predeploys/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_DeployerWhitelist.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ERC20.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MessageSender.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2ToL1MessagePasser.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html b/coverage/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html new file mode 100644 index 000000000..736e664e0 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html @@ -0,0 +1,389 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/verification/ iOVM_BondManager.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+interface ERC20 {
+    function transfer(address, uint256) external returns (bool);
+    function transferFrom(address, address, uint256) external returns (bool);
+}
+ 
+/// All the errors which may be encountered on the bond manager
+library Errors {
+    string constant ERC20_ERR = "BondManager: Could not post bond";
+    string constant ALREADY_FINALIZED = "BondManager: Fraud proof for this pre-state root has already been finalized";
+    string constant SLASHED = "BondManager: Cannot finalize withdrawal, you probably got slashed";
+    string constant WRONG_STATE = "BondManager: Wrong bond state for proposer";
+    string constant CANNOT_CLAIM = "BondManager: Cannot claim yet. Dispute must be finalized first";
+ 
+    string constant WITHDRAWAL_PENDING = "BondManager: Withdrawal already pending";
+    string constant TOO_EARLY = "BondManager: Too early to finalize your withdrawal";
+ 
+    string constant ONLY_TRANSITIONER = "BondManager: Only the transitioner for this pre-state root may call this function";
+    string constant ONLY_FRAUD_VERIFIER = "BondManager: Only the fraud verifier may call this function";
+    string constant ONLY_STATE_COMMITMENT_CHAIN = "BondManager: Only the state commitment chain may call this function";
+    string constant WAIT_FOR_DISPUTES = "BondManager: Wait for other potential disputes";
+}
+ 
+/**
+ * @title iOVM_BondManager
+ */
+interface iOVM_BondManager {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    /// The lifecycle of a proposer's bond
+    enum State {
+        // Before depositing or after getting slashed, a user is uncollateralized
+        NOT_COLLATERALIZED,
+        // After depositing, a user is collateralized
+        COLLATERALIZED,
+        // After a user has initiated a withdrawal
+        WITHDRAWING
+    }
+ 
+    /// A bond posted by a proposer
+    struct Bond {
+        // The user's state
+        State state;
+        // The timestamp at which a proposer issued their withdrawal request
+        uint32 withdrawalTimestamp;
+        // The time when the first disputed was initiated for this bond
+        uint256 firstDisputeAt;
+        // The earliest observed state root for this bond which has had fraud
+        bytes32 earliestDisputedStateRoot;
+        // The state root's timestamp
+        uint256 earliestTimestamp;
+    }
+ 
+    // Per pre-state root, store the number of state provisions that were made
+    // and how many of these calls were made by each user. Payouts will then be
+    // claimed by users proportionally for that dispute.
+    struct Rewards {
+        // Flag to check if rewards for a fraud proof are claimable
+        bool canClaim;
+        // Total number of `recordGasSpent` calls made
+        uint256 total;
+        // The gas spent by each user to provide witness data. The sum of all
+        // values inside this map MUST be equal to the value of `total`
+        mapping(address => uint256) gasSpent;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function recordGasSpent(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        address _who,
+        uint256 _gasSpent
+    ) external;
+ 
+    function finalize(
+        bytes32 _preStateRoot,
+        address _publisher,
+        uint256 _timestamp
+    ) external;
+ 
+    function deposit() external;
+ 
+    function startWithdrawal() external;
+ 
+    function finalizeWithdrawal() external;
+ 
+    function claim(
+        address _who
+    ) external;
+ 
+    function isCollateralized(
+        address _who
+    ) external view returns (bool);
+ 
+    function getGasSpent(
+        bytes32 _preStateRoot,
+        address _who
+    ) external view returns (uint256);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html b/coverage/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html new file mode 100644 index 000000000..6a84d41e2 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html @@ -0,0 +1,260 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/verification/ iOVM_FraudVerifier.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/* Interface Imports */
+import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
+ 
+/**
+ * @title iOVM_FraudVerifier
+ */
+interface iOVM_FraudVerifier {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event FraudProofInitialized(
+        bytes32 _preStateRoot,
+        uint256 _preStateRootIndex,
+        bytes32 _transactionHash,
+        address _who
+    );
+ 
+    event FraudProofFinalized(
+        bytes32 _preStateRoot,
+        uint256 _preStateRootIndex,
+        bytes32 _transactionHash,
+        address _who
+    );
+ 
+ 
+    /***************************************
+     * Public Functions: Transition Status *
+     ***************************************/
+ 
+    function getStateTransitioner(bytes32 _preStateRoot, bytes32 _txHash) external view returns (iOVM_StateTransitioner _transitioner);
+ 
+ 
+    /****************************************
+     * Public Functions: Fraud Verification *
+     ****************************************/
+ 
+    function initializeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
+        Lib_OVMCodec.Transaction calldata _transaction,
+        Lib_OVMCodec.TransactionChainElement calldata _txChainElement,
+        Lib_OVMCodec.ChainBatchHeader calldata _transactionBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _transactionProof
+    ) external;
+ 
+    function finalizeFraudVerification(
+        bytes32 _preStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
+        bytes32 _txHash,
+        bytes32 _postStateRoot,
+        Lib_OVMCodec.ChainBatchHeader calldata _postStateRootBatchHeader,
+        Lib_OVMCodec.ChainInclusionProof calldata _postStateRootProof
+    ) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html b/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html new file mode 100644 index 000000000..7bf0a4555 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html @@ -0,0 +1,314 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/verification/ iOVM_StateTransitioner.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title iOVM_StateTransitioner
+ */
+interface iOVM_StateTransitioner {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event AccountCommitted(
+        address _address
+    );
+ 
+    event ContractStorageCommitted(
+        address _address,
+        bytes32 _key
+    );
+ 
+ 
+    /**********************************
+     * Public Functions: State Access *
+     **********************************/
+ 
+    function getPreStateRoot() external view returns (bytes32 _preStateRoot);
+    function getPostStateRoot() external view returns (bytes32 _postStateRoot);
+    function isComplete() external view returns (bool _complete);
+ 
+ 
+    /***********************************
+     * Public Functions: Pre-Execution *
+     ***********************************/
+ 
+    function proveContractState(
+        address _ovmContractAddress,
+        address _ethContractAddress,
+        bytes calldata _stateTrieWitness
+    ) external;
+ 
+    function proveStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes calldata _storageTrieWitness
+    ) external;
+ 
+ 
+    /*******************************
+     * Public Functions: Execution *
+     *******************************/
+ 
+    function applyTransaction(
+        Lib_OVMCodec.Transaction calldata _transaction
+    ) external;
+ 
+ 
+    /************************************
+     * Public Functions: Post-Execution *
+     ************************************/
+ 
+    function commitContractState(
+        address _ovmContractAddress,
+        bytes calldata _stateTrieWitness
+    ) external;
+ 
+    function commitStorageSlot(
+        address _ovmContractAddress,
+        bytes32 _key,
+        bytes calldata _storageTrieWitness
+    ) external;
+ 
+ 
+    /**********************************
+     * Public Functions: Finalization *
+     **********************************/
+ 
+    function completeTransition() external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html b/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html new file mode 100644 index 000000000..29124d9c6 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html @@ -0,0 +1,143 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/iOVM/verification/ iOVM_StateTransitionerFactory.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
+ 
+/**
+ * @title iOVM_StateTransitionerFactory
+ */
+interface iOVM_StateTransitionerFactory {
+ 
+    /***************************************
+     * Public Functions: Contract Creation *
+     ***************************************/
+ 
+    function create(
+        address _proxyManager,
+        uint256 _stateTransitionIndex,
+        bytes32 _preStateRoot,
+        bytes32 _transactionHash
+    )
+        external
+        returns (
+            iOVM_StateTransitioner _ovmStateTransitioner
+        );
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/iOVM/verification/index.html b/coverage/optimistic-ethereum/iOVM/verification/index.html new file mode 100644 index 000000000..4655a37c6 --- /dev/null +++ b/coverage/optimistic-ethereum/iOVM/verification/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/iOVM/verification/ + + + + + + + +
+
+

+ all files optimistic-ethereum/iOVM/verification/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
iOVM_BondManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_FraudVerifier.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitioner.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitionerFactory.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html b/coverage/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html new file mode 100644 index 000000000..38cfe2666 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html @@ -0,0 +1,308 @@ + + + + Code coverage report for optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/bridge/ OVM_CrossDomainEnabled.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +78× +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+/* Interface Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title OVM_CrossDomainEnabled
+ * @dev Helper contract for contracts performing cross-domain communications
+ *
+ * Compiler used: defined by inheriting contract
+ * Runtime target: defined by inheriting contract
+ */
+contract OVM_CrossDomainEnabled {
+    // Messenger contract used to send and recieve messages from the other domain.
+    address public messenger;
+ 
+    /***************
+     * Constructor *
+     ***************/    
+    constructor(
+        address _messenger
+    ) {
+        messenger = _messenger;
+    }
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    /**
+     * @notice Enforces that the modified function is only callable by a specific cross-domain account.
+     * @param _sourceDomainAccount The only account on the originating domain which is authenticated to call this function.
+     */
+    modifier onlyFromCrossDomainAccount(
+        address _sourceDomainAccount
+    ) {
+        require(
+            msg.sender == address(getCrossDomainMessenger()),
+            "OVM_XCHAIN: messenger contract unauthenticated"
+        );
+ 
+        require(
+            getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,
+            "OVM_XCHAIN: wrong sender of cross-domain message"
+        );
+ 
+        _;
+    }
+    
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Gets the messenger, usually from storage.  This function is exposed in case a child contract needs to override.
+     * @return The address of the cross-domain messenger contract which should be used. 
+     */
+    function getCrossDomainMessenger()
+        internal
+        virtual
+        returns(
+            iAbs_BaseCrossDomainMessenger
+        )
+    {
+        return iAbs_BaseCrossDomainMessenger(messenger);
+    }
+ 
+    /**
+     * @notice Sends a message to an account on another domain
+     * @param _crossDomainTarget The intended recipient on the destination domain
+     * @param _data The data to send to the target (usually calldata to a function with `onlyFromCrossDomainAccount()`)
+     * @param _gasLimit The gasLimit for the receipt of the message on the target domain.
+     */
+    function sendCrossDomainMessage(
+        address _crossDomainTarget,
+        bytes memory _data,
+        uint32 _gasLimit
+    ) internal {
+        getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/bridge/index.html b/coverage/optimistic-ethereum/libraries/bridge/index.html new file mode 100644 index 000000000..53b785d67 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/bridge/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/libraries/bridge/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/bridge/ +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 6/6 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
OVM_CrossDomainEnabled.sol
100%5/5100%4/4100%4/4100%6/6
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html b/coverage/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html new file mode 100644 index 000000000..d903ad31e --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html @@ -0,0 +1,1178 @@ + + + + Code coverage report for optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/codec/ Lib_OVMCodec.sol +

+
+
+ 100% + Statements + 33/33 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 33/33 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  + +  + + + + + +  + +  + + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + +  +  +  +  + +  +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +113× +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+import { Lib_Bytes32Utils } from "../utils/Lib_Bytes32Utils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title Lib_OVMCodec
+ */
+library Lib_OVMCodec {
+ 
+    /*********
+     * Enums *
+     *********/
+ 
+    enum EOASignatureType {
+        EIP155_TRANSACTON,
+        ETH_SIGNED_MESSAGE
+    }
+ 
+    enum QueueOrigin {
+        SEQUENCER_QUEUE,
+        L1TOL2_QUEUE
+    }
+ 
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct Account {
+        uint256 nonce;
+        uint256 balance;
+        bytes32 storageRoot;
+        bytes32 codeHash;
+        address ethAddress;
+        bool isFresh;
+    }
+ 
+    struct EVMAccount {
+        uint256 nonce;
+        uint256 balance;
+        bytes32 storageRoot;
+        bytes32 codeHash;
+    }
+ 
+    struct ChainBatchHeader {
+        uint256 batchIndex;
+        bytes32 batchRoot;
+        uint256 batchSize;
+        uint256 prevTotalElements;
+        bytes extraData;
+    }
+ 
+    struct ChainInclusionProof {
+        uint256 index;
+        bytes32[] siblings;
+    }
+ 
+    struct Transaction {
+        uint256 timestamp;
+        uint256 blockNumber;
+        QueueOrigin l1QueueOrigin;
+        address l1TxOrigin;
+        address entrypoint;
+        uint256 gasLimit;
+        bytes data;
+    }
+ 
+    struct TransactionChainElement {
+        bool isSequenced;
+        uint256 queueIndex;  // QUEUED TX ONLY
+        uint256 timestamp;   // SEQUENCER TX ONLY
+        uint256 blockNumber; // SEQUENCER TX ONLY
+        bytes txData;        // SEQUENCER TX ONLY
+    }
+ 
+    struct QueueElement {
+        bytes32 transactionHash;
+        uint40 timestamp;
+        uint40 blockNumber;
+    }
+ 
+    struct EIP155Transaction {
+        uint256 nonce;
+        uint256 gasPrice;
+        uint256 gasLimit;
+        address to;
+        uint256 value;
+        bytes data;
+        uint256 chainId;
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Decodes an EOA transaction (i.e., native Ethereum RLP encoding).
+     * @param _transaction Encoded EOA transaction.
+     * @return Transaction decoded into a struct.
+     */
+    function decodeEIP155Transaction(
+        bytes memory _transaction,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (
+            EIP155Transaction memory
+        )
+    {
+        if (_isEthSignedMessage) {
+            (
+                uint256 _nonce,
+                uint256 _gasLimit,
+                uint256 _gasPrice,
+                uint256 _chainId,
+                address _to,
+                bytes memory _data
+            ) = abi.decode(
+                _transaction,
+                (uint256, uint256, uint256, uint256, address ,bytes)
+            );
+            return EIP155Transaction({
+                nonce: _nonce,
+                gasPrice: _gasPrice,
+                gasLimit: _gasLimit,
+                to: _to,
+                value: 0,
+                data: _data,
+                chainId: _chainId
+            });
+        } else {
+            Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);
+ 
+            return EIP155Transaction({
+                nonce: Lib_RLPReader.readUint256(decoded[0]),
+                gasPrice: Lib_RLPReader.readUint256(decoded[1]),
+                gasLimit: Lib_RLPReader.readUint256(decoded[2]),
+                to: Lib_RLPReader.readAddress(decoded[3]),
+                value: Lib_RLPReader.readUint256(decoded[4]),
+                data: Lib_RLPReader.readBytes(decoded[5]),
+                chainId:  Lib_RLPReader.readUint256(decoded[6])
+            });
+        }
+    }
+ 
+    /**
+     * Decompresses a compressed EIP155 transaction.
+     * @param _transaction Compressed EIP155 transaction bytes.
+     * @return Transaction parsed into a struct.
+     */
+    function decompressEIP155Transaction(
+        bytes memory _transaction
+    )
+        internal
+        returns (
+            EIP155Transaction memory
+        )
+    {
+        return EIP155Transaction({
+            gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),
+            gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,
+            nonce: Lib_BytesUtils.toUint24(_transaction, 6),
+            to: Lib_BytesUtils.toAddress(_transaction, 9),
+            data: Lib_BytesUtils.slice(_transaction, 29),
+            chainId: Lib_SafeExecutionManagerWrapper.safeCHAINID(),
+            value: 0
+        });
+    }
+ 
+    /**
+     * Encodes an EOA transaction back into the original transaction.
+     * @param _transaction EIP155transaction to encode.
+     * @param _isEthSignedMessage Whether or not this was an eth signed message.
+     * @return Encoded transaction.
+     */
+    function encodeEIP155Transaction(
+        EIP155Transaction memory _transaction,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        if (_isEthSignedMessage) {
+            return abi.encode(
+                _transaction.nonce,
+                _transaction.gasLimit,
+                _transaction.gasPrice,
+                _transaction.chainId,
+                _transaction.to,
+                _transaction.data
+            );
+        } else {
+            bytes[] memory raw = new bytes[](9);
+ 
+            raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
+            raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
+            raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
+            if (_transaction.to == address(0)) {
+                raw[3] = Lib_RLPWriter.writeBytes('');
+            } else {
+                raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
+            }
+            raw[4] = Lib_RLPWriter.writeUint(0);
+            raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
+            raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
+            raw[7] = Lib_RLPWriter.writeBytes(bytes(''));
+            raw[8] = Lib_RLPWriter.writeBytes(bytes(''));
+ 
+            return Lib_RLPWriter.writeList(raw);
+        }
+    }
+ 
+    /**
+     * Encodes a standard OVM transaction.
+     * @param _transaction OVM transaction to encode.
+     * @return Encoded transaction bytes.
+     */
+    function encodeTransaction(
+        Transaction memory _transaction
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodePacked(
+            _transaction.timestamp,
+            _transaction.blockNumber,
+            _transaction.l1QueueOrigin,
+            _transaction.l1TxOrigin,
+            _transaction.entrypoint,
+            _transaction.gasLimit,
+            _transaction.data
+        );
+    }
+ 
+    /**
+     * Hashes a standard OVM transaction.
+     * @param _transaction OVM transaction to encode.
+     * @return Hashed transaction
+     */
+    function hashTransaction(
+        Transaction memory _transaction
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(encodeTransaction(_transaction));
+    }
+ 
+    /**
+     * Converts an OVM account to an EVM account.
+     * @param _in OVM account to convert.
+     * @return Converted EVM account.
+     */
+    function toEVMAccount(
+        Account memory _in
+    )
+        internal
+        pure
+        returns (
+            EVMAccount memory
+        )
+    {
+        return EVMAccount({
+            nonce: _in.nonce,
+            balance: _in.balance,
+            storageRoot: _in.storageRoot,
+            codeHash: _in.codeHash
+        });
+    }
+ 
+    /**
+     * @notice RLP-encodes an account state struct.
+     * @param _account Account state struct.
+     * @return RLP-encoded account state.
+     */
+    function encodeEVMAccount(
+        EVMAccount memory _account
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes[] memory raw = new bytes[](4);
+ 
+        // Unfortunately we can't create this array outright because
+        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning
+        // index-by-index circumvents this issue.
+        raw[0] = Lib_RLPWriter.writeBytes(
+            Lib_Bytes32Utils.removeLeadingZeros(
+                bytes32(_account.nonce)
+            )
+        );
+        raw[1] = Lib_RLPWriter.writeBytes(
+            Lib_Bytes32Utils.removeLeadingZeros(
+                bytes32(_account.balance)
+            )
+        );
+        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));
+        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));
+ 
+        return Lib_RLPWriter.writeList(raw);
+    }
+ 
+    /**
+     * @notice Decodes an RLP-encoded account state into a useful struct.
+     * @param _encoded RLP-encoded account state.
+     * @return Account state struct.
+     */
+    function decodeEVMAccount(
+        bytes memory _encoded
+    )
+        internal
+        pure
+        returns (
+            EVMAccount memory
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);
+ 
+        return EVMAccount({
+            nonce: Lib_RLPReader.readUint256(accountState[0]),
+            balance: Lib_RLPReader.readUint256(accountState[1]),
+            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),
+            codeHash: Lib_RLPReader.readBytes32(accountState[3])
+        });
+    }
+ 
+    /**
+     * Calculates a hash for a given batch header.
+     * @param _batchHeader Header to hash.
+     * @return Hash of the header.
+     */
+    function hashBatchHeader(
+        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return keccak256(
+            abi.encode(
+                _batchHeader.batchRoot,
+                _batchHeader.batchSize,
+                _batchHeader.prevTotalElements,
+                _batchHeader.extraData
+            )
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/codec/index.html b/coverage/optimistic-ethereum/libraries/codec/index.html new file mode 100644 index 000000000..9d8deae87 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/codec/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/libraries/codec/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/codec/ +

+
+
+ 100% + Statements + 33/33 +
+
+ 100% + Branches + 6/6 +
+
+ 100% + Functions + 9/9 +
+
+ 100% + Lines + 33/33 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_OVMCodec.sol
100%33/33100%6/6100%9/9100%33/33
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html b/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html new file mode 100644 index 000000000..39482864f --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html @@ -0,0 +1,272 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/resolver/ Lib_AddressManager.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +390× +390× +  +  +  +  +  +  +  +  +  +2164× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2554× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Contract Imports */
+import { Ownable } from "./Lib_Ownable.sol";
+ 
+/**
+ * @title Lib_AddressManager
+ */
+contract Lib_AddressManager is Ownable {
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event AddressSet(
+        string _name,
+        address _newAddress
+    );
+ 
+    /*******************************************
+     * Contract Variables: Internal Accounting *
+     *******************************************/
+ 
+    mapping (bytes32 => address) private addresses;
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function setAddress(
+        string memory _name,
+        address _address
+    )
+        public
+        onlyOwner
+    {
+        emit AddressSet(_name, _address);
+        addresses[_getNameHash(_name)] = _address;
+    }
+ 
+    function getAddress(
+        string memory _name
+    )
+        public
+        view
+        returns (address)
+    {
+        return addresses[_getNameHash(_name)];
+    }
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function _getNameHash(
+        string memory _name
+    )
+        internal
+        pure
+        returns (
+            bytes32 _hash
+        )
+    {
+        return keccak256(abi.encodePacked(_name));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html b/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html new file mode 100644 index 000000000..648b9c25f --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html @@ -0,0 +1,209 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/resolver/ Lib_AddressResolver.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1062× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2133× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressManager } from "./Lib_AddressManager.sol";
+ 
+/**
+ * @title Lib_AddressResolver
+ */
+abstract contract Lib_AddressResolver {
+ 
+    /*******************************************
+     * Contract Variables: Contract References *
+     *******************************************/
+ 
+    Lib_AddressManager internal libAddressManager;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Lib_AddressManager.
+     */
+    constructor(
+        address _libAddressManager
+    )  {
+        libAddressManager = Lib_AddressManager(_libAddressManager);
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function resolve(
+        string memory _name
+    )
+        public
+        view
+        returns (
+            address _contract
+        )
+    {
+        return libAddressManager.getAddress(_name);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html b/coverage/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html new file mode 100644 index 000000000..b25d23d2e --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html @@ -0,0 +1,293 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/Lib_Ownable.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/resolver/ Lib_Ownable.sol +

+
+
+ 37.5% + Statements + 3/8 +
+
+ 25% + Branches + 1/4 +
+
+ 50% + Functions + 2/4 +
+
+ 44.44% + Lines + 4/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +126× +126× +  +  +  +  +  +  +  +  +390× +  +  +  +390× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Ownable
+ * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
+ */
+abstract contract Ownable {
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+    address public owner;
+ 
+ 
+    /**********
+     * Events *
+     **********/
+ 
+    event OwnershipTransferred(
+        address indexed previousOwner,
+        address indexed newOwner
+    );
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    constructor() {
+        owner = msg.sender;
+        emit OwnershipTransferred(address(0), owner);
+    }
+ 
+ 
+    /**********************
+     * Function Modifiers *
+     **********************/
+ 
+    modifier onlyOwner() {
+        Erequire(
+            owner == msg.sender,
+            "Ownable: caller is not the owner"
+        );
+        _;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    function renounceOwnership()
+        public
+        virtual
+        onlyOwner
+    {
+        emit OwnershipTransferred(owner, address(0));
+        owner = address(0);
+    }
+ 
+    function transferOwnership(address _newOwner)
+        public
+        virtual
+        onlyOwner
+    {
+        require(
+            _newOwner != address(0),
+            "Ownable: new owner cannot be the zero address"
+        );
+ 
+        emit OwnershipTransferred(owner, _newOwner);
+        owner = _newOwner;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html b/coverage/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html new file mode 100644 index 000000000..5d72132f0 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html @@ -0,0 +1,281 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/resolver/ Lib_ResolvedDelegateProxy.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 8/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +36× +36× +  +  +  +  +  +  +  +  +  +  +31× +31× +  +  +  +  +31× +  +31× +22× +  +  +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_AddressManager } from "./Lib_AddressManager.sol";
+ 
+/**
+ * @title Lib_ResolvedDelegateProxy
+ */
+contract Lib_ResolvedDelegateProxy {
+ 
+    /*************
+     * Variables *
+     *************/
+ 
+ 
+    // Using mappings to store fields to avoid overwriting storage slots in the
+    // implementation contract. For example, instead of storing these fields at
+    // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.
+    // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html
+    // NOTE: Do not use this code in your own contract system. 
+    //      There is a known flaw in this contract, and we will remove it from the repository
+    //      in the near future. Due to the very limited way that we are using it, this flaw is
+    //      not an issue in our system. 
+    mapping(address=>string) private implementationName;
+    mapping(address=>Lib_AddressManager) private addressManager;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _libAddressManager Address of the Lib_AddressManager.
+     * @param _implementationName implementationName of the contract to proxy to.
+     */
+    constructor(
+        address _libAddressManager,
+        string memory _implementationName
+    )
+    {
+        addressManager[address(this)] = Lib_AddressManager(_libAddressManager);
+        implementationName[address(this)] = _implementationName;
+    }
+ 
+ 
+    /*********************
+     * Fallback Function *
+     *********************/
+ 
+    fallback()
+        external
+    {
+        address target = addressManager[address(this)].getAddress((implementationName[address(this)]));
+        Erequire(
+            target != address(0),
+            "Target address must be initialized."
+        );
+ 
+        (bool success, bytes memory returndata) = target.delegatecall(msg.data);
+ 
+        if (success == true) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/resolver/index.html b/coverage/optimistic-ethereum/libraries/resolver/index.html new file mode 100644 index 000000000..db7272d11 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/resolver/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for optimistic-ethereum/libraries/resolver/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/resolver/ +

+
+
+ 75% + Statements + 15/20 +
+
+ 50% + Branches + 4/8 +
+
+ 81.82% + Functions + 9/11 +
+
+ 78.26% + Lines + 18/23 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_AddressManager.sol
100%4/4100%0/0100%3/3100%4/4
Lib_AddressResolver.sol
100%2/2100%0/0100%2/2100%2/2
Lib_Ownable.sol
37.5%3/825%1/450%2/444.44%4/9
Lib_ResolvedDelegateProxy.sol
100%6/675%3/4100%2/2100%8/8
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html b/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html new file mode 100644 index 000000000..4e8f16658 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html @@ -0,0 +1,1925 @@ + + + + Code coverage report for optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/rlp/ Lib_RLPReader.sol +

+
+
+ 98.68% + Statements + 75/76 +
+
+ 67.5% + Branches + 27/40 +
+
+ 94.74% + Functions + 18/19 +
+
+ 98.8% + Lines + 82/83 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +512× +512× +  +  +  +512× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +450× +  +  +  +  +  +446× +  +  +  +  +  +  +  +  +446× +  +446× +446× +446× +4230× +  +  +  +  +4230× +  +  +  +  +  +  +  +4230× +  +  +  +  +4230× +4230× +  +  +  +446× +  +  +  +446× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +450× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +651× +  +  +  +  +  +651× +  +  +  +  +651× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +68× +  +  +  +  +68× +  +  +  +  +  +68× +  +  +  +  +68× +68× +68× +  +  +  +  +  +  +  +  +68× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +56× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  + + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +776× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5399× +  +  +  +  +5395× +5395× +5395× +  +  +  +5395× +  +  +33× +  +  +  +4334× +  +4334× +  +  +  +  +4334× +  +  +536× +  +536× +  +  +  +  +536× +536× +  +  +  +  +  +  +  +536× +  +  +  +  +536× +  +  +89× +  +89× +  +  +  +  +89× +  +  +403× +  +403× +  +  +  +  +403× +403× +  +  +  +  +  +  +  +403× +  +  +  +  +403× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1427× +1427× + +  +  +1426× +1426× +1426× +  +  +  +  +1426× +2634× +  +  +  +2634× +2634× +  +  +  +1426× +1426× +  +  +  +  +  +  +  +  +  +1426× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +776× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_RLPReader
+ * @dev Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).
+ */
+library Lib_RLPReader {
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 constant internal MAX_LIST_LENGTH = 32;
+ 
+ 
+    /*********
+     * Enums *
+     *********/
+ 
+    enum RLPItemType {
+        DATA_ITEM,
+        LIST_ITEM
+    }
+ 
+    
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct RLPItem {
+        uint256 length;
+        uint256 ptr;
+    }
+    
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+    
+    /**
+     * Converts bytes to a reference to memory position and length.
+     * @param _in Input bytes to convert.
+     * @return Output memory reference.
+     */
+    function toRLPItem(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem memory
+        )
+    {
+        uint256 ptr;
+        assembly {
+            ptr := add(_in, 32)
+        }
+ 
+        return RLPItem({
+            length: _in.length,
+            ptr: ptr
+        });
+    }
+ 
+    /**
+     * Reads an RLP list value into a list of RLP items.
+     * @param _in RLP list value.
+     * @return Decoded RLP list items.
+     */
+    function readList(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem[] memory
+        )
+    {
+        (
+            uint256 listOffset,
+            ,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.LIST_ITEM,
+            "Invalid RLP list value."
+        );
+ 
+        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by
+        // writing to the length. Since we can't know the number of RLP items without looping over
+        // the entire input, we'd have to loop twice to accurately size this array. It's easier to
+        // simply set a reasonable maximum list length and decrease the size before we finish.
+        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);
+ 
+        uint256 itemCount = 0;
+        uint256 offset = listOffset;
+        while (offset < _in.length) {
+            Erequire(
+                itemCount < MAX_LIST_LENGTH,
+                "Provided RLP list exceeds max list length."
+            );
+ 
+            (
+                uint256 itemOffset,
+                uint256 itemLength,
+            ) = _decodeLength(RLPItem({
+                length: _in.length - offset,
+                ptr: _in.ptr + offset
+            }));
+ 
+            out[itemCount] = RLPItem({
+                length: itemLength + itemOffset,
+                ptr: _in.ptr + offset
+            });
+ 
+            itemCount += 1;
+            offset += itemOffset + itemLength;
+        }
+ 
+        // Decrease the array size to match the actual item count.
+        assembly {
+            mstore(out, itemCount)
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Reads an RLP list value into a list of RLP items.
+     * @param _in RLP list value.
+     * @return Decoded RLP list items.
+     */
+    function readList(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            RLPItem[] memory
+        )
+    {
+        return readList(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bytes value into bytes.
+     * @param _in RLP bytes value.
+     * @return Decoded bytes.
+     */
+    function readBytes(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        (
+            uint256 itemOffset,
+            uint256 itemLength,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.DATA_ITEM,
+            "Invalid RLP bytes value."
+        );
+ 
+        return _copy(_in.ptr, itemOffset, itemLength);
+    }
+ 
+    /**
+     * Reads an RLP bytes value into bytes.
+     * @param _in RLP bytes value.
+     * @return Decoded bytes.
+     */
+    function readBytes(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return readBytes(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP string value into a string.
+     * @param _in RLP string value.
+     * @return Decoded string.
+     */
+    function readString(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            string memory
+        )
+    {
+        return string(readBytes(_in));
+    }
+ 
+    /**
+     * Reads an RLP string value into a string.
+     * @param _in RLP string value.
+     * @return Decoded string.
+     */
+    function readString(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            string memory
+        )
+    {
+        return readString(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bytes32 value into a bytes32.
+     * @param _in RLP bytes32 value.
+     * @return Decoded bytes32.
+     */
+    function readBytes32(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        Erequire(
+            _in.length <= 33,
+            "Invalid RLP bytes32 value."
+        );
+ 
+        (
+            uint256 itemOffset,
+            uint256 itemLength,
+            RLPItemType itemType
+        ) = _decodeLength(_in);
+ 
+        Erequire(
+            itemType == RLPItemType.DATA_ITEM,
+            "Invalid RLP bytes32 value."
+        );
+ 
+        uint256 ptr = _in.ptr + itemOffset;
+        bytes32 out;
+        assembly {
+            out := mload(ptr)
+ 
+            // Shift the bytes over to match the item size.
+            if lt(itemLength, 32) {
+                out := div(out, exp(256, sub(32, itemLength)))
+            }
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Reads an RLP bytes32 value into a bytes32.
+     * @param _in RLP bytes32 value.
+     * @return Decoded bytes32.
+     */
+    function readBytes32(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return readBytes32(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP uint256 value into a uint256.
+     * @param _in RLP uint256 value.
+     * @return Decoded uint256.
+     */
+    function readUint256(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        return uint256(readBytes32(_in));
+    }
+ 
+    /**
+     * Reads an RLP uint256 value into a uint256.
+     * @param _in RLP uint256 value.
+     * @return Decoded uint256.
+     */
+    function readUint256(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        return readUint256(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP bool value into a bool.
+     * @param _in RLP bool value.
+     * @return Decoded bool.
+     */
+    function readBool(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        Erequire(
+            _in.length == 1,
+            "Invalid RLP boolean value."
+        );
+ 
+        uint256 ptr = _in.ptr;
+        uint256 out;
+        assembly {
+            out := byte(0, mload(ptr))
+        }
+ 
+        return out != 0;
+    }
+ 
+    /**
+     * Reads an RLP bool value into a bool.
+     * @param _in RLP bool value.
+     * @return Decoded bool.
+     */
+    function readBool(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        return readBool(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads an RLP address value into a address.
+     * @param _in RLP address value.
+     * @return Decoded address.
+     */
+    function readAddress(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        if (_in.length == 1) {
+            return address(0);
+        }
+ 
+        Erequire(
+            _in.length == 21,
+            "Invalid RLP address value."
+        );
+ 
+        return address(readUint256(_in));
+    }
+ 
+    /**
+     * Reads an RLP address value into a address.
+     * @param _in RLP address value.
+     * @return Decoded address.
+     */
+    function readAddress(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        return readAddress(
+            toRLPItem(_in)
+        );
+    }
+ 
+    /**
+     * Reads the raw bytes of an RLP item.
+     * @param _in RLP item to read.
+     * @return Raw RLP bytes.
+     */
+    function readRawBytes(
+        RLPItem memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return _copy(_in);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Decodes the length of an RLP item.
+     * @param _in RLP item to decode.
+     * @return Offset of the encoded data.
+     * @return Length of the encoded data.
+     * @return RLP item type (LIST_ITEM or DATA_ITEM).
+     */
+    function _decodeLength(
+        RLPItem memory _in
+    )
+        private
+        pure
+        returns (
+            uint256,
+            uint256,
+            RLPItemType
+        )
+    {
+        require(
+            _in.length > 0,
+            "RLP item cannot be null."
+        );
+ 
+        uint256 ptr = _in.ptr;
+        uint256 prefix;
+        assembly {
+            prefix := byte(0, mload(ptr))
+        }
+ 
+        if (prefix <= 0x7f) {
+            // Single byte.
+ 
+            return (0, 1, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xb7) {
+            // Short string.
+ 
+            uint256 strLen = prefix - 0x80;
+            
+            Erequire(
+                _in.length > strLen,
+                "Invalid RLP short string."
+            );
+ 
+            return (1, strLen, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xbf) {
+            // Long string.
+            uint256 lenOfStrLen = prefix - 0xb7;
+ 
+            Erequire(
+                _in.length > lenOfStrLen,
+                "Invalid RLP long string length."
+            );
+ 
+            uint256 strLen;
+            assembly {
+                // Pick out the string length.
+                strLen := div(
+                    mload(add(ptr, 1)),
+                    exp(256, sub(32, lenOfStrLen))
+                )
+            }
+ 
+            Erequire(
+                _in.length > lenOfStrLen + strLen,
+                "Invalid RLP long string."
+            );
+ 
+            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);
+        } else if (prefix <= 0xf7) {
+            // Short list.
+            uint256 listLen = prefix - 0xc0;
+ 
+            Erequire(
+                _in.length > listLen,
+                "Invalid RLP short list."
+            );
+ 
+            return (1, listLen, RLPItemType.LIST_ITEM);
+        } else {
+            // Long list.
+            uint256 lenOfListLen = prefix - 0xf7;
+ 
+            Erequire(
+                _in.length > lenOfListLen,
+                "Invalid RLP long list length."
+            );
+ 
+            uint256 listLen;
+            assembly {
+                // Pick out the list length.
+                listLen := div(
+                    mload(add(ptr, 1)),
+                    exp(256, sub(32, lenOfListLen))
+                )
+            }
+ 
+            Erequire(
+                _in.length > lenOfListLen + listLen,
+                "Invalid RLP long list."
+            );
+ 
+            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);
+        }
+    }
+ 
+    /**
+     * Copies the bytes from a memory location.
+     * @param _src Pointer to the location to read from.
+     * @param _offset Offset to start reading from.
+     * @param _length Number of bytes to read.
+     * @return Copied bytes.
+     */
+    function _copy(
+        uint256 _src,
+        uint256 _offset,
+        uint256 _length
+    )
+        private
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes memory out = new bytes(_length);
+        if (out.length == 0) {
+            return out;
+        }
+ 
+        uint256 src = _src + _offset;
+        uint256 dest;
+        assembly {
+            dest := add(out, 32)
+        }
+ 
+        // Copy over as many complete words as we can.
+        for (uint256 i = 0; i < _length / 32; i++) {
+            assembly {
+                mstore(dest, mload(src))
+            }
+ 
+            src += 32;
+            dest += 32;
+        }
+ 
+        // Pick out the remaining bytes.
+        uint256 mask = 256 ** (32 - (_length % 32)) - 1;
+        assembly {
+            mstore(
+                dest,
+                or(
+                    and(mload(src), not(mask)),
+                    and(mload(dest), mask)
+                )
+            )
+        }
+ 
+        return out;
+    }
+ 
+    /**
+     * Copies an RLP item into bytes.
+     * @param _in RLP item to copy.
+     * @return Copied bytes.
+     */
+    function _copy(
+        RLPItem memory _in
+    )
+        private
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return _copy(_in.ptr, 0, _in.length);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html b/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html new file mode 100644 index 000000000..03e613a85 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html @@ -0,0 +1,911 @@ + + + + Code coverage report for optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/rlp/ Lib_RLPWriter.sol +

+
+
+ 94.55% + Statements + 52/55 +
+
+ 100% + Branches + 8/8 +
+
+ 90% + Functions + 9/10 +
+
+ 95.08% + Lines + 58/61 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +324× +  +324× +16× +  +308× +  +  +324× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +157× +157× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +139× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +30× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +465× +  +465× +415× +415× +  +50× +50× +50× +72× +72× +  +  +50× +50× +50× +72× +  +  +  +465× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +52× +  +52× +52× +1643× +24× +  +  +  +52× +52× +45× +  +  +52× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1030× +1030× +1030× +  +1030× +420× +  +  +420× +420× +  +  +1030× +1030× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +157× + +  +  +149× +149× +149× +1030× +  +  +149× +149× +149× +  +149× +1030× +  +1030× +1030× +  +1030× +1030× +  +  +149× +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+ 
+/**
+ * @title Lib_RLPWriter
+ * @author Bakaoh (with modifications)
+ */
+library Lib_RLPWriter {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * RLP encodes a byte string.
+     * @param _in The byte string to encode.
+     * @return _out The RLP encoded string in bytes.
+     */
+    function writeBytes(
+        bytes memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory encoded;
+ 
+        if (_in.length == 1 && uint8(_in[0]) < 128) {
+            encoded = _in;
+        } else {
+            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);
+        }
+ 
+        return encoded;
+    }
+ 
+    /**
+     * RLP encodes a list of RLP encoded byte byte strings.
+     * @param _in The list of RLP encoded byte strings.
+     * @return _out The RLP encoded list of items in bytes.
+     */
+    function writeList(
+        bytes[] memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory list = _flatten(_in);
+        return abi.encodePacked(_writeLength(list.length, 192), list);
+    }
+ 
+    /**
+     * RLP encodes a string.
+     * @param _in The string to encode.
+     * @return _out The RLP encoded string in bytes.
+     */
+    function writeString(
+        string memory _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(bytes(_in));
+    }
+ 
+    /**
+     * RLP encodes an address.
+     * @param _in The address to encode.
+     * @return _out The RLP encoded address in bytes.
+     */
+    function writeAddress(
+        address _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(abi.encodePacked(_in));
+    }
+ 
+    /**
+     * RLP encodes a uint.
+     * @param _in The uint256 to encode.
+     * @return _out The RLP encoded uint256 in bytes.
+     */
+    function writeUint(
+        uint256 _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return writeBytes(_toBinary(_in));
+    }
+ 
+    /**
+     * RLP encodes a bool.
+     * @param _in The bool to encode.
+     * @return _out The RLP encoded bool in bytes.
+     */
+    function writeBool(
+        bool _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        bytes memory encoded = new bytes(1);
+        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));
+        return encoded;
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.
+     * @param _len The length of the string or the payload.
+     * @param _offset 128 if item is string, 192 if item is list.
+     * @return _encoded RLP encoded bytes.
+     */
+    function _writeLength(
+        uint256 _len,
+        uint256 _offset
+    )
+        private
+        pure
+        returns (
+            bytes memory _encoded
+        )
+    {
+        bytes memory encoded;
+ 
+        if (_len < 56) {
+            encoded = new bytes(1);
+            encoded[0] = byte(uint8(_len) + uint8(_offset));
+        } else {
+            uint256 lenLen;
+            uint256 i = 1;
+            while (_len / i != 0) {
+                lenLen++;
+                i *= 256;
+            }
+ 
+            encoded = new bytes(lenLen + 1);
+            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);
+            for(i = 1; i <= lenLen; i++) {
+                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));
+            }
+        }
+ 
+        return encoded;
+    }
+ 
+    /**
+     * Encode integer in big endian binary form with no leading zeroes.
+     * @notice TODO: This should be optimized with assembly to save gas costs.
+     * @param _x The integer to encode.
+     * @return _binary RLP encoded bytes.
+     */
+    function _toBinary(
+        uint256 _x
+    )
+        private
+        pure
+        returns (
+            bytes memory _binary
+        )
+    {
+        bytes memory b = abi.encodePacked(_x);
+ 
+        uint256 i = 0;
+        for (; i < 32; i++) {
+            if (b[i] != 0) {
+                break;
+            }
+        }
+ 
+        bytes memory res = new bytes(32 - i);
+        for (uint256 j = 0; j < res.length; j++) {
+            res[j] = b[i++];
+        }
+ 
+        return res;
+    }
+ 
+    /**
+     * Copies a piece of memory to another location.
+     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.
+     * @param _dest Destination location.
+     * @param _src Source location.
+     * @param _len Length of memory to copy.
+     */
+    function _memcpy(
+        uint256 _dest,
+        uint256 _src,
+        uint256 _len
+    )
+        private
+        pure
+    {
+        uint256 dest = _dest;
+        uint256 src = _src;
+        uint256 len = _len;
+ 
+        for(; len >= 32; len -= 32) {
+            assembly {
+                mstore(dest, mload(src))
+            }
+            dest += 32;
+            src += 32;
+        }
+ 
+        uint256 mask = 256 ** (32 - len) - 1;
+        assembly {
+            let srcpart := and(mload(src), not(mask))
+            let destpart := and(mload(dest), mask)
+            mstore(dest, or(destpart, srcpart))
+        }
+    }
+ 
+    /**
+     * Flattens a list of byte strings into one byte string.
+     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.
+     * @param _list List of byte strings to flatten.
+     * @return _flattened The flattened byte string.
+     */
+    function _flatten(
+        bytes[] memory _list
+    )
+        private
+        pure
+        returns (
+            bytes memory _flattened
+        )
+    {
+        if (_list.length == 0) {
+            return new bytes(0);
+        }
+ 
+        uint256 len;
+        uint256 i = 0;
+        for (; i < _list.length; i++) {
+            len += _list[i].length;
+        }
+ 
+        bytes memory flattened = new bytes(len);
+        uint256 flattenedPtr;
+        assembly { flattenedPtr := add(flattened, 0x20) }
+ 
+        for(i = 0; i < _list.length; i++) {
+            bytes memory item = _list[i];
+ 
+            uint256 listPtr;
+            assembly { listPtr := add(item, 0x20)}
+ 
+            _memcpy(flattenedPtr, listPtr, item.length);
+            flattenedPtr += _list[i].length;
+        }
+ 
+        return flattened;
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/rlp/index.html b/coverage/optimistic-ethereum/libraries/rlp/index.html new file mode 100644 index 000000000..a6477149e --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/rlp/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/libraries/rlp/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/rlp/ +

+
+
+ 96.95% + Statements + 127/131 +
+
+ 72.92% + Branches + 35/48 +
+
+ 93.1% + Functions + 27/29 +
+
+ 97.22% + Lines + 140/144 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_RLPReader.sol
98.68%75/7667.5%27/4094.74%18/1998.8%82/83
Lib_RLPWriter.sol
94.55%52/55100%8/890%9/1095.08%58/61
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html b/coverage/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html new file mode 100644 index 000000000..c7a07cece --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/standards/ IUniswapV2ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+interface IUniswapV2ERC20 {
+    event Approval(address indexed owner, address indexed spender, uint value);
+    event Transfer(address indexed from, address indexed to, uint value);
+ 
+    function name() external view returns (string memory);
+    function symbol() external view returns (string memory);
+    function decimals() external view returns (uint8);
+    function totalSupply() external view returns (uint);
+    function balanceOf(address owner) external view returns (uint);
+    function allowance(address owner, address spender) external view returns (uint);
+ 
+    function approve(address spender, uint value) external returns (bool);
+    function transfer(address to, uint value) external returns (bool);
+    function transferFrom(address from, address to, uint value) external returns (bool);
+ 
+    function DOMAIN_SEPARATOR() external view returns (bytes32);
+    function PERMIT_TYPEHASH() external pure returns (bytes32);
+    function nonces(address owner) external view returns (uint);
+ 
+    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html b/coverage/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html new file mode 100644 index 000000000..fca77d0f2 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/libraries/standards/UniSafeMath.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/standards/ UniSafeMath.sol +

+
+
+ 66.67% + Statements + 2/3 +
+
+ 33.33% + Branches + 2/6 +
+
+ 66.67% + Functions + 2/3 +
+
+ 66.67% + Lines + 2/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  + +  +  +  +10× +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
+ 
+library UniSafeMath {
+    function add(uint x, uint y) internal pure returns (uint z) {
+        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
+    }
+ 
+    function sub(uint x, uint y) internal pure returns (uint z) {
+        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
+    }
+ 
+    function mul(uint x, uint y) internal pure returns (uint z) {
+        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html b/coverage/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html new file mode 100644 index 000000000..17a1f4209 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html @@ -0,0 +1,359 @@ + + + + Code coverage report for optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/standards/ UniswapV2ERC20.sol +

+
+
+ 82.14% + Statements + 23/28 +
+
+ 16.67% + Branches + 1/6 +
+
+ 88.89% + Functions + 8/9 +
+
+ 82.76% + Lines + 24/29 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +39× +39× +  +39× +39× +  +  +39× +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  + + + +  +  +  + + +  +  +  + + + +  +  +  + + +  +  +  + + +  +  +  + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >=0.5.16 <0.8.0;
+ 
+import './IUniswapV2ERC20.sol';
+import './UniSafeMath.sol';
+ 
+contract UniswapV2ERC20 is IUniswapV2ERC20 {
+    using UniSafeMath for uint;
+ 
+    string public override name;
+    string public override symbol;
+    uint8 public constant override decimals = 18;
+    uint public override totalSupply;
+    mapping(address => uint) public override balanceOf;
+    mapping(address => mapping(address => uint)) public override allowance;
+ 
+    bytes32 public override DOMAIN_SEPARATOR;
+    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
+    bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
+    mapping(address => uint) public override nonces;
+ 
+    constructor(
+    string memory _name,
+        string memory _symbol
+    ) {
+        name = _name;
+        symbol = _symbol;
+ 
+        uint chainId;
+        assembly {
+            chainId := chainid()
+        }
+        DOMAIN_SEPARATOR = keccak256(
+            abi.encode(
+                keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
+                keccak256(bytes(name)),
+                keccak256(bytes('1')),
+                chainId,
+                address(this)
+            )
+        );
+    }
+ 
+    function _mint(address to, uint value) internal {
+        totalSupply = totalSupply.add(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(address(0), to, value);
+    }
+ 
+    function _burn(address from, uint value) internal {
+        balanceOf[from] = balanceOf[from].sub(value);
+        totalSupply = totalSupply.sub(value);
+        emit Transfer(from, address(0), value);
+    }
+ 
+    function _approve(address owner, address spender, uint value) private {
+        allowance[owner][spender] = value;
+        emit Approval(owner, spender, value);
+    }
+ 
+    function _transfer(address from, address to, uint value) private {
+        balanceOf[from] = balanceOf[from].sub(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(from, to, value);
+    }
+ 
+    function approve(address spender, uint value) external override returns (bool) {
+        _approve(msg.sender, spender, value);
+        return true;
+    }
+ 
+    function transfer(address to, uint value) external override returns (bool) {
+        _transfer(msg.sender, to, value);
+        return true;
+    }
+ 
+    function transferFrom(address from, address to, uint value) external override returns (bool) {
+        Eif (allowance[from][msg.sender] != uint(-1)) {
+            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
+        }
+        _transfer(from, to, value);
+        return true;
+    }
+ 
+    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override {
+        require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
+        bytes32 digest = keccak256(
+            abi.encodePacked(
+                '\x19\x01',
+                DOMAIN_SEPARATOR,
+                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
+            )
+        );
+        address recoveredAddress = ecrecover(digest, v, r, s);
+        require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
+        _approve(owner, spender, value);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/standards/index.html b/coverage/optimistic-ethereum/libraries/standards/index.html new file mode 100644 index 000000000..a7881423d --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/standards/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for optimistic-ethereum/libraries/standards/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/standards/ +

+
+
+ 80.65% + Statements + 25/31 +
+
+ 25% + Branches + 3/12 +
+
+ 83.33% + Functions + 10/12 +
+
+ 81.25% + Lines + 26/32 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
IUniswapV2ERC20.sol
100%0/0100%0/0100%0/0100%0/0
UniSafeMath.sol
66.67%2/333.33%2/666.67%2/366.67%2/3
UniswapV2ERC20.sol
82.14%23/2816.67%1/688.89%8/982.76%24/29
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html b/coverage/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html new file mode 100644 index 000000000..873c10410 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html @@ -0,0 +1,2945 @@ + + + + Code coverage report for optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/trie/ Lib_MerkleTrie.sol +

+
+
+ 72.45% + Statements + 142/196 +
+
+ 55.88% + Branches + 38/68 +
+
+ 84.62% + Functions + 22/26 +
+
+ 72.02% + Lines + 139/193 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +22× +22× +22× +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +77× +73× +  +58× +  +58× +  +  +  +  +58× +  +58× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +95× +95× +  +95× +95× +95× +95× +  +  +95× +243× +243× +  +  +  +243× +  +243× +  +95× +  +  +  +  +  +148× +  +  +  +  +  +  +  +  +  +  +  +229× +147× +  +  +  +  +  +147× +147× +147× +147× +147× +  +  +82× +82× +82× +82× +82× +82× +  +82× +80× +  +  +  +  +  +73× +  +  +  +80× +80× +  + +  +  +  +  +  +  +  + + + +  +  + +  +  +  +  +  +  +  +80× +80× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +22× +  +  +  +  +  +22× +22× +  +22× +  +  +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +22× +22× +  +  +22× +  +65× +65× +  +65× +  +  +22× +22× +  +  + + +  +  +  + +  + +  +  +  +  +42× +  +42× +42× +42× +  +  +  +  +65× +  +  +  +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +99× +95× +  +95× +265× +265× +  +  +  +  +  +95× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +148× +  +148× +  +  +  +  +148× +  +  +148× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +172× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +51× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +65× +  +  +65× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +87× +42× +  +45× +45× +  +45× +44× +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +82× +82× +4991× +  +82× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +65× +  +65× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +714× +  +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +22× +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +42× +42× +42× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +23× +23× +23× +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +26× +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  +22× +43× +  +  +  +22× +22× +  +  +22× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
+import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+ 
+/**
+ * @title Lib_MerkleTrie
+ */
+library Lib_MerkleTrie {
+ 
+    /*******************
+     * Data Structures *
+     *******************/
+ 
+    enum NodeType {
+        BranchNode,
+        ExtensionNode,
+        LeafNode
+    }
+ 
+    struct TrieNode {
+        bytes encoded;
+        Lib_RLPReader.RLPItem[] decoded;
+    }
+ 
+ 
+    /**********************
+     * Contract Constants *
+     **********************/
+ 
+    // TREE_RADIX determines the number of elements per branch node.
+    uint256 constant TREE_RADIX = 16;
+    // Branch nodes have TREE_RADIX elements plus an additional `value` slot.
+    uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;
+    // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.
+    uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;
+ 
+    // Prefixes are prepended to the `path` within a leaf or extension node and
+    // allow us to differentiate between the two node types. `ODD` or `EVEN` is
+    // determined by the number of nibbles within the unprefixed `path`. If the
+    // number of nibbles if even, we need to insert an extra padding nibble so
+    // the resulting prefixed `path` has an even number of nibbles.
+    uint8 constant PREFIX_EXTENSION_EVEN = 0;
+    uint8 constant PREFIX_EXTENSION_ODD = 1;
+    uint8 constant PREFIX_LEAF_EVEN = 2;
+    uint8 constant PREFIX_LEAF_ODD = 3;
+ 
+    // Just a utility constant. RLP represents `NULL` as 0x80.
+    bytes1 constant RLP_NULL = bytes1(0x80);
+    bytes constant RLP_NULL_BYTES = hex'80';
+    bytes32 constant internal KECCAK256_RLP_NULL_BYTES = keccak256(RLP_NULL_BYTES);
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Verifies a proof that a given key/value pair is present in the
+     * Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _value Value of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
+     * traditional Merkle trees, this proof is executed top-down and consists
+     * of a list of RLP-encoded nodes that make a path down to the target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
+     */
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        (
+            bool exists,
+            bytes memory value
+        ) = get(_key, _proof, _root);
+ 
+        return (
+            exists && Lib_BytesUtils.equal(_value, value)
+        );
+    }
+ 
+    /**
+     * @notice Verifies a proof that a given key is *not* present in
+     * the Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the key is absent in the trie, `false` otherwise.
+     */
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        (
+            bool exists,
+        ) = get(_key, _proof, _root);
+ 
+        return exists == false;
+    }
+ 
+    /**
+     * @notice Updates a Merkle trie and returns a new root hash.
+     * @param _key Key of the node to update, as a hex string.
+     * @param _value Value of the node to update, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node. If the key exists, we can simply update the value.
+     * Otherwise, we need to modify the trie to handle the new k/v pair.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _updatedRoot Root hash of the newly constructed trie.
+     */
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        // Special case when inserting the very first node.
+        Iif (_root == KECCAK256_RLP_NULL_BYTES) {
+            return getSingleNodeRootHash(_key, _value);
+        }
+ 
+        TrieNode[] memory proof = _parseProof(_proof);
+        (uint256 pathLength, bytes memory keyRemainder, ) = _walkNodePath(proof, _key, _root);
+        TrieNode[] memory newPath = _getNewPath(proof, pathLength, keyRemainder, _value);
+ 
+        return _getUpdatedTrieRoot(newPath, _key);
+    }
+ 
+    /**
+     * @notice Retrieves the value associated with a given key.
+     * @param _key Key to search for, as hex bytes.
+     * @param _proof Merkle trie inclusion proof for the key.
+     * @param _root Known root of the Merkle trie.
+     * @return _exists Whether or not the key exists.
+     * @return _value Value of the key if it exists.
+     */
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _exists,
+            bytes memory _value
+        )
+    {
+        TrieNode[] memory proof = _parseProof(_proof);
+        (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(proof, _key, _root);
+ 
+        bool exists = keyRemainder.length == 0;
+ 
+        Erequire(
+            exists || isFinalNode,
+            "Provided proof is invalid."
+        );
+ 
+        bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes('');
+ 
+        return (
+            exists,
+            value
+        );
+    }
+ 
+    /**
+     * Computes the root hash for a trie with a single node.
+     * @param _key Key for the single node.
+     * @param _value Value for the single node.
+     * @return _updatedRoot Hash of the trie.
+     */
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        return keccak256(_makeLeafNode(
+            Lib_BytesUtils.toNibbles(_key),
+            _value
+        ).encoded);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * @notice Walks through a proof using a provided key.
+     * @param _proof Inclusion proof to walk through.
+     * @param _key Key to use for the walk.
+     * @param _root Known root of the trie.
+     * @return _pathLength Length of the final path
+     * @return _keyRemainder Portion of the key remaining after the walk.
+     * @return _isFinalNode Whether or not we've hit a dead end.
+     */
+    function _walkNodePath(
+        TrieNode[] memory _proof,
+        bytes memory _key,
+        bytes32 _root
+    )
+        private
+        pure
+        returns (
+            uint256 _pathLength,
+            bytes memory _keyRemainder,
+            bool _isFinalNode
+        )
+    {
+        uint256 pathLength = 0;
+        bytes memory key = Lib_BytesUtils.toNibbles(_key);
+ 
+        bytes32 currentNodeID = _root;
+        uint256 currentKeyIndex = 0;
+        uint256 currentKeyIncrement = 0;
+        TrieNode memory currentNode;
+ 
+        // Proof is top-down, so we start at the first element (root).
+        for (uint256 i = 0; i < _proof.length; i++) {
+            currentNode = _proof[i];
+            currentKeyIndex += currentKeyIncrement;
+ 
+            // Keep track of the proof elements we actually need.
+            // It's expensive to resize arrays, so this simply reduces gas costs.
+            pathLength += 1;
+ 
+            if (currentKeyIndex == 0) {
+                // First proof element is always the root node.
+                require(
+                    keccak256(currentNode.encoded) == currentNodeID,
+                    "Invalid root hash"
+                );
+            } else Eif (currentNode.encoded.length >= 32) {
+                // Nodes 32 bytes or larger are hashed inside branch nodes.
+                require(
+                    keccak256(currentNode.encoded) == currentNodeID,
+                    "Invalid large internal hash"
+                );
+            } else {
+                // Nodes smaller than 31 bytes aren't hashed.
+                require(
+                    Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
+                    "Invalid internal node hash"
+                );
+            }
+ 
+            if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {
+                Iif (currentKeyIndex == key.length) {
+                    // We've hit the end of the key, meaning the value should be within this branch node.
+                    break;
+                } else {
+                    // We're not at the end of the key yet.
+                    // Figure out what the next node ID should be and continue.
+                    uint8 branchKey = uint8(key[currentKeyIndex]);
+                    Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
+                    currentNodeID = _getNodeID(nextNode);
+                    currentKeyIncrement = 1;
+                    continue;
+                }
+            } else Eif (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
+                bytes memory path = _getNodePath(currentNode);
+                uint8 prefix = uint8(path[0]);
+                uint8 offset = 2 - prefix % 2;
+                bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);
+                bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);
+                uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
+ 
+                if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
+                    if (
+                        pathRemainder.length == sharedNibbleLength &&
+                        keyRemainder.length == sharedNibbleLength
+                    ) {
+                        // The key within this leaf matches our key exactly.
+                        // Increment the key index to reflect that we have no remainder.
+                        currentKeyIndex += sharedNibbleLength;
+                    }
+ 
+                    // We've hit a leaf node, so our next node should be NULL.
+                    currentNodeID = bytes32(RLP_NULL);
+                    break;
+                } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
+                    Iif (sharedNibbleLength == 0) {
+                        // Our extension node doesn't share any part of our key.
+                        // We've hit the end of this path, updates will need to modify this extension.
+                        currentNodeID = bytes32(RLP_NULL);
+                        break;
+                    } else {
+                        // Our extension shares some nibbles.
+                        // Carry on to the next node.
+                        currentNodeID = _getNodeID(currentNode.decoded[1]);
+                        currentKeyIncrement = sharedNibbleLength;
+                        continue;
+                    }
+                } else {
+                    revert("Received a node with an unknown prefix");
+                }
+            } else {
+                revert("Received an unparseable node.");
+            }
+        }
+ 
+        // If our node ID is NULL, then we're at a dead end.
+        bool isFinalNode = currentNodeID == bytes32(RLP_NULL);
+        return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);
+    }
+ 
+    /**
+     * @notice Creates new nodes to support a k/v pair insertion into a given
+     * Merkle trie path.
+     * @param _path Path to the node nearest the k/v pair.
+     * @param _pathLength Length of the path. Necessary because the provided
+     * path may include additional nodes (e.g., it comes directly from a proof)
+     * and we can't resize in-memory arrays without costly duplication.
+     * @param _keyRemainder Portion of the initial key that must be inserted
+     * into the trie.
+     * @param _value Value to insert at the given key.
+     * @return _newPath A new path with the inserted k/v pair and extra supporting nodes.
+     */
+    function _getNewPath(
+        TrieNode[] memory _path,
+        uint256 _pathLength,
+        bytes memory _keyRemainder,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _newPath
+        )
+    {
+        bytes memory keyRemainder = _keyRemainder;
+ 
+        // Most of our logic depends on the status of the last node in the path.
+        TrieNode memory lastNode = _path[_pathLength - 1];
+        NodeType lastNodeType = _getNodeType(lastNode);
+ 
+        // Create an array for newly created nodes.
+        // We need up to three new nodes, depending on the contents of the last node.
+        // Since array resizing is expensive, we'll keep track of the size manually.
+        // We're using an explicit `totalNewNodes += 1` after insertions for clarity.
+        TrieNode[] memory newNodes = new TrieNode[](3);
+        uint256 totalNewNodes = 0;
+ 
+        Eif (keyRemainder.length == 0 && lastNodeType == NodeType.LeafNode) {
+            // We've found a leaf node with the given key.
+            // Simply need to update the value of the node to match.
+            newNodes[totalNewNodes] = _makeLeafNode(_getNodeKey(lastNode), _value);
+            totalNewNodes += 1;
+        } else if (lastNodeType == NodeType.BranchNode) {
+            if (keyRemainder.length == 0) {
+                // We've found a branch node with the given key.
+                // Simply need to update the value of the node to match.
+                newNodes[totalNewNodes] = _editBranchValue(lastNode, _value);
+                totalNewNodes += 1;
+            } else {
+                // We've found a branch node, but it doesn't contain our key.
+                // Reinsert the old branch for now.
+                newNodes[totalNewNodes] = lastNode;
+                totalNewNodes += 1;
+                // Create a new leaf node, slicing our remainder since the first byte points
+                // to our branch node.
+                newNodes[totalNewNodes] = _makeLeafNode(Lib_BytesUtils.slice(keyRemainder, 1), _value);
+                totalNewNodes += 1;
+            }
+        } else {
+            // Our last node is either an extension node or a leaf node with a different key.
+            bytes memory lastNodeKey = _getNodeKey(lastNode);
+            uint256 sharedNibbleLength = _getSharedNibbleLength(lastNodeKey, keyRemainder);
+ 
+            if (sharedNibbleLength != 0) {
+                // We've got some shared nibbles between the last node and our key remainder.
+                // We'll need to insert an extension node that covers these shared nibbles.
+                bytes memory nextNodeKey = Lib_BytesUtils.slice(lastNodeKey, 0, sharedNibbleLength);
+                newNodes[totalNewNodes] = _makeExtensionNode(nextNodeKey, _getNodeHash(_value));
+                totalNewNodes += 1;
+ 
+                // Cut down the keys since we've just covered these shared nibbles.
+                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, sharedNibbleLength);
+                keyRemainder = Lib_BytesUtils.slice(keyRemainder, sharedNibbleLength);
+            }
+ 
+            // Create an empty branch to fill in.
+            TrieNode memory newBranch = _makeEmptyBranchNode();
+ 
+            if (lastNodeKey.length == 0) {
+                // Key remainder was larger than the key for our last node.
+                // The value within our last node is therefore going to be shifted into
+                // a branch value slot.
+                newBranch = _editBranchValue(newBranch, _getNodeValue(lastNode));
+            } else {
+                // Last node key was larger than the key remainder.
+                // We're going to modify some index of our branch.
+                uint8 branchKey = uint8(lastNodeKey[0]);
+                // Move on to the next nibble.
+                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, 1);
+ 
+                if (lastNodeType == NodeType.LeafNode) {
+                    // We're dealing with a leaf node.
+                    // We'll modify the key and insert the old leaf node into the branch index.
+                    TrieNode memory modifiedLastNode = _makeLeafNode(lastNodeKey, _getNodeValue(lastNode));
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
+                } else if (lastNodeKey.length != 0) {
+                    // We're dealing with a shrinking extension node.
+                    // We need to modify the node to decrease the size of the key.
+                    TrieNode memory modifiedLastNode = _makeExtensionNode(lastNodeKey, _getNodeValue(lastNode));
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
+                } else {
+                    // We're dealing with an unnecessary extension node.
+                    // We're going to delete the node entirely.
+                    // Simply insert its current value into the branch index.
+                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeValue(lastNode));
+                }
+            }
+ 
+            if (keyRemainder.length == 0) {
+                // We've got nothing left in the key remainder.
+                // Simply insert the value into the branch value slot.
+                newBranch = _editBranchValue(newBranch, _value);
+                // Push the branch into the list of new nodes.
+                newNodes[totalNewNodes] = newBranch;
+                totalNewNodes += 1;
+            } else {
+                // We've got some key remainder to work with.
+                // We'll be inserting a leaf node into the trie.
+                // First, move on to the next nibble.
+                keyRemainder = Lib_BytesUtils.slice(keyRemainder, 1);
+                // Push the branch into the list of new nodes.
+                newNodes[totalNewNodes] = newBranch;
+                totalNewNodes += 1;
+                // Push a new leaf node for our k/v pair.
+                newNodes[totalNewNodes] = _makeLeafNode(keyRemainder, _value);
+                totalNewNodes += 1;
+            }
+        }
+ 
+        // Finally, join the old path with our newly created nodes.
+        // Since we're overwriting the last node in the path, we use `_pathLength - 1`.
+        return _joinNodeArrays(_path, _pathLength - 1, newNodes, totalNewNodes);
+    }
+ 
+    /**
+     * @notice Computes the trie root from a given path.
+     * @param _nodes Path to some k/v pair.
+     * @param _key Key for the k/v pair.
+     * @return _updatedRoot Root hash for the updated trie.
+     */
+    function _getUpdatedTrieRoot(
+        TrieNode[] memory _nodes,
+        bytes memory _key
+    )
+        private
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = Lib_BytesUtils.toNibbles(_key);
+ 
+        // Some variables to keep track of during iteration.
+        TrieNode memory currentNode;
+        NodeType currentNodeType;
+        bytes memory previousNodeHash;
+ 
+        // Run through the path backwards to rebuild our root hash.
+        for (uint256 i = _nodes.length; i > 0; i--) {
+            // Pick out the current node.
+            currentNode = _nodes[i - 1];
+            currentNodeType = _getNodeType(currentNode);
+ 
+            if (currentNodeType == NodeType.LeafNode) {
+                // Leaf nodes are already correctly encoded.
+                // Shift the key over to account for the nodes key.
+                bytes memory nodeKey = _getNodeKey(currentNode);
+                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
+            } else if (currentNodeType == NodeType.ExtensionNode) {
+                // Shift the key over to account for the nodes key.
+                bytes memory nodeKey = _getNodeKey(currentNode);
+                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
+ 
+                // If this node is the last element in the path, it'll be correctly encoded
+                // and we can skip this part.
+                Eif (previousNodeHash.length > 0) {
+                    // Re-encode the node based on the previous node.
+                    currentNode = _makeExtensionNode(nodeKey, previousNodeHash);
+                }
+            } else Eif (currentNodeType == NodeType.BranchNode) {
+                // If this node is the last element in the path, it'll be correctly encoded
+                // and we can skip this part.
+                Eif (previousNodeHash.length > 0) {
+                    // Re-encode the node based on the previous node.
+                    uint8 branchKey = uint8(key[key.length - 1]);
+                    key = Lib_BytesUtils.slice(key, 0, key.length - 1);
+                    currentNode = _editBranchIndex(currentNode, branchKey, previousNodeHash);
+                }
+            }
+ 
+            // Compute the node hash for the next iteration.
+            previousNodeHash = _getNodeHash(currentNode.encoded);
+        }
+ 
+        // Current node should be the root at this point.
+        // Simply return the hash of its encoding.
+        return keccak256(currentNode.encoded);
+    }
+ 
+    /**
+     * @notice Parses an RLP-encoded proof into something more useful.
+     * @param _proof RLP-encoded proof to parse.
+     * @return _parsed Proof parsed into easily accessible structs.
+     */
+    function _parseProof(
+        bytes memory _proof
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _parsed
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);
+        TrieNode[] memory proof = new TrieNode[](nodes.length);
+ 
+        for (uint256 i = 0; i < nodes.length; i++) {
+            bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);
+            proof[i] = TrieNode({
+                encoded: encoded,
+                decoded: Lib_RLPReader.readList(encoded)
+            });
+        }
+ 
+        return proof;
+    }
+ 
+    /**
+     * @notice Picks out the ID for a node. Node ID is referred to as the
+     * "hash" within the specification, but nodes < 32 bytes are not actually
+     * hashed.
+     * @param _node Node to pull an ID for.
+     * @return _nodeID ID for the node, depending on the size of its contents.
+     */
+    function _getNodeID(
+        Lib_RLPReader.RLPItem memory _node
+    )
+        private
+        pure
+        returns (
+            bytes32 _nodeID
+        )
+    {
+        bytes memory nodeID;
+ 
+        Iif (_node.length < 32) {
+            // Nodes smaller than 32 bytes are RLP encoded.
+            nodeID = Lib_RLPReader.readRawBytes(_node);
+        } else {
+            // Nodes 32 bytes or larger are hashed.
+            nodeID = Lib_RLPReader.readBytes(_node);
+        }
+ 
+        return Lib_BytesUtils.toBytes32(nodeID);
+    }
+ 
+    /**
+     * @notice Gets the path for a leaf or extension node.
+     * @param _node Node to get a path for.
+     * @return _path Node path, converted to an array of nibbles.
+     */
+    function _getNodePath(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _path
+        )
+    {
+        return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));
+    }
+ 
+    /**
+     * @notice Gets the key for a leaf or extension node. Keys are essentially
+     * just paths without any prefix.
+     * @param _node Node to get a key for.
+     * @return _key Node key, converted to an array of nibbles.
+     */
+    function _getNodeKey(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _key
+        )
+    {
+        return _removeHexPrefix(_getNodePath(_node));
+    }
+ 
+    /**
+     * @notice Gets the path for a node.
+     * @param _node Node to get a value for.
+     * @return _value Node value, as hex bytes.
+     */
+    function _getNodeValue(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            bytes memory _value
+        )
+    {
+        return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
+    }
+ 
+    /**
+     * @notice Computes the node hash for an encoded node. Nodes < 32 bytes
+     * are not hashed, all others are keccak256 hashed.
+     * @param _encoded Encoded node to hash.
+     * @return _hash Hash of the encoded node. Simply the input if < 32 bytes.
+     */
+    function _getNodeHash(
+        bytes memory _encoded
+    )
+        private
+        pure
+        returns (
+            bytes memory _hash
+        )
+    {
+        Iif (_encoded.length < 32) {
+            return _encoded;
+        } else {
+            return abi.encodePacked(keccak256(_encoded));
+        }
+    }
+ 
+    /**
+     * @notice Determines the type for a given node.
+     * @param _node Node to determine a type for.
+     * @return _type Type of the node; BranchNode/ExtensionNode/LeafNode.
+     */
+    function _getNodeType(
+        TrieNode memory _node
+    )
+        private
+        pure
+        returns (
+            NodeType _type
+        )
+    {
+        if (_node.decoded.length == BRANCH_NODE_LENGTH) {
+            return NodeType.BranchNode;
+        } else Eif (_node.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
+            bytes memory path = _getNodePath(_node);
+            uint8 prefix = uint8(path[0]);
+ 
+            if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
+                return NodeType.LeafNode;
+            } else Eif (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
+                return NodeType.ExtensionNode;
+            }
+        }
+ 
+        revert("Invalid node type");
+    }
+ 
+    /**
+     * @notice Utility; determines the number of nibbles shared between two
+     * nibble arrays.
+     * @param _a First nibble array.
+     * @param _b Second nibble array.
+     * @return _shared Number of shared nibbles.
+     */
+    function _getSharedNibbleLength(
+        bytes memory _a,
+        bytes memory _b
+    )
+        private
+        pure
+        returns (
+            uint256 _shared
+        )
+    {
+        uint256 i = 0;
+        while (_a.length > i && _b.length > i && _a[i] == _b[i]) {
+            i++;
+        }
+        return i;
+    }
+ 
+    /**
+     * @notice Utility; converts an RLP-encoded node into our nice struct.
+     * @param _raw RLP-encoded node to convert.
+     * @return _node Node as a TrieNode struct.
+     */
+    function _makeNode(
+        bytes[] memory _raw
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes memory encoded = Lib_RLPWriter.writeList(_raw);
+ 
+        return TrieNode({
+            encoded: encoded,
+            decoded: Lib_RLPReader.readList(encoded)
+        });
+    }
+ 
+    /**
+     * @notice Utility; converts an RLP-decoded node into our nice struct.
+     * @param _items RLP-decoded node to convert.
+     * @return _node Node as a TrieNode struct.
+     */
+    function _makeNode(
+        Lib_RLPReader.RLPItem[] memory _items
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](_items.length);
+        for (uint256 i = 0; i < _items.length; i++) {
+            raw[i] = Lib_RLPReader.readRawBytes(_items[i]);
+        }
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates a new extension node.
+     * @param _key Key for the extension node, unprefixed.
+     * @param _value Value for the extension node.
+     * @return _node New extension node with the given k/v pair.
+     */
+    function _makeExtensionNode(
+        bytes memory _key,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](2);
+        bytes memory key = _addHexPrefix(_key, false);
+        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
+        raw[1] = Lib_RLPWriter.writeBytes(_value);
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates a new leaf node.
+     * @dev This function is essentially identical to `_makeExtensionNode`.
+     * Although we could route both to a single method with a flag, it's
+     * more gas efficient to keep them separate and duplicate the logic.
+     * @param _key Key for the leaf node, unprefixed.
+     * @param _value Value for the leaf node.
+     * @return _node New leaf node with the given k/v pair.
+     */
+    function _makeLeafNode(
+        bytes memory _key,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](2);
+        bytes memory key = _addHexPrefix(_key, true);
+        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
+        raw[1] = Lib_RLPWriter.writeBytes(_value);
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Creates an empty branch node.
+     * @return _node Empty branch node as a TrieNode struct.
+     */
+    function _makeEmptyBranchNode()
+        private
+        pure
+        returns (
+            TrieNode memory _node
+        )
+    {
+        bytes[] memory raw = new bytes[](BRANCH_NODE_LENGTH);
+        for (uint256 i = 0; i < raw.length; i++) {
+            raw[i] = RLP_NULL_BYTES;
+        }
+        return _makeNode(raw);
+    }
+ 
+    /**
+     * @notice Modifies the value slot for a given branch.
+     * @param _branch Branch node to modify.
+     * @param _value Value to insert into the branch.
+     * @return _updatedNode Modified branch node.
+     */
+    function _editBranchValue(
+        TrieNode memory _branch,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _updatedNode
+        )
+    {
+        bytes memory encoded = Lib_RLPWriter.writeBytes(_value);
+        _branch.decoded[_branch.decoded.length - 1] = Lib_RLPReader.toRLPItem(encoded);
+        return _makeNode(_branch.decoded);
+    }
+ 
+    /**
+     * @notice Modifies a slot at an index for a given branch.
+     * @param _branch Branch node to modify.
+     * @param _index Slot index to modify.
+     * @param _value Value to insert into the slot.
+     * @return _updatedNode Modified branch node.
+     */
+    function _editBranchIndex(
+        TrieNode memory _branch,
+        uint8 _index,
+        bytes memory _value
+    )
+        private
+        pure
+        returns (
+            TrieNode memory _updatedNode
+        )
+    {
+        bytes memory encoded = _value.length < 32 ? _value : Lib_RLPWriter.writeBytes(_value);
+        _branch.decoded[_index] = Lib_RLPReader.toRLPItem(encoded);
+        return _makeNode(_branch.decoded);
+    }
+ 
+    /**
+     * @notice Utility; adds a prefix to a key.
+     * @param _key Key to prefix.
+     * @param _isLeaf Whether or not the key belongs to a leaf.
+     * @return _prefixedKey Prefixed key.
+     */
+    function _addHexPrefix(
+        bytes memory _key,
+        bool _isLeaf
+    )
+        private
+        pure
+        returns (
+            bytes memory _prefixedKey
+        )
+    {
+        uint8 prefix = _isLeaf ? uint8(0x02) : uint8(0x00);
+        uint8 offset = uint8(_key.length % 2);
+        bytes memory prefixed = new bytes(2 - offset);
+        prefixed[0] = bytes1(prefix + offset);
+        return abi.encodePacked(prefixed, _key);
+    }
+ 
+    /**
+     * @notice Utility; removes a prefix from a path.
+     * @param _path Path to remove the prefix from.
+     * @return _unprefixedKey Unprefixed key.
+     */
+    function _removeHexPrefix(
+        bytes memory _path
+    )
+        private
+        pure
+        returns (
+            bytes memory _unprefixedKey
+        )
+    {
+        if (uint8(_path[0]) % 2 == 0) {
+            return Lib_BytesUtils.slice(_path, 2);
+        } else {
+            return Lib_BytesUtils.slice(_path, 1);
+        }
+    }
+ 
+    /**
+     * @notice Utility; combines two node arrays. Array lengths are required
+     * because the actual lengths may be longer than the filled lengths.
+     * Array resizing is extremely costly and should be avoided.
+     * @param _a First array to join.
+     * @param _aLength Length of the first array.
+     * @param _b Second array to join.
+     * @param _bLength Length of the second array.
+     * @return _joined Combined node array.
+     */
+    function _joinNodeArrays(
+        TrieNode[] memory _a,
+        uint256 _aLength,
+        TrieNode[] memory _b,
+        uint256 _bLength
+    )
+        private
+        pure
+        returns (
+            TrieNode[] memory _joined
+        )
+    {
+        TrieNode[] memory ret = new TrieNode[](_aLength + _bLength);
+ 
+        // Copy elements from the first array.
+        for (uint256 i = 0; i < _aLength; i++) {
+            ret[i] = _a[i];
+        }
+ 
+        // Copy elements from the second array.
+        for (uint256 i = 0; i < _bLength; i++) {
+            ret[i + _aLength] = _b[i];
+        }
+ 
+        return ret;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html b/coverage/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html new file mode 100644 index 000000000..1e999e7d4 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html @@ -0,0 +1,548 @@ + + + + Code coverage report for optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/trie/ Lib_SecureMerkleTrie.sol +

+
+
+ 63.64% + Statements + 7/11 +
+
+ 100% + Branches + 0/0 +
+
+ 66.67% + Functions + 4/6 +
+
+ 63.64% + Lines + 7/11 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +47× +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_MerkleTrie } from "./Lib_MerkleTrie.sol";
+ 
+/**
+ * @title Lib_SecureMerkleTrie
+ */
+library Lib_SecureMerkleTrie {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * @notice Verifies a proof that a given key/value pair is present in the
+     * Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _value Value of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
+     * traditional Merkle trees, this proof is executed top-down and consists
+     * of a list of RLP-encoded nodes that make a path down to the target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
+     */
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
+    }
+ 
+    /**
+     * @notice Verifies a proof that a given key is *not* present in
+     * the Merkle trie.
+     * @param _key Key of the node to search for, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _verified `true` if the key is not present in the trie, `false` otherwise.
+     */
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _verified
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.verifyExclusionProof(key, _proof, _root);
+    }
+ 
+    /**
+     * @notice Updates a Merkle trie and returns a new root hash.
+     * @param _key Key of the node to update, as a hex string.
+     * @param _value Value of the node to update, as a hex string.
+     * @param _proof Merkle trie inclusion proof for the node *nearest* the
+     * target node. If the key exists, we can simply update the value.
+     * Otherwise, we need to modify the trie to handle the new k/v pair.
+     * @param _root Known root of the Merkle trie. Used to verify that the
+     * included proof is correctly constructed.
+     * @return _updatedRoot Root hash of the newly constructed trie.
+     */
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.update(key, _value, _proof, _root);
+    }
+ 
+    /**
+     * @notice Retrieves the value associated with a given key.
+     * @param _key Key to search for, as hex bytes.
+     * @param _proof Merkle trie inclusion proof for the key.
+     * @param _root Known root of the Merkle trie.
+     * @return _exists Whether or not the key exists.
+     * @return _value Value of the key if it exists.
+     */
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        internal
+        pure
+        returns (
+            bool _exists,
+            bytes memory _value
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.get(key, _proof, _root);
+    }
+ 
+    /**
+     * Computes the root hash for a trie with a single node.
+     * @param _key Key for the single node.
+     * @param _value Value for the single node.
+     * @return _updatedRoot Hash of the trie.
+     */
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        internal
+        pure
+        returns (
+            bytes32 _updatedRoot
+        )
+    {
+        bytes memory key = _getSecureKey(_key);
+        return Lib_MerkleTrie.getSingleNodeRootHash(key, _value);
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Computes the secure counterpart to a key.
+     * @param _key Key to get a secure key from.
+     * @return _secureKey Secure version of the key.
+     */
+    function _getSecureKey(
+        bytes memory _key
+    )
+        private
+        pure
+        returns (
+            bytes memory _secureKey
+        )
+    {
+        return abi.encodePacked(keccak256(_key));
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/trie/index.html b/coverage/optimistic-ethereum/libraries/trie/index.html new file mode 100644 index 000000000..8aa2158f9 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/trie/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/libraries/trie/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/trie/ +

+
+
+ 71.98% + Statements + 149/207 +
+
+ 55.88% + Branches + 38/68 +
+
+ 81.25% + Functions + 26/32 +
+
+ 71.57% + Lines + 146/204 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_MerkleTrie.sol
72.45%142/19655.88%38/6884.62%22/2672.02%139/193
Lib_SecureMerkleTrie.sol
63.64%7/11100%0/066.67%4/663.64%7/11
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html new file mode 100644 index 000000000..2faa1790a --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html @@ -0,0 +1,416 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_Bytes32Utils.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +40× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_Byte32Utils
+ */
+library Lib_Bytes32Utils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to "true."
+     * @param _in Input bytes32 value.
+     * @return Bytes32 as a boolean.
+     */
+    function toBool(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        return _in != 0;
+    }
+ 
+    /**
+     * Converts a boolean to a bytes32 value.
+     * @param _in Input boolean value.
+     * @return Boolean as a bytes32.
+     */
+    function fromBool(
+        bool _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return bytes32(uint256(_in ? 1 : 0));
+    }
+ 
+    /**
+     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.
+     * @param _in Input bytes32 value.
+     * @return Bytes32 as an address.
+     */
+    function toAddress(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            address
+        )
+    {
+        return address(uint160(uint256(_in)));
+    }
+ 
+    /**
+     * Converts an address to a bytes32.
+     * @param _in Input address value.
+     * @return Address as a bytes32.
+     */
+    function fromAddress(
+        address _in
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return bytes32(uint256(_in));
+    }
+ 
+    /**
+     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.
+     * @param _in Input bytes32 value.
+     * @return Bytes32 without any leading zeros.
+     */
+    function removeLeadingZeros(
+        bytes32 _in
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        bytes memory out;
+ 
+        assembly {
+            // Figure out how many leading zero bytes to remove.
+            let shift := 0
+            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {
+                shift := add(shift, 1)
+            }
+ 
+            // Reserve some space for our output and fix the free memory pointer.
+            out := mload(0x40)
+            mstore(0x40, add(out, 0x40))
+ 
+            // Shift the value and store it into the output bytes.
+            mstore(add(out, 0x20), shl(mul(shift, 8), _in))
+ 
+            // Store the new size (with leading zero bytes removed) in the output byte size.
+            mstore(out, sub(32, shift))
+        }
+ 
+        return out;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html new file mode 100644 index 000000000..b1d79bba0 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html @@ -0,0 +1,728 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_BytesUtils.sol +

+
+
+ 100% + Statements + 38/38 +
+
+ 63.64% + Branches + 14/22 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 44/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +311× +311× +311× +  +308× +  +308× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +308× +  +  +  +  +  +  +  +  +  +  +299× +73× +  +  +226× +  +  +  +  +  +  +  +  +  + + + +  +  + +  +  +  +  +  +  +  +  +  +164× + + +  +  + +  +  +162× +  +  +  +  +  +  +  +  +  + +  +  +  +15× +15× +15× +  +15× +  +  +  +15× +  +  +  +12× +12× +12× +  +12× +  +  +  +12× +  +  +  + + + +  + +  +  +  + +  +  +  +  +  +  +  +  +  +292× +  +292× +9144× +9144× +  +  +292× +  +  +  +  +  +  +  +  +  +26× +  +26× +708× +  +  +26× +  +  +  +  +  +  +  +  +  +  +26× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_BytesUtils
+ */
+library Lib_BytesUtils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start,
+        uint256 _length
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        Erequire(_length + 31 >= _length, "slice_overflow");
+        Erequire(_start + _length >= _start, "slice_overflow");
+        require(_bytes.length >= _start + _length, "slice_outOfBounds");
+ 
+        bytes memory tempBytes;
+ 
+        assembly {
+            switch iszero(_length)
+            case 0 {
+                // Get a location of some free memory and store it in tempBytes as
+                // Solidity does for memory variables.
+                tempBytes := mload(0x40)
+ 
+                // The first word of the slice result is potentially a partial
+                // word read from the original array. To read it, we calculate
+                // the length of that partial word and start copying that many
+                // bytes into the array. The first word we copy will start with
+                // data we don't care about, but the last `lengthmod` bytes will
+                // land at the beginning of the contents of the new array. When
+                // we're done copying, we overwrite the full first word with
+                // the actual length of the slice.
+                let lengthmod := and(_length, 31)
+ 
+                // The multiplication in the next line is necessary
+                // because when slicing multiples of 32 bytes (lengthmod == 0)
+                // the following copy loop was copying the origin's length
+                // and then ending prematurely not copying everything it should.
+                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
+                let end := add(mc, _length)
+ 
+                for {
+                    // The multiplication in the next line has the same exact purpose
+                    // as the one above.
+                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
+                } lt(mc, end) {
+                    mc := add(mc, 0x20)
+                    cc := add(cc, 0x20)
+                } {
+                    mstore(mc, mload(cc))
+                }
+ 
+                mstore(tempBytes, _length)
+ 
+                //update free-memory pointer
+                //allocating the array padded to 32 bytes like the compiler does now
+                mstore(0x40, and(add(mc, 31), not(31)))
+            }
+            //if we want a zero-length slice let's just return a zero-length array
+            default {
+                tempBytes := mload(0x40)
+ 
+                //zero out the 32 bytes slice we are about to return
+                //we need to do it because Solidity does not garbage collect
+                mstore(tempBytes, 0)
+ 
+                mstore(0x40, add(tempBytes, 0x20))
+            }
+        }
+ 
+        return tempBytes;
+    }
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        if (_bytes.length - _start == 0) {
+            return bytes('');
+        }
+ 
+        return slice(_bytes, _start, _bytes.length - _start);
+    }
+ 
+    function toBytes32PadLeft(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes32)
+    {
+        bytes32 ret;
+        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;
+        assembly {
+            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))
+        }
+        return ret;
+    }
+ 
+    function toBytes32(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes32)
+    {
+        if (_bytes.length < 32) {
+            bytes32 ret;
+            assembly {
+                ret := mload(add(_bytes, 32))
+            }
+            return ret;
+        }
+ 
+        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes
+    }
+ 
+    function toUint256(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (uint256)
+    {
+        return uint256(toBytes32(_bytes));
+    }
+ 
+    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
+        Erequire(_start + 3 >= _start, "toUint24_overflow");
+        Erequire(_bytes.length >= _start + 3 , "toUint24_outOfBounds");
+        uint24 tempUint;
+ 
+        assembly {
+            tempUint := mload(add(add(_bytes, 0x3), _start))
+        }
+ 
+        return tempUint;
+    }
+ 
+    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
+        Erequire(_start + 1 >= _start, "toUint8_overflow");
+        Erequire(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
+        uint8 tempUint;
+ 
+        assembly {
+            tempUint := mload(add(add(_bytes, 0x1), _start))
+        }
+ 
+        return tempUint;
+    }
+ 
+    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
+        Erequire(_start + 20 >= _start, "toAddress_overflow");
+        Erequire(_bytes.length >= _start + 20, "toAddress_outOfBounds");
+        address tempAddress;
+ 
+        assembly {
+            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
+        }
+ 
+        return tempAddress;
+    }
+ 
+    function toNibbles(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        bytes memory nibbles = new bytes(_bytes.length * 2);
+ 
+        for (uint256 i = 0; i < _bytes.length; i++) {
+            nibbles[i * 2] = _bytes[i] >> 4;
+            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);
+        }
+ 
+        return nibbles;
+    }
+ 
+    function fromNibbles(
+        bytes memory _bytes
+    )
+        internal
+        pure
+        returns (bytes memory)
+    {
+        bytes memory ret = new bytes(_bytes.length / 2);
+ 
+        for (uint256 i = 0; i < ret.length; i++) {
+            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);
+        }
+ 
+        return ret;
+    }
+ 
+    function equal(
+        bytes memory _bytes,
+        bytes memory _other
+    )
+        internal
+        pure
+        returns (bool)
+    {
+        return keccak256(_bytes) == keccak256(_other);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html new file mode 100644 index 000000000..8e0c02eee --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html @@ -0,0 +1,356 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_ECDSAUtils.sol +

+
+
+ 100% + Statements + 9/9 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× + +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_ECDSAUtils
+ */
+library Lib_ECDSAUtils {
+ 
+    /**************************************
+     * Internal Functions: ECDSA Recovery *
+     **************************************/
+ 
+    /**
+     * Recovers a signed address given a message and signature.
+     * @param _message Message that was originally signed.
+     * @param _isEthSignedMessage Whether or not the user used the `Ethereum Signed Message` prefix.
+     * @param _v Signature `v` parameter.
+     * @param _r Signature `r` parameter.
+     * @param _s Signature `s` parameter.
+     * @return _sender Signer address.
+     */
+    function recover(
+        bytes memory _message,
+        bool _isEthSignedMessage,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        internal
+        pure
+        returns (
+            address _sender
+        )
+    {
+        bytes32 messageHash = getMessageHash(_message, _isEthSignedMessage);
+ 
+        return ecrecover(
+            messageHash,
+            _v + 27,
+            _r,
+            _s
+        );
+    }
+ 
+    function getMessageHash(
+        bytes memory _message,
+        bool _isEthSignedMessage
+    )
+        internal
+        pure
+        returns (bytes32) {
+        if (_isEthSignedMessage) {
+            return getEthSignedMessageHash(_message);
+        }
+        return getNativeMessageHash(_message);
+    }
+ 
+ 
+    /*************************************
+     * Private Functions: ECDSA Recovery *
+     *************************************/
+ 
+    /**
+     * Gets the native message hash (simple keccak256) for a message.
+     * @param _message Message to hash.
+     * @return _messageHash Native message hash.
+     */
+    function getNativeMessageHash(
+        bytes memory _message
+    )
+        private
+        pure
+        returns (
+            bytes32 _messageHash
+        )
+    {
+        return keccak256(_message);
+    }
+ 
+    /**
+     * Gets the hash of a message with the `Ethereum Signed Message` prefix.
+     * @param _message Message to hash.
+     * @return _messageHash Prefixed message hash.
+     */
+    function getEthSignedMessageHash(
+        bytes memory _message
+    )
+        private
+        pure
+        returns (
+            bytes32 _messageHash
+        )
+    {
+        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
+        bytes32 messageHash = keccak256(_message);
+        return keccak256(abi.encodePacked(prefix, messageHash));
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html new file mode 100644 index 000000000..5be2cd548 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_ErrorUtils.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title Lib_ErrorUtils
+ */
+library Lib_ErrorUtils {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Encodes an error string into raw solidity-style revert data.
+     * (i.e. ascii bytes, prefixed with bytes4(keccak("Error(string))"))
+     * Ref: https://docs.soliditylang.org/en/v0.8.2/control-structures.html?highlight=Error(string)#panic-via-assert-and-error-via-require
+     * @param _reason Reason for the reversion.
+     * @return Standard solidity revert data for the given reason.
+     */
+    function encodeRevertString(
+        string memory _reason
+    )
+        internal
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return abi.encodeWithSignature(
+            "Error(string)",
+            _reason
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html new file mode 100644 index 000000000..578273032 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html @@ -0,0 +1,629 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_EthUtils.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_EthUtils.sol +

+
+
+ 83.33% + Statements + 10/12 +
+
+ 100% + Branches + 0/0 +
+
+ 85.71% + Functions + 6/7 +
+
+ 87.5% + Lines + 14/16 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +34× +  +  +  +  +  +  +34× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +212× +  +  +  +212× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +19× +  +  +  +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +  +27× +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
+import { Lib_Bytes32Utils } from "./Lib_Bytes32Utils.sol";
+ 
+/**
+ * @title Lib_EthUtils
+ */
+library Lib_EthUtils {
+ 
+    /***********************************
+     * Internal Functions: Code Access *
+     ***********************************/
+ 
+    /**
+     * Gets the code for a given address.
+     * @param _address Address to get code for.
+     * @param _offset Offset to start reading from.
+     * @param _length Number of bytes to read.
+     * @return _code Code read from the contract.
+     */
+    function getCode(
+        address _address,
+        uint256 _offset,
+        uint256 _length
+    )
+        internal
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        assembly {
+            _code := mload(0x40)
+            mstore(0x40, add(_code, add(_length, 0x20)))
+            mstore(_code, _length)
+            extcodecopy(_address, add(_code, 0x20), _offset, _length)
+        }
+ 
+        return _code;
+    }
+ 
+    /**
+     * Gets the full code for a given address.
+     * @param _address Address to get code for.
+     * @return _code Full code of the contract.
+     */
+    function getCode(
+        address _address
+    )
+        internal
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        return getCode(
+            _address,
+            0,
+            getCodeSize(_address)
+        );
+    }
+ 
+    /**
+     * Gets the size of a contract's code in bytes.
+     * @param _address Address to get code size for.
+     * @return _codeSize Size of the contract's code in bytes.
+     */
+    function getCodeSize(
+        address _address
+    )
+        internal
+        view
+        returns (
+            uint256 _codeSize
+        )
+    {
+        assembly {
+            _codeSize := extcodesize(_address)
+        }
+ 
+        return _codeSize;
+    }
+ 
+    /**
+     * Gets the hash of a contract's code.
+     * @param _address Address to get a code hash for.
+     * @return _codeHash Hash of the contract's code.
+     */
+    function getCodeHash(
+        address _address
+    )
+        internal
+        view
+        returns (
+            bytes32 _codeHash
+        )
+    {
+        assembly {
+            _codeHash := extcodehash(_address)
+        }
+ 
+        return _codeHash;
+    }
+ 
+ 
+    /*****************************************
+     * Internal Functions: Contract Creation *
+     *****************************************/
+ 
+    /**
+     * Creates a contract with some given initialization code.
+     * @param _code Contract initialization code.
+     * @return _created Address of the created contract.
+     */
+    function createContract(
+        bytes memory _code
+    )
+        internal
+        returns (
+            address _created
+        )
+    {
+        assembly {
+            _created := create(
+                0,
+                add(_code, 0x20),
+                mload(_code)
+            )
+        }
+ 
+        return _created;
+    }
+ 
+    /**
+     * Computes the address that would be generated by CREATE.
+     * @param _creator Address creating the contract.
+     * @param _nonce Creator's nonce.
+     * @return _address Address to be generated by CREATE.
+     */
+    function getAddressForCREATE(
+        address _creator,
+        uint256 _nonce
+    )
+        internal
+        pure
+        returns (
+            address _address
+        )
+    {
+        bytes[] memory encoded = new bytes[](2);
+        encoded[0] = Lib_RLPWriter.writeAddress(_creator);
+        encoded[1] = Lib_RLPWriter.writeUint(_nonce);
+ 
+        bytes memory encodedList = Lib_RLPWriter.writeList(encoded);
+        return Lib_Bytes32Utils.toAddress(keccak256(encodedList));
+    }
+ 
+    /**
+     * Computes the address that would be generated by CREATE2.
+     * @param _creator Address creating the contract.
+     * @param _bytecode Bytecode of the contract to be created.
+     * @param _salt 32 byte salt value mixed into the hash.
+     * @return _address Address to be generated by CREATE2.
+     */
+    function getAddressForCREATE2(
+        address _creator,
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        internal
+        pure
+        returns (address _address)
+    {
+        bytes32 hashedData = keccak256(abi.encodePacked(
+            byte(0xff),
+            _creator,
+            _salt,
+            keccak256(_bytecode)
+        ));
+ 
+        return Lib_Bytes32Utils.toAddress(hashedData);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_Math.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_Math.sol.html new file mode 100644 index 000000000..ff97d943c --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/Lib_Math.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_Math.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_Math.sol +

+
+
+ 0% + Statements + 0/3 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/1 +
+
+ 0% + Lines + 0/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_Math
+ */
+library Lib_Math {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Calculates the minumum of two numbers.
+     * @param _x First number to compare.
+     * @param _y Second number to compare.
+     * @return Lesser of the two numbers.
+     */
+    function min(
+        uint256 _x,
+        uint256 _y
+    )
+        internal
+        pure
+        returns (
+            uint256
+        )
+    {
+        if (_x < _y) {
+            return _x;
+        }
+ 
+        return _y;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html new file mode 100644 index 000000000..60fb172ca --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html @@ -0,0 +1,725 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_MerkleTree.sol +

+
+
+ 97.83% + Statements + 45/46 +
+
+ 90.91% + Branches + 20/22 +
+
+ 100% + Functions + 3/3 +
+
+ 97.96% + Lines + 48/49 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +124× +  +  +  +  +123× +  +  +  +123× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +123× +  +  +123× +123× +  +  +123× +  +  +123× +  +  +123× +123× +  +123× +321× +321× +  +321× +5814× +5814× +5814× +  +  +  +  +5814× +  +  +321× +45× +45× +45× +  +  +  +  +45× +  +  +321× +321× +  +  +123× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +102× +  +  +  +  +101× +  +  +  +  +100× +  +  +  +  +99× +  +99× +653× +146× +  +  +  +  +  +  +507× +  +  +  +  +  +  +  +653× +  +  +99× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +  +  +  +  +100× + +  +  +  +  +97× +97× +97× +776× +206× +206× +  +  +  +  +97× +70× +  +  +97× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @title Lib_MerkleTree
+ * @author River Keefer
+ */
+library Lib_MerkleTree {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Calculates a merkle root for a list of 32-byte leaf hashes.  WARNING: If the number
+     * of leaves passed in is not a power of two, it pads out the tree with zero hashes.
+     * If you do not know the original length of elements for the tree you are verifying,
+     * then this may allow empty leaves past _elements.length to pass a verification check down the line.
+     * Note that the _elements argument is modified, therefore it must not be used again afterwards
+     * @param _elements Array of hashes from which to generate a merkle root.
+     * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).
+     */
+    function getMerkleRoot(
+        bytes32[] memory _elements
+    )
+        internal
+        pure
+        returns (
+            bytes32
+        )
+    {
+        require(
+            _elements.length > 0,
+            "Lib_MerkleTree: Must provide at least one leaf hash."
+        );
+ 
+        Iif (_elements.length == 0) {
+            return _elements[0];
+        }
+ 
+        uint256[16] memory defaults = [
+            0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,
+            0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,
+            0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,
+            0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,
+            0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,
+            0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,
+            0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,
+            0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,
+            0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,
+            0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,
+            0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,
+            0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,
+            0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,
+            0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,
+            0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,
+            0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10
+        ];
+ 
+        // Reserve memory space for our hashes.
+        bytes memory buf = new bytes(64);
+ 
+        // We'll need to keep track of left and right siblings.
+        bytes32 leftSibling;
+        bytes32 rightSibling;
+ 
+        // Number of non-empty nodes at the current depth.
+        uint256 rowSize = _elements.length;
+ 
+        // Current depth, counting from 0 at the leaves
+        uint256 depth = 0;
+ 
+        // Common sub-expressions
+        uint256 halfRowSize;         // rowSize / 2
+        bool rowSizeIsOdd;           // rowSize % 2 == 1
+ 
+        while (rowSize > 1) {
+            halfRowSize = rowSize / 2;
+            rowSizeIsOdd = rowSize % 2 == 1;
+ 
+            for (uint256 i = 0; i < halfRowSize; i++) {
+                leftSibling  = _elements[(2 * i)    ];
+                rightSibling = _elements[(2 * i) + 1];
+                assembly {
+                    mstore(add(buf, 32), leftSibling )
+                    mstore(add(buf, 64), rightSibling)
+                }
+ 
+                _elements[i] = keccak256(buf);
+            }
+ 
+            if (rowSizeIsOdd) {
+                leftSibling  = _elements[rowSize - 1];
+                rightSibling = bytes32(defaults[depth]);
+                assembly {
+                    mstore(add(buf, 32), leftSibling)
+                    mstore(add(buf, 64), rightSibling)
+                }
+ 
+                _elements[halfRowSize] = keccak256(buf);
+            }
+ 
+            rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);
+            depth++;
+        }
+ 
+        return _elements[0];
+    }
+ 
+    /**
+     * Verifies a merkle branch for the given leaf hash.  Assumes the original length
+     * of leaves generated is a known, correct input, and does not return true for indices
+     * extending past that index (even if _siblings would be otherwise valid.)
+     * @param _root The Merkle root to verify against.
+     * @param _leaf The leaf hash to verify inclusion of.
+     * @param _index The index in the tree of this leaf.
+     * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
+     * @param _totalLeaves The total number of leaves originally passed into.
+     * @return Whether or not the merkle branch and leaf passes verification.
+     */
+    function verify(
+        bytes32 _root,
+        bytes32 _leaf,
+        uint256 _index,
+        bytes32[] memory _siblings,
+        uint256 _totalLeaves
+    )
+        internal
+        pure
+        returns (
+            bool
+        )
+    {
+        require(
+            _totalLeaves > 0,
+            "Lib_MerkleTree: Total leaves must be greater than zero."
+        );
+ 
+        require(
+            _index < _totalLeaves,
+            "Lib_MerkleTree: Index out of bounds."
+        );
+ 
+        require(
+            _siblings.length == _ceilLog2(_totalLeaves),
+            "Lib_MerkleTree: Total siblings does not correctly correspond to total leaves."
+        );
+ 
+        bytes32 computedRoot = _leaf;
+ 
+        for (uint256 i = 0; i < _siblings.length; i++) {
+            if ((_index & 1) == 1) {
+                computedRoot = keccak256(
+                    abi.encodePacked(
+                        _siblings[i],
+                        computedRoot
+                    )
+                );
+            } else {
+                computedRoot = keccak256(
+                    abi.encodePacked(
+                        computedRoot,
+                        _siblings[i]
+                    )
+                );
+            }
+ 
+            _index >>= 1;
+        }
+ 
+        return _root == computedRoot;
+    }
+ 
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Calculates the integer ceiling of the log base 2 of an input.
+     * @param _in Unsigned input to calculate the log.
+     * @return ceil(log_base_2(_in))
+     */
+    function _ceilLog2(
+        uint256 _in
+    )
+        private
+        pure
+        returns (
+            uint256
+        )
+    {
+        Erequire(
+            _in > 0,
+            "Lib_MerkleTree: Cannot compute ceil(log_2) of 0."
+        );
+ 
+        if (_in == 1) {
+            return 0;
+        }
+ 
+        // Find the highest set bit (will be floor(log_2)).
+        // Borrowed with <3 from https://github.com/ethereum/solidity-examples
+        uint256 val = _in;
+        uint256 highest = 0;
+        for (uint8 i = 128; i >= 1; i >>= 1) {
+            if (val & (uint(1) << i) - 1 << i != 0) {
+                highest += i;
+                val >>= i;
+            }
+        }
+ 
+        // Increment by one if this is not a perfect logarithm.
+        if ((uint(1) << highest) != _in) {
+            highest += 1;
+        }
+ 
+        return highest;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html new file mode 100644 index 000000000..1ccf21bdd --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html @@ -0,0 +1,248 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_ReentrancyGuard.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +54× +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +14× +  +14× +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/**
+ * @dev Contract module that helps prevent reentrant calls to a function.
+ *
+ * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
+ * available, which can be applied to functions to make sure there are no nested
+ * (reentrant) calls to them.
+ *
+ * Note that because there is a single `nonReentrant` guard, functions marked as
+ * `nonReentrant` may not call one another. This can be worked around by making
+ * those functions `private`, and then adding `external` `nonReentrant` entry
+ * points to them.
+ *
+ * TIP: If you would like to learn more about reentrancy and alternative ways
+ * to protect against it, check out our blog post
+ * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
+ */
+abstract contract Lib_ReentrancyGuard {
+    // Booleans are more expensive than uint256 or any type that takes up a full
+    // word because each write operation emits an extra SLOAD to first read the
+    // slot's contents, replace the bits taken up by the boolean, and then write
+    // back. This is the compiler's defense against contract upgrades and
+    // pointer aliasing, and it cannot be disabled.
+ 
+    // The values being non-zero value makes deployment a bit more expensive,
+    // but in exchange the refund on every call to nonReentrant will be lower in
+    // amount. Since refunds are capped to a percentage of the total
+    // transaction's gas, it is best to keep them low in cases like this one, to
+    // increase the likelihood of the full refund coming into effect.
+    uint256 private constant _NOT_ENTERED = 1;
+    uint256 private constant _ENTERED = 2;
+ 
+    uint256 private _status;
+ 
+    constructor () {
+        _status = _NOT_ENTERED;
+    }
+ 
+    /**
+     * @dev Prevents a contract from calling itself, directly or indirectly.
+     * Calling a `nonReentrant` function from another `nonReentrant`
+     * function is not supported. It is possible to prevent this from happening
+     * by making the `nonReentrant` function external, and make it call a
+     * `private` function that does the actual work.
+     */
+    modifier nonReentrant() {
+        // On the first call to nonReentrant, _notEntered will be true
+        Erequire(_status != _ENTERED, "ReentrancyGuard: reentrant call");
+ 
+        // Any calls to nonReentrant after this point will fail
+        _status = _ENTERED;
+ 
+        _;
+ 
+        // By storing the original value once again, a refund is triggered (see
+        // https://eips.ethereum.org/EIPS/eip-2200)
+        _status = _NOT_ENTERED;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html new file mode 100644 index 000000000..57d0143ce --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html @@ -0,0 +1,1193 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/utils/ Lib_RingBuffer.sol +

+
+
+ 78.13% + Statements + 50/64 +
+
+ 54.17% + Branches + 13/24 +
+
+ 81.82% + Functions + 9/11 +
+
+ 77.46% + Lines + 55/71 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +578× +578× +  +  +578× +140× +  +  +  +578× +11× +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +578× +578× +  +  +578× +578× +578× +  +  +  +  +  +  +  +  +  +  +  +  +  +470× +  +470× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +538× +  +538× +  +  +  +  +535× +535× +  +535× +  +  +535× +  +  +535× +  +  +  +  +535× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  +  +  +  + +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +453× +453× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +580× +580× +  +  +  +  +  +  +  +  +  +  +  +  +  +579× +579× +  +579× +579× +579× +  +  +  +  +579× +579× +579× +579× +  +  +  +  +  +579× +579× +  +  +579× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2620× +2620× +  +2620× +2620× +2620× +  +  +  +  +2620× +2620× +2620× +2620× +  +  +  +  +  +2620× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1648× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+library Lib_RingBuffer {
+    using Lib_RingBuffer for RingBuffer;
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct Buffer {
+        uint256 length;
+        mapping (uint256 => bytes32) buf;
+    }
+ 
+    struct RingBuffer {
+        bytes32 contextA;
+        bytes32 contextB;
+        Buffer bufferA;
+        Buffer bufferB;
+        uint256 nextOverwritableIndex;
+    }
+ 
+    struct RingBufferContext {
+        // contextA
+        uint40 globalIndex;
+        bytes27 extraData;
+ 
+        // contextB
+        uint64 currBufferIndex;
+        uint40 prevResetIndex;
+        uint40 currResetIndex;
+    }
+ 
+ 
+    /*************
+     * Constants *
+     *************/
+ 
+    uint256 constant MIN_CAPACITY = 16;
+ 
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Pushes a single element to the buffer.
+     * @param _self Buffer to access.
+     * @param _value Value to push to the buffer.
+     * @param _extraData Optional global extra data.
+     */
+    function push(
+        RingBuffer storage _self,
+        bytes32 _value,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
+ 
+        // Set a minimum capacity.
+        if (currBuffer.length == 0) {
+            currBuffer.length = MIN_CAPACITY;
+        }
+ 
+        // Check if we need to expand the buffer.
+        if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {
+            Iif (ctx.currResetIndex < _self.nextOverwritableIndex) {
+                // We're going to overwrite the inactive buffer.
+                // Bump the buffer index, reset the delete offset, and set our reset indices.
+                ctx.currBufferIndex++;
+                ctx.prevResetIndex = ctx.currResetIndex;
+                ctx.currResetIndex = ctx.globalIndex;
+ 
+                // Swap over to the next buffer.
+                currBuffer = _self.getBuffer(ctx.currBufferIndex);
+            } else {
+                // We're not overwriting yet, double the length of the current buffer.
+                currBuffer.length *= 2;
+            }
+        }
+ 
+        // Index to write to is the difference of the global and reset indices.
+        uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;
+        currBuffer.buf[writeHead] = _value;
+ 
+        // Bump the global index and insert our extra data, then save the context.
+        ctx.globalIndex++;
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Pushes a single element to the buffer.
+     * @param _self Buffer to access.
+     * @param _value Value to push to the buffer.
+     */
+    function push(
+        RingBuffer storage _self,
+        bytes32 _value
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        
+        _self.push(
+            _value,
+            ctx.extraData
+        );
+    }
+ 
+    /**
+     * Retrieves an element from the buffer.
+     * @param _self Buffer to access.
+     * @param _index Element index to retrieve.
+     * @return Value of the element at the given index.
+     */
+    function get(
+        RingBuffer storage _self,
+        uint256 _index
+    )
+        internal
+        view
+        returns (
+            bytes32    
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+ 
+        require(
+            _index < ctx.globalIndex,
+            "Index out of bounds."
+        );
+ 
+        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
+        Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);
+ 
+        Eif (_index >= ctx.currResetIndex) {
+            // We're trying to load an element from the current buffer.
+            // Relative index is just the difference from the reset index.
+            uint256 relativeIndex = _index - ctx.currResetIndex;
+ 
+            // Shouldn't happen but why not check.
+            Erequire(
+                relativeIndex < currBuffer.length,
+                "Index out of bounds."
+            );
+ 
+            return currBuffer.buf[relativeIndex];
+        } else {
+            // We're trying to load an element from the previous buffer.
+            // Relative index is the difference from the reset index in the other direction.
+            uint256 relativeIndex = ctx.currResetIndex - _index;
+ 
+            // Condition only fails in the case that we deleted and flipped buffers.
+            require(
+                ctx.currResetIndex > ctx.prevResetIndex,
+                "Index out of bounds."
+            );
+ 
+            // Make sure we're not trying to read beyond the array.
+            require(
+                relativeIndex <= prevBuffer.length,
+                "Index out of bounds."
+            );
+ 
+            return prevBuffer.buf[prevBuffer.length - relativeIndex];
+        }
+    }
+ 
+    /**
+     * Deletes all elements after (and including) a given index.
+     * @param _self Buffer to access.
+     * @param _index Index of the element to delete from (inclusive).
+     * @param _extraData Optional global extra data.
+     */
+    function deleteElementsAfterInclusive(
+        RingBuffer storage _self,
+        uint40 _index,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+ 
+        Erequire(
+            _index < ctx.globalIndex && _index >= ctx.prevResetIndex,
+            "Index out of bounds."
+        );
+ 
+        Iif (_index < ctx.currResetIndex) {
+            // We're switching back to the previous buffer.
+            // Reduce the buffer index, set the current reset index back to match the previous one.
+            // We use the equality of these two values to prevent reading beyond this buffer.
+            ctx.currBufferIndex--;
+            ctx.currResetIndex = ctx.prevResetIndex;
+        }
+ 
+        // Set our global index and extra data, save the context.
+        ctx.globalIndex = _index;
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Deletes all elements after (and including) a given index.
+     * @param _self Buffer to access.
+     * @param _index Index of the element to delete from (inclusive).
+     */
+    function deleteElementsAfterInclusive(
+        RingBuffer storage _self,
+        uint40 _index
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        _self.deleteElementsAfterInclusive(
+            _index,
+            ctx.extraData
+        );
+    }
+ 
+    /**
+     * Retrieves the current global index.
+     * @param _self Buffer to access.
+     * @return Current global index.
+     */
+    function getLength(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        return ctx.globalIndex;
+    }
+ 
+    /**
+     * Changes current global extra data.
+     * @param _self Buffer to access.
+     * @param _extraData New global extra data.
+     */
+    function setExtraData(
+        RingBuffer storage _self,
+        bytes27 _extraData
+    )
+        internal
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        ctx.extraData = _extraData;
+        _self.setContext(ctx);
+    }
+ 
+    /**
+     * Retrieves the current global extra data.
+     * @param _self Buffer to access.
+     * @return Current global extra data.
+     */
+    function getExtraData(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            bytes27
+        )
+    {
+        RingBufferContext memory ctx = _self.getContext();
+        return ctx.extraData;
+    }
+ 
+    /**
+     * Sets the current ring buffer context.
+     * @param _self Buffer to access.
+     * @param _ctx Current ring buffer context.
+     */
+    function setContext(
+        RingBuffer storage _self,
+        RingBufferContext memory _ctx
+    )
+        internal
+    {
+        bytes32 contextA;
+        bytes32 contextB;
+ 
+        uint40 globalIndex = _ctx.globalIndex;
+        bytes27 extraData = _ctx.extraData;
+        assembly {
+            contextA := globalIndex
+            contextA := or(contextA, extraData)
+        }
+ 
+        uint64 currBufferIndex = _ctx.currBufferIndex;
+        uint40 prevResetIndex = _ctx.prevResetIndex;
+        uint40 currResetIndex = _ctx.currResetIndex;
+        assembly {
+            contextB := currBufferIndex
+            contextB := or(contextB, shl(64, prevResetIndex))
+            contextB := or(contextB, shl(104, currResetIndex))
+        }
+ 
+        Eif (_self.contextA != contextA) {
+            _self.contextA = contextA;
+        }
+ 
+        Iif (_self.contextB != contextB) {
+            _self.contextB = contextB;
+        }
+    }
+ 
+    /**
+     * Retrieves the current ring buffer context.
+     * @param _self Buffer to access.
+     * @return Current ring buffer context.
+     */
+    function getContext(
+        RingBuffer storage _self
+    )
+        internal
+        view
+        returns (
+            RingBufferContext memory
+        )
+    {
+        bytes32 contextA = _self.contextA;
+        bytes32 contextB = _self.contextB;
+ 
+        uint40 globalIndex;
+        bytes27 extraData;
+        assembly {
+            globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
+            extraData   := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)
+        }
+ 
+        uint64 currBufferIndex;
+        uint40 prevResetIndex;
+        uint40 currResetIndex;
+        assembly {
+            currBufferIndex :=          and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)
+            prevResetIndex  := shr(64,  and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))
+            currResetIndex  := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))
+        }
+ 
+        return RingBufferContext({
+            globalIndex: globalIndex,
+            extraData: extraData,
+            currBufferIndex: currBufferIndex,
+            prevResetIndex: prevResetIndex,
+            currResetIndex: currResetIndex
+        });
+    }
+ 
+    /**
+     * Retrieves the a buffer from the ring buffer by index.
+     * @param _self Buffer to access.
+     * @param _which Index of the sub buffer to access.
+     * @return Sub buffer for the index.
+     */
+    function getBuffer(
+        RingBuffer storage _self,
+        uint256 _which
+    )
+        internal
+        view
+        returns (
+            Buffer storage
+        )
+    {
+        return _which % 2 == 0 ? _self.bufferA : _self.bufferB;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/utils/index.html b/coverage/optimistic-ethereum/libraries/utils/index.html new file mode 100644 index 000000000..a87d86505 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/utils/index.html @@ -0,0 +1,197 @@ + + + + Code coverage report for optimistic-ethereum/libraries/utils/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/utils/ +

+
+
+ 89.07% + Statements + 163/183 +
+
+ 67.57% + Branches + 50/74 +
+
+ 91.11% + Functions + 41/45 +
+
+ 89.27% + Lines + 183/205 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_Bytes32Utils.sol
100%6/6100%0/0100%5/5100%7/7
Lib_BytesUtils.sol
100%38/3863.64%14/22100%11/11100%44/44
Lib_ECDSAUtils.sol
100%9/9100%2/2100%4/4100%9/9
Lib_ErrorUtils.sol
100%1/1100%0/0100%1/1100%1/1
Lib_EthUtils.sol
83.33%10/12100%0/085.71%6/787.5%14/16
Lib_Math.sol
0%0/30%0/20%0/10%0/3
Lib_MerkleTree.sol
97.83%45/4690.91%20/22100%3/397.96%48/49
Lib_ReentrancyGuard.sol
100%4/450%1/2100%2/2100%5/5
Lib_RingBuffer.sol
78.13%50/6454.17%13/2481.82%9/1177.46%55/71
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html b/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html new file mode 100644 index 000000000..864775242 --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html @@ -0,0 +1,1205 @@ + + + + Code coverage report for optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/wrappers/ Lib_SafeExecutionManagerWrapper.sol +

+
+
+ 100% + Statements + 30/30 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 16/16 +
+
+ 96.77% + Lines + 30/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +41× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +43× +  +  +  +  +  +  +43× +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +146× +146× +  +  +  +  +146× + +  +  +  +  +  +  +  +144× +  +  +  +  +  +  +  +  +  +  +  +145× +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_ErrorUtils } from "../utils/Lib_ErrorUtils.sol";
+ 
+/**
+ * @title Lib_SafeExecutionManagerWrapper
+ * @dev The Safe Execution Manager Wrapper provides functions which facilitate writing OVM safe 
+ * code using the standard solidity compiler, by routing all its operations through the Execution 
+ * Manager.
+ * 
+ * Compiler used: solc
+ * Runtime target: OVM
+ */
+library Lib_SafeExecutionManagerWrapper {
+ 
+    /**********************
+     * Internal Functions *
+     **********************/
+ 
+    /**
+     * Performs a safe ovmCALL.
+     * @param _gasLimit Gas limit for the call.
+     * @param _target Address to call.
+     * @param _calldata Data to send to the call.
+     * @return _success Whether or not the call reverted.
+     * @return _returndata Data returned by the call.
+     */
+    function safeCALL(
+        uint256 _gasLimit,
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCALL(uint256,address,bytes)",
+                _gasLimit,
+                _target,
+                _calldata
+            )
+        );
+ 
+        return abi.decode(returndata, (bool, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmDELEGATECALL.
+     * @param _gasLimit Gas limit for the call.
+     * @param _target Address to call.
+     * @param _calldata Data to send to the call.
+     * @return _success Whether or not the call reverted.
+     * @return _returndata Data returned by the call.
+     */
+    function safeDELEGATECALL(
+        uint256 _gasLimit,
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmDELEGATECALL(uint256,address,bytes)",
+                _gasLimit,
+                _target,
+                _calldata
+            )
+        );
+ 
+        return abi.decode(returndata, (bool, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmCREATE call.
+     * @param _gasLimit Gas limit for the creation.
+     * @param _bytecode Code for the new contract.
+     * @return _contract Address of the created contract.
+     */
+    function safeCREATE(
+        uint256 _gasLimit,
+        bytes memory _bytecode
+    )
+        internal
+        returns (
+            address,
+            bytes memory
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            _gasLimit,
+            abi.encodeWithSignature(
+                "ovmCREATE(bytes)",
+                _bytecode
+            )
+        );
+ 
+        return abi.decode(returndata, (address, bytes));
+    }
+ 
+    /**
+     * Performs a safe ovmEXTCODESIZE call.
+     * @param _contract Address of the contract to query the size of.
+     * @return _EXTCODESIZE Size of the requested contract in bytes.
+     */
+    function safeEXTCODESIZE(
+        address _contract
+    )
+        internal
+        returns (
+            uint256 _EXTCODESIZE
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmEXTCODESIZE(address)",
+                _contract
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmCHAINID call.
+     * @return _CHAINID Result of calling ovmCHAINID.
+     */
+    function safeCHAINID()
+        internal
+        returns (
+            uint256 _CHAINID
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCHAINID()"
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmCALLER call.
+     * @return _CALLER Result of calling ovmCALLER.
+     */
+    function safeCALLER()
+        internal
+        returns (
+            address _CALLER
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCALLER()"
+            )
+        );
+ 
+        return abi.decode(returndata, (address));
+    }
+ 
+    /**
+     * Performs a safe ovmADDRESS call.
+     * @return _ADDRESS Result of calling ovmADDRESS.
+     */
+    function safeADDRESS()
+        internal
+        returns (
+            address _ADDRESS
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmADDRESS()"
+            )
+        );
+ 
+        return abi.decode(returndata, (address));
+    }
+ 
+    /**
+     * Performs a safe ovmGETNONCE call.
+     * @return _nonce Result of calling ovmGETNONCE.
+     */
+    function safeGETNONCE()
+        internal
+        returns (
+            uint256 _nonce
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmGETNONCE()"
+            )
+        );
+ 
+        return abi.decode(returndata, (uint256));
+    }
+ 
+    /**
+     * Performs a safe ovmSETNONCE call.
+     * @param _nonce New account nonce.
+     */
+    function safeSETNONCE(
+        uint256 _nonce
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSETNONCE(uint256)",
+                _nonce
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe ovmCREATEEOA call.
+     * @param _messageHash Message hash which was signed by EOA
+     * @param _v v value of signature (0 or 1)
+     * @param _r r value of signature
+     * @param _s s value of signature
+     */
+    function safeCREATEEOA(
+        bytes32 _messageHash,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmCREATEEOA(bytes32,uint8,bytes32,bytes32)",
+                _messageHash,
+                _v,
+                _r,
+                _s
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe REVERT.
+     * @param _reason String revert reason to pass along with the REVERT.
+     */
+    function safeREVERT(
+        string memory _reason
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmREVERT(bytes)",
+                Lib_ErrorUtils.encodeRevertString(
+                    _reason
+                )
+            )
+        );
+    }
+ 
+    /**
+     * Performs a safe "require".
+     * @param _condition Boolean condition that must be true or will revert.
+     * @param _reason String revert reason to pass along with the REVERT.
+     */
+    function safeREQUIRE(
+        bool _condition,
+        string memory _reason
+    )
+        internal
+    {
+        if (!_condition) {
+            safeREVERT(
+                _reason
+            );
+        }
+    }
+ 
+    /**
+     * Performs a safe ovmSLOAD call.
+     */
+    function safeSLOAD(
+        bytes32 _key
+    )
+        internal
+        returns (
+            bytes32
+        )
+    {
+        bytes memory returndata = _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSLOAD(bytes32)",
+                _key
+            )
+        );
+ 
+        return abi.decode(returndata, (bytes32));
+    }
+ 
+    /**
+     * Performs a safe ovmSSTORE call.
+     */
+    function safeSSTORE(
+        bytes32 _key,
+        bytes32 _value
+    )
+        internal
+    {
+        _safeExecutionManagerInteraction(
+            abi.encodeWithSignature(
+                "ovmSSTORE(bytes32,bytes32)",
+                _key,
+                _value
+            )
+        );
+    }
+ 
+    /*********************
+     * Private Functions *
+     *********************/
+ 
+    /**
+     * Performs an ovm interaction and the necessary safety checks.
+     * @param _gasLimit Gas limit for the interaction.
+     * @param _calldata Data to send to the OVM_ExecutionManager (encoded with sighash).
+     * @return _returndata Data sent back by the OVM_ExecutionManager.
+     */
+    function _safeExecutionManagerInteraction(
+        uint256 _gasLimit,
+        bytes memory _calldata
+    )
+        private
+        returns (
+            bytes memory _returndata
+        )
+    {
+        address ovmExecutionManager = msg.sender;
+        (
+            bool success,
+            bytes memory returndata
+        ) = ovmExecutionManager.call{gas: _gasLimit}(_calldata);
+ 
+        if (success == false) {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        } else Iif (returndata.length == 1) {
+            assembly {
+                return(0, 1)
+            }
+        } else {
+            return returndata;
+        }
+    }
+ 
+    function _safeExecutionManagerInteraction(
+        bytes memory _calldata
+    )
+        private
+        returns (
+            bytes memory _returndata
+        )
+    {
+        return _safeExecutionManagerInteraction(
+            gasleft(),
+            _calldata
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html b/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html new file mode 100644 index 000000000..5389cca3c --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html @@ -0,0 +1,566 @@ + + + + Code coverage report for optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/libraries/wrappers/ Lib_SafeMathWrapper.sol +

+
+
+ 21.05% + Statements + 4/19 +
+
+ 50% + Branches + 1/2 +
+
+ 12.5% + Functions + 1/8 +
+
+ 21.05% + Lines + 4/19 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// Pulled from @openzeppelin/contracts/math/SafeMath.sol
+// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_SafeExecutionManagerWrapper } from "./Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title Lib_SafeMathWrapper
+ */
+ 
+/**
+ * @dev Wrappers over Solidity's arithmetic operations with added overflow
+ * checks.
+ *
+ * Arithmetic operations in Solidity wrap on overflow. This can easily result
+ * in bugs, because programmers usually assume that an overflow raises an
+ * error, which is the standard behavior in high level programming languages.
+ * `SafeMath` restores this intuition by reverting the transaction when an
+ * operation overflows.
+ *
+ * Using this library instead of the unchecked operations eliminates an entire
+ * class of bugs, so it's recommended to use it always.
+ */
+ 
+library Lib_SafeMathWrapper {
+    /**
+     * @dev Returns the addition of two unsigned integers, reverting on
+     * overflow.
+     *
+     * Counterpart to Solidity's `+` operator.
+     *
+     * Requirements:
+     *
+     * - Addition cannot overflow.
+     */
+    function add(uint256 a, uint256 b) internal returns (uint256) {
+        uint256 c = a + b;
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c >= a, "Lib_SafeMathWrapper: addition overflow");
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the subtraction of two unsigned integers, reverting on
+     * overflow (when the result is negative).
+     *
+     * Counterpart to Solidity's `-` operator.
+     *
+     * Requirements:
+     *
+     * - Subtraction cannot overflow.
+     */
+    function sub(uint256 a, uint256 b) internal returns (uint256) {
+        return sub(a, b, "Lib_SafeMathWrapper: subtraction overflow");
+    }
+ 
+    /**
+     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
+     * overflow (when the result is negative).
+     *
+     * Counterpart to Solidity's `-` operator.
+     *
+     * Requirements:
+     *
+     * - Subtraction cannot overflow.
+     */
+    function sub(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b <= a, errorMessage);
+        uint256 c = a - b;
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the multiplication of two unsigned integers, reverting on
+     * overflow.
+     *
+     * Counterpart to Solidity's `*` operator.
+     *
+     * Requirements:
+     *
+     * - Multiplication cannot overflow.
+     */
+    function mul(uint256 a, uint256 b) internal returns (uint256) {
+        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
+        // benefit is lost if 'b' is also tested.
+        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
+        Iif (a == 0) {
+            return 0;
+        }
+ 
+        uint256 c = a * b;
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c / a == b, "Lib_SafeMathWrapper: multiplication overflow");
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the integer division of two unsigned integers. Reverts on
+     * division by zero. The result is rounded towards zero.
+     *
+     * Counterpart to Solidity's `/` operator. Note: this function uses a
+     * `revert` opcode (which leaves remaining gas untouched) while Solidity
+     * uses an invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function div(uint256 a, uint256 b) internal returns (uint256) {
+        return div(a, b, "Lib_SafeMathWrapper: division by zero");
+    }
+ 
+    /**
+     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
+     * division by zero. The result is rounded towards zero.
+     *
+     * Counterpart to Solidity's `/` operator. Note: this function uses a
+     * `revert` opcode (which leaves remaining gas untouched) while Solidity
+     * uses an invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function div(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b > 0, errorMessage);
+        uint256 c = a / b;
+        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+ 
+        return c;
+    }
+ 
+    /**
+     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+     * Reverts when dividing by zero.
+     *
+     * Counterpart to Solidity's `%` operator. This function uses a `revert`
+     * opcode (which leaves remaining gas untouched) while Solidity uses an
+     * invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function mod(uint256 a, uint256 b) internal returns (uint256) {
+        return mod(a, b, "Lib_SafeMathWrapper: modulo by zero");
+    }
+ 
+    /**
+     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
+     * Reverts with custom message when dividing by zero.
+     *
+     * Counterpart to Solidity's `%` operator. This function uses a `revert`
+     * opcode (which leaves remaining gas untouched) while Solidity uses an
+     * invalid opcode to revert (consuming all remaining gas).
+     *
+     * Requirements:
+     *
+     * - The divisor cannot be zero.
+     */
+    function mod(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b != 0, errorMessage);
+        return a % b;
+    }
+}
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/libraries/wrappers/index.html b/coverage/optimistic-ethereum/libraries/wrappers/index.html new file mode 100644 index 000000000..4855727ba --- /dev/null +++ b/coverage/optimistic-ethereum/libraries/wrappers/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/libraries/wrappers/ + + + + + + + +
+
+

+ all files optimistic-ethereum/libraries/wrappers/ +

+
+
+ 69.39% + Statements + 34/49 +
+
+ 75% + Branches + 6/8 +
+
+ 70.83% + Functions + 17/24 +
+
+ 68% + Lines + 34/50 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Lib_SafeExecutionManagerWrapper.sol
100%30/3083.33%5/6100%16/1696.77%30/31
Lib_SafeMathWrapper.sol
21.05%4/1950%1/212.5%1/821.05%4/19
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/mockOVM/accounts/index.html b/coverage/optimistic-ethereum/mockOVM/accounts/index.html new file mode 100644 index 000000000..d48d74930 --- /dev/null +++ b/coverage/optimistic-ethereum/mockOVM/accounts/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/accounts/ + + + + + + + +
+
+

+ all files optimistic-ethereum/mockOVM/accounts/ +

+
+
+ 0% + Statements + 0/9 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/9 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
mockOVM_ECDSAContractAccount.sol
0%0/90%0/20%0/20%0/9
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html b/coverage/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html new file mode 100644 index 000000000..41a520f12 --- /dev/null +++ b/coverage/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html @@ -0,0 +1,350 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/mockOVM/accounts/ mockOVM_ECDSAContractAccount.sol +

+
+
+ 0% + Statements + 0/9 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Interface Imports */
+import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
+import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
+import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
+ 
+/**
+ * @title mockOVM_ECDSAContractAccount
+ */
+contract mockOVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Executes a signed transaction.
+     * @param _transaction Signed EOA transaction.
+     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
+     * param _v Signature `v` parameter.
+     * param _r Signature `r` parameter.
+     * param _s Signature `s` parameter.
+     * @return _success Whether or not the call returned (rather than reverted).
+     * @return _returndata Data returned by the call.
+     */
+    function execute(
+        bytes memory _transaction,
+        Lib_OVMCodec.EOASignatureType _signatureType,
+        uint8, // _v,
+        bytes32, // _r,
+        bytes32 // _s
+    )
+        override
+        public
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
+        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
+ 
+        // Need to make sure that the transaction nonce is right.
+        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
+            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
+            "Transaction nonce does not match the expected nonce."
+        );
+ 
+        // Contract creations are signalled by sending a transaction to the zero address.
+        if (decodedTx.to == address(0)) {
+            (address created, ) = Lib_SafeExecutionManagerWrapper.safeCREATE(
+                decodedTx.gasLimit,
+                decodedTx.data
+            );
+ 
+            // If the created address is the ZERO_ADDRESS then we know the deployment failed, though not why
+            return (created != address(0), abi.encode(created));
+        } else {
+            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
+            // the nonce of the calling account. Normally an EOA would bump the nonce for both
+            // cases, but since this is a contract we'd end up bumping the nonce twice.
+            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
+ 
+            return Lib_SafeExecutionManagerWrapper.safeCALL(
+                decodedTx.gasLimit,
+                decodedTx.to,
+                decodedTx.data
+            );
+        }
+    }
+ 
+    function qall(
+        uint256 _gasLimit,
+        address _to,
+        bytes memory _data
+    )
+        public
+        returns (
+            bool _success,
+            bytes memory _returndata
+        )
+    {
+        return Lib_SafeExecutionManagerWrapper.safeCALL(
+            _gasLimit,
+            _to,
+            _data
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/mockOVM/bridge/index.html b/coverage/optimistic-ethereum/mockOVM/bridge/index.html new file mode 100644 index 000000000..d1417a522 --- /dev/null +++ b/coverage/optimistic-ethereum/mockOVM/bridge/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/bridge/ + + + + + + + +
+
+

+ all files optimistic-ethereum/mockOVM/bridge/ +

+
+
+ 0% + Statements + 0/19 +
+
+ 0% + Branches + 0/8 +
+
+ 0% + Functions + 0/8 +
+
+ 0% + Lines + 0/19 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
mockOVM_CrossDomainMessenger.sol
0%0/140%0/60%0/60%0/14
mockOVM_GenericCrossDomainMessenger.sol
0%0/50%0/20%0/20%0/5
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html new file mode 100644 index 000000000..47e36cc0a --- /dev/null +++ b/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html @@ -0,0 +1,500 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/mockOVM/bridge/ mockOVM_CrossDomainMessenger.sol +

+
+
+ 0% + Statements + 0/14 +
+
+ 0% + Branches + 0/6 +
+
+ 0% + Functions + 0/6 +
+
+ 0% + Lines + 0/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Contract Imports */
+import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
+ 
+/**
+ * @title mockOVM_CrossDomainMessenger
+ */
+contract mockOVM_CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
+ 
+    /***********
+     * Structs *
+     ***********/
+ 
+    struct ReceivedMessage {
+        uint256 timestamp;
+        address target;
+        address sender;
+        bytes message;
+        uint256 messageNonce;
+        uint32 gasLimit;
+    }
+ 
+ 
+    /**********************
+     * Contract Variables *
+     **********************/
+ 
+    ReceivedMessage[] internal fullReceivedMessages;
+    address internal targetMessengerAddress;
+    uint256 internal lastRelayedMessage;
+    uint256 internal delay;
+    uint256 public messageNonce;
+    address override public xDomainMessageSender;
+ 
+ 
+    /***************
+     * Constructor *
+     ***************/
+ 
+    /**
+     * @param _delay Time in seconds before a message can be relayed.
+     */
+    constructor(
+        uint256 _delay
+    )
+    {
+        delay = _delay;
+    }
+ 
+ 
+    /********************
+     * Public Functions *
+     ********************/
+ 
+    /**
+     * Sets the target messenger address.
+     * @dev Currently, this function is public and therefore allows anyone to modify the target
+     *      messenger for a given xdomain messenger contract. Obviously this shouldn't be allowed,
+     *      but we still need to determine an adequate mechanism for updating this address.
+     * @param _targetMessengerAddress New messenger address.
+     */
+    function setTargetMessengerAddress(
+        address _targetMessengerAddress
+    )
+        public
+    {
+        targetMessengerAddress = _targetMessengerAddress;
+    }
+ 
+    /**
+     * Sends a message to another mock xdomain messenger.
+     * @param _target Target for the message.
+     * @param _message Message to send.
+     * @param _gasLimit Amount of gas to send with the call.
+     */
+    function sendMessage(
+        address _target,
+        bytes memory _message,
+        uint32 _gasLimit
+    )
+        override
+        public
+    {
+        mockOVM_CrossDomainMessenger targetMessenger = mockOVM_CrossDomainMessenger(
+            targetMessengerAddress
+        );
+ 
+        // Just send it over!
+        targetMessenger.receiveMessage(ReceivedMessage({
+            timestamp: block.timestamp,
+            target: _target,
+            sender: msg.sender,
+            message: _message,
+            messageNonce: messageNonce,
+            gasLimit: _gasLimit
+        }));
+ 
+        messageNonce += 1;
+    }
+ 
+    /**
+     * Receives a message to be sent later.
+     * @param _message Message to send later.
+     */
+    function receiveMessage(
+        ReceivedMessage memory _message
+    )
+        public
+    {
+        fullReceivedMessages.push(_message);
+    }
+ 
+    /**
+     * Checks whether we have messages to relay.
+     * @param _exists Whether or not we have more messages to relay.
+     */
+    function hasNextMessage()
+        public
+        view
+        returns (
+            bool _exists
+        )
+    {
+        return fullReceivedMessages.length > lastRelayedMessage;
+    }
+ 
+    /**
+     * Relays the last received message not yet relayed.
+     */
+    function relayNextMessage()
+        public
+    {
+        require(hasNextMessage(), "No pending messages to relay");
+        ReceivedMessage memory nextMessage = fullReceivedMessages[lastRelayedMessage];
+        require(nextMessage.timestamp + delay < block.timestamp, "Message is not ready to be relayed. The delay period is not up yet!");
+ 
+        xDomainMessageSender = nextMessage.sender;
+        (bool success,) = nextMessage.target.call{gas: nextMessage.gasLimit}(nextMessage.message);
+        require(success, "Cross-domain message call reverted. Did you set your gas limit high enough?");
+        lastRelayedMessage += 1;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html new file mode 100644 index 000000000..a584a996b --- /dev/null +++ b/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html @@ -0,0 +1,206 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/mockOVM/bridge/ mockOVM_GenericCrossDomainMessenger.sol +

+
+
+ 0% + Statements + 0/5 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/**
+ * @title mockOVM_GenericCrossDomainMessenger
+ * @dev An experimental alternative mock for local testing.
+ */
+contract mockOVM_GenericCrossDomainMessenger {
+    address public xDomainMessageSender;
+ 
+    event SentMessage(
+        address _sender,
+        address _target,
+        bytes _message,
+        uint256 _gasLimit
+    );
+ 
+    function sendMessage(
+        address _target,
+        bytes memory _message,
+        uint32 _gasLimit
+    )
+        public
+    {
+        emit SentMessage(
+            msg.sender,
+            _target,
+            _message,
+            _gasLimit
+        );
+    }
+ 
+    function relayMessage(
+        address _sender,
+        address _target,
+        bytes memory _message,
+        uint256 _gasLimit
+    )
+        public
+    {
+        xDomainMessageSender = _sender;
+        (bool success, ) = _target.call{gas: _gasLimit}(_message);
+        require(success, "Cross-domain message call reverted. Did you set your gas limit high enough?");
+        xDomainMessageSender = address(0);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/mockOVM/verification/index.html b/coverage/optimistic-ethereum/mockOVM/verification/index.html new file mode 100644 index 000000000..f2db23491 --- /dev/null +++ b/coverage/optimistic-ethereum/mockOVM/verification/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/verification/ + + + + + + + +
+
+

+ all files optimistic-ethereum/mockOVM/verification/ +

+
+
+ 50% + Statements + 1/2 +
+
+ 100% + Branches + 0/0 +
+
+ 22.22% + Functions + 2/9 +
+
+ 50% + Lines + 1/2 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
mockOVM_BondManager.sol
50%1/2100%0/022.22%2/950%1/2
+
+
+ + + + + + + diff --git a/coverage/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html b/coverage/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html new file mode 100644 index 000000000..e66f2c6fa --- /dev/null +++ b/coverage/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html @@ -0,0 +1,329 @@ + + + + Code coverage report for optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol + + + + + + + +
+
+

+ all files / optimistic-ethereum/mockOVM/verification/ mockOVM_BondManager.sol +

+
+
+ 50% + Statements + 1/2 +
+
+ 100% + Branches + 0/0 +
+
+ 22.22% + Functions + 2/9 +
+
+ 50% + Lines + 1/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Interface Imports */
+import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
+ 
+/* Contract Imports */
+import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
+ 
+/**
+ * @title mockOVM_BondManager
+ */
+contract mockOVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
+    constructor(
+        address _libAddressManager
+    )
+        Lib_AddressResolver(_libAddressManager)
+    {}
+ 
+    function recordGasSpent(
+        bytes32 _preStateRoot,
+        bytes32 _txHash,
+        address _who,
+        uint256 _gasSpent
+    )
+        override
+        public
+    {}
+ 
+    function finalize(
+        bytes32 _preStateRoot,
+        address _publisher,
+        uint256 _timestamp
+    )
+        override
+        public
+    {}
+ 
+    function deposit()
+        override
+        public
+    {}
+ 
+    function startWithdrawal()
+        override
+        public
+    {}
+ 
+    function finalizeWithdrawal()
+        override
+        public
+    {}
+ 
+    function claim(
+        address _who
+    )
+        override
+        public
+    {}
+ 
+    function isCollateralized(
+        address _who
+    )
+        override
+        public
+        view
+        returns (
+            bool
+        )
+    {
+        // Only authenticate sequencer to submit state root batches.
+        return _who == resolve("OVM_Proposer");
+    }
+ 
+    function getGasSpent(
+        bytes32, // _preStateRoot,
+        address // _who
+    )
+        override
+        public
+        pure 
+        returns (
+            uint256
+        )
+    {
+        return 0;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/prettify.css b/coverage/prettify.css new file mode 100644 index 000000000..b317a7cda --- /dev/null +++ b/coverage/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/prettify.js b/coverage/prettify.js new file mode 100644 index 000000000..ef51e0386 --- /dev/null +++ b/coverage/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/sort-arrow-sprite.png b/coverage/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..03f704a609c6fd0dbfdac63466a7d7c958b5cbf3 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/coverage/test-helpers/Helper_GasMeasurer.sol.html b/coverage/test-helpers/Helper_GasMeasurer.sol.html new file mode 100644 index 000000000..e33773a59 --- /dev/null +++ b/coverage/test-helpers/Helper_GasMeasurer.sol.html @@ -0,0 +1,164 @@ + + + + Code coverage report for test-helpers/Helper_GasMeasurer.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_GasMeasurer.sol +

+
+
+ 100% + Statements + 7/7 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34  +  +  +  +  +  +  +  +  +  +  +  +47× +47× +  +47× +47× +47× +  +  +  +  +47× +47× +  +  +  +  +47× +  +47× +  +  + 
// SPDX-License-Identifier: UNLICENSED
+// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+contract Helper_GasMeasurer {
+    function measureCallGas(
+        address _target,
+        bytes memory _data
+    )
+        public
+        returns ( uint256 )
+    {
+        uint256 gasBefore;
+        uint256 gasAfter;
+ 
+        uint256 calldataStart;
+        uint256 calldataLength;
+        assembly {
+            calldataStart := add(_data,0x20)
+            calldataLength := mload(_data)
+        }
+ 
+        bool success;
+        assembly {
+            gasBefore := gas()
+            success := call(gas(), _target, 0, calldataStart, calldataLength, 0, 0)
+            gasAfter := gas()
+        }
+        Erequire(success, "Call failed, but calls we want to measure gas for should succeed!");
+ 
+        return gasBefore - gasAfter;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-helpers/Helper_ModifiableStorage.sol.html b/coverage/test-helpers/Helper_ModifiableStorage.sol.html new file mode 100644 index 000000000..f0c0291b2 --- /dev/null +++ b/coverage/test-helpers/Helper_ModifiableStorage.sol.html @@ -0,0 +1,233 @@ + + + + Code coverage report for test-helpers/Helper_ModifiableStorage.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_ModifiableStorage.sol +

+
+
+ 0% + Statements + 0/5 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+contract Helper_ModifiableStorage {
+    mapping (address => address) private target;
+ 
+    constructor(
+        address _target
+    )
+    {
+        target[address(this)] = _target;
+    }
+ 
+    fallback()
+        external
+    {
+        (bool success, bytes memory returndata) = target[address(this)].delegatecall(msg.data);
+ 
+        if (success) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+ 
+    function __setStorageSlot(
+        bytes32 _key,
+        bytes32 _value
+    )
+        public
+    {
+        assembly {
+            sstore(_key, _value)
+        }
+    }
+ 
+    function __getStorageSlot(
+        bytes32 _key
+    )
+        public
+        view
+        returns (
+            bytes32 _value
+        )
+    {
+        bytes32 value;
+        assembly {
+            value := sload(_key)
+        }
+        return value;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-helpers/Helper_PrecompileCaller.sol.html b/coverage/test-helpers/Helper_PrecompileCaller.sol.html new file mode 100644 index 000000000..1c17c6868 --- /dev/null +++ b/coverage/test-helpers/Helper_PrecompileCaller.sol.html @@ -0,0 +1,224 @@ + + + + Code coverage report for test-helpers/Helper_PrecompileCaller.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_PrecompileCaller.sol +

+
+
+ 75% + Statements + 9/12 +
+
+ 50% + Branches + 3/6 +
+
+ 100% + Functions + 3/3 +
+
+ 75% + Lines + 9/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54  +  +  +  +  +  +  +  +  +  +  +  +54× +54× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+import { Helper_SimpleProxy } from "./Helper_SimpleProxy.sol";
+ 
+contract Helper_PredeployCaller is Helper_SimpleProxy {
+    function callPredeploy(
+        address _predeploy,
+        bytes memory _data
+    )
+        public
+    {
+        Eif (msg.sender == owner) {
+            makeExternalCall(_predeploy, _data);
+        } else {
+            makeExternalCall(target, msg.data);
+        }
+    }
+ 
+    function callPredeployAbi(
+        address _predeploy,
+        bytes memory _data
+    )
+        public
+        returns (
+            bytes memory
+        )
+    {
+ 
+        bool success;
+        bytes memory returndata;
+        Eif (msg.sender == owner) {
+            (success, returndata) = _predeploy.call(_data);
+        } else {
+            (success, returndata) = target.call(msg.data);
+        }
+        Erequire(success, "Predeploy call reverted");
+        return returndata;
+    }
+ 
+    function getL1MessageSender(
+        address _predeploy,
+        bytes memory _data
+    )
+        public
+        returns (
+            address
+        )
+    {
+        callPredeploy(_predeploy, _data);
+        return address(0); // unused: silence compiler
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-helpers/Helper_SimpleProxy.sol.html b/coverage/test-helpers/Helper_SimpleProxy.sol.html new file mode 100644 index 000000000..431c71e0b --- /dev/null +++ b/coverage/test-helpers/Helper_SimpleProxy.sol.html @@ -0,0 +1,212 @@ + + + + Code coverage report for test-helpers/Helper_SimpleProxy.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_SimpleProxy.sol +

+
+
+ 85.71% + Statements + 6/7 +
+
+ 75% + Branches + 3/4 +
+
+ 100% + Functions + 4/4 +
+
+ 88.89% + Lines + 8/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50  +  +  +  +  +  +  +  +  +69× +  +  +  +  +  +271× +  +  +  +  +  +  +  +23× +23× +  +  +  +  +  +  +  +  +  +  +  +325× +  +325× +321× +  +  +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+contract Helper_SimpleProxy {
+    address internal owner;
+    address internal target;
+ 
+    constructor()
+    {
+        owner = msg.sender;
+    }
+ 
+    fallback()
+        external
+    {
+        makeExternalCall(target, msg.data);
+    }
+ 
+    function setTarget(
+        address _target
+    )
+        public
+    {
+        Eif (msg.sender == owner) {
+            target = _target;
+        } else {
+            makeExternalCall(target, msg.data);
+        }
+    }
+ 
+    function makeExternalCall(
+        address _target,
+        bytes memory _calldata
+    )
+        internal
+    {
+        (bool success, bytes memory returndata) = _target.call(_calldata);
+ 
+        if (success) {
+            assembly {
+                return(add(returndata, 0x20), mload(returndata))
+            }
+        } else {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-helpers/Helper_TestRunner.sol.html b/coverage/test-helpers/Helper_TestRunner.sol.html new file mode 100644 index 000000000..4034ff256 --- /dev/null +++ b/coverage/test-helpers/Helper_TestRunner.sol.html @@ -0,0 +1,647 @@ + + + + Code coverage report for test-helpers/Helper_TestRunner.sol + + + + + + + +
+
+

+ all files / test-helpers/ Helper_TestRunner.sol +

+
+
+ 30.3% + Statements + 20/66 +
+
+ 66.67% + Branches + 16/24 +
+
+ 80% + Functions + 4/5 +
+
+ 33.8% + Lines + 24/71 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +161× +161× +  +  +  +  +  +161× + + +  +  +  +159× + +  +  +  +  +156× +  +156× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +156× + +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +156× +17× +  +  +  +  +  +  +  +  +  +  +83× +87× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +  +  +  +  +  +  +14× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +18× +  + +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Logging */
+import { console } from "hardhat/console.sol";
+ 
+/**
+ * @title Helper_TestRunner
+ */
+contract Helper_TestRunner {
+    struct TestStep {
+        string functionName;
+        bytes functionData;
+        bool expectedReturnStatus;
+        bytes expectedReturnData;
+        bool onlyValidateFlag;
+    }
+ 
+    function runSingleTestStep(
+        TestStep memory _step
+    )
+        public
+    {
+        bytes32 namehash = keccak256(abi.encodePacked(_step.functionName));
+        Iif (namehash == keccak256("evmRETURN")) {
+            bytes memory functionData = _step.functionData;
+            assembly {
+                return(add(functionData, 0x20), mload(functionData))
+            }
+        }
+        if (namehash == keccak256("evmREVERT")) {
+            bytes memory functionData = _step.functionData;
+            assembly {
+                revert(add(functionData, 0x20), mload(functionData))
+            }
+        }
+        if (namehash == keccak256("evmINVALID")) {
+            assembly {
+                invalid()
+            }
+        }
+ 
+        (bool success, bytes memory returndata) = address(msg.sender).call(_step.functionData);
+ 
+        Iif (success != _step.expectedReturnStatus) {
+            if (success == true) {
+                console.log("ERROR: Expected function to revert, but function returned successfully");
+                console.log("Offending Step: %s", _step.functionName);
+                console.log("Return Data:");
+                console.logBytes(returndata);
+                console.log("");
+            } else {
+                (
+                    uint256 _flag,
+                    uint256 _nuisanceGasLeft,
+                    uint256 _ovmGasRefund,
+                    bytes memory _data
+                ) = _decodeRevertData(returndata);
+ 
+                console.log("ERROR: Expected function to return successfully, but function reverted");
+                console.log("Offending Step: %s", _step.functionName);
+                console.log("Flag: %s", _flag);
+                console.log("Nuisance Gas Left: %s", _nuisanceGasLeft);
+                console.log("OVM Gas Refund: %s", _ovmGasRefund);
+                console.log("Extra Data:");
+                console.logBytes(_data);
+                console.log("");
+            }
+ 
+            _failStep();
+        }
+ 
+        if (keccak256(returndata) != keccak256(_step.expectedReturnData)) {
+            Iif (success == true) {
+                console.log("ERROR: Actual return data does not match expected return data");
+                console.log("Offending Step: %s", _step.functionName);
+                console.log("Expected:");
+                console.logBytes(_step.expectedReturnData);
+                console.log("Actual:");
+                console.logBytes(returndata);
+                console.log("");
+ 
+                _failStep();
+            } else {
+                (
+                    uint256 _expectedFlag,
+                    uint256 _expectedNuisanceGasLeft,
+                    uint256 _expectedOvmGasRefund,
+                    bytes memory _expectedData
+                ) = _decodeRevertData(_step.expectedReturnData);
+ 
+                (
+                    uint256 _flag,
+                    uint256 _nuisanceGasLeft,
+                    uint256 _ovmGasRefund,
+                    bytes memory _data
+                ) = _decodeRevertData(returndata);
+ 
+                Eif (
+                    _step.onlyValidateFlag
+                ) {
+                    Iif (
+                        _expectedFlag != _flag
+                    ) {
+                        console.log("ERROR: Actual revert flag does not match expected revert flag data");
+                        console.log("Offending Step: %s", _step.functionName);
+                        console.log("Expected Flag: %s", _expectedFlag);
+                        console.log("Actual Flag: %s", _flag);
+                        _failStep();
+                    }
+                } else {
+                    console.log("ERROR: Actual revert flag data does not match expected revert flag data");
+                    console.log("Offending Step: %s", _step.functionName);
+                    console.log("Expected Flag: %s", _expectedFlag);
+                    console.log("Actual Flag: %s", _flag);
+                    console.log("Expected Nuisance Gas Left: %s", _expectedNuisanceGasLeft);
+                    console.log("Actual Nuisance Gas Left: %s", _nuisanceGasLeft);
+                    console.log("Expected OVM Gas Refund: %s", _expectedOvmGasRefund);
+                    console.log("Actual OVM Gas Refund: %s", _ovmGasRefund);
+                    console.log("Expected Extra Data:");
+                    console.logBytes(_expectedData);
+                    console.log("Actual Extra Data:");
+                    console.logBytes(_data);
+                    console.log("");
+                    _failStep();
+                }
+            }
+        }
+ 
+        if (success == false) {
+            assembly {
+                revert(add(returndata, 0x20), mload(returndata))
+            }
+        }
+    }
+ 
+    function runMultipleTestSteps(
+        TestStep[] memory _steps
+    )
+        public
+    {
+        for (uint256 i = 0; i < _steps.length; i++) {
+            runSingleTestStep(_steps[i]);
+        }
+    }
+ 
+    function _decodeRevertData(
+        bytes memory _revertdata
+    )
+        internal
+        pure
+        returns (
+            uint256 _flag,
+            uint256 _nuisanceGasLeft,
+            uint256 _ovmGasRefund,
+            bytes memory _data
+        )
+    {
+        Iif (_revertdata.length == 0) {
+            return (
+                0,
+                0,
+                0,
+                bytes('')
+            );
+        }
+ 
+        return abi.decode(_revertdata, (uint256, uint256, uint256, bytes));
+    }
+ 
+    function _failStep()
+        internal
+        pure
+    {
+        revert("Test step failed.");
+    }
+}
+ 
+contract Helper_TestRunner_CREATE is Helper_TestRunner {
+    constructor(
+        bytes memory _bytecode,
+        TestStep[] memory _steps
+    )
+    {
+        if (_steps.length > 0) {
+            runMultipleTestSteps(_steps);
+        } else {
+            assembly {
+                return(add(_bytecode, 0x20), mload(_bytecode))
+            }
+        }
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-helpers/Mock_FraudVerifier.sol.html b/coverage/test-helpers/Mock_FraudVerifier.sol.html new file mode 100644 index 000000000..414282eb3 --- /dev/null +++ b/coverage/test-helpers/Mock_FraudVerifier.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for test-helpers/Mock_FraudVerifier.sol + + + + + + + +
+
+

+ all files / test-helpers/ Mock_FraudVerifier.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +46× +  +  +  +12× +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+import { OVM_BondManager } from "./../optimistic-ethereum/OVM/verification/OVM_BondManager.sol";
+ 
+contract Mock_FraudVerifier {
+    OVM_BondManager bondManager;
+ 
+    mapping (bytes32 => address) transitioners;
+ 
+    function setBondManager(OVM_BondManager _bondManager) public {
+        bondManager = _bondManager;
+    }
+ 
+    function setStateTransitioner(bytes32 preStateRoot, bytes32 txHash, address addr) public {
+        transitioners[keccak256(abi.encodePacked(preStateRoot, txHash))] = addr;
+    }
+ 
+    function getStateTransitioner(
+        bytes32 _preStateRoot,
+        bytes32 _txHash
+    )
+        public
+        view
+        returns (
+            address
+        )
+    {
+        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
+    }
+ 
+    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) public {
+        bondManager.finalize(_preStateRoot, publisher, timestamp);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-helpers/TestERC20.sol.html b/coverage/test-helpers/TestERC20.sol.html new file mode 100644 index 000000000..8aac61ec3 --- /dev/null +++ b/coverage/test-helpers/TestERC20.sol.html @@ -0,0 +1,269 @@ + + + + Code coverage report for test-helpers/TestERC20.sol + + + + + + + +
+
+

+ all files / test-helpers/ TestERC20.sol +

+
+
+ 89.47% + Statements + 17/19 +
+
+ 37.5% + Branches + 3/8 +
+
+ 90% + Functions + 9/10 +
+
+ 89.47% + Lines + 17/19 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +21× +21× +  +  +  +18× +18× +  +  +  +25× +25× +25× +  +  +  +18× +18× +  +  +  + + +  +  +  +18× +  +  +18× +18× +  +  +  +  +  +67× +  +  +  +25× +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+// a test ERC20 token with an open mint function
+contract TestERC20 {
+    using SafeMath for uint;
+ 
+    string public constant name = 'Test';
+    string public constant symbol = 'TST';
+    uint8 public constant decimals = 18;
+    uint256  public totalSupply;
+    mapping(address => uint) public balanceOf;
+    mapping(address => mapping(address => uint)) public allowance;
+ 
+    event Approval(address indexed owner, address indexed spender, uint256 value);
+    event Transfer(address indexed from, address indexed to, uint256 value);
+ 
+    constructor() {}
+ 
+    function mint(address to, uint256 value) public {
+        totalSupply = totalSupply.add(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(address(0), to, value);
+    }
+ 
+    function _approve(address owner, address spender, uint256 value) private {
+        allowance[owner][spender] = value;
+        emit Approval(owner, spender, value);
+    }
+ 
+    function _transfer(address from, address to, uint256 value) private {
+        balanceOf[from] = balanceOf[from].sub(value);
+        balanceOf[to] = balanceOf[to].add(value);
+        emit Transfer(from, to, value);
+    }
+ 
+    function approve(address spender, uint256 value) external returns (bool) {
+        _approve(msg.sender, spender, value);
+        return true;
+    }
+ 
+    function transfer(address to, uint256 value) external returns (bool) {
+        _transfer(msg.sender, to, value);
+        return true;
+    }
+ 
+    function transferFrom(address from, address to, uint256 value) external returns (bool) {
+        Iif (allowance[from][msg.sender] != uint(-1)) {
+            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
+        }
+        _transfer(from, to, value);
+        return true;
+    }
+}
+ 
+library SafeMath {
+    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
+        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
+    }
+ 
+    function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
+        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
+    }
+ 
+    function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
+        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-helpers/index.html b/coverage/test-helpers/index.html new file mode 100644 index 000000000..d957a052c --- /dev/null +++ b/coverage/test-helpers/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for test-helpers/ + + + + + + + +
+
+

+ all files test-helpers/ +

+
+
+ 52.5% + Statements + 63/120 +
+
+ 56.52% + Branches + 26/46 +
+
+ 80.65% + Functions + 25/31 +
+
+ 53.38% + Lines + 71/133 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Helper_GasMeasurer.sol
100%7/750%1/2100%1/1100%9/9
Helper_ModifiableStorage.sol
0%0/50%0/20%0/40%0/9
Helper_PrecompileCaller.sol
75%9/1250%3/6100%3/375%9/12
Helper_SimpleProxy.sol
85.71%6/775%3/4100%4/488.89%8/9
Helper_TestRunner.sol
30.3%20/6666.67%16/2480%4/533.8%24/71
Mock_FraudVerifier.sol
100%4/4100%0/0100%4/4100%4/4
TestERC20.sol
89.47%17/1937.5%3/890%9/1089.47%17/19
+
+
+ + + + + + + diff --git a/coverage/test-libraries/codec/TestLib_OVMCodec.sol.html b/coverage/test-libraries/codec/TestLib_OVMCodec.sol.html new file mode 100644 index 000000000..3c1930eb7 --- /dev/null +++ b/coverage/test-libraries/codec/TestLib_OVMCodec.sol.html @@ -0,0 +1,245 @@ + + + + Code coverage report for test-libraries/codec/TestLib_OVMCodec.sol + + + + + + + +
+
+

+ all files / test-libraries/codec/ TestLib_OVMCodec.sol +

+
+
+ 0% + Statements + 0/4 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_OVMCodec } from "../../optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol";
+ 
+/**
+ * @title TestLib_OVMCodec
+ */
+contract TestLib_OVMCodec {
+ 
+    function decodeEIP155Transaction(
+        bytes memory _transaction,
+        bool _isEthSignedMessage
+    )
+        public
+        pure
+        returns (
+            Lib_OVMCodec.EIP155Transaction memory _decoded
+        )
+    {
+        return Lib_OVMCodec.decodeEIP155Transaction(_transaction, _isEthSignedMessage);
+    }
+ 
+    function encodeTransaction(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        public
+        pure
+        returns (
+            bytes memory _encoded
+        )
+    {
+        return Lib_OVMCodec.encodeTransaction(_transaction);
+    }
+ 
+    function hashTransaction(
+        Lib_OVMCodec.Transaction memory _transaction
+    )
+        public
+        pure
+        returns (
+            bytes32 _hash
+        )
+    {
+        return Lib_OVMCodec.hashTransaction(_transaction);
+    }
+ 
+    function decompressEIP155Transaction(
+        bytes memory _transaction
+    )
+        public
+        returns (
+            Lib_OVMCodec.EIP155Transaction memory _decompressed
+        )
+    {
+        return Lib_OVMCodec.decompressEIP155Transaction(_transaction);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/codec/index.html b/coverage/test-libraries/codec/index.html new file mode 100644 index 000000000..513c5a78e --- /dev/null +++ b/coverage/test-libraries/codec/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for test-libraries/codec/ + + + + + + + +
+
+

+ all files test-libraries/codec/ +

+
+
+ 0% + Statements + 0/4 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/4 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
TestLib_OVMCodec.sol
0%0/4100%0/00%0/40%0/4
+
+
+ + + + + + + diff --git a/coverage/test-libraries/rlp/TestLib_RLPReader.sol.html b/coverage/test-libraries/rlp/TestLib_RLPReader.sol.html new file mode 100644 index 000000000..946105c3c --- /dev/null +++ b/coverage/test-libraries/rlp/TestLib_RLPReader.sol.html @@ -0,0 +1,368 @@ + + + + Code coverage report for test-libraries/rlp/TestLib_RLPReader.sol + + + + + + + +
+
+

+ all files / test-libraries/rlp/ TestLib_RLPReader.sol +

+
+
+ 90.91% + Statements + 10/11 +
+
+ 100% + Branches + 0/0 +
+
+ 85.71% + Functions + 6/7 +
+
+ 90.91% + Lines + 10/11 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +62× +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPReader } from "../../optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol";
+ 
+/**
+ * @title TestLib_RLPReader
+ */
+contract TestLib_RLPReader {
+ 
+    function readList(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bytes[] memory
+        )
+    {
+        Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_in);
+        bytes[] memory out = new bytes[](decoded.length);
+        for (uint256 i = 0; i < out.length; i++) {
+            out[i] = Lib_RLPReader.readRawBytes(decoded[i]);
+        }
+        return out;
+    }
+ 
+    function readString(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            string memory
+        )
+    {
+        return Lib_RLPReader.readString(_in);
+    }
+ 
+    function readBytes(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bytes memory
+        )
+    {
+        return Lib_RLPReader.readBytes(_in);
+    }
+ 
+    function readBytes32(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_RLPReader.readBytes32(_in);
+    }
+ 
+    function readUint256(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            uint256
+        )
+    {
+        return Lib_RLPReader.readUint256(_in);
+    }
+ 
+    function readBool(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_RLPReader.readBool(_in);
+    }
+ 
+    function readAddress(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            address
+        )
+    {
+        return Lib_RLPReader.readAddress(_in);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/rlp/TestLib_RLPWriter.sol.html b/coverage/test-libraries/rlp/TestLib_RLPWriter.sol.html new file mode 100644 index 000000000..1a3ca073f --- /dev/null +++ b/coverage/test-libraries/rlp/TestLib_RLPWriter.sol.html @@ -0,0 +1,356 @@ + + + + Code coverage report for test-libraries/rlp/TestLib_RLPWriter.sol + + + + + + + +
+
+

+ all files / test-libraries/rlp/ TestLib_RLPWriter.sol +

+
+
+ 62.5% + Statements + 5/8 +
+
+ 100% + Branches + 0/0 +
+
+ 57.14% + Functions + 4/7 +
+
+ 62.5% + Lines + 5/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +61× +  +  +  +  +  +  +  +  +  +  +  +139× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RLPWriter } from "../../optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol";
+import { TestERC20 } from "../../test-helpers/TestERC20.sol";
+ 
+/**
+ * @title TestLib_RLPWriter
+ */
+contract TestLib_RLPWriter {
+ 
+    function writeBytes(
+        bytes memory _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeBytes(_in);
+    }
+ 
+    function writeList(
+        bytes[] memory _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeList(_in);
+    }
+ 
+    function writeString(
+        string memory _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeString(_in);
+    }
+ 
+    function writeAddress(
+        address _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeAddress(_in);
+    }
+ 
+    function writeUint(
+        uint256 _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeUint(_in);
+    }
+ 
+    function writeBool(
+        bool _in
+    )
+        public
+        pure
+        returns (
+            bytes memory _out
+        )
+    {
+        return Lib_RLPWriter.writeBool(_in);
+    }
+ 
+    function writeAddressWithTaintedMemory(
+        address _in
+    )
+        public
+        returns (
+            bytes memory _out
+        )
+    {
+        new TestERC20();
+        return Lib_RLPWriter.writeAddress(_in);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/rlp/index.html b/coverage/test-libraries/rlp/index.html new file mode 100644 index 000000000..23f40f43d --- /dev/null +++ b/coverage/test-libraries/rlp/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for test-libraries/rlp/ + + + + + + + +
+
+

+ all files test-libraries/rlp/ +

+
+
+ 78.95% + Statements + 15/19 +
+
+ 100% + Branches + 0/0 +
+
+ 71.43% + Functions + 10/14 +
+
+ 78.95% + Lines + 15/19 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
TestLib_RLPReader.sol
90.91%10/11100%0/085.71%6/790.91%10/11
TestLib_RLPWriter.sol
62.5%5/8100%0/057.14%4/762.5%5/8
+
+
+ + + + + + + diff --git a/coverage/test-libraries/trie/TestLib_MerkleTrie.sol.html b/coverage/test-libraries/trie/TestLib_MerkleTrie.sol.html new file mode 100644 index 000000000..5ba93e048 --- /dev/null +++ b/coverage/test-libraries/trie/TestLib_MerkleTrie.sol.html @@ -0,0 +1,377 @@ + + + + Code coverage report for test-libraries/trie/TestLib_MerkleTrie.sol + + + + + + + +
+
+

+ all files / test-libraries/trie/ TestLib_MerkleTrie.sol +

+
+
+ 60% + Statements + 3/5 +
+
+ 100% + Branches + 0/0 +
+
+ 60% + Functions + 3/5 +
+
+ 60% + Lines + 3/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +32× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_MerkleTrie } from "../../optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol";
+ 
+/**
+ * @title TestLib_MerkleTrie
+ */
+contract TestLib_MerkleTrie {
+ 
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_MerkleTrie.verifyInclusionProof(
+            _key,
+            _value,
+            _proof,
+            _root
+        );
+    }
+ 
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_MerkleTrie.verifyExclusionProof(
+            _key,
+            _proof,
+            _root
+        );
+    }
+ 
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_MerkleTrie.update(
+            _key,
+            _value,
+            _proof,
+            _root
+        );
+    }
+ 
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        return Lib_MerkleTrie.get(
+            _key,
+            _proof,
+            _root
+        );
+    }
+ 
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_MerkleTrie.getSingleNodeRootHash(
+            _key,
+            _value
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html b/coverage/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html new file mode 100644 index 000000000..1735f3dbc --- /dev/null +++ b/coverage/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html @@ -0,0 +1,380 @@ + + + + Code coverage report for test-libraries/trie/TestLib_SecureMerkleTrie.sol + + + + + + + +
+
+

+ all files / test-libraries/trie/ TestLib_SecureMerkleTrie.sol +

+
+
+ 60% + Statements + 3/5 +
+
+ 100% + Branches + 0/0 +
+
+ 60% + Functions + 3/5 +
+
+ 60% + Lines + 3/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_SecureMerkleTrie } from "../../optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol";
+ 
+/**
+ * @title TestLib_SecureMerkleTrie
+ */
+contract TestLib_SecureMerkleTrie {
+ 
+    function verifyInclusionProof(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_SecureMerkleTrie.verifyInclusionProof(
+            _key,
+            _value,
+            _proof,
+            _root
+        );
+    }
+ 
+    function verifyExclusionProof(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_SecureMerkleTrie.verifyExclusionProof(
+            _key,
+            _proof,
+            _root
+        );
+    }
+ 
+    function update(
+        bytes memory _key,
+        bytes memory _value,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_SecureMerkleTrie.update(
+            _key,
+            _value,
+            _proof,
+            _root
+        );
+    }
+ 
+    function get(
+        bytes memory _key,
+        bytes memory _proof,
+        bytes32 _root
+    )
+        public
+        pure
+        returns (
+            bool,
+            bytes memory
+        )
+    {
+        return Lib_SecureMerkleTrie.get(
+            _key,
+            _proof,
+            _root
+        );
+    }
+ 
+    function getSingleNodeRootHash(
+        bytes memory _key,
+        bytes memory _value
+    )
+        public
+        pure
+        returns (
+            bytes32
+        )
+    {
+        return Lib_SecureMerkleTrie.getSingleNodeRootHash(
+            _key,
+            _value
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/trie/index.html b/coverage/test-libraries/trie/index.html new file mode 100644 index 000000000..156eb46c8 --- /dev/null +++ b/coverage/test-libraries/trie/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for test-libraries/trie/ + + + + + + + +
+
+

+ all files test-libraries/trie/ +

+
+
+ 60% + Statements + 6/10 +
+
+ 100% + Branches + 0/0 +
+
+ 60% + Functions + 6/10 +
+
+ 60% + Lines + 6/10 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
TestLib_MerkleTrie.sol
60%3/5100%0/060%3/560%3/5
TestLib_SecureMerkleTrie.sol
60%3/5100%0/060%3/560%3/5
+
+
+ + + + + + + diff --git a/coverage/test-libraries/utils/TestLib_Bytes32Utils.sol.html b/coverage/test-libraries/utils/TestLib_Bytes32Utils.sol.html new file mode 100644 index 000000000..d74a5946d --- /dev/null +++ b/coverage/test-libraries/utils/TestLib_Bytes32Utils.sol.html @@ -0,0 +1,242 @@ + + + + Code coverage report for test-libraries/utils/TestLib_Bytes32Utils.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_Bytes32Utils.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 4/4 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_Bytes32Utils } from "../../optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol";
+ 
+/**
+ * @title TestLib_Byte32Utils
+ */
+contract TestLib_Bytes32Utils {
+ 
+    function toBool(
+        bytes32 _in
+    )
+        public
+        pure
+        returns (
+            bool _out
+        )
+    {
+        return Lib_Bytes32Utils.toBool(_in);
+    }
+ 
+    function fromBool(
+        bool _in
+    )
+        public
+        pure
+        returns (
+            bytes32 _out
+        )
+    {
+        return Lib_Bytes32Utils.fromBool(_in);
+    }
+ 
+    function toAddress(
+        bytes32 _in
+    )
+        public
+        pure
+        returns (
+            address _out
+        )
+    {
+        return Lib_Bytes32Utils.toAddress(_in);
+    }
+ 
+    function fromAddress(
+        address _in
+    )
+        public
+        pure
+        returns (
+            bytes32 _out
+        )
+    {
+        return Lib_Bytes32Utils.fromAddress(_in);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/utils/TestLib_BytesUtils.sol.html b/coverage/test-libraries/utils/TestLib_BytesUtils.sol.html new file mode 100644 index 000000000..1da9a7b70 --- /dev/null +++ b/coverage/test-libraries/utils/TestLib_BytesUtils.sol.html @@ -0,0 +1,428 @@ + + + + Code coverage report for test-libraries/utils/TestLib_BytesUtils.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_BytesUtils.sol +

+
+
+ 88.89% + Statements + 8/9 +
+
+ 100% + Branches + 0/0 +
+
+ 87.5% + Functions + 7/8 +
+
+ 88.89% + Lines + 8/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_BytesUtils } from "../../optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol";
+import { TestERC20 } from "../../test-helpers/TestERC20.sol";
+ 
+/**
+ * @title TestLib_BytesUtils
+ */
+contract TestLib_BytesUtils {
+ 
+    function concat(
+        bytes memory _preBytes,
+        bytes memory _postBytes
+    )
+        public
+        pure
+        returns (bytes memory)
+    {
+        return abi.encodePacked(
+            _preBytes,
+            _postBytes
+        );
+    }
+ 
+    function slice(
+        bytes memory _bytes,
+        uint256 _start,
+        uint256 _length
+    )
+        public
+        pure
+        returns (bytes memory)
+    {
+        return Lib_BytesUtils.slice(
+            _bytes,
+            _start,
+            _length
+        );
+    }
+ 
+    function toBytes32(
+        bytes memory _bytes
+    )
+        public
+        pure
+        returns (bytes32)
+    {
+        return Lib_BytesUtils.toBytes32(
+            _bytes
+        );
+    }
+ 
+    function toUint256(
+        bytes memory _bytes
+    )
+        public
+        pure
+        returns (uint256)
+    {
+        return Lib_BytesUtils.toUint256(
+            _bytes
+        );
+    }
+ 
+    function toNibbles(
+        bytes memory _bytes
+    )
+        public
+        pure
+        returns (bytes memory)
+    {
+        return Lib_BytesUtils.toNibbles(
+            _bytes
+        );
+    }
+ 
+    function fromNibbles(
+        bytes memory _bytes
+    )
+        public
+        pure
+        returns (bytes memory)
+    {
+        return Lib_BytesUtils.fromNibbles(
+            _bytes
+        );
+    }
+ 
+    function equal(
+        bytes memory _bytes,
+        bytes memory _other
+    )
+        public
+        pure
+        returns (bool)
+    {
+        return Lib_BytesUtils.equal(
+            _bytes,
+            _other
+        );
+    }
+ 
+    function sliceWithTaintedMemory(
+        bytes memory _bytes,
+        uint256 _start,
+        uint256 _length
+    )
+        public
+        returns (bytes memory)
+    {
+        new TestERC20();
+        return Lib_BytesUtils.slice(
+            _bytes,
+            _start,
+            _length
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/utils/TestLib_ECDSAUtils.sol.html b/coverage/test-libraries/utils/TestLib_ECDSAUtils.sol.html new file mode 100644 index 000000000..9327fbbb2 --- /dev/null +++ b/coverage/test-libraries/utils/TestLib_ECDSAUtils.sol.html @@ -0,0 +1,164 @@ + + + + Code coverage report for test-libraries/utils/TestLib_ECDSAUtils.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_ECDSAUtils.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+ 
+/* Library Imports */
+import { Lib_ECDSAUtils } from "../../optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol";
+ 
+/**
+ * @title TestLib_ECDSAUtils
+ */
+contract TestLib_ECDSAUtils {
+ 
+    function recover(
+        bytes memory _message,
+        bool _isEthSignedMessage,
+        uint8 _v,
+        bytes32 _r,
+        bytes32 _s
+    )
+        public
+        pure
+        returns (
+            address _sender
+        )
+    {
+        return Lib_ECDSAUtils.recover(
+            _message,
+            _isEthSignedMessage,
+            _v,
+            _r,
+            _s
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/utils/TestLib_EthUtils.sol.html b/coverage/test-libraries/utils/TestLib_EthUtils.sol.html new file mode 100644 index 000000000..2bf8a5405 --- /dev/null +++ b/coverage/test-libraries/utils/TestLib_EthUtils.sol.html @@ -0,0 +1,419 @@ + + + + Code coverage report for test-libraries/utils/TestLib_EthUtils.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_EthUtils.sol +

+
+
+ 14.29% + Statements + 1/7 +
+
+ 100% + Branches + 0/0 +
+
+ 14.29% + Functions + 1/7 +
+
+ 14.29% + Lines + 1/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+// @unsupported: ovm
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_EthUtils } from "../../optimistic-ethereum/libraries/utils/Lib_EthUtils.sol";
+ 
+/**
+ * @title TestLib_EthUtils
+ */
+contract TestLib_EthUtils {
+ 
+    function getCode(
+        address _address,
+        uint256 _offset,
+        uint256 _length
+    )
+        public
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        return Lib_EthUtils.getCode(
+            _address,
+            _offset,
+            _length
+        );
+    }
+ 
+    function getCode(
+        address _address
+    )
+        public
+        view
+        returns (
+            bytes memory _code
+        )
+    {
+        return Lib_EthUtils.getCode(
+            _address
+        );
+    }
+ 
+    function getCodeSize(
+        address _address
+    )
+        public
+        view
+        returns (
+            uint256 _codeSize
+        )
+    {
+        return Lib_EthUtils.getCodeSize(
+            _address
+        );
+    }
+ 
+    function getCodeHash(
+        address _address
+    )
+        public
+        view
+        returns (
+            bytes32 _codeHash
+        )
+    {
+        return Lib_EthUtils.getCodeHash(
+            _address
+        );
+    }
+ 
+    function createContract(
+        bytes memory _code
+    )
+        public
+        returns (
+            address _created
+        )
+    {
+        return Lib_EthUtils.createContract(
+            _code
+        );
+    }
+ 
+    function getAddressForCREATE(
+        address _creator,
+        uint256 _nonce
+    )
+        public
+        pure
+        returns (
+            address _address
+        )
+    {
+        return Lib_EthUtils.getAddressForCREATE(
+            _creator,
+            _nonce
+        );
+    }
+ 
+    function getAddressForCREATE2(
+        address _creator,
+        bytes memory _bytecode,
+        bytes32 _salt
+    )
+        public
+        pure
+        returns (address _address)
+    {
+        return Lib_EthUtils.getAddressForCREATE2(
+            _creator,
+            _bytecode,
+            _salt
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/utils/TestLib_MerkleTree.sol.html b/coverage/test-libraries/utils/TestLib_MerkleTree.sol.html new file mode 100644 index 000000000..0e685493b --- /dev/null +++ b/coverage/test-libraries/utils/TestLib_MerkleTree.sol.html @@ -0,0 +1,209 @@ + + + + Code coverage report for test-libraries/utils/TestLib_MerkleTree.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_MerkleTree.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +100× +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_MerkleTree } from "../../optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol";
+ 
+/**
+ * @title TestLib_MerkleTree
+ */
+contract TestLib_MerkleTree {
+ 
+    function getMerkleRoot(
+        bytes32[] memory _elements
+    )
+        public
+       pure 
+        returns (
+            bytes32
+        )
+    {
+        return Lib_MerkleTree.getMerkleRoot(
+            _elements
+        );
+    }
+ 
+    function verify(
+        bytes32 _root,
+        bytes32 _leaf,
+        uint256 _index,
+        bytes32[] memory _siblings,
+        uint256 _totalLeaves
+    )
+        public
+        pure
+        returns (
+            bool
+        )
+    {
+        return Lib_MerkleTree.verify(
+            _root,
+            _leaf,
+            _index,
+            _siblings,
+            _totalLeaves
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/utils/TestLib_RingBuffer.sol.html b/coverage/test-libraries/utils/TestLib_RingBuffer.sol.html new file mode 100644 index 000000000..a958378e1 --- /dev/null +++ b/coverage/test-libraries/utils/TestLib_RingBuffer.sol.html @@ -0,0 +1,278 @@ + + + + Code coverage report for test-libraries/utils/TestLib_RingBuffer.sol + + + + + + + +
+
+

+ all files / test-libraries/utils/ TestLib_RingBuffer.sol +

+
+
+ 0% + Statements + 0/5 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/5 +
+
+ 0% + Lines + 0/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
// SPDX-License-Identifier: MIT
+pragma solidity >0.5.0 <0.8.0;
+pragma experimental ABIEncoderV2;
+ 
+/* Library Imports */
+import { Lib_RingBuffer } from "../../optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol";
+ 
+/**
+ * @title TestLib_RingBuffer
+ */
+contract TestLib_RingBuffer {
+    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
+    
+    Lib_RingBuffer.RingBuffer internal buf;
+ 
+    function push(
+        bytes32 _value,
+        bytes27 _extraData
+    )
+        public
+    {
+        buf.push(
+            _value,
+            _extraData
+        );
+    }
+ 
+    function get(
+        uint256 _index
+    )
+        public
+        view
+        returns (
+            bytes32    
+        )
+    {
+        return buf.get(_index);
+    }
+ 
+    function deleteElementsAfterInclusive(
+        uint40 _index,
+        bytes27 _extraData
+    )
+        internal
+    {
+        return buf.deleteElementsAfterInclusive(
+            _index,
+            _extraData
+        );
+    }
+ 
+    function getLength()
+        internal
+        view
+        returns (
+            uint40
+        )
+    {
+        return buf.getLength();
+    }
+ 
+    function getExtraData()
+        internal
+        view
+        returns (
+            bytes27
+        )
+    {
+        return buf.getExtraData();
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test-libraries/utils/index.html b/coverage/test-libraries/utils/index.html new file mode 100644 index 000000000..9a77798b4 --- /dev/null +++ b/coverage/test-libraries/utils/index.html @@ -0,0 +1,158 @@ + + + + Code coverage report for test-libraries/utils/ + + + + + + + +
+
+

+ all files test-libraries/utils/ +

+
+
+ 57.14% + Statements + 16/28 +
+
+ 100% + Branches + 0/0 +
+
+ 55.56% + Functions + 15/27 +
+
+ 57.14% + Lines + 16/28 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
TestLib_Bytes32Utils.sol
100%4/4100%0/0100%4/4100%4/4
TestLib_BytesUtils.sol
88.89%8/9100%0/087.5%7/888.89%8/9
TestLib_ECDSAUtils.sol
100%1/1100%0/0100%1/1100%1/1
TestLib_EthUtils.sol
14.29%1/7100%0/014.29%1/714.29%1/7
TestLib_MerkleTree.sol
100%2/2100%0/0100%2/2100%2/2
TestLib_RingBuffer.sol
0%0/5100%0/00%0/50%0/5
+
+
+ + + + + + + From 4f18240e64a6cca4c8ff06996951964bb075654b Mon Sep 17 00:00:00 2001 From: Maurelian Date: Thu, 25 Mar 2021 16:33:30 -0400 Subject: [PATCH 04/10] Revert "Check-in coverage output" Too noisy to have coverage output stored here. I will look for an alternative solution. This reverts commit fb631f2471903e9b8ab76c66e18f308d92930cae. --- coverage.json | 1 - .../OVM_ECDSAContractAccount.sol.html | 485 -- coverage/OVM/accounts/OVM_ProxyEOA.sol.html | 428 -- coverage/OVM/accounts/index.html | 106 - .../Abs_BaseCrossDomainMessenger.sol.html | 443 -- .../OVM_L1CrossDomainMessenger.sol.html | 947 --- .../OVM_L1MultiMessageRelayer.sol.html | 275 - .../OVM_L2CrossDomainMessenger.sol.html | 473 -- coverage/OVM/bridge/messaging/index.html | 132 - .../bridge/tokens/Abs_L1TokenGateway.sol.html | 692 -- .../tokens/Abs_L2DepositedToken.sol.html | 755 --- .../bridge/tokens/OVM_L1ERC20Gateway.sol.html | 365 -- .../bridge/tokens/OVM_L1ETHGateway.sol.html | 557 -- .../tokens/OVM_L2DepositedERC20.sol.html | 266 - coverage/OVM/bridge/tokens/index.html | 145 - .../OVM_CanonicalTransactionChain.sol.html | 3755 ----------- .../chain/OVM_ChainStorageContainer.sol.html | 680 -- .../chain/OVM_StateCommitmentChain.sol.html | 1307 ---- coverage/OVM/chain/index.html | 119 - .../execution/OVM_ExecutionManager.sol.html | 5654 ----------------- .../OVM/execution/OVM_SafetyChecker.sol.html | 509 -- .../OVM/execution/OVM_StateManager.sol.html | 2279 ------- .../OVM_StateManagerFactory.sol.html | 188 - coverage/OVM/execution/index.html | 132 - .../OVM/predeploys/ERC1820Registry.sol.html | 662 -- .../predeploys/OVM_DeployerWhitelist.sol.html | 701 -- coverage/OVM/predeploys/OVM_ETH.sol.html | 167 - .../predeploys/OVM_L1MessageSender.sol.html | 194 - .../OVM_L2ToL1MessagePasser.sol.html | 215 - .../OVM_ProxySequencerEntrypoint.sol.html | 413 -- .../OVM_SequencerEntrypoint.sol.html | 446 -- coverage/OVM/predeploys/index.html | 171 - .../Abs_FraudContributor.sol.html | 119 - .../OVM/verification/OVM_BondManager.sol.html | 689 -- .../verification/OVM_FraudVerifier.sol.html | 953 --- .../OVM_StateTransitioner.sol.html | 1484 ----- .../OVM_StateTransitionerFactory.sol.html | 266 - coverage/OVM/verification/index.html | 145 - coverage/base.css | 213 - coverage/coverage-final.json | 78 - .../iOVM_ECDSAContractAccount.sol.html | 137 - coverage/iOVM/accounts/index.html | 93 - .../iAbs_BaseCrossDomainMessenger.sol.html | 173 - .../iOVM_L1CrossDomainMessenger.sol.html | 257 - .../iOVM_L1MultiMessageRelayer.sol.html | 119 - .../iOVM_L2CrossDomainMessenger.sol.html | 155 - coverage/iOVM/bridge/messaging/index.html | 132 - .../bridge/tokens/iOVM_L1ETHGateway.sol.html | 230 - .../tokens/iOVM_L1TokenGateway.sol.html | 218 - .../tokens/iOVM_L2DepositedToken.sol.html | 218 - coverage/iOVM/bridge/tokens/index.html | 119 - .../iOVM_CanonicalTransactionChain.sol.html | 782 --- .../chain/iOVM_ChainStorageContainer.sol.html | 398 -- .../chain/iOVM_StateCommitmentChain.sol.html | 419 -- coverage/iOVM/chain/index.html | 119 - .../execution/iOVM_ExecutionManager.sol.html | 533 -- .../execution/iOVM_SafetyChecker.sol.html | 107 - .../iOVM/execution/iOVM_StateManager.sol.html | 296 - .../iOVM_StateManagerFactory.sol.html | 134 - coverage/iOVM/execution/index.html | 132 - .../iOVM_DeployerWhitelist.sol.html | 125 - coverage/iOVM/predeploys/iOVM_ERC20.sol.html | 224 - .../predeploys/iOVM_L1MessageSender.sol.html | 107 - .../iOVM_L2ToL1MessagePasser.sol.html | 140 - coverage/iOVM/predeploys/index.html | 132 - .../verification/iOVM_BondManager.sol.html | 389 -- .../verification/iOVM_FraudVerifier.sol.html | 260 - .../iOVM_StateTransitioner.sol.html | 314 - .../iOVM_StateTransitionerFactory.sol.html | 143 - coverage/iOVM/verification/index.html | 132 - coverage/index.html | 366 -- .../OVM_ECDSAContractAccount.sol.html | 485 -- .../OVM/accounts/OVM_ProxyEOA.sol.html | 428 -- coverage/lcov-report/OVM/accounts/index.html | 106 - .../Abs_BaseCrossDomainMessenger.sol.html | 443 -- .../OVM_L1CrossDomainMessenger.sol.html | 947 --- .../OVM_L1MultiMessageRelayer.sol.html | 275 - .../OVM_L2CrossDomainMessenger.sol.html | 473 -- .../OVM/bridge/messaging/index.html | 132 - .../bridge/tokens/Abs_L1TokenGateway.sol.html | 692 -- .../tokens/Abs_L2DepositedToken.sol.html | 755 --- .../bridge/tokens/OVM_L1ERC20Gateway.sol.html | 365 -- .../bridge/tokens/OVM_L1ETHGateway.sol.html | 557 -- .../tokens/OVM_L2DepositedERC20.sol.html | 266 - .../lcov-report/OVM/bridge/tokens/index.html | 145 - .../OVM_CanonicalTransactionChain.sol.html | 3755 ----------- .../chain/OVM_ChainStorageContainer.sol.html | 680 -- .../chain/OVM_StateCommitmentChain.sol.html | 1307 ---- coverage/lcov-report/OVM/chain/index.html | 119 - .../execution/OVM_ExecutionManager.sol.html | 5654 ----------------- .../OVM/execution/OVM_SafetyChecker.sol.html | 509 -- .../OVM/execution/OVM_StateManager.sol.html | 2279 ------- .../OVM_StateManagerFactory.sol.html | 188 - coverage/lcov-report/OVM/execution/index.html | 132 - .../OVM/predeploys/ERC1820Registry.sol.html | 662 -- .../predeploys/OVM_DeployerWhitelist.sol.html | 701 -- .../OVM/predeploys/OVM_ETH.sol.html | 167 - .../predeploys/OVM_L1MessageSender.sol.html | 194 - .../OVM_L2ToL1MessagePasser.sol.html | 215 - .../OVM_ProxySequencerEntrypoint.sol.html | 413 -- .../OVM_SequencerEntrypoint.sol.html | 446 -- .../lcov-report/OVM/predeploys/index.html | 171 - .../Abs_FraudContributor.sol.html | 119 - .../OVM/verification/OVM_BondManager.sol.html | 689 -- .../verification/OVM_FraudVerifier.sol.html | 953 --- .../OVM_StateTransitioner.sol.html | 1484 ----- .../OVM_StateTransitionerFactory.sol.html | 266 - .../lcov-report/OVM/verification/index.html | 145 - coverage/lcov-report/base.css | 213 - .../iOVM_ECDSAContractAccount.sol.html | 137 - coverage/lcov-report/iOVM/accounts/index.html | 93 - .../iAbs_BaseCrossDomainMessenger.sol.html | 173 - .../iOVM_L1CrossDomainMessenger.sol.html | 257 - .../iOVM_L1MultiMessageRelayer.sol.html | 119 - .../iOVM_L2CrossDomainMessenger.sol.html | 155 - .../iOVM/bridge/messaging/index.html | 132 - .../bridge/tokens/iOVM_L1ETHGateway.sol.html | 230 - .../tokens/iOVM_L1TokenGateway.sol.html | 218 - .../tokens/iOVM_L2DepositedToken.sol.html | 218 - .../lcov-report/iOVM/bridge/tokens/index.html | 119 - .../iOVM_CanonicalTransactionChain.sol.html | 782 --- .../chain/iOVM_ChainStorageContainer.sol.html | 398 -- .../chain/iOVM_StateCommitmentChain.sol.html | 419 -- coverage/lcov-report/iOVM/chain/index.html | 119 - .../execution/iOVM_ExecutionManager.sol.html | 533 -- .../execution/iOVM_SafetyChecker.sol.html | 107 - .../iOVM/execution/iOVM_StateManager.sol.html | 296 - .../iOVM_StateManagerFactory.sol.html | 134 - .../lcov-report/iOVM/execution/index.html | 132 - .../iOVM_DeployerWhitelist.sol.html | 125 - .../iOVM/predeploys/iOVM_ERC20.sol.html | 224 - .../predeploys/iOVM_L1MessageSender.sol.html | 107 - .../iOVM_L2ToL1MessagePasser.sol.html | 140 - .../lcov-report/iOVM/predeploys/index.html | 132 - .../verification/iOVM_BondManager.sol.html | 389 -- .../verification/iOVM_FraudVerifier.sol.html | 260 - .../iOVM_StateTransitioner.sol.html | 314 - .../iOVM_StateTransitionerFactory.sol.html | 143 - .../lcov-report/iOVM/verification/index.html | 132 - coverage/lcov-report/index.html | 366 -- .../bridge/OVM_CrossDomainEnabled.sol.html | 308 - .../lcov-report/libraries/bridge/index.html | 93 - .../libraries/codec/Lib_OVMCodec.sol.html | 1178 ---- .../lcov-report/libraries/codec/index.html | 93 - .../resolver/Lib_AddressManager.sol.html | 272 - .../resolver/Lib_AddressResolver.sol.html | 209 - .../libraries/resolver/Lib_Ownable.sol.html | 293 - .../Lib_ResolvedDelegateProxy.sol.html | 281 - .../lcov-report/libraries/resolver/index.html | 132 - .../libraries/rlp/Lib_RLPReader.sol.html | 1925 ------ .../libraries/rlp/Lib_RLPWriter.sol.html | 911 --- coverage/lcov-report/libraries/rlp/index.html | 106 - .../standards/IUniswapV2ERC20.sol.html | 137 - .../libraries/standards/UniSafeMath.sol.html | 119 - .../standards/UniswapV2ERC20.sol.html | 359 -- .../libraries/standards/index.html | 119 - .../libraries/trie/Lib_MerkleTrie.sol.html | 2945 --------- .../trie/Lib_SecureMerkleTrie.sol.html | 548 -- .../lcov-report/libraries/trie/index.html | 106 - .../libraries/utils/Lib_Bytes32Utils.sol.html | 416 -- .../libraries/utils/Lib_BytesUtils.sol.html | 728 --- .../libraries/utils/Lib_ECDSAUtils.sol.html | 356 -- .../libraries/utils/Lib_ErrorUtils.sol.html | 170 - .../libraries/utils/Lib_EthUtils.sol.html | 629 -- .../libraries/utils/Lib_Math.sol.html | 170 - .../libraries/utils/Lib_MerkleTree.sol.html | 725 --- .../utils/Lib_ReentrancyGuard.sol.html | 248 - .../libraries/utils/Lib_RingBuffer.sol.html | 1193 ---- .../lcov-report/libraries/utils/index.html | 197 - .../Lib_SafeExecutionManagerWrapper.sol.html | 1205 ---- .../wrappers/Lib_SafeMathWrapper.sol.html | 566 -- .../lcov-report/libraries/wrappers/index.html | 106 - .../OVM_ECDSAContractAccount.sol.html | 485 -- .../OVM/accounts/OVM_ProxyEOA.sol.html | 428 -- .../OVM/accounts/index.html | 106 - .../Abs_BaseCrossDomainMessenger.sol.html | 443 -- .../OVM_L1CrossDomainMessenger.sol.html | 947 --- .../OVM_L1MultiMessageRelayer.sol.html | 275 - .../OVM_L2CrossDomainMessenger.sol.html | 473 -- .../OVM/bridge/messaging/index.html | 132 - .../bridge/tokens/Abs_L1TokenGateway.sol.html | 692 -- .../tokens/Abs_L2DepositedToken.sol.html | 755 --- .../bridge/tokens/OVM_L1ERC20Gateway.sol.html | 365 -- .../bridge/tokens/OVM_L1ETHGateway.sol.html | 557 -- .../tokens/OVM_L2DepositedERC20.sol.html | 266 - .../OVM/bridge/tokens/index.html | 145 - .../OVM_CanonicalTransactionChain.sol.html | 3755 ----------- .../chain/OVM_ChainStorageContainer.sol.html | 680 -- .../chain/OVM_StateCommitmentChain.sol.html | 1307 ---- .../optimistic-ethereum/OVM/chain/index.html | 119 - .../execution/OVM_ExecutionManager.sol.html | 5654 ----------------- .../OVM/execution/OVM_SafetyChecker.sol.html | 509 -- .../OVM/execution/OVM_StateManager.sol.html | 2279 ------- .../OVM_StateManagerFactory.sol.html | 188 - .../OVM/execution/index.html | 132 - .../OVM/predeploys/ERC1820Registry.sol.html | 662 -- .../predeploys/OVM_DeployerWhitelist.sol.html | 701 -- .../OVM/predeploys/OVM_ETH.sol.html | 167 - .../predeploys/OVM_L1MessageSender.sol.html | 194 - .../OVM_L2ToL1MessagePasser.sol.html | 215 - .../OVM_ProxySequencerEntrypoint.sol.html | 413 -- .../OVM_SequencerEntrypoint.sol.html | 446 -- .../OVM/predeploys/index.html | 171 - .../Abs_FraudContributor.sol.html | 119 - .../OVM/verification/OVM_BondManager.sol.html | 689 -- .../verification/OVM_FraudVerifier.sol.html | 953 --- .../OVM_StateTransitioner.sol.html | 1484 ----- .../OVM_StateTransitionerFactory.sol.html | 266 - .../OVM/verification/index.html | 145 - .../iOVM_ECDSAContractAccount.sol.html | 137 - .../iOVM/accounts/index.html | 93 - .../iAbs_BaseCrossDomainMessenger.sol.html | 173 - .../iOVM_L1CrossDomainMessenger.sol.html | 257 - .../iOVM_L1MultiMessageRelayer.sol.html | 119 - .../iOVM_L2CrossDomainMessenger.sol.html | 155 - .../iOVM/bridge/messaging/index.html | 132 - .../bridge/tokens/iOVM_L1ETHGateway.sol.html | 230 - .../tokens/iOVM_L1TokenGateway.sol.html | 218 - .../tokens/iOVM_L2DepositedToken.sol.html | 218 - .../iOVM/bridge/tokens/index.html | 119 - .../iOVM_CanonicalTransactionChain.sol.html | 782 --- .../chain/iOVM_ChainStorageContainer.sol.html | 398 -- .../chain/iOVM_StateCommitmentChain.sol.html | 419 -- .../optimistic-ethereum/iOVM/chain/index.html | 119 - .../execution/iOVM_ExecutionManager.sol.html | 533 -- .../execution/iOVM_SafetyChecker.sol.html | 107 - .../iOVM/execution/iOVM_StateManager.sol.html | 296 - .../iOVM_StateManagerFactory.sol.html | 134 - .../iOVM/execution/index.html | 132 - .../iOVM_DeployerWhitelist.sol.html | 125 - .../iOVM/predeploys/iOVM_ERC20.sol.html | 224 - .../predeploys/iOVM_L1MessageSender.sol.html | 107 - .../iOVM_L2ToL1MessagePasser.sol.html | 140 - .../iOVM/predeploys/index.html | 132 - .../verification/iOVM_BondManager.sol.html | 389 -- .../verification/iOVM_FraudVerifier.sol.html | 260 - .../iOVM_StateTransitioner.sol.html | 314 - .../iOVM_StateTransitionerFactory.sol.html | 143 - .../iOVM/verification/index.html | 132 - .../bridge/OVM_CrossDomainEnabled.sol.html | 308 - .../libraries/bridge/index.html | 93 - .../libraries/codec/Lib_OVMCodec.sol.html | 1178 ---- .../libraries/codec/index.html | 93 - .../resolver/Lib_AddressManager.sol.html | 272 - .../resolver/Lib_AddressResolver.sol.html | 209 - .../libraries/resolver/Lib_Ownable.sol.html | 293 - .../Lib_ResolvedDelegateProxy.sol.html | 281 - .../libraries/resolver/index.html | 132 - .../libraries/rlp/Lib_RLPReader.sol.html | 1925 ------ .../libraries/rlp/Lib_RLPWriter.sol.html | 911 --- .../libraries/rlp/index.html | 106 - .../standards/IUniswapV2ERC20.sol.html | 137 - .../libraries/standards/UniSafeMath.sol.html | 119 - .../standards/UniswapV2ERC20.sol.html | 359 -- .../libraries/standards/index.html | 119 - .../libraries/trie/Lib_MerkleTrie.sol.html | 2945 --------- .../trie/Lib_SecureMerkleTrie.sol.html | 548 -- .../libraries/trie/index.html | 106 - .../libraries/utils/Lib_Bytes32Utils.sol.html | 416 -- .../libraries/utils/Lib_BytesUtils.sol.html | 728 --- .../libraries/utils/Lib_ECDSAUtils.sol.html | 356 -- .../libraries/utils/Lib_ErrorUtils.sol.html | 170 - .../libraries/utils/Lib_EthUtils.sol.html | 629 -- .../libraries/utils/Lib_Math.sol.html | 170 - .../libraries/utils/Lib_MerkleTree.sol.html | 725 --- .../utils/Lib_ReentrancyGuard.sol.html | 248 - .../libraries/utils/Lib_RingBuffer.sol.html | 1193 ---- .../libraries/utils/index.html | 197 - .../Lib_SafeExecutionManagerWrapper.sol.html | 1205 ---- .../wrappers/Lib_SafeMathWrapper.sol.html | 566 -- .../libraries/wrappers/index.html | 106 - .../mockOVM/accounts/index.html | 93 - .../mockOVM_ECDSAContractAccount.sol.html | 350 - .../mockOVM/bridge/index.html | 106 - .../mockOVM_CrossDomainMessenger.sol.html | 500 -- ...ckOVM_GenericCrossDomainMessenger.sol.html | 206 - .../mockOVM/verification/index.html | 93 - .../verification/mockOVM_BondManager.sol.html | 329 - coverage/lcov-report/prettify.css | 1 - coverage/lcov-report/prettify.js | 1 - coverage/lcov-report/sort-arrow-sprite.png | Bin 209 -> 0 bytes coverage/lcov-report/sorter.js | 158 - .../test-helpers/Helper_GasMeasurer.sol.html | 164 - .../Helper_ModifiableStorage.sol.html | 233 - .../Helper_PrecompileCaller.sol.html | 224 - .../test-helpers/Helper_SimpleProxy.sol.html | 212 - .../test-helpers/Helper_TestRunner.sol.html | 647 -- .../test-helpers/Mock_FraudVerifier.sol.html | 170 - .../test-helpers/TestERC20.sol.html | 269 - coverage/lcov-report/test-helpers/index.html | 171 - .../codec/TestLib_OVMCodec.sol.html | 245 - .../test-libraries/codec/index.html | 93 - .../rlp/TestLib_RLPReader.sol.html | 368 -- .../rlp/TestLib_RLPWriter.sol.html | 356 -- .../lcov-report/test-libraries/rlp/index.html | 106 - .../trie/TestLib_MerkleTrie.sol.html | 377 -- .../trie/TestLib_SecureMerkleTrie.sol.html | 380 -- .../test-libraries/trie/index.html | 106 - .../utils/TestLib_Bytes32Utils.sol.html | 242 - .../utils/TestLib_BytesUtils.sol.html | 428 -- .../utils/TestLib_ECDSAUtils.sol.html | 164 - .../utils/TestLib_EthUtils.sol.html | 419 -- .../utils/TestLib_MerkleTree.sol.html | 209 - .../utils/TestLib_RingBuffer.sol.html | 278 - .../test-libraries/utils/index.html | 158 - coverage/lcov.info | 3736 ----------- .../bridge/OVM_CrossDomainEnabled.sol.html | 308 - coverage/libraries/bridge/index.html | 93 - .../libraries/codec/Lib_OVMCodec.sol.html | 1178 ---- coverage/libraries/codec/index.html | 93 - .../resolver/Lib_AddressManager.sol.html | 272 - .../resolver/Lib_AddressResolver.sol.html | 209 - .../libraries/resolver/Lib_Ownable.sol.html | 293 - .../Lib_ResolvedDelegateProxy.sol.html | 281 - coverage/libraries/resolver/index.html | 132 - coverage/libraries/rlp/Lib_RLPReader.sol.html | 1925 ------ coverage/libraries/rlp/Lib_RLPWriter.sol.html | 911 --- coverage/libraries/rlp/index.html | 106 - .../standards/IUniswapV2ERC20.sol.html | 137 - .../libraries/standards/UniSafeMath.sol.html | 119 - .../standards/UniswapV2ERC20.sol.html | 359 -- coverage/libraries/standards/index.html | 119 - .../libraries/trie/Lib_MerkleTrie.sol.html | 2945 --------- .../trie/Lib_SecureMerkleTrie.sol.html | 548 -- coverage/libraries/trie/index.html | 106 - .../libraries/utils/Lib_Bytes32Utils.sol.html | 416 -- .../libraries/utils/Lib_BytesUtils.sol.html | 728 --- .../libraries/utils/Lib_ECDSAUtils.sol.html | 356 -- .../libraries/utils/Lib_ErrorUtils.sol.html | 170 - .../libraries/utils/Lib_EthUtils.sol.html | 629 -- coverage/libraries/utils/Lib_Math.sol.html | 170 - .../libraries/utils/Lib_MerkleTree.sol.html | 725 --- .../utils/Lib_ReentrancyGuard.sol.html | 248 - .../libraries/utils/Lib_RingBuffer.sol.html | 1193 ---- coverage/libraries/utils/index.html | 197 - .../Lib_SafeExecutionManagerWrapper.sol.html | 1205 ---- .../wrappers/Lib_SafeMathWrapper.sol.html | 566 -- coverage/libraries/wrappers/index.html | 106 - .../OVM_ECDSAContractAccount.sol.html | 485 -- .../OVM/accounts/OVM_ProxyEOA.sol.html | 428 -- .../OVM/accounts/index.html | 106 - .../Abs_BaseCrossDomainMessenger.sol.html | 443 -- .../OVM_L1CrossDomainMessenger.sol.html | 947 --- .../OVM_L1MultiMessageRelayer.sol.html | 275 - .../OVM_L2CrossDomainMessenger.sol.html | 473 -- .../OVM/bridge/messaging/index.html | 132 - .../bridge/tokens/Abs_L1TokenGateway.sol.html | 692 -- .../tokens/Abs_L2DepositedToken.sol.html | 755 --- .../bridge/tokens/OVM_L1ERC20Gateway.sol.html | 365 -- .../bridge/tokens/OVM_L1ETHGateway.sol.html | 557 -- .../tokens/OVM_L2DepositedERC20.sol.html | 266 - .../OVM/bridge/tokens/index.html | 145 - .../OVM_CanonicalTransactionChain.sol.html | 3755 ----------- .../chain/OVM_ChainStorageContainer.sol.html | 680 -- .../chain/OVM_StateCommitmentChain.sol.html | 1307 ---- .../optimistic-ethereum/OVM/chain/index.html | 119 - .../execution/OVM_ExecutionManager.sol.html | 5654 ----------------- .../OVM/execution/OVM_SafetyChecker.sol.html | 509 -- .../OVM/execution/OVM_StateManager.sol.html | 2279 ------- .../OVM_StateManagerFactory.sol.html | 188 - .../OVM/execution/index.html | 132 - .../OVM/predeploys/ERC1820Registry.sol.html | 662 -- .../predeploys/OVM_DeployerWhitelist.sol.html | 701 -- .../OVM/predeploys/OVM_ETH.sol.html | 167 - .../predeploys/OVM_L1MessageSender.sol.html | 194 - .../OVM_L2ToL1MessagePasser.sol.html | 215 - .../OVM_ProxySequencerEntrypoint.sol.html | 413 -- .../OVM_SequencerEntrypoint.sol.html | 446 -- .../OVM/predeploys/index.html | 171 - .../Abs_FraudContributor.sol.html | 119 - .../OVM/verification/OVM_BondManager.sol.html | 689 -- .../verification/OVM_FraudVerifier.sol.html | 953 --- .../OVM_StateTransitioner.sol.html | 1484 ----- .../OVM_StateTransitionerFactory.sol.html | 266 - .../OVM/verification/index.html | 145 - .../iOVM_ECDSAContractAccount.sol.html | 137 - .../iOVM/accounts/index.html | 93 - .../iAbs_BaseCrossDomainMessenger.sol.html | 173 - .../iOVM_L1CrossDomainMessenger.sol.html | 257 - .../iOVM_L1MultiMessageRelayer.sol.html | 119 - .../iOVM_L2CrossDomainMessenger.sol.html | 155 - .../iOVM/bridge/messaging/index.html | 132 - .../bridge/tokens/iOVM_L1ETHGateway.sol.html | 230 - .../tokens/iOVM_L1TokenGateway.sol.html | 218 - .../tokens/iOVM_L2DepositedToken.sol.html | 218 - .../iOVM/bridge/tokens/index.html | 119 - .../iOVM_CanonicalTransactionChain.sol.html | 782 --- .../chain/iOVM_ChainStorageContainer.sol.html | 398 -- .../chain/iOVM_StateCommitmentChain.sol.html | 419 -- .../optimistic-ethereum/iOVM/chain/index.html | 119 - .../execution/iOVM_ExecutionManager.sol.html | 533 -- .../execution/iOVM_SafetyChecker.sol.html | 107 - .../iOVM/execution/iOVM_StateManager.sol.html | 296 - .../iOVM_StateManagerFactory.sol.html | 134 - .../iOVM/execution/index.html | 132 - .../iOVM_DeployerWhitelist.sol.html | 125 - .../iOVM/predeploys/iOVM_ERC20.sol.html | 224 - .../predeploys/iOVM_L1MessageSender.sol.html | 107 - .../iOVM_L2ToL1MessagePasser.sol.html | 140 - .../iOVM/predeploys/index.html | 132 - .../verification/iOVM_BondManager.sol.html | 389 -- .../verification/iOVM_FraudVerifier.sol.html | 260 - .../iOVM_StateTransitioner.sol.html | 314 - .../iOVM_StateTransitionerFactory.sol.html | 143 - .../iOVM/verification/index.html | 132 - .../bridge/OVM_CrossDomainEnabled.sol.html | 308 - .../libraries/bridge/index.html | 93 - .../libraries/codec/Lib_OVMCodec.sol.html | 1178 ---- .../libraries/codec/index.html | 93 - .../resolver/Lib_AddressManager.sol.html | 272 - .../resolver/Lib_AddressResolver.sol.html | 209 - .../libraries/resolver/Lib_Ownable.sol.html | 293 - .../Lib_ResolvedDelegateProxy.sol.html | 281 - .../libraries/resolver/index.html | 132 - .../libraries/rlp/Lib_RLPReader.sol.html | 1925 ------ .../libraries/rlp/Lib_RLPWriter.sol.html | 911 --- .../libraries/rlp/index.html | 106 - .../standards/IUniswapV2ERC20.sol.html | 137 - .../libraries/standards/UniSafeMath.sol.html | 119 - .../standards/UniswapV2ERC20.sol.html | 359 -- .../libraries/standards/index.html | 119 - .../libraries/trie/Lib_MerkleTrie.sol.html | 2945 --------- .../trie/Lib_SecureMerkleTrie.sol.html | 548 -- .../libraries/trie/index.html | 106 - .../libraries/utils/Lib_Bytes32Utils.sol.html | 416 -- .../libraries/utils/Lib_BytesUtils.sol.html | 728 --- .../libraries/utils/Lib_ECDSAUtils.sol.html | 356 -- .../libraries/utils/Lib_ErrorUtils.sol.html | 170 - .../libraries/utils/Lib_EthUtils.sol.html | 629 -- .../libraries/utils/Lib_Math.sol.html | 170 - .../libraries/utils/Lib_MerkleTree.sol.html | 725 --- .../utils/Lib_ReentrancyGuard.sol.html | 248 - .../libraries/utils/Lib_RingBuffer.sol.html | 1193 ---- .../libraries/utils/index.html | 197 - .../Lib_SafeExecutionManagerWrapper.sol.html | 1205 ---- .../wrappers/Lib_SafeMathWrapper.sol.html | 566 -- .../libraries/wrappers/index.html | 106 - .../mockOVM/accounts/index.html | 93 - .../mockOVM_ECDSAContractAccount.sol.html | 350 - .../mockOVM/bridge/index.html | 106 - .../mockOVM_CrossDomainMessenger.sol.html | 500 -- ...ckOVM_GenericCrossDomainMessenger.sol.html | 206 - .../mockOVM/verification/index.html | 93 - .../verification/mockOVM_BondManager.sol.html | 329 - coverage/prettify.css | 1 - coverage/prettify.js | 1 - coverage/sort-arrow-sprite.png | Bin 209 -> 0 bytes coverage/sorter.js | 158 - .../test-helpers/Helper_GasMeasurer.sol.html | 164 - .../Helper_ModifiableStorage.sol.html | 233 - .../Helper_PrecompileCaller.sol.html | 224 - .../test-helpers/Helper_SimpleProxy.sol.html | 212 - .../test-helpers/Helper_TestRunner.sol.html | 647 -- .../test-helpers/Mock_FraudVerifier.sol.html | 170 - coverage/test-helpers/TestERC20.sol.html | 269 - coverage/test-helpers/index.html | 171 - .../codec/TestLib_OVMCodec.sol.html | 245 - coverage/test-libraries/codec/index.html | 93 - .../rlp/TestLib_RLPReader.sol.html | 368 -- .../rlp/TestLib_RLPWriter.sol.html | 356 -- coverage/test-libraries/rlp/index.html | 106 - .../trie/TestLib_MerkleTrie.sol.html | 377 -- .../trie/TestLib_SecureMerkleTrie.sol.html | 380 -- coverage/test-libraries/trie/index.html | 106 - .../utils/TestLib_Bytes32Utils.sol.html | 242 - .../utils/TestLib_BytesUtils.sol.html | 428 -- .../utils/TestLib_ECDSAUtils.sol.html | 164 - .../utils/TestLib_EthUtils.sol.html | 419 -- .../utils/TestLib_MerkleTree.sol.html | 209 - .../utils/TestLib_RingBuffer.sol.html | 278 - coverage/test-libraries/utils/index.html | 158 - 471 files changed, 224273 deletions(-) delete mode 100644 coverage.json delete mode 100644 coverage/OVM/accounts/OVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/OVM/accounts/OVM_ProxyEOA.sol.html delete mode 100644 coverage/OVM/accounts/index.html delete mode 100644 coverage/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html delete mode 100644 coverage/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html delete mode 100644 coverage/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html delete mode 100644 coverage/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html delete mode 100644 coverage/OVM/bridge/messaging/index.html delete mode 100644 coverage/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html delete mode 100644 coverage/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html delete mode 100644 coverage/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html delete mode 100644 coverage/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html delete mode 100644 coverage/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html delete mode 100644 coverage/OVM/bridge/tokens/index.html delete mode 100644 coverage/OVM/chain/OVM_CanonicalTransactionChain.sol.html delete mode 100644 coverage/OVM/chain/OVM_ChainStorageContainer.sol.html delete mode 100644 coverage/OVM/chain/OVM_StateCommitmentChain.sol.html delete mode 100644 coverage/OVM/chain/index.html delete mode 100644 coverage/OVM/execution/OVM_ExecutionManager.sol.html delete mode 100644 coverage/OVM/execution/OVM_SafetyChecker.sol.html delete mode 100644 coverage/OVM/execution/OVM_StateManager.sol.html delete mode 100644 coverage/OVM/execution/OVM_StateManagerFactory.sol.html delete mode 100644 coverage/OVM/execution/index.html delete mode 100644 coverage/OVM/predeploys/ERC1820Registry.sol.html delete mode 100644 coverage/OVM/predeploys/OVM_DeployerWhitelist.sol.html delete mode 100644 coverage/OVM/predeploys/OVM_ETH.sol.html delete mode 100644 coverage/OVM/predeploys/OVM_L1MessageSender.sol.html delete mode 100644 coverage/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html delete mode 100644 coverage/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html delete mode 100644 coverage/OVM/predeploys/OVM_SequencerEntrypoint.sol.html delete mode 100644 coverage/OVM/predeploys/index.html delete mode 100644 coverage/OVM/verification/Abs_FraudContributor.sol.html delete mode 100644 coverage/OVM/verification/OVM_BondManager.sol.html delete mode 100644 coverage/OVM/verification/OVM_FraudVerifier.sol.html delete mode 100644 coverage/OVM/verification/OVM_StateTransitioner.sol.html delete mode 100644 coverage/OVM/verification/OVM_StateTransitionerFactory.sol.html delete mode 100644 coverage/OVM/verification/index.html delete mode 100644 coverage/base.css delete mode 100644 coverage/coverage-final.json delete mode 100644 coverage/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/iOVM/accounts/index.html delete mode 100644 coverage/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html delete mode 100644 coverage/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html delete mode 100644 coverage/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html delete mode 100644 coverage/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html delete mode 100644 coverage/iOVM/bridge/messaging/index.html delete mode 100644 coverage/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html delete mode 100644 coverage/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html delete mode 100644 coverage/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html delete mode 100644 coverage/iOVM/bridge/tokens/index.html delete mode 100644 coverage/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html delete mode 100644 coverage/iOVM/chain/iOVM_ChainStorageContainer.sol.html delete mode 100644 coverage/iOVM/chain/iOVM_StateCommitmentChain.sol.html delete mode 100644 coverage/iOVM/chain/index.html delete mode 100644 coverage/iOVM/execution/iOVM_ExecutionManager.sol.html delete mode 100644 coverage/iOVM/execution/iOVM_SafetyChecker.sol.html delete mode 100644 coverage/iOVM/execution/iOVM_StateManager.sol.html delete mode 100644 coverage/iOVM/execution/iOVM_StateManagerFactory.sol.html delete mode 100644 coverage/iOVM/execution/index.html delete mode 100644 coverage/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html delete mode 100644 coverage/iOVM/predeploys/iOVM_ERC20.sol.html delete mode 100644 coverage/iOVM/predeploys/iOVM_L1MessageSender.sol.html delete mode 100644 coverage/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html delete mode 100644 coverage/iOVM/predeploys/index.html delete mode 100644 coverage/iOVM/verification/iOVM_BondManager.sol.html delete mode 100644 coverage/iOVM/verification/iOVM_FraudVerifier.sol.html delete mode 100644 coverage/iOVM/verification/iOVM_StateTransitioner.sol.html delete mode 100644 coverage/iOVM/verification/iOVM_StateTransitionerFactory.sol.html delete mode 100644 coverage/iOVM/verification/index.html delete mode 100644 coverage/index.html delete mode 100644 coverage/lcov-report/OVM/accounts/OVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/lcov-report/OVM/accounts/OVM_ProxyEOA.sol.html delete mode 100644 coverage/lcov-report/OVM/accounts/index.html delete mode 100644 coverage/lcov-report/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html delete mode 100644 coverage/lcov-report/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/OVM/bridge/messaging/index.html delete mode 100644 coverage/lcov-report/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html delete mode 100644 coverage/lcov-report/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html delete mode 100644 coverage/lcov-report/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html delete mode 100644 coverage/lcov-report/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html delete mode 100644 coverage/lcov-report/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html delete mode 100644 coverage/lcov-report/OVM/bridge/tokens/index.html delete mode 100644 coverage/lcov-report/OVM/chain/OVM_CanonicalTransactionChain.sol.html delete mode 100644 coverage/lcov-report/OVM/chain/OVM_ChainStorageContainer.sol.html delete mode 100644 coverage/lcov-report/OVM/chain/OVM_StateCommitmentChain.sol.html delete mode 100644 coverage/lcov-report/OVM/chain/index.html delete mode 100644 coverage/lcov-report/OVM/execution/OVM_ExecutionManager.sol.html delete mode 100644 coverage/lcov-report/OVM/execution/OVM_SafetyChecker.sol.html delete mode 100644 coverage/lcov-report/OVM/execution/OVM_StateManager.sol.html delete mode 100644 coverage/lcov-report/OVM/execution/OVM_StateManagerFactory.sol.html delete mode 100644 coverage/lcov-report/OVM/execution/index.html delete mode 100644 coverage/lcov-report/OVM/predeploys/ERC1820Registry.sol.html delete mode 100644 coverage/lcov-report/OVM/predeploys/OVM_DeployerWhitelist.sol.html delete mode 100644 coverage/lcov-report/OVM/predeploys/OVM_ETH.sol.html delete mode 100644 coverage/lcov-report/OVM/predeploys/OVM_L1MessageSender.sol.html delete mode 100644 coverage/lcov-report/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html delete mode 100644 coverage/lcov-report/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html delete mode 100644 coverage/lcov-report/OVM/predeploys/OVM_SequencerEntrypoint.sol.html delete mode 100644 coverage/lcov-report/OVM/predeploys/index.html delete mode 100644 coverage/lcov-report/OVM/verification/Abs_FraudContributor.sol.html delete mode 100644 coverage/lcov-report/OVM/verification/OVM_BondManager.sol.html delete mode 100644 coverage/lcov-report/OVM/verification/OVM_FraudVerifier.sol.html delete mode 100644 coverage/lcov-report/OVM/verification/OVM_StateTransitioner.sol.html delete mode 100644 coverage/lcov-report/OVM/verification/OVM_StateTransitionerFactory.sol.html delete mode 100644 coverage/lcov-report/OVM/verification/index.html delete mode 100644 coverage/lcov-report/base.css delete mode 100644 coverage/lcov-report/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/lcov-report/iOVM/accounts/index.html delete mode 100644 coverage/lcov-report/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html delete mode 100644 coverage/lcov-report/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/iOVM/bridge/messaging/index.html delete mode 100644 coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html delete mode 100644 coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html delete mode 100644 coverage/lcov-report/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html delete mode 100644 coverage/lcov-report/iOVM/bridge/tokens/index.html delete mode 100644 coverage/lcov-report/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html delete mode 100644 coverage/lcov-report/iOVM/chain/iOVM_ChainStorageContainer.sol.html delete mode 100644 coverage/lcov-report/iOVM/chain/iOVM_StateCommitmentChain.sol.html delete mode 100644 coverage/lcov-report/iOVM/chain/index.html delete mode 100644 coverage/lcov-report/iOVM/execution/iOVM_ExecutionManager.sol.html delete mode 100644 coverage/lcov-report/iOVM/execution/iOVM_SafetyChecker.sol.html delete mode 100644 coverage/lcov-report/iOVM/execution/iOVM_StateManager.sol.html delete mode 100644 coverage/lcov-report/iOVM/execution/iOVM_StateManagerFactory.sol.html delete mode 100644 coverage/lcov-report/iOVM/execution/index.html delete mode 100644 coverage/lcov-report/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html delete mode 100644 coverage/lcov-report/iOVM/predeploys/iOVM_ERC20.sol.html delete mode 100644 coverage/lcov-report/iOVM/predeploys/iOVM_L1MessageSender.sol.html delete mode 100644 coverage/lcov-report/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html delete mode 100644 coverage/lcov-report/iOVM/predeploys/index.html delete mode 100644 coverage/lcov-report/iOVM/verification/iOVM_BondManager.sol.html delete mode 100644 coverage/lcov-report/iOVM/verification/iOVM_FraudVerifier.sol.html delete mode 100644 coverage/lcov-report/iOVM/verification/iOVM_StateTransitioner.sol.html delete mode 100644 coverage/lcov-report/iOVM/verification/iOVM_StateTransitionerFactory.sol.html delete mode 100644 coverage/lcov-report/iOVM/verification/index.html delete mode 100644 coverage/lcov-report/index.html delete mode 100644 coverage/lcov-report/libraries/bridge/OVM_CrossDomainEnabled.sol.html delete mode 100644 coverage/lcov-report/libraries/bridge/index.html delete mode 100644 coverage/lcov-report/libraries/codec/Lib_OVMCodec.sol.html delete mode 100644 coverage/lcov-report/libraries/codec/index.html delete mode 100644 coverage/lcov-report/libraries/resolver/Lib_AddressManager.sol.html delete mode 100644 coverage/lcov-report/libraries/resolver/Lib_AddressResolver.sol.html delete mode 100644 coverage/lcov-report/libraries/resolver/Lib_Ownable.sol.html delete mode 100644 coverage/lcov-report/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html delete mode 100644 coverage/lcov-report/libraries/resolver/index.html delete mode 100644 coverage/lcov-report/libraries/rlp/Lib_RLPReader.sol.html delete mode 100644 coverage/lcov-report/libraries/rlp/Lib_RLPWriter.sol.html delete mode 100644 coverage/lcov-report/libraries/rlp/index.html delete mode 100644 coverage/lcov-report/libraries/standards/IUniswapV2ERC20.sol.html delete mode 100644 coverage/lcov-report/libraries/standards/UniSafeMath.sol.html delete mode 100644 coverage/lcov-report/libraries/standards/UniswapV2ERC20.sol.html delete mode 100644 coverage/lcov-report/libraries/standards/index.html delete mode 100644 coverage/lcov-report/libraries/trie/Lib_MerkleTrie.sol.html delete mode 100644 coverage/lcov-report/libraries/trie/Lib_SecureMerkleTrie.sol.html delete mode 100644 coverage/lcov-report/libraries/trie/index.html delete mode 100644 coverage/lcov-report/libraries/utils/Lib_Bytes32Utils.sol.html delete mode 100644 coverage/lcov-report/libraries/utils/Lib_BytesUtils.sol.html delete mode 100644 coverage/lcov-report/libraries/utils/Lib_ECDSAUtils.sol.html delete mode 100644 coverage/lcov-report/libraries/utils/Lib_ErrorUtils.sol.html delete mode 100644 coverage/lcov-report/libraries/utils/Lib_EthUtils.sol.html delete mode 100644 coverage/lcov-report/libraries/utils/Lib_Math.sol.html delete mode 100644 coverage/lcov-report/libraries/utils/Lib_MerkleTree.sol.html delete mode 100644 coverage/lcov-report/libraries/utils/Lib_ReentrancyGuard.sol.html delete mode 100644 coverage/lcov-report/libraries/utils/Lib_RingBuffer.sol.html delete mode 100644 coverage/lcov-report/libraries/utils/index.html delete mode 100644 coverage/lcov-report/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html delete mode 100644 coverage/lcov-report/libraries/wrappers/Lib_SafeMathWrapper.sol.html delete mode 100644 coverage/lcov-report/libraries/wrappers/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/accounts/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/chain/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/execution/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/predeploys/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/OVM/verification/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/accounts/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/chain/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/execution/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/iOVM/verification/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/bridge/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/codec/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/resolver/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/rlp/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/standards/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/trie/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Math.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/utils/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/libraries/wrappers/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/verification/index.html delete mode 100644 coverage/lcov-report/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html delete mode 100644 coverage/lcov-report/prettify.css delete mode 100644 coverage/lcov-report/prettify.js delete mode 100644 coverage/lcov-report/sort-arrow-sprite.png delete mode 100644 coverage/lcov-report/sorter.js delete mode 100644 coverage/lcov-report/test-helpers/Helper_GasMeasurer.sol.html delete mode 100644 coverage/lcov-report/test-helpers/Helper_ModifiableStorage.sol.html delete mode 100644 coverage/lcov-report/test-helpers/Helper_PrecompileCaller.sol.html delete mode 100644 coverage/lcov-report/test-helpers/Helper_SimpleProxy.sol.html delete mode 100644 coverage/lcov-report/test-helpers/Helper_TestRunner.sol.html delete mode 100644 coverage/lcov-report/test-helpers/Mock_FraudVerifier.sol.html delete mode 100644 coverage/lcov-report/test-helpers/TestERC20.sol.html delete mode 100644 coverage/lcov-report/test-helpers/index.html delete mode 100644 coverage/lcov-report/test-libraries/codec/TestLib_OVMCodec.sol.html delete mode 100644 coverage/lcov-report/test-libraries/codec/index.html delete mode 100644 coverage/lcov-report/test-libraries/rlp/TestLib_RLPReader.sol.html delete mode 100644 coverage/lcov-report/test-libraries/rlp/TestLib_RLPWriter.sol.html delete mode 100644 coverage/lcov-report/test-libraries/rlp/index.html delete mode 100644 coverage/lcov-report/test-libraries/trie/TestLib_MerkleTrie.sol.html delete mode 100644 coverage/lcov-report/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html delete mode 100644 coverage/lcov-report/test-libraries/trie/index.html delete mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_Bytes32Utils.sol.html delete mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_BytesUtils.sol.html delete mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_ECDSAUtils.sol.html delete mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_EthUtils.sol.html delete mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_MerkleTree.sol.html delete mode 100644 coverage/lcov-report/test-libraries/utils/TestLib_RingBuffer.sol.html delete mode 100644 coverage/lcov-report/test-libraries/utils/index.html delete mode 100644 coverage/lcov.info delete mode 100644 coverage/libraries/bridge/OVM_CrossDomainEnabled.sol.html delete mode 100644 coverage/libraries/bridge/index.html delete mode 100644 coverage/libraries/codec/Lib_OVMCodec.sol.html delete mode 100644 coverage/libraries/codec/index.html delete mode 100644 coverage/libraries/resolver/Lib_AddressManager.sol.html delete mode 100644 coverage/libraries/resolver/Lib_AddressResolver.sol.html delete mode 100644 coverage/libraries/resolver/Lib_Ownable.sol.html delete mode 100644 coverage/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html delete mode 100644 coverage/libraries/resolver/index.html delete mode 100644 coverage/libraries/rlp/Lib_RLPReader.sol.html delete mode 100644 coverage/libraries/rlp/Lib_RLPWriter.sol.html delete mode 100644 coverage/libraries/rlp/index.html delete mode 100644 coverage/libraries/standards/IUniswapV2ERC20.sol.html delete mode 100644 coverage/libraries/standards/UniSafeMath.sol.html delete mode 100644 coverage/libraries/standards/UniswapV2ERC20.sol.html delete mode 100644 coverage/libraries/standards/index.html delete mode 100644 coverage/libraries/trie/Lib_MerkleTrie.sol.html delete mode 100644 coverage/libraries/trie/Lib_SecureMerkleTrie.sol.html delete mode 100644 coverage/libraries/trie/index.html delete mode 100644 coverage/libraries/utils/Lib_Bytes32Utils.sol.html delete mode 100644 coverage/libraries/utils/Lib_BytesUtils.sol.html delete mode 100644 coverage/libraries/utils/Lib_ECDSAUtils.sol.html delete mode 100644 coverage/libraries/utils/Lib_ErrorUtils.sol.html delete mode 100644 coverage/libraries/utils/Lib_EthUtils.sol.html delete mode 100644 coverage/libraries/utils/Lib_Math.sol.html delete mode 100644 coverage/libraries/utils/Lib_MerkleTree.sol.html delete mode 100644 coverage/libraries/utils/Lib_ReentrancyGuard.sol.html delete mode 100644 coverage/libraries/utils/Lib_RingBuffer.sol.html delete mode 100644 coverage/libraries/utils/index.html delete mode 100644 coverage/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html delete mode 100644 coverage/libraries/wrappers/Lib_SafeMathWrapper.sol.html delete mode 100644 coverage/libraries/wrappers/index.html delete mode 100644 coverage/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/accounts/index.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/messaging/index.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/bridge/tokens/index.html delete mode 100644 coverage/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/chain/index.html delete mode 100644 coverage/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/execution/index.html delete mode 100644 coverage/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/predeploys/index.html delete mode 100644 coverage/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html delete mode 100644 coverage/optimistic-ethereum/OVM/verification/index.html delete mode 100644 coverage/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/accounts/index.html delete mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/bridge/messaging/index.html delete mode 100644 coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/bridge/tokens/index.html delete mode 100644 coverage/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/chain/index.html delete mode 100644 coverage/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/execution/index.html delete mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/predeploys/index.html delete mode 100644 coverage/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html delete mode 100644 coverage/optimistic-ethereum/iOVM/verification/index.html delete mode 100644 coverage/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/bridge/index.html delete mode 100644 coverage/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/codec/index.html delete mode 100644 coverage/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/resolver/index.html delete mode 100644 coverage/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/rlp/index.html delete mode 100644 coverage/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/standards/index.html delete mode 100644 coverage/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/trie/index.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_Math.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/utils/index.html delete mode 100644 coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html delete mode 100644 coverage/optimistic-ethereum/libraries/wrappers/index.html delete mode 100644 coverage/optimistic-ethereum/mockOVM/accounts/index.html delete mode 100644 coverage/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html delete mode 100644 coverage/optimistic-ethereum/mockOVM/bridge/index.html delete mode 100644 coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html delete mode 100644 coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html delete mode 100644 coverage/optimistic-ethereum/mockOVM/verification/index.html delete mode 100644 coverage/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html delete mode 100644 coverage/prettify.css delete mode 100644 coverage/prettify.js delete mode 100644 coverage/sort-arrow-sprite.png delete mode 100644 coverage/sorter.js delete mode 100644 coverage/test-helpers/Helper_GasMeasurer.sol.html delete mode 100644 coverage/test-helpers/Helper_ModifiableStorage.sol.html delete mode 100644 coverage/test-helpers/Helper_PrecompileCaller.sol.html delete mode 100644 coverage/test-helpers/Helper_SimpleProxy.sol.html delete mode 100644 coverage/test-helpers/Helper_TestRunner.sol.html delete mode 100644 coverage/test-helpers/Mock_FraudVerifier.sol.html delete mode 100644 coverage/test-helpers/TestERC20.sol.html delete mode 100644 coverage/test-helpers/index.html delete mode 100644 coverage/test-libraries/codec/TestLib_OVMCodec.sol.html delete mode 100644 coverage/test-libraries/codec/index.html delete mode 100644 coverage/test-libraries/rlp/TestLib_RLPReader.sol.html delete mode 100644 coverage/test-libraries/rlp/TestLib_RLPWriter.sol.html delete mode 100644 coverage/test-libraries/rlp/index.html delete mode 100644 coverage/test-libraries/trie/TestLib_MerkleTrie.sol.html delete mode 100644 coverage/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html delete mode 100644 coverage/test-libraries/trie/index.html delete mode 100644 coverage/test-libraries/utils/TestLib_Bytes32Utils.sol.html delete mode 100644 coverage/test-libraries/utils/TestLib_BytesUtils.sol.html delete mode 100644 coverage/test-libraries/utils/TestLib_ECDSAUtils.sol.html delete mode 100644 coverage/test-libraries/utils/TestLib_EthUtils.sol.html delete mode 100644 coverage/test-libraries/utils/TestLib_MerkleTree.sol.html delete mode 100644 coverage/test-libraries/utils/TestLib_RingBuffer.sol.html delete mode 100644 coverage/test-libraries/utils/index.html diff --git a/coverage.json b/coverage.json deleted file mode 100644 index 6556e7153..000000000 --- a/coverage.json +++ /dev/null @@ -1 +0,0 @@ -{"contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol":{"l":{"23":78,"37":9,"42":6,"47":3,"65":22,"79":7},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol","s":{"1":78,"2":9,"3":6,"4":22,"5":7},"b":{"1":[6,3],"2":[3,3]},"f":{"1":78,"2":9,"3":22,"4":7},"fnMap":{"1":{"name":"constructor","line":20,"loc":{"start":{"line":20,"column":4},"end":{"line":24,"column":4}}},"2":{"name":"onlyFromCrossDomainAccount","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"getCrossDomainMessenger","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":66,"column":4}}},"4":{"name":"sendCrossDomainMessage","line":74,"loc":{"start":{"line":74,"column":4},"end":{"line":80,"column":4}}}},"statementMap":{"1":{"start":{"line":23,"column":8},"end":{"line":23,"column":29}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1159}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":1311}},"4":{"start":{"line":65,"column":8},"end":{"line":65,"column":55}},"5":{"start":{"line":79,"column":8},"end":{"line":79,"column":82}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":8}},{"start":{"line":42,"column":8},"end":{"line":42,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol":{"l":{"119":7,"120":1,"131":1,"141":6,"143":6,"168":5,"195":5,"196":2,"205":3,"207":3,"208":3,"209":3,"210":3,"211":1,"213":2,"215":3,"216":3,"217":3,"218":3,"219":3,"221":3,"239":25,"264":25,"281":1,"303":1,"308":1,"313":1,"318":1,"319":1,"321":1,"338":6,"340":6,"362":107},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol","s":{"1":7,"2":1,"3":1,"4":6,"5":6,"6":5,"7":5,"8":2,"9":3,"10":3,"11":3,"12":3,"13":3,"14":1,"15":2,"16":3,"17":3,"18":3,"19":3,"20":3,"21":3,"22":25,"23":25,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":6,"32":6,"33":107},"b":{"1":[1,6],"2":[2,3],"3":[1,2]},"f":{"1":7,"2":5,"3":5,"4":25,"5":25,"6":1,"7":1,"8":6,"9":107},"fnMap":{"1":{"name":"decodeEIP155Transaction","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":153,"column":4}}},"2":{"name":"decompressEIP155Transaction","line":160,"loc":{"start":{"line":160,"column":4},"end":{"line":177,"column":4}}},"3":{"name":"encodeEIP155Transaction","line":185,"loc":{"start":{"line":185,"column":4},"end":{"line":223,"column":4}}},"4":{"name":"encodeTransaction","line":230,"loc":{"start":{"line":230,"column":4},"end":{"line":248,"column":4}}},"5":{"name":"hashTransaction","line":255,"loc":{"start":{"line":255,"column":4},"end":{"line":265,"column":4}}},"6":{"name":"toEVMAccount","line":272,"loc":{"start":{"line":272,"column":4},"end":{"line":287,"column":4}}},"7":{"name":"encodeEVMAccount","line":294,"loc":{"start":{"line":294,"column":4},"end":{"line":322,"column":4}}},"8":{"name":"decodeEVMAccount","line":329,"loc":{"start":{"line":329,"column":4},"end":{"line":346,"column":4}}},"9":{"name":"hashBatchHeader","line":353,"loc":{"start":{"line":353,"column":4},"end":{"line":370,"column":4}}}},"statementMap":{"1":{"start":{"line":119,"column":8},"end":{"line":119,"column":2703}},"2":{"start":{"line":120,"column":12},"end":{"line":120,"column":2747}},"3":{"start":{"line":131,"column":12},"end":{"line":131,"column":3104}},"4":{"start":{"line":141,"column":12},"end":{"line":141,"column":89}},"5":{"start":{"line":143,"column":12},"end":{"line":143,"column":3487}},"6":{"start":{"line":168,"column":8},"end":{"line":168,"column":4339}},"7":{"start":{"line":195,"column":8},"end":{"line":195,"column":5277}},"8":{"start":{"line":196,"column":12},"end":{"line":196,"column":5321}},"9":{"start":{"line":205,"column":12},"end":{"line":205,"column":47}},"10":{"start":{"line":207,"column":12},"end":{"line":207,"column":63}},"11":{"start":{"line":208,"column":12},"end":{"line":208,"column":66}},"12":{"start":{"line":209,"column":12},"end":{"line":209,"column":66}},"13":{"start":{"line":210,"column":12},"end":{"line":210,"column":5856}},"14":{"start":{"line":211,"column":16},"end":{"line":211,"column":52}},"15":{"start":{"line":213,"column":16},"end":{"line":213,"column":67}},"16":{"start":{"line":215,"column":12},"end":{"line":215,"column":46}},"17":{"start":{"line":216,"column":12},"end":{"line":216,"column":63}},"18":{"start":{"line":217,"column":12},"end":{"line":217,"column":65}},"19":{"start":{"line":218,"column":12},"end":{"line":218,"column":55}},"20":{"start":{"line":219,"column":12},"end":{"line":219,"column":55}},"21":{"start":{"line":221,"column":12},"end":{"line":221,"column":47}},"22":{"start":{"line":239,"column":8},"end":{"line":239,"column":6746}},"23":{"start":{"line":264,"column":8},"end":{"line":264,"column":57}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":7723}},"25":{"start":{"line":303,"column":8},"end":{"line":303,"column":43}},"26":{"start":{"line":308,"column":8},"end":{"line":308,"column":8466}},"27":{"start":{"line":313,"column":8},"end":{"line":313,"column":8623}},"28":{"start":{"line":318,"column":8},"end":{"line":318,"column":80}},"29":{"start":{"line":319,"column":8},"end":{"line":319,"column":77}},"30":{"start":{"line":321,"column":8},"end":{"line":321,"column":43}},"31":{"start":{"line":338,"column":8},"end":{"line":338,"column":86}},"32":{"start":{"line":340,"column":8},"end":{"line":340,"column":9427}},"33":{"start":{"line":362,"column":8},"end":{"line":362,"column":10058}}},"branchMap":{"1":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":8},"end":{"line":119,"column":8}},{"start":{"line":119,"column":8},"end":{"line":119,"column":8}}]},"2":{"line":195,"type":"if","locations":[{"start":{"line":195,"column":8},"end":{"line":195,"column":8}},{"start":{"line":195,"column":8},"end":{"line":195,"column":8}}]},"3":{"line":210,"type":"if","locations":[{"start":{"line":210,"column":12},"end":{"line":210,"column":12}},{"start":{"line":210,"column":12},"end":{"line":210,"column":12}}]}}},"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol":{"l":{"39":379,"40":379,"50":2107,"67":2486},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol","s":{"1":379,"2":379,"3":2107,"4":2486},"b":{},"f":{"1":379,"2":2107,"3":2486},"fnMap":{"1":{"name":"setAddress","line":37,"loc":{"start":{"line":32,"column":4},"end":{"line":41,"column":4}}},"2":{"name":"getAddress","line":43,"loc":{"start":{"line":43,"column":4},"end":{"line":51,"column":4}}},"3":{"name":"_getNameHash","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":68,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":40}},"2":{"start":{"line":40,"column":8},"end":{"line":40,"column":48}},"3":{"start":{"line":50,"column":8},"end":{"line":50,"column":45}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":49}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol":{"l":{"29":1041,"46":2076},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol","s":{"1":1041,"2":2076},"b":{},"f":{"1":1041,"2":2076},"fnMap":{"1":{"name":"constructor","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":30,"column":4}}},"2":{"name":"resolve","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":47,"column":4}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":65}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":50}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol":{"l":{"32":120,"33":120,"42":379,"46":379,"59":0,"60":0,"68":0,"73":0,"74":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol","s":{"1":120,"2":120,"3":379,"4":0,"5":0,"6":0,"7":0,"8":0},"b":{"1":[379,0],"2":[0,0]},"f":{"1":120,"2":379,"3":0,"4":0},"fnMap":{"1":{"name":"constructor","line":31,"loc":{"start":{"line":31,"column":4},"end":{"line":34,"column":4}}},"2":{"name":"onlyOwner","line":41,"loc":{"start":{"line":41,"column":4},"end":{"line":47,"column":4}}},"3":{"name":"renounceOwnership","line":57,"loc":{"start":{"line":54,"column":4},"end":{"line":61,"column":4}}},"4":{"name":"transferOwnership","line":66,"loc":{"start":{"line":63,"column":4},"end":{"line":75,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":25}},"2":{"start":{"line":33,"column":8},"end":{"line":33,"column":52}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":791}},"4":{"start":{"line":59,"column":8},"end":{"line":59,"column":52}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":25}},"6":{"start":{"line":68,"column":8},"end":{"line":68,"column":1280}},"7":{"start":{"line":73,"column":8},"end":{"line":73,"column":51}},"8":{"start":{"line":74,"column":8},"end":{"line":74,"column":24}}},"branchMap":{"1":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":8}},{"start":{"line":42,"column":8},"end":{"line":42,"column":8}}]},"2":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":8},"end":{"line":68,"column":8}},{"start":{"line":68,"column":8},"end":{"line":68,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol":{"l":{"42":36,"43":36,"54":31,"55":31,"60":31,"62":31,"63":22,"67":9},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol","s":{"1":36,"2":36,"3":31,"4":31,"5":31,"6":31},"b":{"1":[31,0],"2":[22,9]},"f":{"1":36,"2":31},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":4}}},"2":{"name":null,"line":51,"loc":{"start":{"line":51,"column":4},"end":{"line":71,"column":4}}}},"statementMap":{"1":{"start":{"line":42,"column":8},"end":{"line":42,"column":77}},"2":{"start":{"line":43,"column":8},"end":{"line":43,"column":62}},"3":{"start":{"line":54,"column":8},"end":{"line":54,"column":102}},"4":{"start":{"line":55,"column":8},"end":{"line":55,"column":1765}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":79}},"6":{"start":{"line":62,"column":8},"end":{"line":62,"column":1960}}},"branchMap":{"1":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":8},"end":{"line":55,"column":8}},{"start":{"line":55,"column":8},"end":{"line":55,"column":8}}]},"2":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol":{"l":{"55":512,"56":512,"60":512,"80":450,"86":446,"95":446,"97":446,"98":446,"99":446,"100":4230,"105":4230,"113":4230,"118":4230,"119":4230,"123":446,"127":446,"144":450,"163":651,"169":651,"174":651,"191":4,"210":5,"227":5,"246":68,"251":68,"257":68,"262":68,"263":68,"264":68,"273":68,"290":0,"309":56,"326":8,"345":2,"350":2,"351":2,"352":2,"356":2,"373":2,"392":7,"393":1,"396":6,"401":6,"418":1,"437":776,"463":5399,"468":5395,"469":5395,"470":5395,"474":5395,"477":33,"481":4334,"483":4334,"488":4334,"491":536,"493":536,"498":536,"499":536,"507":536,"512":536,"515":89,"517":89,"522":89,"525":403,"527":403,"532":403,"533":403,"541":403,"546":403,"568":1427,"569":1427,"570":1,"573":1426,"574":1426,"575":1426,"580":1426,"581":2634,"585":2634,"586":2634,"590":1426,"591":1426,"601":1426,"618":776},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol","s":{"1":512,"2":512,"3":450,"4":446,"5":446,"6":446,"7":446,"8":446,"9":4230,"10":4230,"11":4230,"12":4230,"13":4230,"14":446,"15":450,"16":651,"17":651,"18":651,"19":4,"20":5,"21":5,"22":68,"23":68,"24":68,"25":68,"26":68,"27":68,"28":0,"29":56,"30":8,"31":2,"32":2,"33":2,"34":2,"35":2,"36":7,"37":1,"38":6,"39":6,"40":1,"41":776,"42":5399,"43":5395,"44":5395,"45":5395,"46":33,"47":5362,"48":4334,"49":4334,"50":4334,"51":1028,"52":536,"53":536,"54":536,"55":536,"56":536,"57":492,"58":89,"59":89,"60":89,"61":403,"62":403,"63":403,"64":403,"65":403,"66":1427,"67":1427,"68":1,"69":1426,"70":1426,"71":1426,"72":2634,"73":2634,"74":1426,"75":1426,"76":776},"b":{"1":[446,0],"2":[4230,0],"3":[651,0],"4":[68,0],"5":[68,0],"6":[2,0],"7":[1,6],"8":[6,0],"9":[5395,4],"10":[33,5362],"11":[4334,1028],"12":[4334,0],"13":[536,492],"14":[536,0],"15":[536,0],"16":[89,403],"17":[89,0],"18":[403,0],"19":[403,0],"20":[1,1426]},"f":{"1":512,"2":450,"3":450,"4":651,"5":4,"6":5,"7":5,"8":68,"9":0,"10":56,"11":8,"12":2,"13":2,"14":7,"15":1,"16":776,"17":5399,"18":1427,"19":776},"fnMap":{"1":{"name":"toRLPItem","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":64,"column":4}}},"2":{"name":"readList","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":128,"column":4}}},"3":{"name":"readList","line":135,"loc":{"start":{"line":135,"column":4},"end":{"line":147,"column":4}}},"4":{"name":"readBytes","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":175,"column":4}}},"5":{"name":"readBytes","line":182,"loc":{"start":{"line":182,"column":4},"end":{"line":194,"column":4}}},"6":{"name":"readString","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":211,"column":4}}},"7":{"name":"readString","line":218,"loc":{"start":{"line":218,"column":4},"end":{"line":230,"column":4}}},"8":{"name":"readBytes32","line":237,"loc":{"start":{"line":237,"column":4},"end":{"line":274,"column":4}}},"9":{"name":"readBytes32","line":281,"loc":{"start":{"line":281,"column":4},"end":{"line":293,"column":4}}},"10":{"name":"readUint256","line":300,"loc":{"start":{"line":300,"column":4},"end":{"line":310,"column":4}}},"11":{"name":"readUint256","line":317,"loc":{"start":{"line":317,"column":4},"end":{"line":329,"column":4}}},"12":{"name":"readBool","line":336,"loc":{"start":{"line":336,"column":4},"end":{"line":357,"column":4}}},"13":{"name":"readBool","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":376,"column":4}}},"14":{"name":"readAddress","line":383,"loc":{"start":{"line":383,"column":4},"end":{"line":402,"column":4}}},"15":{"name":"readAddress","line":409,"loc":{"start":{"line":409,"column":4},"end":{"line":421,"column":4}}},"16":{"name":"readRawBytes","line":428,"loc":{"start":{"line":428,"column":4},"end":{"line":438,"column":4}}},"17":{"name":"_decodeLength","line":452,"loc":{"start":{"line":452,"column":4},"end":{"line":548,"column":4}}},"18":{"name":"_copy","line":557,"loc":{"start":{"line":557,"column":4},"end":{"line":602,"column":4}}},"19":{"name":"_copy","line":609,"loc":{"start":{"line":609,"column":4},"end":{"line":619,"column":4}}}},"statementMap":{"1":{"start":{"line":55,"column":8},"end":{"line":55,"column":19}},"2":{"start":{"line":60,"column":8},"end":{"line":60,"column":1063}},"3":{"start":{"line":80,"column":8},"end":{"line":80,"column":1475}},"4":{"start":{"line":86,"column":8},"end":{"line":86,"column":1575}},"5":{"start":{"line":95,"column":8},"end":{"line":95,"column":61}},"6":{"start":{"line":97,"column":8},"end":{"line":97,"column":29}},"7":{"start":{"line":98,"column":8},"end":{"line":98,"column":35}},"8":{"start":{"line":99,"column":8},"end":{"line":99,"column":2213}},"9":{"start":{"line":100,"column":12},"end":{"line":100,"column":2259}},"10":{"start":{"line":105,"column":12},"end":{"line":105,"column":2405}},"11":{"start":{"line":113,"column":12},"end":{"line":113,"column":2630}},"12":{"start":{"line":118,"column":12},"end":{"line":118,"column":25}},"13":{"start":{"line":119,"column":12},"end":{"line":119,"column":44}},"14":{"start":{"line":127,"column":8},"end":{"line":127,"column":18}},"15":{"start":{"line":144,"column":8},"end":{"line":144,"column":3303}},"16":{"start":{"line":163,"column":8},"end":{"line":163,"column":3665}},"17":{"start":{"line":169,"column":8},"end":{"line":169,"column":3783}},"18":{"start":{"line":174,"column":8},"end":{"line":174,"column":53}},"19":{"start":{"line":191,"column":8},"end":{"line":191,"column":4230}},"20":{"start":{"line":210,"column":8},"end":{"line":210,"column":37}},"21":{"start":{"line":227,"column":8},"end":{"line":227,"column":4903}},"22":{"start":{"line":246,"column":8},"end":{"line":246,"column":5252}},"23":{"start":{"line":251,"column":8},"end":{"line":251,"column":5374}},"24":{"start":{"line":257,"column":8},"end":{"line":257,"column":5492}},"25":{"start":{"line":262,"column":8},"end":{"line":262,"column":42}},"26":{"start":{"line":263,"column":8},"end":{"line":263,"column":19}},"27":{"start":{"line":273,"column":8},"end":{"line":273,"column":18}},"28":{"start":{"line":290,"column":8},"end":{"line":290,"column":6212}},"29":{"start":{"line":309,"column":8},"end":{"line":309,"column":40}},"30":{"start":{"line":326,"column":8},"end":{"line":326,"column":6888}},"31":{"start":{"line":345,"column":8},"end":{"line":345,"column":7220}},"32":{"start":{"line":350,"column":8},"end":{"line":350,"column":29}},"33":{"start":{"line":351,"column":8},"end":{"line":351,"column":19}},"34":{"start":{"line":356,"column":8},"end":{"line":356,"column":23}},"35":{"start":{"line":373,"column":8},"end":{"line":373,"column":7731}},"36":{"start":{"line":392,"column":8},"end":{"line":392,"column":8078}},"37":{"start":{"line":393,"column":12},"end":{"line":393,"column":29}},"38":{"start":{"line":396,"column":8},"end":{"line":396,"column":8151}},"39":{"start":{"line":401,"column":8},"end":{"line":401,"column":40}},"40":{"start":{"line":418,"column":8},"end":{"line":418,"column":8577}},"41":{"start":{"line":437,"column":8},"end":{"line":437,"column":25}},"42":{"start":{"line":463,"column":8},"end":{"line":463,"column":9468}},"43":{"start":{"line":468,"column":8},"end":{"line":468,"column":29}},"44":{"start":{"line":469,"column":8},"end":{"line":469,"column":22}},"45":{"start":{"line":474,"column":8},"end":{"line":474,"column":9691}},"46":{"start":{"line":477,"column":12},"end":{"line":477,"column":48}},"47":{"start":{"line":478,"column":15},"end":{"line":478,"column":9807}},"48":{"start":{"line":481,"column":12},"end":{"line":481,"column":42}},"49":{"start":{"line":483,"column":12},"end":{"line":483,"column":9932}},"50":{"start":{"line":488,"column":12},"end":{"line":488,"column":53}},"51":{"start":{"line":489,"column":15},"end":{"line":489,"column":10104}},"52":{"start":{"line":491,"column":12},"end":{"line":491,"column":47}},"53":{"start":{"line":493,"column":12},"end":{"line":493,"column":10220}},"54":{"start":{"line":498,"column":12},"end":{"line":498,"column":26}},"55":{"start":{"line":507,"column":12},"end":{"line":507,"column":10602}},"56":{"start":{"line":512,"column":12},"end":{"line":512,"column":67}},"57":{"start":{"line":513,"column":15},"end":{"line":513,"column":10801}},"58":{"start":{"line":515,"column":12},"end":{"line":515,"column":43}},"59":{"start":{"line":517,"column":12},"end":{"line":517,"column":10912}},"60":{"start":{"line":522,"column":12},"end":{"line":522,"column":54}},"61":{"start":{"line":525,"column":12},"end":{"line":525,"column":48}},"62":{"start":{"line":527,"column":12},"end":{"line":527,"column":11179}},"63":{"start":{"line":532,"column":12},"end":{"line":532,"column":27}},"64":{"start":{"line":541,"column":12},"end":{"line":541,"column":11561}},"65":{"start":{"line":546,"column":12},"end":{"line":546,"column":69}},"66":{"start":{"line":568,"column":8},"end":{"line":568,"column":45}},"67":{"start":{"line":569,"column":8},"end":{"line":569,"column":12253}},"68":{"start":{"line":570,"column":12},"end":{"line":570,"column":22}},"69":{"start":{"line":573,"column":8},"end":{"line":573,"column":36}},"70":{"start":{"line":574,"column":8},"end":{"line":574,"column":20}},"71":{"start":{"line":580,"column":8},"end":{"line":580,"column":12497}},"72":{"start":{"line":585,"column":12},"end":{"line":585,"column":20}},"73":{"start":{"line":586,"column":12},"end":{"line":586,"column":21}},"74":{"start":{"line":590,"column":8},"end":{"line":590,"column":55}},"75":{"start":{"line":601,"column":8},"end":{"line":601,"column":18}},"76":{"start":{"line":618,"column":8},"end":{"line":618,"column":44}}},"branchMap":{"1":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"2":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":12},"end":{"line":100,"column":12}},{"start":{"line":100,"column":12},"end":{"line":100,"column":12}}]},"3":{"line":169,"type":"if","locations":[{"start":{"line":169,"column":8},"end":{"line":169,"column":8}},{"start":{"line":169,"column":8},"end":{"line":169,"column":8}}]},"4":{"line":246,"type":"if","locations":[{"start":{"line":246,"column":8},"end":{"line":246,"column":8}},{"start":{"line":246,"column":8},"end":{"line":246,"column":8}}]},"5":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":8},"end":{"line":257,"column":8}},{"start":{"line":257,"column":8},"end":{"line":257,"column":8}}]},"6":{"line":345,"type":"if","locations":[{"start":{"line":345,"column":8},"end":{"line":345,"column":8}},{"start":{"line":345,"column":8},"end":{"line":345,"column":8}}]},"7":{"line":392,"type":"if","locations":[{"start":{"line":392,"column":8},"end":{"line":392,"column":8}},{"start":{"line":392,"column":8},"end":{"line":392,"column":8}}]},"8":{"line":396,"type":"if","locations":[{"start":{"line":396,"column":8},"end":{"line":396,"column":8}},{"start":{"line":396,"column":8},"end":{"line":396,"column":8}}]},"9":{"line":463,"type":"if","locations":[{"start":{"line":463,"column":8},"end":{"line":463,"column":8}},{"start":{"line":463,"column":8},"end":{"line":463,"column":8}}]},"10":{"line":474,"type":"if","locations":[{"start":{"line":474,"column":8},"end":{"line":474,"column":8}},{"start":{"line":474,"column":8},"end":{"line":474,"column":8}}]},"11":{"line":478,"type":"if","locations":[{"start":{"line":478,"column":15},"end":{"line":478,"column":15}},{"start":{"line":478,"column":15},"end":{"line":478,"column":15}}]},"12":{"line":483,"type":"if","locations":[{"start":{"line":483,"column":12},"end":{"line":483,"column":12}},{"start":{"line":483,"column":12},"end":{"line":483,"column":12}}]},"13":{"line":489,"type":"if","locations":[{"start":{"line":489,"column":15},"end":{"line":489,"column":15}},{"start":{"line":489,"column":15},"end":{"line":489,"column":15}}]},"14":{"line":493,"type":"if","locations":[{"start":{"line":493,"column":12},"end":{"line":493,"column":12}},{"start":{"line":493,"column":12},"end":{"line":493,"column":12}}]},"15":{"line":507,"type":"if","locations":[{"start":{"line":507,"column":12},"end":{"line":507,"column":12}},{"start":{"line":507,"column":12},"end":{"line":507,"column":12}}]},"16":{"line":513,"type":"if","locations":[{"start":{"line":513,"column":15},"end":{"line":513,"column":15}},{"start":{"line":513,"column":15},"end":{"line":513,"column":15}}]},"17":{"line":517,"type":"if","locations":[{"start":{"line":517,"column":12},"end":{"line":517,"column":12}},{"start":{"line":517,"column":12},"end":{"line":517,"column":12}}]},"18":{"line":527,"type":"if","locations":[{"start":{"line":527,"column":12},"end":{"line":527,"column":12}},{"start":{"line":527,"column":12},"end":{"line":527,"column":12}}]},"19":{"line":541,"type":"if","locations":[{"start":{"line":541,"column":12},"end":{"line":541,"column":12}},{"start":{"line":541,"column":12},"end":{"line":541,"column":12}}]},"20":{"line":569,"type":"if","locations":[{"start":{"line":569,"column":8},"end":{"line":569,"column":8}},{"start":{"line":569,"column":8},"end":{"line":569,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol":{"l":{"32":324,"34":324,"35":16,"37":308,"40":324,"57":157,"58":157,"75":139,"92":30,"109":52,"126":0,"127":0,"128":0,"152":465,"154":465,"155":415,"156":415,"158":50,"159":50,"160":50,"161":72,"162":72,"165":50,"166":50,"167":50,"168":72,"172":465,"190":52,"192":52,"193":52,"194":1643,"195":24,"199":52,"200":52,"201":45,"204":52,"222":1030,"223":1030,"224":1030,"226":1030,"227":420,"230":420,"231":420,"234":1030,"235":1030,"257":157,"258":8,"261":149,"262":149,"263":149,"264":1030,"267":149,"268":149,"269":149,"271":149,"272":1030,"274":1030,"275":1030,"277":1030,"278":1030,"281":149},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol","s":{"1":324,"2":324,"3":16,"4":308,"5":324,"6":157,"7":157,"8":139,"9":30,"10":52,"11":0,"12":0,"13":0,"14":465,"15":465,"16":415,"17":415,"18":50,"19":50,"20":50,"21":72,"22":50,"23":50,"24":50,"25":72,"26":465,"27":52,"28":52,"29":52,"30":1643,"31":52,"32":52,"33":45,"34":52,"35":1030,"36":1030,"37":1030,"38":1030,"39":420,"40":420,"41":1030,"42":157,"43":8,"44":149,"45":149,"46":149,"47":1030,"48":149,"49":149,"50":149,"51":1030,"52":1030,"53":1030,"54":1030,"55":149},"b":{"1":[16,308],"2":[415,50],"3":[24,1619],"4":[8,149]},"f":{"1":324,"2":157,"3":139,"4":30,"5":52,"6":0,"7":465,"8":52,"9":1030,"10":157},"fnMap":{"1":{"name":"writeBytes","line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":41,"column":4}}},"2":{"name":"writeList","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":59,"column":4}}},"3":{"name":"writeString","line":66,"loc":{"start":{"line":66,"column":4},"end":{"line":76,"column":4}}},"4":{"name":"writeAddress","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":93,"column":4}}},"5":{"name":"writeUint","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":110,"column":4}}},"6":{"name":"writeBool","line":117,"loc":{"start":{"line":117,"column":4},"end":{"line":129,"column":4}}},"7":{"name":"_writeLength","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":173,"column":4}}},"8":{"name":"_toBinary","line":181,"loc":{"start":{"line":181,"column":4},"end":{"line":205,"column":4}}},"9":{"name":"_memcpy","line":214,"loc":{"start":{"line":214,"column":4},"end":{"line":240,"column":4}}},"10":{"name":"_flatten","line":248,"loc":{"start":{"line":248,"column":4},"end":{"line":282,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":28}},"2":{"start":{"line":34,"column":8},"end":{"line":34,"column":711}},"3":{"start":{"line":35,"column":12},"end":{"line":35,"column":24}},"4":{"start":{"line":37,"column":12},"end":{"line":37,"column":73}},"5":{"start":{"line":40,"column":8},"end":{"line":40,"column":22}},"6":{"start":{"line":57,"column":8},"end":{"line":57,"column":41}},"7":{"start":{"line":58,"column":8},"end":{"line":58,"column":69}},"8":{"start":{"line":75,"column":8},"end":{"line":75,"column":37}},"9":{"start":{"line":92,"column":8},"end":{"line":92,"column":48}},"10":{"start":{"line":109,"column":8},"end":{"line":109,"column":41}},"11":{"start":{"line":126,"column":8},"end":{"line":126,"column":43}},"12":{"start":{"line":127,"column":8},"end":{"line":127,"column":55}},"13":{"start":{"line":128,"column":8},"end":{"line":128,"column":22}},"14":{"start":{"line":152,"column":8},"end":{"line":152,"column":28}},"15":{"start":{"line":154,"column":8},"end":{"line":154,"column":3384}},"16":{"start":{"line":155,"column":12},"end":{"line":155,"column":33}},"17":{"start":{"line":156,"column":12},"end":{"line":156,"column":58}},"18":{"start":{"line":158,"column":12},"end":{"line":158,"column":26}},"19":{"start":{"line":159,"column":12},"end":{"line":159,"column":25}},"20":{"start":{"line":160,"column":12},"end":{"line":160,"column":3586}},"21":{"start":{"line":162,"column":16},"end":{"line":162,"column":23}},"22":{"start":{"line":165,"column":12},"end":{"line":165,"column":42}},"23":{"start":{"line":166,"column":12},"end":{"line":166,"column":65}},"24":{"start":{"line":167,"column":12},"end":{"line":167,"column":3802}},"25":{"start":{"line":168,"column":16},"end":{"line":168,"column":73}},"26":{"start":{"line":172,"column":8},"end":{"line":172,"column":22}},"27":{"start":{"line":190,"column":8},"end":{"line":190,"column":45}},"28":{"start":{"line":192,"column":8},"end":{"line":192,"column":21}},"29":{"start":{"line":193,"column":8},"end":{"line":193,"column":4434}},"30":{"start":{"line":194,"column":12},"end":{"line":194,"column":4472}},"31":{"start":{"line":199,"column":8},"end":{"line":199,"column":44}},"32":{"start":{"line":200,"column":8},"end":{"line":200,"column":4587}},"33":{"start":{"line":201,"column":12},"end":{"line":201,"column":26}},"34":{"start":{"line":204,"column":8},"end":{"line":204,"column":18}},"35":{"start":{"line":222,"column":8},"end":{"line":222,"column":28}},"36":{"start":{"line":223,"column":8},"end":{"line":223,"column":26}},"37":{"start":{"line":224,"column":8},"end":{"line":224,"column":26}},"38":{"start":{"line":226,"column":8},"end":{"line":226,"column":5212}},"39":{"start":{"line":230,"column":12},"end":{"line":230,"column":21}},"40":{"start":{"line":231,"column":12},"end":{"line":231,"column":20}},"41":{"start":{"line":234,"column":8},"end":{"line":234,"column":44}},"42":{"start":{"line":257,"column":8},"end":{"line":257,"column":6057}},"43":{"start":{"line":258,"column":12},"end":{"line":258,"column":31}},"44":{"start":{"line":261,"column":8},"end":{"line":261,"column":19}},"45":{"start":{"line":262,"column":8},"end":{"line":262,"column":21}},"46":{"start":{"line":263,"column":8},"end":{"line":263,"column":6178}},"47":{"start":{"line":264,"column":12},"end":{"line":264,"column":33}},"48":{"start":{"line":267,"column":8},"end":{"line":267,"column":47}},"49":{"start":{"line":268,"column":8},"end":{"line":268,"column":28}},"50":{"start":{"line":271,"column":8},"end":{"line":271,"column":6403}},"51":{"start":{"line":272,"column":12},"end":{"line":272,"column":40}},"52":{"start":{"line":274,"column":12},"end":{"line":274,"column":27}},"53":{"start":{"line":277,"column":12},"end":{"line":277,"column":54}},"54":{"start":{"line":278,"column":12},"end":{"line":278,"column":42}},"55":{"start":{"line":281,"column":8},"end":{"line":281,"column":24}}},"branchMap":{"1":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":8}},{"start":{"line":34,"column":8},"end":{"line":34,"column":8}}]},"2":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":8},"end":{"line":154,"column":8}},{"start":{"line":154,"column":8},"end":{"line":154,"column":8}}]},"3":{"line":194,"type":"if","locations":[{"start":{"line":194,"column":12},"end":{"line":194,"column":12}},{"start":{"line":194,"column":12},"end":{"line":194,"column":12}}]},"4":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":8},"end":{"line":257,"column":8}},{"start":{"line":257,"column":8},"end":{"line":257,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol":{"l":{"8":6,"12":10,"16":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol","s":{"1":6,"2":10,"3":0},"b":{"1":[6,0],"2":[10,0],"3":[0,0]},"f":{"1":6,"2":10,"3":0},"fnMap":{"1":{"name":"add","line":7,"loc":{"start":{"line":7,"column":4},"end":{"line":9,"column":4}}},"2":{"name":"sub","line":11,"loc":{"start":{"line":11,"column":4},"end":{"line":13,"column":4}}},"3":{"name":"mul","line":15,"loc":{"start":{"line":15,"column":4},"end":{"line":17,"column":4}}}},"statementMap":{"1":{"start":{"line":8,"column":8},"end":{"line":8,"column":56}},"2":{"start":{"line":12,"column":8},"end":{"line":12,"column":57}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":70}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":8},"end":{"line":8,"column":8}},{"start":{"line":8,"column":8},"end":{"line":8,"column":8}}]},"2":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":8},"end":{"line":12,"column":8}},{"start":{"line":12,"column":8},"end":{"line":12,"column":8}}]},"3":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":8},"end":{"line":16,"column":8}},{"start":{"line":16,"column":8},"end":{"line":16,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol":{"l":{"26":39,"27":39,"29":39,"30":39,"33":39,"45":1,"46":1,"47":1,"51":2,"52":2,"53":2,"57":2,"58":2,"62":4,"63":4,"64":4,"68":2,"69":2,"73":2,"74":2,"78":2,"79":2,"81":2,"82":2,"86":0,"87":0,"94":0,"95":0,"96":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol","s":{"1":39,"2":39,"3":39,"4":39,"5":1,"6":1,"7":1,"8":2,"9":2,"10":2,"11":2,"12":2,"13":4,"14":4,"15":4,"16":2,"17":2,"18":2,"19":2,"20":2,"21":2,"22":2,"23":2,"24":0,"25":0,"26":0,"27":0,"28":0},"b":{"1":[2,0],"2":[0,0],"3":[0,0]},"f":{"1":39,"2":1,"3":2,"4":2,"5":4,"6":2,"7":2,"8":2,"9":0},"fnMap":{"1":{"name":"constructor","line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":42,"column":4}}},"2":{"name":"_mint","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"_burn","line":50,"loc":{"start":{"line":50,"column":4},"end":{"line":54,"column":4}}},"4":{"name":"_approve","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":59,"column":4}}},"5":{"name":"_transfer","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":65,"column":4}}},"6":{"name":"approve","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":70,"column":4}}},"7":{"name":"transfer","line":72,"loc":{"start":{"line":72,"column":4},"end":{"line":75,"column":4}}},"8":{"name":"transferFrom","line":77,"loc":{"start":{"line":77,"column":4},"end":{"line":83,"column":4}}},"9":{"name":"permit","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":97,"column":4}}}},"statementMap":{"1":{"start":{"line":26,"column":8},"end":{"line":26,"column":19}},"2":{"start":{"line":27,"column":8},"end":{"line":27,"column":23}},"3":{"start":{"line":29,"column":8},"end":{"line":29,"column":20}},"4":{"start":{"line":33,"column":8},"end":{"line":33,"column":1051}},"5":{"start":{"line":45,"column":8},"end":{"line":45,"column":43}},"6":{"start":{"line":46,"column":8},"end":{"line":46,"column":47}},"7":{"start":{"line":47,"column":8},"end":{"line":47,"column":44}},"8":{"start":{"line":51,"column":8},"end":{"line":51,"column":51}},"9":{"start":{"line":52,"column":8},"end":{"line":52,"column":43}},"10":{"start":{"line":53,"column":8},"end":{"line":53,"column":46}},"11":{"start":{"line":57,"column":8},"end":{"line":57,"column":40}},"12":{"start":{"line":58,"column":8},"end":{"line":58,"column":44}},"13":{"start":{"line":62,"column":8},"end":{"line":62,"column":51}},"14":{"start":{"line":63,"column":8},"end":{"line":63,"column":47}},"15":{"start":{"line":64,"column":8},"end":{"line":64,"column":38}},"16":{"start":{"line":68,"column":8},"end":{"line":68,"column":43}},"17":{"start":{"line":69,"column":8},"end":{"line":69,"column":19}},"18":{"start":{"line":73,"column":8},"end":{"line":73,"column":39}},"19":{"start":{"line":74,"column":8},"end":{"line":74,"column":19}},"20":{"start":{"line":78,"column":8},"end":{"line":78,"column":2609}},"21":{"start":{"line":79,"column":12},"end":{"line":79,"column":79}},"22":{"start":{"line":81,"column":8},"end":{"line":81,"column":33}},"23":{"start":{"line":82,"column":8},"end":{"line":82,"column":19}},"24":{"start":{"line":86,"column":8},"end":{"line":86,"column":65}},"25":{"start":{"line":87,"column":8},"end":{"line":87,"column":3019}},"26":{"start":{"line":94,"column":8},"end":{"line":94,"column":61}},"27":{"start":{"line":95,"column":8},"end":{"line":95,"column":107}},"28":{"start":{"line":96,"column":8},"end":{"line":96,"column":38}}},"branchMap":{"1":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]},"2":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"3":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":8},"end":{"line":95,"column":8}},{"start":{"line":95,"column":8},"end":{"line":95,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol":{"l":{"85":25,"90":24,"116":0,"120":0,"147":22,"148":0,"151":22,"152":22,"153":22,"155":22,"178":77,"179":73,"181":58,"183":58,"188":58,"190":58,"212":0,"245":95,"246":95,"248":95,"249":95,"250":95,"251":95,"254":95,"255":243,"256":243,"260":243,"262":243,"264":95,"270":148,"276":0,"282":229,"283":147,"285":0,"289":147,"290":147,"291":147,"292":147,"293":147,"296":82,"297":82,"298":82,"299":82,"300":82,"301":82,"303":82,"304":80,"310":73,"314":80,"315":80,"317":1,"320":0,"321":0,"325":1,"326":1,"327":1,"330":1,"333":0,"338":80,"339":80,"366":22,"369":22,"370":22,"376":22,"377":22,"379":22,"382":22,"383":22,"385":0,"388":0,"389":0,"393":0,"394":0,"397":0,"398":0,"402":0,"403":0,"405":0,"408":0,"409":0,"410":0,"413":0,"414":0,"418":0,"420":0,"424":0,"428":0,"430":0,"432":0,"435":0,"436":0,"440":0,"441":0,"446":0,"450":0,"453":0,"455":0,"456":0,"461":0,"463":0,"464":0,"466":0,"467":0,"473":22,"492":22,"495":22,"496":22,"497":22,"500":22,"502":65,"503":65,"505":65,"508":22,"509":22,"512":1,"513":1,"517":1,"519":1,"524":42,"526":42,"527":42,"528":42,"533":65,"538":22,"555":99,"556":95,"558":95,"559":265,"560":265,"566":95,"585":148,"587":148,"589":0,"592":148,"595":148,"612":172,"630":45,"647":51,"665":65,"666":0,"668":65,"686":87,"687":42,"689":45,"690":45,"692":45,"693":44,"695":1,"699":0,"719":82,"720":82,"721":4991,"723":82,"740":65,"742":65,"762":42,"763":42,"764":714,"766":42,"785":1,"786":1,"787":1,"788":1,"789":1,"811":22,"812":22,"813":22,"814":22,"815":22,"829":0,"830":0,"831":0,"833":0,"852":0,"853":0,"854":0,"875":42,"876":42,"877":42,"896":23,"897":23,"898":23,"899":23,"900":23,"917":45,"918":26,"920":19,"946":22,"949":22,"950":43,"954":22,"955":22,"958":22},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol","s":{"1":25,"2":24,"3":0,"4":0,"5":22,"6":0,"7":22,"8":22,"9":22,"10":22,"11":77,"12":73,"13":58,"14":58,"15":58,"16":58,"17":0,"18":95,"19":95,"20":95,"21":95,"22":95,"23":95,"24":95,"25":243,"26":243,"27":243,"28":243,"29":95,"30":148,"31":148,"32":0,"33":229,"34":147,"35":147,"36":147,"37":147,"38":147,"39":82,"40":82,"41":82,"42":82,"43":82,"44":82,"45":82,"46":82,"47":80,"48":73,"49":80,"50":2,"51":1,"52":0,"53":1,"54":1,"55":1,"56":0,"57":80,"58":80,"59":22,"60":22,"61":22,"62":22,"63":22,"64":22,"65":22,"66":22,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":22,"105":22,"106":22,"107":22,"108":22,"109":22,"110":65,"111":65,"112":65,"113":22,"114":22,"115":43,"116":1,"117":1,"118":1,"119":1,"120":42,"121":42,"122":42,"123":42,"124":42,"125":65,"126":22,"127":99,"128":95,"129":95,"130":265,"131":265,"132":95,"133":148,"134":148,"135":0,"136":148,"137":148,"138":172,"139":45,"140":51,"141":65,"142":0,"143":65,"144":87,"145":42,"146":45,"147":45,"148":45,"149":45,"150":44,"151":1,"152":1,"153":0,"154":82,"155":82,"156":82,"157":65,"158":65,"159":42,"160":42,"161":714,"162":42,"163":1,"164":1,"165":1,"166":1,"167":1,"168":22,"169":22,"170":22,"171":22,"172":22,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":42,"181":42,"182":42,"183":23,"184":23,"185":23,"186":23,"187":23,"188":45,"189":26,"190":19,"191":22,"192":22,"193":43,"194":22,"195":22,"196":22},"b":{"1":[0,22],"2":[58,0],"3":[95,148],"4":[88,7],"5":[148,0],"6":[141,7],"7":[0,0],"8":[147,82],"9":[0,147],"10":[82,0],"11":[80,2],"12":[73,7],"13":[1,1],"14":[0,1],"15":[22,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[22,43],"24":[1,42],"25":[1,0],"26":[42,0],"27":[42,0],"28":[0,148],"29":[0,65],"30":[42,45],"31":[45,0],"32":[44,1],"33":[1,0],"34":[26,19]},"f":{"1":25,"2":0,"3":22,"4":77,"5":0,"6":95,"7":22,"8":22,"9":99,"10":148,"11":172,"12":45,"13":51,"14":65,"15":87,"16":82,"17":65,"18":42,"19":1,"20":22,"21":0,"22":0,"23":42,"24":23,"25":45,"26":22},"fnMap":{"1":{"name":"verifyInclusionProof","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":93,"column":4}}},"2":{"name":"verifyExclusionProof","line":105,"loc":{"start":{"line":105,"column":4},"end":{"line":121,"column":4}}},"3":{"name":"update","line":134,"loc":{"start":{"line":134,"column":4},"end":{"line":156,"column":4}}},"4":{"name":"get","line":166,"loc":{"start":{"line":166,"column":4},"end":{"line":194,"column":4}}},"5":{"name":"getSingleNodeRootHash","line":202,"loc":{"start":{"line":202,"column":4},"end":{"line":216,"column":4}}},"6":{"name":"_walkNodePath","line":232,"loc":{"start":{"line":232,"column":4},"end":{"line":340,"column":4}}},"7":{"name":"_getNewPath","line":354,"loc":{"start":{"line":354,"column":4},"end":{"line":474,"column":4}}},"8":{"name":"_getUpdatedTrieRoot","line":482,"loc":{"start":{"line":482,"column":4},"end":{"line":539,"column":4}}},"9":{"name":"_parseProof","line":546,"loc":{"start":{"line":546,"column":4},"end":{"line":567,"column":4}}},"10":{"name":"_getNodeID","line":576,"loc":{"start":{"line":576,"column":4},"end":{"line":596,"column":4}}},"11":{"name":"_getNodePath","line":603,"loc":{"start":{"line":603,"column":4},"end":{"line":613,"column":4}}},"12":{"name":"_getNodeKey","line":621,"loc":{"start":{"line":621,"column":4},"end":{"line":631,"column":4}}},"13":{"name":"_getNodeValue","line":638,"loc":{"start":{"line":638,"column":4},"end":{"line":648,"column":4}}},"14":{"name":"_getNodeHash","line":656,"loc":{"start":{"line":656,"column":4},"end":{"line":670,"column":4}}},"15":{"name":"_getNodeType","line":677,"loc":{"start":{"line":677,"column":4},"end":{"line":700,"column":4}}},"16":{"name":"_getSharedNibbleLength","line":709,"loc":{"start":{"line":709,"column":4},"end":{"line":724,"column":4}}},"17":{"name":"_makeNode","line":731,"loc":{"start":{"line":731,"column":4},"end":{"line":746,"column":4}}},"18":{"name":"_makeNode","line":753,"loc":{"start":{"line":753,"column":4},"end":{"line":767,"column":4}}},"19":{"name":"_makeExtensionNode","line":775,"loc":{"start":{"line":775,"column":4},"end":{"line":790,"column":4}}},"20":{"name":"_makeLeafNode","line":801,"loc":{"start":{"line":801,"column":4},"end":{"line":816,"column":4}}},"21":{"name":"_makeEmptyBranchNode","line":822,"loc":{"start":{"line":822,"column":4},"end":{"line":834,"column":4}}},"22":{"name":"_editBranchValue","line":842,"loc":{"start":{"line":842,"column":4},"end":{"line":855,"column":4}}},"23":{"name":"_editBranchIndex","line":864,"loc":{"start":{"line":864,"column":4},"end":{"line":878,"column":4}}},"24":{"name":"_addHexPrefix","line":886,"loc":{"start":{"line":886,"column":4},"end":{"line":901,"column":4}}},"25":{"name":"_removeHexPrefix","line":908,"loc":{"start":{"line":908,"column":4},"end":{"line":922,"column":4}}},"26":{"name":"_joinNodeArrays","line":934,"loc":{"start":{"line":934,"column":4},"end":{"line":959,"column":4}}}},"statementMap":{"1":{"start":{"line":85,"column":8},"end":{"line":85,"column":2923}},"2":{"start":{"line":90,"column":8},"end":{"line":90,"column":3001}},"3":{"start":{"line":116,"column":8},"end":{"line":116,"column":3811}},"4":{"start":{"line":120,"column":8},"end":{"line":120,"column":30}},"5":{"start":{"line":147,"column":8},"end":{"line":147,"column":4811}},"6":{"start":{"line":148,"column":12},"end":{"line":148,"column":54}},"7":{"start":{"line":151,"column":8},"end":{"line":151,"column":53}},"8":{"start":{"line":152,"column":8},"end":{"line":152,"column":93}},"9":{"start":{"line":153,"column":8},"end":{"line":153,"column":88}},"10":{"start":{"line":155,"column":8},"end":{"line":155,"column":49}},"11":{"start":{"line":178,"column":8},"end":{"line":178,"column":53}},"12":{"start":{"line":179,"column":8},"end":{"line":179,"column":109}},"13":{"start":{"line":181,"column":8},"end":{"line":181,"column":46}},"14":{"start":{"line":183,"column":8},"end":{"line":183,"column":6018}},"15":{"start":{"line":188,"column":8},"end":{"line":188,"column":86}},"16":{"start":{"line":190,"column":8},"end":{"line":190,"column":6213}},"17":{"start":{"line":212,"column":8},"end":{"line":212,"column":6704}},"18":{"start":{"line":245,"column":8},"end":{"line":245,"column":30}},"19":{"start":{"line":246,"column":8},"end":{"line":246,"column":57}},"20":{"start":{"line":248,"column":8},"end":{"line":248,"column":37}},"21":{"start":{"line":249,"column":8},"end":{"line":249,"column":35}},"22":{"start":{"line":250,"column":8},"end":{"line":250,"column":39}},"23":{"start":{"line":251,"column":8},"end":{"line":251,"column":35}},"24":{"start":{"line":254,"column":8},"end":{"line":254,"column":7917}},"25":{"start":{"line":255,"column":12},"end":{"line":255,"column":34}},"26":{"start":{"line":256,"column":12},"end":{"line":256,"column":49}},"27":{"start":{"line":260,"column":12},"end":{"line":260,"column":26}},"28":{"start":{"line":262,"column":12},"end":{"line":262,"column":8247}},"29":{"start":{"line":264,"column":16},"end":{"line":264,"column":8359}},"30":{"start":{"line":268,"column":19},"end":{"line":268,"column":8511}},"31":{"start":{"line":270,"column":16},"end":{"line":270,"column":8647}},"32":{"start":{"line":276,"column":16},"end":{"line":276,"column":8893}},"33":{"start":{"line":282,"column":12},"end":{"line":282,"column":9077}},"34":{"start":{"line":283,"column":16},"end":{"line":283,"column":9153}},"35":{"start":{"line":289,"column":20},"end":{"line":289,"column":65}},"36":{"start":{"line":290,"column":20},"end":{"line":290,"column":90}},"37":{"start":{"line":291,"column":20},"end":{"line":291,"column":55}},"38":{"start":{"line":292,"column":20},"end":{"line":292,"column":42}},"39":{"start":{"line":295,"column":19},"end":{"line":295,"column":9813}},"40":{"start":{"line":296,"column":16},"end":{"line":296,"column":61}},"41":{"start":{"line":297,"column":16},"end":{"line":297,"column":45}},"42":{"start":{"line":298,"column":16},"end":{"line":298,"column":45}},"43":{"start":{"line":299,"column":16},"end":{"line":299,"column":79}},"44":{"start":{"line":300,"column":16},"end":{"line":300,"column":86}},"45":{"start":{"line":301,"column":16},"end":{"line":301,"column":96}},"46":{"start":{"line":303,"column":16},"end":{"line":303,"column":10325}},"47":{"start":{"line":304,"column":20},"end":{"line":304,"column":10412}},"48":{"start":{"line":310,"column":24},"end":{"line":310,"column":60}},"49":{"start":{"line":314,"column":20},"end":{"line":314,"column":52}},"50":{"start":{"line":316,"column":23},"end":{"line":316,"column":11009}},"51":{"start":{"line":317,"column":20},"end":{"line":317,"column":11106}},"52":{"start":{"line":320,"column":24},"end":{"line":320,"column":56}},"53":{"start":{"line":325,"column":24},"end":{"line":325,"column":73}},"54":{"start":{"line":326,"column":24},"end":{"line":326,"column":63}},"55":{"start":{"line":330,"column":20},"end":{"line":330,"column":67}},"56":{"start":{"line":333,"column":16},"end":{"line":333,"column":54}},"57":{"start":{"line":338,"column":8},"end":{"line":338,"column":61}},"58":{"start":{"line":339,"column":8},"end":{"line":339,"column":84}},"59":{"start":{"line":366,"column":8},"end":{"line":366,"column":49}},"60":{"start":{"line":369,"column":8},"end":{"line":369,"column":57}},"61":{"start":{"line":370,"column":8},"end":{"line":370,"column":54}},"62":{"start":{"line":376,"column":8},"end":{"line":376,"column":54}},"63":{"start":{"line":377,"column":8},"end":{"line":377,"column":33}},"64":{"start":{"line":379,"column":8},"end":{"line":379,"column":13744}},"65":{"start":{"line":382,"column":12},"end":{"line":382,"column":81}},"66":{"start":{"line":383,"column":12},"end":{"line":383,"column":29}},"67":{"start":{"line":384,"column":15},"end":{"line":384,"column":14072}},"68":{"start":{"line":385,"column":12},"end":{"line":385,"column":14131}},"69":{"start":{"line":388,"column":16},"end":{"line":388,"column":75}},"70":{"start":{"line":389,"column":16},"end":{"line":389,"column":33}},"71":{"start":{"line":393,"column":16},"end":{"line":393,"column":49}},"72":{"start":{"line":394,"column":16},"end":{"line":394,"column":33}},"73":{"start":{"line":397,"column":16},"end":{"line":397,"column":101}},"74":{"start":{"line":398,"column":16},"end":{"line":398,"column":33}},"75":{"start":{"line":402,"column":12},"end":{"line":402,"column":60}},"76":{"start":{"line":403,"column":12},"end":{"line":403,"column":90}},"77":{"start":{"line":405,"column":12},"end":{"line":405,"column":15218}},"78":{"start":{"line":408,"column":16},"end":{"line":408,"column":99}},"79":{"start":{"line":409,"column":16},"end":{"line":409,"column":94}},"80":{"start":{"line":410,"column":16},"end":{"line":410,"column":33}},"81":{"start":{"line":413,"column":16},"end":{"line":413,"column":82}},"82":{"start":{"line":414,"column":16},"end":{"line":414,"column":84}},"83":{"start":{"line":418,"column":12},"end":{"line":418,"column":62}},"84":{"start":{"line":420,"column":12},"end":{"line":420,"column":16068}},"85":{"start":{"line":424,"column":16},"end":{"line":424,"column":79}},"86":{"start":{"line":428,"column":16},"end":{"line":428,"column":55}},"87":{"start":{"line":430,"column":16},"end":{"line":430,"column":65}},"88":{"start":{"line":432,"column":16},"end":{"line":432,"column":16734}},"89":{"start":{"line":435,"column":20},"end":{"line":435,"column":106}},"90":{"start":{"line":436,"column":20},"end":{"line":436,"column":109}},"91":{"start":{"line":437,"column":23},"end":{"line":437,"column":17169}},"92":{"start":{"line":440,"column":20},"end":{"line":440,"column":111}},"93":{"start":{"line":441,"column":20},"end":{"line":441,"column":109}},"94":{"start":{"line":446,"column":20},"end":{"line":446,"column":94}},"95":{"start":{"line":450,"column":12},"end":{"line":450,"column":17956}},"96":{"start":{"line":453,"column":16},"end":{"line":453,"column":62}},"97":{"start":{"line":455,"column":16},"end":{"line":455,"column":50}},"98":{"start":{"line":456,"column":16},"end":{"line":456,"column":33}},"99":{"start":{"line":461,"column":16},"end":{"line":461,"column":67}},"100":{"start":{"line":463,"column":16},"end":{"line":463,"column":50}},"101":{"start":{"line":464,"column":16},"end":{"line":464,"column":33}},"102":{"start":{"line":466,"column":16},"end":{"line":466,"column":76}},"103":{"start":{"line":467,"column":16},"end":{"line":467,"column":33}},"104":{"start":{"line":473,"column":8},"end":{"line":473,"column":79}},"105":{"start":{"line":492,"column":8},"end":{"line":492,"column":57}},"106":{"start":{"line":495,"column":8},"end":{"line":495,"column":35}},"107":{"start":{"line":496,"column":8},"end":{"line":496,"column":32}},"108":{"start":{"line":497,"column":8},"end":{"line":497,"column":37}},"109":{"start":{"line":500,"column":8},"end":{"line":500,"column":19924}},"110":{"start":{"line":502,"column":12},"end":{"line":502,"column":38}},"111":{"start":{"line":503,"column":12},"end":{"line":503,"column":54}},"112":{"start":{"line":505,"column":12},"end":{"line":505,"column":20127}},"113":{"start":{"line":508,"column":16},"end":{"line":508,"column":63}},"114":{"start":{"line":509,"column":16},"end":{"line":509,"column":78}},"115":{"start":{"line":510,"column":19},"end":{"line":510,"column":20465}},"116":{"start":{"line":512,"column":16},"end":{"line":512,"column":63}},"117":{"start":{"line":513,"column":16},"end":{"line":513,"column":78}},"118":{"start":{"line":517,"column":16},"end":{"line":517,"column":20887}},"119":{"start":{"line":519,"column":20},"end":{"line":519,"column":78}},"120":{"start":{"line":521,"column":19},"end":{"line":521,"column":21106}},"121":{"start":{"line":524,"column":16},"end":{"line":524,"column":21310}},"122":{"start":{"line":526,"column":20},"end":{"line":526,"column":64}},"123":{"start":{"line":527,"column":20},"end":{"line":527,"column":69}},"124":{"start":{"line":528,"column":20},"end":{"line":528,"column":91}},"125":{"start":{"line":533,"column":12},"end":{"line":533,"column":63}},"126":{"start":{"line":538,"column":8},"end":{"line":538,"column":45}},"127":{"start":{"line":555,"column":8},"end":{"line":555,"column":77}},"128":{"start":{"line":556,"column":8},"end":{"line":556,"column":62}},"129":{"start":{"line":558,"column":8},"end":{"line":558,"column":22490}},"130":{"start":{"line":559,"column":12},"end":{"line":559,"column":68}},"131":{"start":{"line":560,"column":12},"end":{"line":560,"column":22622}},"132":{"start":{"line":566,"column":8},"end":{"line":566,"column":20}},"133":{"start":{"line":585,"column":8},"end":{"line":585,"column":27}},"134":{"start":{"line":587,"column":8},"end":{"line":587,"column":23295}},"135":{"start":{"line":589,"column":12},"end":{"line":589,"column":53}},"136":{"start":{"line":592,"column":12},"end":{"line":592,"column":50}},"137":{"start":{"line":595,"column":8},"end":{"line":595,"column":47}},"138":{"start":{"line":612,"column":8},"end":{"line":612,"column":82}},"139":{"start":{"line":630,"column":8},"end":{"line":630,"column":52}},"140":{"start":{"line":647,"column":8},"end":{"line":647,"column":79}},"141":{"start":{"line":665,"column":8},"end":{"line":665,"column":25348}},"142":{"start":{"line":666,"column":12},"end":{"line":666,"column":27}},"143":{"start":{"line":668,"column":12},"end":{"line":668,"column":56}},"144":{"start":{"line":686,"column":8},"end":{"line":686,"column":25851}},"145":{"start":{"line":687,"column":12},"end":{"line":687,"column":38}},"146":{"start":{"line":688,"column":15},"end":{"line":688,"column":25956}},"147":{"start":{"line":689,"column":12},"end":{"line":689,"column":51}},"148":{"start":{"line":690,"column":12},"end":{"line":690,"column":41}},"149":{"start":{"line":692,"column":12},"end":{"line":692,"column":26130}},"150":{"start":{"line":693,"column":16},"end":{"line":693,"column":40}},"151":{"start":{"line":694,"column":19},"end":{"line":694,"column":26254}},"152":{"start":{"line":695,"column":16},"end":{"line":695,"column":45}},"153":{"start":{"line":699,"column":8},"end":{"line":699,"column":34}},"154":{"start":{"line":719,"column":8},"end":{"line":719,"column":21}},"155":{"start":{"line":720,"column":8},"end":{"line":720,"column":26891}},"156":{"start":{"line":723,"column":8},"end":{"line":723,"column":16}},"157":{"start":{"line":740,"column":8},"end":{"line":740,"column":60}},"158":{"start":{"line":742,"column":8},"end":{"line":742,"column":27417}},"159":{"start":{"line":762,"column":8},"end":{"line":762,"column":55}},"160":{"start":{"line":763,"column":8},"end":{"line":763,"column":27962}},"161":{"start":{"line":764,"column":12},"end":{"line":764,"column":57}},"162":{"start":{"line":766,"column":8},"end":{"line":766,"column":29}},"163":{"start":{"line":785,"column":8},"end":{"line":785,"column":43}},"164":{"start":{"line":786,"column":8},"end":{"line":786,"column":53}},"165":{"start":{"line":787,"column":8},"end":{"line":787,"column":73}},"166":{"start":{"line":788,"column":8},"end":{"line":788,"column":48}},"167":{"start":{"line":789,"column":8},"end":{"line":789,"column":29}},"168":{"start":{"line":811,"column":8},"end":{"line":811,"column":43}},"169":{"start":{"line":812,"column":8},"end":{"line":812,"column":52}},"170":{"start":{"line":813,"column":8},"end":{"line":813,"column":73}},"171":{"start":{"line":814,"column":8},"end":{"line":814,"column":48}},"172":{"start":{"line":815,"column":8},"end":{"line":815,"column":29}},"173":{"start":{"line":829,"column":8},"end":{"line":829,"column":60}},"174":{"start":{"line":830,"column":8},"end":{"line":830,"column":30021}},"175":{"start":{"line":831,"column":12},"end":{"line":831,"column":34}},"176":{"start":{"line":833,"column":8},"end":{"line":833,"column":29}},"177":{"start":{"line":852,"column":8},"end":{"line":852,"column":63}},"178":{"start":{"line":853,"column":8},"end":{"line":853,"column":85}},"179":{"start":{"line":854,"column":8},"end":{"line":854,"column":41}},"180":{"start":{"line":875,"column":8},"end":{"line":875,"column":93}},"181":{"start":{"line":876,"column":8},"end":{"line":876,"column":65}},"182":{"start":{"line":877,"column":8},"end":{"line":877,"column":41}},"183":{"start":{"line":896,"column":8},"end":{"line":896,"column":58}},"184":{"start":{"line":897,"column":8},"end":{"line":897,"column":45}},"185":{"start":{"line":898,"column":8},"end":{"line":898,"column":53}},"186":{"start":{"line":899,"column":8},"end":{"line":899,"column":44}},"187":{"start":{"line":900,"column":8},"end":{"line":900,"column":47}},"188":{"start":{"line":917,"column":8},"end":{"line":917,"column":32479}},"189":{"start":{"line":918,"column":12},"end":{"line":918,"column":49}},"190":{"start":{"line":920,"column":12},"end":{"line":920,"column":49}},"191":{"start":{"line":946,"column":8},"end":{"line":946,"column":67}},"192":{"start":{"line":949,"column":8},"end":{"line":949,"column":33473}},"193":{"start":{"line":950,"column":12},"end":{"line":950,"column":25}},"194":{"start":{"line":954,"column":8},"end":{"line":954,"column":33609}},"195":{"start":{"line":955,"column":12},"end":{"line":955,"column":36}},"196":{"start":{"line":958,"column":8},"end":{"line":958,"column":18}}},"branchMap":{"1":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":8},"end":{"line":147,"column":8}},{"start":{"line":147,"column":8},"end":{"line":147,"column":8}}]},"2":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":8},"end":{"line":183,"column":8}},{"start":{"line":183,"column":8},"end":{"line":183,"column":8}}]},"3":{"line":262,"type":"if","locations":[{"start":{"line":262,"column":12},"end":{"line":262,"column":12}},{"start":{"line":262,"column":12},"end":{"line":262,"column":12}}]},"4":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":16},"end":{"line":264,"column":16}},{"start":{"line":264,"column":16},"end":{"line":264,"column":16}}]},"5":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":19},"end":{"line":268,"column":19}},{"start":{"line":268,"column":19},"end":{"line":268,"column":19}}]},"6":{"line":270,"type":"if","locations":[{"start":{"line":270,"column":16},"end":{"line":270,"column":16}},{"start":{"line":270,"column":16},"end":{"line":270,"column":16}}]},"7":{"line":276,"type":"if","locations":[{"start":{"line":276,"column":16},"end":{"line":276,"column":16}},{"start":{"line":276,"column":16},"end":{"line":276,"column":16}}]},"8":{"line":282,"type":"if","locations":[{"start":{"line":282,"column":12},"end":{"line":282,"column":12}},{"start":{"line":282,"column":12},"end":{"line":282,"column":12}}]},"9":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":16},"end":{"line":283,"column":16}},{"start":{"line":283,"column":16},"end":{"line":283,"column":16}}]},"10":{"line":295,"type":"if","locations":[{"start":{"line":295,"column":19},"end":{"line":295,"column":19}},{"start":{"line":295,"column":19},"end":{"line":295,"column":19}}]},"11":{"line":303,"type":"if","locations":[{"start":{"line":303,"column":16},"end":{"line":303,"column":16}},{"start":{"line":303,"column":16},"end":{"line":303,"column":16}}]},"12":{"line":304,"type":"if","locations":[{"start":{"line":304,"column":20},"end":{"line":304,"column":20}},{"start":{"line":304,"column":20},"end":{"line":304,"column":20}}]},"13":{"line":316,"type":"if","locations":[{"start":{"line":316,"column":23},"end":{"line":316,"column":23}},{"start":{"line":316,"column":23},"end":{"line":316,"column":23}}]},"14":{"line":317,"type":"if","locations":[{"start":{"line":317,"column":20},"end":{"line":317,"column":20}},{"start":{"line":317,"column":20},"end":{"line":317,"column":20}}]},"15":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"16":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":15},"end":{"line":384,"column":15}},{"start":{"line":384,"column":15},"end":{"line":384,"column":15}}]},"17":{"line":385,"type":"if","locations":[{"start":{"line":385,"column":12},"end":{"line":385,"column":12}},{"start":{"line":385,"column":12},"end":{"line":385,"column":12}}]},"18":{"line":405,"type":"if","locations":[{"start":{"line":405,"column":12},"end":{"line":405,"column":12}},{"start":{"line":405,"column":12},"end":{"line":405,"column":12}}]},"19":{"line":420,"type":"if","locations":[{"start":{"line":420,"column":12},"end":{"line":420,"column":12}},{"start":{"line":420,"column":12},"end":{"line":420,"column":12}}]},"20":{"line":432,"type":"if","locations":[{"start":{"line":432,"column":16},"end":{"line":432,"column":16}},{"start":{"line":432,"column":16},"end":{"line":432,"column":16}}]},"21":{"line":437,"type":"if","locations":[{"start":{"line":437,"column":23},"end":{"line":437,"column":23}},{"start":{"line":437,"column":23},"end":{"line":437,"column":23}}]},"22":{"line":450,"type":"if","locations":[{"start":{"line":450,"column":12},"end":{"line":450,"column":12}},{"start":{"line":450,"column":12},"end":{"line":450,"column":12}}]},"23":{"line":505,"type":"if","locations":[{"start":{"line":505,"column":12},"end":{"line":505,"column":12}},{"start":{"line":505,"column":12},"end":{"line":505,"column":12}}]},"24":{"line":510,"type":"if","locations":[{"start":{"line":510,"column":19},"end":{"line":510,"column":19}},{"start":{"line":510,"column":19},"end":{"line":510,"column":19}}]},"25":{"line":517,"type":"if","locations":[{"start":{"line":517,"column":16},"end":{"line":517,"column":16}},{"start":{"line":517,"column":16},"end":{"line":517,"column":16}}]},"26":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":19},"end":{"line":521,"column":19}},{"start":{"line":521,"column":19},"end":{"line":521,"column":19}}]},"27":{"line":524,"type":"if","locations":[{"start":{"line":524,"column":16},"end":{"line":524,"column":16}},{"start":{"line":524,"column":16},"end":{"line":524,"column":16}}]},"28":{"line":587,"type":"if","locations":[{"start":{"line":587,"column":8},"end":{"line":587,"column":8}},{"start":{"line":587,"column":8},"end":{"line":587,"column":8}}]},"29":{"line":665,"type":"if","locations":[{"start":{"line":665,"column":8},"end":{"line":665,"column":8}},{"start":{"line":665,"column":8},"end":{"line":665,"column":8}}]},"30":{"line":686,"type":"if","locations":[{"start":{"line":686,"column":8},"end":{"line":686,"column":8}},{"start":{"line":686,"column":8},"end":{"line":686,"column":8}}]},"31":{"line":688,"type":"if","locations":[{"start":{"line":688,"column":15},"end":{"line":688,"column":15}},{"start":{"line":688,"column":15},"end":{"line":688,"column":15}}]},"32":{"line":692,"type":"if","locations":[{"start":{"line":692,"column":12},"end":{"line":692,"column":12}},{"start":{"line":692,"column":12},"end":{"line":692,"column":12}}]},"33":{"line":694,"type":"if","locations":[{"start":{"line":694,"column":19},"end":{"line":694,"column":19}},{"start":{"line":694,"column":19},"end":{"line":694,"column":19}}]},"34":{"line":917,"type":"if","locations":[{"start":{"line":917,"column":8},"end":{"line":917,"column":8}},{"start":{"line":917,"column":8},"end":{"line":917,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol":{"l":{"41":15,"42":15,"66":0,"67":0,"93":12,"94":12,"117":20,"118":20,"137":0,"138":0,"160":47},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol","s":{"1":15,"2":15,"3":0,"4":0,"5":12,"6":12,"7":20,"8":20,"9":0,"10":0,"11":47},"b":{},"f":{"1":15,"2":0,"3":12,"4":20,"5":0,"6":47},"fnMap":{"1":{"name":"verifyInclusionProof","line":29,"loc":{"start":{"line":29,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"verifyExclusionProof","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":68,"column":4}}},"3":{"name":"update","line":81,"loc":{"start":{"line":81,"column":4},"end":{"line":95,"column":4}}},"4":{"name":"get","line":105,"loc":{"start":{"line":105,"column":4},"end":{"line":119,"column":4}}},"5":{"name":"getSingleNodeRootHash","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":139,"column":4}}},"6":{"name":"_getSecureKey","line":151,"loc":{"start":{"line":151,"column":4},"end":{"line":161,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":46}},"2":{"start":{"line":42,"column":8},"end":{"line":42,"column":78}},"3":{"start":{"line":66,"column":8},"end":{"line":66,"column":46}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":70}},"5":{"start":{"line":93,"column":8},"end":{"line":93,"column":46}},"6":{"start":{"line":94,"column":8},"end":{"line":94,"column":64}},"7":{"start":{"line":117,"column":8},"end":{"line":117,"column":46}},"8":{"start":{"line":118,"column":8},"end":{"line":118,"column":53}},"9":{"start":{"line":137,"column":8},"end":{"line":137,"column":46}},"10":{"start":{"line":138,"column":8},"end":{"line":138,"column":64}},"11":{"start":{"line":160,"column":8},"end":{"line":160,"column":48}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol":{"l":{"27":40,"44":2,"61":31,"78":19,"95":3,"97":3,"115":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol","s":{"1":40,"2":2,"3":31,"4":19,"5":3,"6":3},"b":{},"f":{"1":40,"2":2,"3":31,"4":19,"5":3},"fnMap":{"1":{"name":"toBool","line":18,"loc":{"start":{"line":18,"column":4},"end":{"line":28,"column":4}}},"2":{"name":"fromBool","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":45,"column":4}}},"3":{"name":"toAddress","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":62,"column":4}}},"4":{"name":"fromAddress","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":79,"column":4}}},"5":{"name":"removeLeadingZeros","line":86,"loc":{"start":{"line":86,"column":4},"end":{"line":116,"column":4}}}},"statementMap":{"1":{"start":{"line":27,"column":8},"end":{"line":27,"column":23}},"2":{"start":{"line":44,"column":8},"end":{"line":44,"column":44}},"3":{"start":{"line":61,"column":8},"end":{"line":61,"column":45}},"4":{"start":{"line":78,"column":8},"end":{"line":78,"column":36}},"5":{"start":{"line":95,"column":8},"end":{"line":95,"column":24}},"6":{"start":{"line":115,"column":8},"end":{"line":115,"column":18}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol":{"l":{"22":311,"23":311,"24":311,"26":308,"28":308,"81":308,"92":299,"93":73,"96":226,"106":1,"107":1,"108":1,"111":1,"121":164,"122":2,"123":2,"126":2,"129":162,"139":3,"143":15,"144":15,"145":15,"147":15,"151":15,"155":12,"156":12,"157":12,"159":12,"163":12,"167":5,"168":5,"169":5,"171":5,"175":5,"185":292,"187":292,"188":9144,"189":9144,"192":292,"202":26,"204":26,"205":708,"208":26,"219":26},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol","s":{"1":311,"2":311,"3":311,"4":308,"5":308,"6":299,"7":73,"8":226,"9":1,"10":1,"11":1,"12":164,"13":2,"14":2,"15":162,"16":3,"17":15,"18":15,"19":15,"20":15,"21":12,"22":12,"23":12,"24":12,"25":5,"26":5,"27":5,"28":5,"29":292,"30":292,"31":9144,"32":9144,"33":292,"34":26,"35":26,"36":708,"37":26,"38":26},"b":{"1":[311,0],"2":[311,0],"3":[308,3],"4":[73,226],"5":[2,162],"6":[15,0],"7":[15,0],"8":[12,0],"9":[12,0],"10":[5,0],"11":[5,0]},"f":{"1":311,"2":299,"3":1,"4":164,"5":3,"6":15,"7":12,"8":5,"9":292,"10":26,"11":26},"fnMap":{"1":{"name":"slice","line":13,"loc":{"start":{"line":13,"column":4},"end":{"line":82,"column":4}}},"2":{"name":"slice","line":84,"loc":{"start":{"line":84,"column":4},"end":{"line":97,"column":4}}},"3":{"name":"toBytes32PadLeft","line":99,"loc":{"start":{"line":99,"column":4},"end":{"line":112,"column":4}}},"4":{"name":"toBytes32","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":130,"column":4}}},"5":{"name":"toUint256","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"6":{"name":"toUint24","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":152,"column":4}}},"7":{"name":"toUint8","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":164,"column":4}}},"8":{"name":"toAddress","line":166,"loc":{"start":{"line":166,"column":4},"end":{"line":176,"column":4}}},"9":{"name":"toNibbles","line":178,"loc":{"start":{"line":178,"column":4},"end":{"line":193,"column":4}}},"10":{"name":"fromNibbles","line":195,"loc":{"start":{"line":195,"column":4},"end":{"line":209,"column":4}}},"11":{"name":"equal","line":211,"loc":{"start":{"line":211,"column":4},"end":{"line":220,"column":4}}}},"statementMap":{"1":{"start":{"line":22,"column":8},"end":{"line":22,"column":57}},"2":{"start":{"line":23,"column":8},"end":{"line":23,"column":60}},"3":{"start":{"line":24,"column":8},"end":{"line":24,"column":70}},"4":{"start":{"line":26,"column":8},"end":{"line":26,"column":30}},"5":{"start":{"line":81,"column":8},"end":{"line":81,"column":24}},"6":{"start":{"line":92,"column":8},"end":{"line":92,"column":3245}},"7":{"start":{"line":93,"column":12},"end":{"line":93,"column":28}},"8":{"start":{"line":96,"column":8},"end":{"line":96,"column":60}},"9":{"start":{"line":106,"column":8},"end":{"line":106,"column":19}},"10":{"start":{"line":107,"column":8},"end":{"line":107,"column":62}},"11":{"start":{"line":111,"column":8},"end":{"line":111,"column":18}},"12":{"start":{"line":121,"column":8},"end":{"line":121,"column":3855}},"13":{"start":{"line":122,"column":12},"end":{"line":122,"column":23}},"14":{"start":{"line":126,"column":12},"end":{"line":126,"column":22}},"15":{"start":{"line":129,"column":8},"end":{"line":129,"column":43}},"16":{"start":{"line":139,"column":8},"end":{"line":139,"column":41}},"17":{"start":{"line":143,"column":8},"end":{"line":143,"column":57}},"18":{"start":{"line":144,"column":8},"end":{"line":144,"column":68}},"19":{"start":{"line":145,"column":8},"end":{"line":145,"column":23}},"20":{"start":{"line":151,"column":8},"end":{"line":151,"column":23}},"21":{"start":{"line":155,"column":8},"end":{"line":155,"column":56}},"22":{"start":{"line":156,"column":8},"end":{"line":156,"column":67}},"23":{"start":{"line":157,"column":8},"end":{"line":157,"column":22}},"24":{"start":{"line":163,"column":8},"end":{"line":163,"column":23}},"25":{"start":{"line":167,"column":8},"end":{"line":167,"column":59}},"26":{"start":{"line":168,"column":8},"end":{"line":168,"column":69}},"27":{"start":{"line":169,"column":8},"end":{"line":169,"column":27}},"28":{"start":{"line":175,"column":8},"end":{"line":175,"column":26}},"29":{"start":{"line":185,"column":8},"end":{"line":185,"column":59}},"30":{"start":{"line":187,"column":8},"end":{"line":187,"column":5646}},"31":{"start":{"line":188,"column":12},"end":{"line":188,"column":42}},"32":{"start":{"line":189,"column":12},"end":{"line":189,"column":61}},"33":{"start":{"line":192,"column":8},"end":{"line":192,"column":22}},"34":{"start":{"line":202,"column":8},"end":{"line":202,"column":55}},"35":{"start":{"line":204,"column":8},"end":{"line":204,"column":6036}},"36":{"start":{"line":205,"column":12},"end":{"line":205,"column":62}},"37":{"start":{"line":208,"column":8},"end":{"line":208,"column":18}},"38":{"start":{"line":219,"column":8},"end":{"line":219,"column":53}}},"branchMap":{"1":{"line":22,"type":"if","locations":[{"start":{"line":22,"column":8},"end":{"line":22,"column":8}},{"start":{"line":22,"column":8},"end":{"line":22,"column":8}}]},"2":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":8},"end":{"line":23,"column":8}},{"start":{"line":23,"column":8},"end":{"line":23,"column":8}}]},"3":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":8}},{"start":{"line":24,"column":8},"end":{"line":24,"column":8}}]},"4":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":8}},{"start":{"line":92,"column":8},"end":{"line":92,"column":8}}]},"5":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":8},"end":{"line":121,"column":8}},{"start":{"line":121,"column":8},"end":{"line":121,"column":8}}]},"6":{"line":143,"type":"if","locations":[{"start":{"line":143,"column":8},"end":{"line":143,"column":8}},{"start":{"line":143,"column":8},"end":{"line":143,"column":8}}]},"7":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"8":{"line":155,"type":"if","locations":[{"start":{"line":155,"column":8},"end":{"line":155,"column":8}},{"start":{"line":155,"column":8},"end":{"line":155,"column":8}}]},"9":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"10":{"line":167,"type":"if","locations":[{"start":{"line":167,"column":8},"end":{"line":167,"column":8}},{"start":{"line":167,"column":8},"end":{"line":167,"column":8}}]},"11":{"line":168,"type":"if","locations":[{"start":{"line":168,"column":8},"end":{"line":168,"column":8}},{"start":{"line":168,"column":8},"end":{"line":168,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol":{"l":{"35":22,"37":22,"52":24,"53":9,"55":15,"77":15,"94":9,"95":9,"96":9},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol","s":{"1":22,"2":22,"3":24,"4":9,"5":15,"6":15,"7":9,"8":9,"9":9},"b":{"1":[9,15]},"f":{"1":22,"2":24,"3":15,"4":9},"fnMap":{"1":{"name":"recover","line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"getMessageHash","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":56,"column":4}}},"3":{"name":"getNativeMessageHash","line":68,"loc":{"start":{"line":68,"column":4},"end":{"line":78,"column":4}}},"4":{"name":"getEthSignedMessageHash","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":97,"column":4}}}},"statementMap":{"1":{"start":{"line":35,"column":8},"end":{"line":35,"column":75}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1000}},"3":{"start":{"line":52,"column":8},"end":{"line":52,"column":1277}},"4":{"start":{"line":53,"column":12},"end":{"line":53,"column":52}},"5":{"start":{"line":55,"column":8},"end":{"line":55,"column":45}},"6":{"start":{"line":77,"column":8},"end":{"line":77,"column":34}},"7":{"start":{"line":94,"column":8},"end":{"line":94,"column":64}},"8":{"start":{"line":95,"column":8},"end":{"line":95,"column":49}},"9":{"start":{"line":96,"column":8},"end":{"line":96,"column":63}}},"branchMap":{"1":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol":{"l":{"30":10},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol","s":{"1":10},"b":{},"f":{"1":10},"fnMap":{"1":{"name":"encodeRevertString","line":21,"loc":{"start":{"line":21,"column":4},"end":{"line":34,"column":4}}}},"statementMap":{"1":{"start":{"line":30,"column":8},"end":{"line":30,"column":830}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol":{"l":{"37":34,"44":34,"61":18,"82":212,"86":212,"103":19,"107":19,"128":27,"136":27,"155":27,"156":27,"157":27,"159":27,"160":27,"179":0,"186":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol","s":{"1":34,"2":18,"3":212,"4":19,"5":27,"6":27,"7":27,"8":27,"9":27,"10":27,"11":0,"12":0},"b":{},"f":{"1":34,"2":18,"3":212,"4":19,"5":27,"6":27,"7":0},"fnMap":{"1":{"name":"getCode","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":45,"column":4}}},"2":{"name":"getCode","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":66,"column":4}}},"3":{"name":"getCodeSize","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":87,"column":4}}},"4":{"name":"getCodeHash","line":94,"loc":{"start":{"line":94,"column":4},"end":{"line":108,"column":4}}},"5":{"name":"createContract","line":120,"loc":{"start":{"line":120,"column":4},"end":{"line":137,"column":4}}},"6":{"name":"getAddressForCREATE","line":145,"loc":{"start":{"line":145,"column":4},"end":{"line":161,"column":4}}},"7":{"name":"getAddressForCREATE2","line":170,"loc":{"start":{"line":170,"column":4},"end":{"line":187,"column":4}}}},"statementMap":{"1":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":1471}},"3":{"start":{"line":86,"column":8},"end":{"line":86,"column":24}},"4":{"start":{"line":107,"column":8},"end":{"line":107,"column":24}},"5":{"start":{"line":136,"column":8},"end":{"line":136,"column":23}},"6":{"start":{"line":155,"column":8},"end":{"line":155,"column":47}},"7":{"start":{"line":156,"column":8},"end":{"line":156,"column":56}},"8":{"start":{"line":157,"column":8},"end":{"line":157,"column":51}},"9":{"start":{"line":159,"column":8},"end":{"line":159,"column":67}},"10":{"start":{"line":160,"column":8},"end":{"line":160,"column":65}},"11":{"start":{"line":179,"column":8},"end":{"line":179,"column":4349}},"12":{"start":{"line":186,"column":8},"end":{"line":186,"column":53}}},"branchMap":{}},"contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol":{"l":{"29":0,"30":0,"33":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol","s":{"1":0,"2":0,"3":0},"b":{"1":[0,0]},"f":{"1":0},"fnMap":{"1":{"name":"min","line":19,"loc":{"start":{"line":19,"column":4},"end":{"line":34,"column":4}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":550}},"2":{"start":{"line":30,"column":12},"end":{"line":30,"column":21}},"3":{"start":{"line":33,"column":8},"end":{"line":33,"column":17}}},"branchMap":{"1":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":8},"end":{"line":29,"column":8}},{"start":{"line":29,"column":8},"end":{"line":29,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol":{"l":{"32":118,"37":117,"38":0,"41":117,"61":117,"64":117,"65":117,"68":117,"71":117,"74":117,"75":117,"77":117,"78":273,"79":273,"81":273,"82":4620,"83":4620,"84":4620,"89":4620,"92":273,"93":27,"94":27,"95":27,"100":27,"103":273,"104":273,"107":117,"134":102,"139":101,"144":100,"149":99,"151":99,"152":653,"153":146,"160":507,"168":653,"171":99,"193":100,"198":100,"199":3,"204":97,"205":97,"206":97,"207":776,"208":206,"209":206,"214":97,"215":70,"218":97},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol","s":{"1":118,"2":117,"3":0,"4":117,"5":117,"6":117,"7":117,"8":117,"9":117,"10":117,"11":117,"12":117,"13":273,"14":273,"15":273,"16":4620,"17":4620,"18":4620,"19":273,"20":27,"21":27,"22":27,"23":273,"24":117,"25":102,"26":101,"27":100,"28":99,"29":99,"30":653,"31":146,"32":507,"33":653,"34":99,"35":100,"36":100,"37":3,"38":97,"39":97,"40":97,"41":776,"42":206,"43":206,"44":97,"45":70,"46":97},"b":{"1":[117,1],"2":[0,117],"3":[27,246],"4":[101,1],"5":[100,1],"6":[99,1],"7":[146,507],"8":[100,0],"9":[3,97],"10":[206,570],"11":[70,27]},"f":{"1":118,"2":102,"3":100},"fnMap":{"1":{"name":"getMerkleRoot","line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":108,"column":4}}},"2":{"name":"verify","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":172,"column":4}}},"3":{"name":"_ceilLog2","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":219,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":1067}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1197}},"3":{"start":{"line":38,"column":12},"end":{"line":38,"column":31}},"4":{"start":{"line":41,"column":8},"end":{"line":41,"column":1279}},"5":{"start":{"line":61,"column":8},"end":{"line":61,"column":40}},"6":{"start":{"line":64,"column":8},"end":{"line":64,"column":27}},"7":{"start":{"line":65,"column":8},"end":{"line":65,"column":28}},"8":{"start":{"line":68,"column":8},"end":{"line":68,"column":42}},"9":{"start":{"line":71,"column":8},"end":{"line":71,"column":25}},"10":{"start":{"line":74,"column":8},"end":{"line":74,"column":27}},"11":{"start":{"line":75,"column":8},"end":{"line":75,"column":25}},"12":{"start":{"line":77,"column":8},"end":{"line":77,"column":3156}},"13":{"start":{"line":78,"column":12},"end":{"line":78,"column":36}},"14":{"start":{"line":79,"column":12},"end":{"line":79,"column":42}},"15":{"start":{"line":81,"column":12},"end":{"line":81,"column":3279}},"16":{"start":{"line":82,"column":16},"end":{"line":82,"column":52}},"17":{"start":{"line":83,"column":16},"end":{"line":83,"column":52}},"18":{"start":{"line":89,"column":16},"end":{"line":89,"column":44}},"19":{"start":{"line":92,"column":12},"end":{"line":92,"column":3663}},"20":{"start":{"line":93,"column":16},"end":{"line":93,"column":52}},"21":{"start":{"line":94,"column":16},"end":{"line":94,"column":54}},"22":{"start":{"line":100,"column":16},"end":{"line":100,"column":54}},"23":{"start":{"line":103,"column":12},"end":{"line":103,"column":57}},"24":{"start":{"line":107,"column":8},"end":{"line":107,"column":27}},"25":{"start":{"line":134,"column":8},"end":{"line":134,"column":5110}},"26":{"start":{"line":139,"column":8},"end":{"line":139,"column":5239}},"27":{"start":{"line":144,"column":8},"end":{"line":144,"column":5354}},"28":{"start":{"line":149,"column":8},"end":{"line":149,"column":36}},"29":{"start":{"line":151,"column":8},"end":{"line":151,"column":5571}},"30":{"start":{"line":152,"column":12},"end":{"line":152,"column":5636}},"31":{"start":{"line":153,"column":16},"end":{"line":153,"column":5681}},"32":{"start":{"line":160,"column":16},"end":{"line":160,"column":5898}},"33":{"start":{"line":168,"column":12},"end":{"line":168,"column":23}},"34":{"start":{"line":171,"column":8},"end":{"line":171,"column":36}},"35":{"start":{"line":193,"column":8},"end":{"line":193,"column":6569}},"36":{"start":{"line":198,"column":8},"end":{"line":198,"column":6682}},"37":{"start":{"line":199,"column":12},"end":{"line":199,"column":20}},"38":{"start":{"line":204,"column":8},"end":{"line":204,"column":25}},"39":{"start":{"line":205,"column":8},"end":{"line":205,"column":27}},"40":{"start":{"line":206,"column":8},"end":{"line":206,"column":6934}},"41":{"start":{"line":207,"column":12},"end":{"line":207,"column":6989}},"42":{"start":{"line":208,"column":16},"end":{"line":208,"column":27}},"43":{"start":{"line":209,"column":16},"end":{"line":209,"column":24}},"44":{"start":{"line":214,"column":8},"end":{"line":214,"column":7181}},"45":{"start":{"line":215,"column":12},"end":{"line":215,"column":23}},"46":{"start":{"line":218,"column":8},"end":{"line":218,"column":22}}},"branchMap":{"1":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":8},"end":{"line":32,"column":8}},{"start":{"line":32,"column":8},"end":{"line":32,"column":8}}]},"2":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"3":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":12},"end":{"line":92,"column":12}},{"start":{"line":92,"column":12},"end":{"line":92,"column":12}}]},"4":{"line":134,"type":"if","locations":[{"start":{"line":134,"column":8},"end":{"line":134,"column":8}},{"start":{"line":134,"column":8},"end":{"line":134,"column":8}}]},"5":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"6":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"7":{"line":152,"type":"if","locations":[{"start":{"line":152,"column":12},"end":{"line":152,"column":12}},{"start":{"line":152,"column":12},"end":{"line":152,"column":12}}]},"8":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"9":{"line":198,"type":"if","locations":[{"start":{"line":198,"column":8},"end":{"line":198,"column":8}},{"start":{"line":198,"column":8},"end":{"line":198,"column":8}}]},"10":{"line":207,"type":"if","locations":[{"start":{"line":207,"column":12},"end":{"line":207,"column":12}},{"start":{"line":207,"column":12},"end":{"line":207,"column":12}}]},"11":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol":{"l":{"38":54,"50":14,"53":14,"55":14,"59":6},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol","s":{"1":54,"2":14,"3":14,"4":6},"b":{"1":[14,0]},"f":{"1":54,"2":14},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":39,"column":4}}},"2":{"name":"nonReentrant","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":60,"column":4}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":29}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":70}},"3":{"start":{"line":53,"column":8},"end":{"line":53,"column":25}},"4":{"start":{"line":59,"column":8},"end":{"line":59,"column":29}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol":{"l":{"60":572,"61":572,"64":572,"65":134,"69":572,"70":11,"73":0,"74":0,"75":0,"78":0,"81":11,"86":572,"87":572,"90":572,"91":572,"92":572,"106":470,"108":470,"130":538,"132":538,"137":535,"138":535,"140":535,"143":535,"146":535,"151":535,"155":0,"158":0,"164":0,"169":0,"186":1,"188":1,"193":1,"197":0,"198":0,"202":1,"203":1,"204":1,"218":0,"219":0,"239":441,"240":441,"254":0,"255":0,"256":0,"273":550,"274":550,"288":573,"289":573,"291":573,"292":573,"293":573,"298":573,"299":573,"300":573,"301":573,"307":573,"308":573,"311":573,"312":0,"330":2572,"331":2572,"333":2572,"334":2572,"335":2572,"340":2572,"341":2572,"342":2572,"343":2572,"349":2572,"374":1642},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol","s":{"1":572,"2":572,"3":572,"4":134,"5":572,"6":11,"7":0,"8":0,"9":0,"10":11,"11":572,"12":572,"13":572,"14":572,"15":470,"16":470,"17":538,"18":538,"19":535,"20":535,"21":535,"22":535,"23":535,"24":535,"25":0,"26":0,"27":0,"28":0,"29":1,"30":1,"31":1,"32":0,"33":1,"34":1,"35":1,"36":0,"37":0,"38":441,"39":441,"40":0,"41":0,"42":0,"43":550,"44":550,"45":573,"46":573,"47":573,"48":573,"49":573,"50":573,"51":573,"52":573,"53":573,"54":573,"55":0,"56":2572,"57":2572,"58":2572,"59":2572,"60":2572,"61":2572,"62":2572,"63":2572,"64":1642},"b":{"1":[134,438],"2":[11,561],"3":[0,11],"4":[535,3],"5":[535,0],"6":[535,0],"7":[0,0],"8":[0,0],"9":[1,0],"10":[0,1],"11":[573,0],"12":[0,573]},"f":{"1":572,"2":470,"3":538,"4":1,"5":0,"6":441,"7":0,"8":550,"9":573,"10":2572,"11":1642},"fnMap":{"1":{"name":"push","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":93,"column":4}}},"2":{"name":"push","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":112,"column":4}}},"3":{"name":"get","line":120,"loc":{"start":{"line":120,"column":4},"end":{"line":171,"column":4}}},"4":{"name":"deleteElementsAfterInclusive","line":179,"loc":{"start":{"line":179,"column":4},"end":{"line":205,"column":4}}},"5":{"name":"deleteElementsAfterInclusive","line":212,"loc":{"start":{"line":212,"column":4},"end":{"line":223,"column":4}}},"6":{"name":"getLength","line":230,"loc":{"start":{"line":230,"column":4},"end":{"line":241,"column":4}}},"7":{"name":"setExtraData","line":248,"loc":{"start":{"line":248,"column":4},"end":{"line":257,"column":4}}},"8":{"name":"getExtraData","line":264,"loc":{"start":{"line":264,"column":4},"end":{"line":275,"column":4}}},"9":{"name":"setContext","line":282,"loc":{"start":{"line":282,"column":4},"end":{"line":314,"column":4}}},"10":{"name":"getContext","line":321,"loc":{"start":{"line":321,"column":4},"end":{"line":356,"column":4}}},"11":{"name":"getBuffer","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":375,"column":4}}}},"statementMap":{"1":{"start":{"line":60,"column":8},"end":{"line":60,"column":57}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":72}},"3":{"start":{"line":64,"column":8},"end":{"line":64,"column":1385}},"4":{"start":{"line":65,"column":12},"end":{"line":65,"column":43}},"5":{"start":{"line":69,"column":8},"end":{"line":69,"column":1530}},"6":{"start":{"line":70,"column":12},"end":{"line":70,"column":1611}},"7":{"start":{"line":74,"column":16},"end":{"line":74,"column":54}},"8":{"start":{"line":75,"column":16},"end":{"line":75,"column":51}},"9":{"start":{"line":78,"column":16},"end":{"line":78,"column":64}},"10":{"start":{"line":81,"column":16},"end":{"line":81,"column":37}},"11":{"start":{"line":86,"column":8},"end":{"line":86,"column":64}},"12":{"start":{"line":87,"column":8},"end":{"line":87,"column":41}},"13":{"start":{"line":91,"column":8},"end":{"line":91,"column":33}},"14":{"start":{"line":92,"column":8},"end":{"line":92,"column":28}},"15":{"start":{"line":106,"column":8},"end":{"line":106,"column":57}},"16":{"start":{"line":108,"column":8},"end":{"line":108,"column":2968}},"17":{"start":{"line":130,"column":8},"end":{"line":130,"column":57}},"18":{"start":{"line":132,"column":8},"end":{"line":132,"column":3484}},"19":{"start":{"line":137,"column":8},"end":{"line":137,"column":72}},"20":{"start":{"line":138,"column":8},"end":{"line":138,"column":76}},"21":{"start":{"line":140,"column":8},"end":{"line":140,"column":3739}},"22":{"start":{"line":143,"column":12},"end":{"line":143,"column":63}},"23":{"start":{"line":146,"column":12},"end":{"line":146,"column":4055}},"24":{"start":{"line":151,"column":12},"end":{"line":151,"column":48}},"25":{"start":{"line":155,"column":12},"end":{"line":155,"column":63}},"26":{"start":{"line":158,"column":12},"end":{"line":158,"column":4566}},"27":{"start":{"line":164,"column":12},"end":{"line":164,"column":4767}},"28":{"start":{"line":169,"column":12},"end":{"line":169,"column":68}},"29":{"start":{"line":186,"column":8},"end":{"line":186,"column":57}},"30":{"start":{"line":188,"column":8},"end":{"line":188,"column":5432}},"31":{"start":{"line":193,"column":8},"end":{"line":193,"column":5566}},"32":{"start":{"line":198,"column":12},"end":{"line":198,"column":50}},"33":{"start":{"line":202,"column":8},"end":{"line":202,"column":31}},"34":{"start":{"line":203,"column":8},"end":{"line":203,"column":33}},"35":{"start":{"line":204,"column":8},"end":{"line":204,"column":28}},"36":{"start":{"line":218,"column":8},"end":{"line":218,"column":57}},"37":{"start":{"line":219,"column":8},"end":{"line":219,"column":6512}},"38":{"start":{"line":239,"column":8},"end":{"line":239,"column":57}},"39":{"start":{"line":240,"column":8},"end":{"line":240,"column":30}},"40":{"start":{"line":254,"column":8},"end":{"line":254,"column":57}},"41":{"start":{"line":255,"column":8},"end":{"line":255,"column":33}},"42":{"start":{"line":256,"column":8},"end":{"line":256,"column":28}},"43":{"start":{"line":273,"column":8},"end":{"line":273,"column":57}},"44":{"start":{"line":274,"column":8},"end":{"line":274,"column":28}},"45":{"start":{"line":288,"column":8},"end":{"line":288,"column":24}},"46":{"start":{"line":289,"column":8},"end":{"line":289,"column":24}},"47":{"start":{"line":291,"column":8},"end":{"line":291,"column":45}},"48":{"start":{"line":292,"column":8},"end":{"line":292,"column":42}},"49":{"start":{"line":298,"column":8},"end":{"line":298,"column":53}},"50":{"start":{"line":299,"column":8},"end":{"line":299,"column":51}},"51":{"start":{"line":300,"column":8},"end":{"line":300,"column":51}},"52":{"start":{"line":307,"column":8},"end":{"line":307,"column":8669}},"53":{"start":{"line":308,"column":12},"end":{"line":308,"column":36}},"54":{"start":{"line":311,"column":8},"end":{"line":311,"column":8761}},"55":{"start":{"line":312,"column":12},"end":{"line":312,"column":36}},"56":{"start":{"line":330,"column":8},"end":{"line":330,"column":41}},"57":{"start":{"line":331,"column":8},"end":{"line":331,"column":41}},"58":{"start":{"line":333,"column":8},"end":{"line":333,"column":26}},"59":{"start":{"line":334,"column":8},"end":{"line":334,"column":25}},"60":{"start":{"line":340,"column":8},"end":{"line":340,"column":30}},"61":{"start":{"line":341,"column":8},"end":{"line":341,"column":29}},"62":{"start":{"line":342,"column":8},"end":{"line":342,"column":29}},"63":{"start":{"line":349,"column":8},"end":{"line":349,"column":10056}},"64":{"start":{"line":374,"column":8},"end":{"line":374,"column":62}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"2":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":8}},{"start":{"line":69,"column":8},"end":{"line":69,"column":8}}]},"3":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":12},"end":{"line":70,"column":12}},{"start":{"line":70,"column":12},"end":{"line":70,"column":12}}]},"4":{"line":132,"type":"if","locations":[{"start":{"line":132,"column":8},"end":{"line":132,"column":8}},{"start":{"line":132,"column":8},"end":{"line":132,"column":8}}]},"5":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":8},"end":{"line":140,"column":8}},{"start":{"line":140,"column":8},"end":{"line":140,"column":8}}]},"6":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":12},"end":{"line":146,"column":12}},{"start":{"line":146,"column":12},"end":{"line":146,"column":12}}]},"7":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":12},"end":{"line":158,"column":12}},{"start":{"line":158,"column":12},"end":{"line":158,"column":12}}]},"8":{"line":164,"type":"if","locations":[{"start":{"line":164,"column":12},"end":{"line":164,"column":12}},{"start":{"line":164,"column":12},"end":{"line":164,"column":12}}]},"9":{"line":188,"type":"if","locations":[{"start":{"line":188,"column":8},"end":{"line":188,"column":8}},{"start":{"line":188,"column":8},"end":{"line":188,"column":8}}]},"10":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"11":{"line":307,"type":"if","locations":[{"start":{"line":307,"column":8},"end":{"line":307,"column":8}},{"start":{"line":307,"column":8},"end":{"line":307,"column":8}}]},"12":{"line":311,"type":"if","locations":[{"start":{"line":311,"column":8},"end":{"line":311,"column":8}},{"start":{"line":311,"column":8},"end":{"line":311,"column":8}}]}}},"contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol":{"l":{"41":18,"50":18,"72":2,"81":2,"100":1,"108":1,"124":5,"131":5,"144":12,"150":12,"163":11,"169":11,"182":9,"188":9,"201":7,"207":7,"219":6,"242":2,"262":9,"283":41,"284":7,"301":43,"308":43,"320":21,"348":146,"349":146,"354":146,"355":2,"359":0,"363":144,"375":145},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol","s":{"1":18,"2":18,"3":2,"4":2,"5":1,"6":1,"7":5,"8":5,"9":12,"10":12,"11":11,"12":11,"13":9,"14":9,"15":7,"16":7,"17":6,"18":2,"19":9,"20":41,"21":7,"22":43,"23":43,"24":21,"25":146,"26":146,"27":146,"28":144,"29":144,"30":145},"b":{"1":[7,34],"2":[2,144],"3":[0,144]},"f":{"1":18,"2":2,"3":1,"4":5,"5":12,"6":11,"7":9,"8":7,"9":6,"10":2,"11":9,"12":41,"13":43,"14":21,"15":146,"16":145},"fnMap":{"1":{"name":"safeCALL","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":51,"column":4}}},"2":{"name":"safeDELEGATECALL","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":82,"column":4}}},"3":{"name":"safeCREATE","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":109,"column":4}}},"4":{"name":"safeEXTCODESIZE","line":116,"loc":{"start":{"line":116,"column":4},"end":{"line":132,"column":4}}},"5":{"name":"safeCHAINID","line":138,"loc":{"start":{"line":138,"column":4},"end":{"line":151,"column":4}}},"6":{"name":"safeCALLER","line":157,"loc":{"start":{"line":157,"column":4},"end":{"line":170,"column":4}}},"7":{"name":"safeADDRESS","line":176,"loc":{"start":{"line":176,"column":4},"end":{"line":189,"column":4}}},"8":{"name":"safeGETNONCE","line":195,"loc":{"start":{"line":195,"column":4},"end":{"line":208,"column":4}}},"9":{"name":"safeSETNONCE","line":214,"loc":{"start":{"line":214,"column":4},"end":{"line":225,"column":4}}},"10":{"name":"safeCREATEEOA","line":234,"loc":{"start":{"line":234,"column":4},"end":{"line":251,"column":4}}},"11":{"name":"safeREVERT","line":257,"loc":{"start":{"line":257,"column":4},"end":{"line":270,"column":4}}},"12":{"name":"safeREQUIRE","line":277,"loc":{"start":{"line":277,"column":4},"end":{"line":288,"column":4}}},"13":{"name":"safeSLOAD","line":293,"loc":{"start":{"line":293,"column":4},"end":{"line":309,"column":4}}},"14":{"name":"safeSSTORE","line":314,"loc":{"start":{"line":314,"column":4},"end":{"line":327,"column":4}}},"15":{"name":"_safeExecutionManagerInteraction","line":339,"loc":{"start":{"line":339,"column":4},"end":{"line":365,"column":4}}},"16":{"name":"_safeExecutionManagerInteraction","line":367,"loc":{"start":{"line":367,"column":4},"end":{"line":379,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":1128}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":52}},"3":{"start":{"line":72,"column":8},"end":{"line":72,"column":1988}},"4":{"start":{"line":81,"column":8},"end":{"line":81,"column":52}},"5":{"start":{"line":100,"column":8},"end":{"line":100,"column":2718}},"6":{"start":{"line":108,"column":8},"end":{"line":108,"column":55}},"7":{"start":{"line":124,"column":8},"end":{"line":124,"column":3343}},"8":{"start":{"line":131,"column":8},"end":{"line":131,"column":48}},"9":{"start":{"line":144,"column":8},"end":{"line":144,"column":3817}},"10":{"start":{"line":150,"column":8},"end":{"line":150,"column":48}},"11":{"start":{"line":163,"column":8},"end":{"line":163,"column":4248}},"12":{"start":{"line":169,"column":8},"end":{"line":169,"column":48}},"13":{"start":{"line":182,"column":8},"end":{"line":182,"column":4683}},"14":{"start":{"line":188,"column":8},"end":{"line":188,"column":48}},"15":{"start":{"line":201,"column":8},"end":{"line":201,"column":5118}},"16":{"start":{"line":207,"column":8},"end":{"line":207,"column":48}},"17":{"start":{"line":219,"column":8},"end":{"line":219,"column":5513}},"18":{"start":{"line":242,"column":8},"end":{"line":242,"column":6076}},"19":{"start":{"line":262,"column":8},"end":{"line":262,"column":6544}},"20":{"start":{"line":283,"column":8},"end":{"line":283,"column":7099}},"21":{"start":{"line":284,"column":12},"end":{"line":284,"column":7134}},"22":{"start":{"line":301,"column":8},"end":{"line":301,"column":7383}},"23":{"start":{"line":308,"column":8},"end":{"line":308,"column":48}},"24":{"start":{"line":320,"column":8},"end":{"line":320,"column":7782}},"25":{"start":{"line":348,"column":8},"end":{"line":348,"column":48}},"26":{"start":{"line":349,"column":8},"end":{"line":349,"column":8669}},"27":{"start":{"line":354,"column":8},"end":{"line":354,"column":8752}},"28":{"start":{"line":358,"column":15},"end":{"line":358,"column":8893}},"29":{"start":{"line":363,"column":12},"end":{"line":363,"column":29}},"30":{"start":{"line":375,"column":8},"end":{"line":375,"column":9234}}},"branchMap":{"1":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":8},"end":{"line":283,"column":8}},{"start":{"line":283,"column":8},"end":{"line":283,"column":8}}]},"2":{"line":354,"type":"if","locations":[{"start":{"line":354,"column":8},"end":{"line":354,"column":8}},{"start":{"line":354,"column":8},"end":{"line":354,"column":8}}]},"3":{"line":358,"type":"if","locations":[{"start":{"line":358,"column":15},"end":{"line":358,"column":15}},{"start":{"line":358,"column":15},"end":{"line":358,"column":15}}]}}},"contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol":{"l":{"39":0,"40":0,"42":0,"56":0,"70":0,"71":0,"73":0,"90":7,"91":0,"94":7,"95":7,"97":7,"113":0,"129":0,"130":0,"133":0,"149":0,"165":0,"166":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":7,"9":0,"10":7,"11":7,"12":7,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"b":{"1":[0,7]},"f":{"1":0,"2":0,"3":0,"4":7,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"add","line":38,"loc":{"start":{"line":38,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"sub","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":57,"column":4}}},"3":{"name":"sub","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":74,"column":4}}},"4":{"name":"mul","line":86,"loc":{"start":{"line":86,"column":4},"end":{"line":98,"column":4}}},"5":{"name":"div","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":114,"column":4}}},"6":{"name":"div","line":128,"loc":{"start":{"line":128,"column":4},"end":{"line":134,"column":4}}},"7":{"name":"mod","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":150,"column":4}}},"8":{"name":"mod","line":164,"loc":{"start":{"line":164,"column":4},"end":{"line":167,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":25}},"2":{"start":{"line":40,"column":8},"end":{"line":40,"column":100}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":16}},"4":{"start":{"line":56,"column":8},"end":{"line":56,"column":69}},"5":{"start":{"line":70,"column":8},"end":{"line":70,"column":72}},"6":{"start":{"line":71,"column":8},"end":{"line":71,"column":25}},"7":{"start":{"line":73,"column":8},"end":{"line":73,"column":16}},"8":{"start":{"line":90,"column":8},"end":{"line":90,"column":2816}},"9":{"start":{"line":91,"column":12},"end":{"line":91,"column":20}},"10":{"start":{"line":94,"column":8},"end":{"line":94,"column":25}},"11":{"start":{"line":95,"column":8},"end":{"line":95,"column":110}},"12":{"start":{"line":97,"column":8},"end":{"line":97,"column":16}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":65}},"14":{"start":{"line":129,"column":8},"end":{"line":129,"column":71}},"15":{"start":{"line":130,"column":8},"end":{"line":130,"column":25}},"16":{"start":{"line":133,"column":8},"end":{"line":133,"column":16}},"17":{"start":{"line":149,"column":8},"end":{"line":149,"column":63}},"18":{"start":{"line":165,"column":8},"end":{"line":165,"column":72}},"19":{"start":{"line":166,"column":8},"end":{"line":166,"column":20}}},"branchMap":{"1":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol":{"l":{"63":7,"69":7,"80":7,"83":7,"89":7,"102":7,"103":7,"104":7,"109":7,"115":7,"116":1,"122":1,"123":1,"125":0,"131":6,"133":6},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol","s":{"1":7,"2":7,"3":7,"4":7,"5":7,"6":7,"7":7,"8":7,"9":7,"10":7,"11":1,"12":1,"13":1,"14":0,"15":6,"16":6},"b":{"1":[1,6],"2":[1,0]},"f":{"1":7},"fnMap":{"1":{"name":"execute","line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":139,"column":4}}}},"statementMap":{"1":{"start":{"line":63,"column":8},"end":{"line":63,"column":91}},"2":{"start":{"line":69,"column":8},"end":{"line":69,"column":2653}},"3":{"start":{"line":80,"column":8},"end":{"line":80,"column":119}},"4":{"start":{"line":83,"column":8},"end":{"line":83,"column":3201}},"5":{"start":{"line":89,"column":8},"end":{"line":89,"column":3483}},"6":{"start":{"line":102,"column":8},"end":{"line":102,"column":70}},"7":{"start":{"line":103,"column":8},"end":{"line":103,"column":85}},"8":{"start":{"line":104,"column":8},"end":{"line":104,"column":4275}},"9":{"start":{"line":109,"column":8},"end":{"line":109,"column":4487}},"10":{"start":{"line":115,"column":8},"end":{"line":115,"column":4721}},"11":{"start":{"line":116,"column":12},"end":{"line":116,"column":4772}},"12":{"start":{"line":122,"column":12},"end":{"line":122,"column":5049}},"13":{"start":{"line":123,"column":16},"end":{"line":123,"column":50}},"14":{"start":{"line":125,"column":16},"end":{"line":125,"column":42}},"15":{"start":{"line":131,"column":12},"end":{"line":131,"column":76}},"16":{"start":{"line":133,"column":12},"end":{"line":133,"column":5602}}},"branchMap":{"1":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":8},"end":{"line":115,"column":8}},{"start":{"line":115,"column":8},"end":{"line":115,"column":8}}]},"2":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":12},"end":{"line":122,"column":12}},{"start":{"line":122,"column":12},"end":{"line":122,"column":12}}]}}},"contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol":{"l":{"39":13,"50":1,"56":1,"57":1,"61":0,"81":2,"86":2,"99":2,"116":15},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol","s":{"1":13,"2":1,"3":1,"4":0,"5":2,"6":2,"7":2,"8":15},"b":{"1":[1,0]},"f":{"1":13,"2":1,"3":2,"4":2,"5":15},"fnMap":{"1":{"name":"constructor","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":40,"column":4}}},"2":{"name":null,"line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":65,"column":4}}},"3":{"name":"upgrade","line":76,"loc":{"start":{"line":76,"column":4},"end":{"line":87,"column":4}}},"4":{"name":"getImplementation","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":104,"column":4}}},"5":{"name":"_setImplementation","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":120,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":42}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":1366}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":1554}},"4":{"start":{"line":61,"column":12},"end":{"line":61,"column":1704}},"5":{"start":{"line":81,"column":8},"end":{"line":81,"column":2100}},"6":{"start":{"line":86,"column":8},"end":{"line":86,"column":42}},"7":{"start":{"line":99,"column":8},"end":{"line":99,"column":2610}},"8":{"start":{"line":116,"column":8},"end":{"line":116,"column":2955}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol":{"l":{"47":4,"48":0,"65":7,"72":7,"73":7,"75":7,"76":7,"103":21,"124":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol","s":{"1":4,"2":0,"3":7,"4":7,"5":7,"6":7,"7":7,"8":21,"9":0},"b":{"1":[0,4]},"f":{"1":54,"2":4,"3":7,"4":21,"5":0},"fnMap":{"1":{"name":"constructor","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":41}}},"2":{"name":"xDomainMessageSender","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"sendMessage","line":57,"loc":{"start":{"line":57,"column":4},"end":{"line":77,"column":4}}},"4":{"name":"_getXDomainCalldata","line":91,"loc":{"start":{"line":91,"column":4},"end":{"line":110,"column":4}}},"5":{"name":"_sendXDomainMessage","line":117,"loc":{"start":{"line":117,"column":4},"end":{"line":125,"column":4}}}},"statementMap":{"1":{"start":{"line":47,"column":8},"end":{"line":47,"column":93}},"2":{"start":{"line":48,"column":8},"end":{"line":48,"column":31}},"3":{"start":{"line":65,"column":8},"end":{"line":65,"column":2352}},"4":{"start":{"line":72,"column":8},"end":{"line":72,"column":24}},"5":{"start":{"line":73,"column":8},"end":{"line":73,"column":54}},"6":{"start":{"line":75,"column":8},"end":{"line":75,"column":54}},"7":{"start":{"line":76,"column":8},"end":{"line":76,"column":41}},"8":{"start":{"line":103,"column":8},"end":{"line":103,"column":3373}},"9":{"start":{"line":124,"column":8},"end":{"line":124,"column":49}}},"branchMap":{"1":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":8}},{"start":{"line":47,"column":8},"end":{"line":47,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol":{"l":{"50":12,"51":12,"52":12,"64":9,"65":9,"66":1,"71":8,"95":8,"102":8,"110":4,"112":4,"117":3,"118":3,"119":3,"123":3,"124":3,"125":3,"130":3,"137":3,"154":2,"161":2,"166":1,"190":8,"210":8,"212":8,"238":6,"250":6,"259":5,"264":5,"268":5,"288":5},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol","s":{"1":12,"2":12,"3":12,"4":9,"5":9,"6":1,"7":8,"8":8,"9":4,"10":4,"11":3,"12":3,"13":3,"14":3,"15":3,"16":3,"17":3,"18":3,"19":2,"20":2,"21":1,"22":8,"23":8,"24":8,"25":6,"26":6,"27":5,"28":5,"29":5,"30":5},"b":{"1":[12,0],"2":[1,8],"3":[0,1],"4":[4,4],"5":[3,1],"6":[3,0],"7":[1,1],"8":[5,0]},"f":{"1":36,"2":12,"3":9,"4":8,"5":2,"6":8,"7":8,"8":6,"9":5},"fnMap":{"1":{"name":"constructor","line":39,"loc":{"start":{"line":38,"column":4},"end":{"line":40,"column":5}}},"2":{"name":"initialize","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":53,"column":4}}},"3":{"name":"onlyRelayer","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":72,"column":4}}},"4":{"name":"relayMessage","line":93,"loc":{"start":{"line":83,"column":4},"end":{"line":138,"column":4}}},"5":{"name":"replayMessage","line":144,"loc":{"start":{"line":144,"column":4},"end":{"line":167,"column":4}}},"6":{"name":"_verifyXDomainMessage","line":180,"loc":{"start":{"line":180,"column":4},"end":{"line":194,"column":4}}},"7":{"name":"_verifyStateRootProof","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":220,"column":4}}},"8":{"name":"_verifyStorageProof","line":228,"loc":{"start":{"line":228,"column":4},"end":{"line":274,"column":4}}},"9":{"name":"_sendXDomainMessage","line":281,"loc":{"start":{"line":281,"column":4},"end":{"line":293,"column":4}}}},"statementMap":{"1":{"start":{"line":50,"column":8},"end":{"line":50,"column":102}},"2":{"start":{"line":51,"column":8},"end":{"line":51,"column":65}},"3":{"start":{"line":52,"column":8},"end":{"line":52,"column":48}},"4":{"start":{"line":64,"column":8},"end":{"line":64,"column":57}},"5":{"start":{"line":65,"column":8},"end":{"line":65,"column":2460}},"6":{"start":{"line":66,"column":12},"end":{"line":66,"column":2505}},"7":{"start":{"line":95,"column":8},"end":{"line":95,"column":3142}},"8":{"start":{"line":102,"column":8},"end":{"line":102,"column":3303}},"9":{"start":{"line":110,"column":8},"end":{"line":110,"column":64}},"10":{"start":{"line":112,"column":8},"end":{"line":112,"column":3567}},"11":{"start":{"line":117,"column":8},"end":{"line":117,"column":33}},"12":{"start":{"line":118,"column":8},"end":{"line":118,"column":49}},"13":{"start":{"line":119,"column":8},"end":{"line":119,"column":48}},"14":{"start":{"line":123,"column":8},"end":{"line":123,"column":4023}},"15":{"start":{"line":124,"column":12},"end":{"line":124,"column":57}},"16":{"start":{"line":125,"column":12},"end":{"line":125,"column":52}},"17":{"start":{"line":130,"column":8},"end":{"line":130,"column":4350}},"18":{"start":{"line":137,"column":8},"end":{"line":137,"column":38}},"19":{"start":{"line":154,"column":8},"end":{"line":154,"column":4915}},"20":{"start":{"line":161,"column":8},"end":{"line":161,"column":5076}},"21":{"start":{"line":166,"column":8},"end":{"line":166,"column":54}},"22":{"start":{"line":190,"column":8},"end":{"line":190,"column":5816}},"23":{"start":{"line":210,"column":8},"end":{"line":210,"column":122}},"24":{"start":{"line":212,"column":8},"end":{"line":212,"column":6441}},"25":{"start":{"line":238,"column":8},"end":{"line":238,"column":7225}},"26":{"start":{"line":250,"column":8},"end":{"line":250,"column":7558}},"27":{"start":{"line":259,"column":8},"end":{"line":259,"column":7836}},"28":{"start":{"line":264,"column":8},"end":{"line":264,"column":7986}},"29":{"start":{"line":268,"column":8},"end":{"line":268,"column":8119}},"30":{"start":{"line":288,"column":8},"end":{"line":288,"column":8632}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]},"2":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]},"3":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":12},"end":{"line":66,"column":12}},{"start":{"line":66,"column":12},"end":{"line":66,"column":12}}]},"4":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"5":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":8},"end":{"line":112,"column":8}},{"start":{"line":112,"column":8},"end":{"line":112,"column":8}}]},"6":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"7":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":8}},{"start":{"line":161,"column":8},"end":{"line":161,"column":8}}]},"8":{"line":259,"type":"if","locations":[{"start":{"line":259,"column":8},"end":{"line":259,"column":8}},{"start":{"line":259,"column":8},"end":{"line":259,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol":{"l":{"38":2,"42":1,"58":1,"59":1,"60":3,"61":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol","s":{"1":2,"2":1,"3":1,"4":3,"5":3},"b":{"1":[1,1]},"f":{"1":6,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":30,"loc":{"start":{"line":27,"column":4},"end":{"line":31,"column":5}}},"2":{"name":"onlyBatchRelayer","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"batchRelayMessages","line":56,"loc":{"start":{"line":53,"column":4},"end":{"line":69,"column":4}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":1192}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":121}},"3":{"start":{"line":59,"column":8},"end":{"line":59,"column":1913}},"4":{"start":{"line":60,"column":12},"end":{"line":60,"column":55}},"5":{"start":{"line":61,"column":12},"end":{"line":61,"column":2035}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":8}},{"start":{"line":38,"column":8},"end":{"line":38,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol":{"l":{"59":5,"64":4,"71":4,"73":4,"78":3,"79":3,"80":3,"84":3,"85":3,"86":3,"91":3,"98":3,"117":5,"134":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol","s":{"1":5,"2":4,"3":4,"4":4,"5":3,"6":3,"7":3,"8":3,"9":3,"10":3,"11":3,"12":3,"13":5,"14":3},"b":{"1":[4,1],"2":[3,1],"3":[3,0]},"f":{"1":18,"2":5,"3":5,"4":3},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":34,"column":4},"end":{"line":38,"column":5}}},"2":{"name":"relayMessage","line":56,"loc":{"start":{"line":49,"column":4},"end":{"line":99,"column":4}}},"3":{"name":"_verifyXDomainMessage","line":110,"loc":{"start":{"line":110,"column":4},"end":{"line":120,"column":4}}},"4":{"name":"_sendXDomainMessage","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":135,"column":4}}}},"statementMap":{"1":{"start":{"line":59,"column":8},"end":{"line":59,"column":1793}},"2":{"start":{"line":64,"column":8},"end":{"line":64,"column":1922}},"3":{"start":{"line":71,"column":8},"end":{"line":71,"column":64}},"4":{"start":{"line":73,"column":8},"end":{"line":73,"column":2150}},"5":{"start":{"line":78,"column":8},"end":{"line":78,"column":33}},"6":{"start":{"line":79,"column":8},"end":{"line":79,"column":49}},"7":{"start":{"line":80,"column":8},"end":{"line":80,"column":48}},"8":{"start":{"line":84,"column":8},"end":{"line":84,"column":2606}},"9":{"start":{"line":85,"column":12},"end":{"line":85,"column":57}},"10":{"start":{"line":86,"column":12},"end":{"line":86,"column":52}},"11":{"start":{"line":91,"column":8},"end":{"line":91,"column":2933}},"12":{"start":{"line":98,"column":8},"end":{"line":98,"column":38}},"13":{"start":{"line":117,"column":8},"end":{"line":117,"column":3513}},"14":{"start":{"line":134,"column":8},"end":{"line":134,"column":93}}},"branchMap":{"1":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":8},"end":{"line":59,"column":8}},{"start":{"line":59,"column":8},"end":{"line":59,"column":8}}]},"2":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":8},"end":{"line":73,"column":8}},{"start":{"line":73,"column":8},"end":{"line":73,"column":8}}]},"3":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":8},"end":{"line":84,"column":8}},{"start":{"line":84,"column":8},"end":{"line":84,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol":{"l":{"48":24,"72":0,"91":0,"107":2,"124":1,"139":1,"158":2,"165":2,"172":2,"178":2,"202":1,"207":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol","s":{"1":24,"2":0,"3":0,"4":2,"5":1,"6":1,"7":2,"8":2,"9":2,"10":2,"11":1,"12":1},"b":{},"f":{"1":24,"2":0,"3":0,"4":2,"5":1,"6":1,"7":2,"8":1},"fnMap":{"1":{"name":"constructor","line":46,"loc":{"start":{"line":42,"column":4},"end":{"line":49,"column":4}}},"2":{"name":"_handleFinalizeWithdrawal","line":65,"loc":{"start":{"line":65,"column":4},"end":{"line":73,"column":4}}},"3":{"name":"_handleInitiateDeposit","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":92,"column":4}}},"4":{"name":"getFinalizeDepositL2Gas","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":108,"column":4}}},"5":{"name":"deposit","line":118,"loc":{"start":{"line":118,"column":4},"end":{"line":125,"column":4}}},"6":{"name":"depositTo","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"7":{"name":"_initiateDeposit","line":150,"loc":{"start":{"line":150,"column":4},"end":{"line":179,"column":4}}},"8":{"name":"finalizeWithdrawal","line":199,"loc":{"start":{"line":193,"column":4},"end":{"line":208,"column":4}}}},"statementMap":{"1":{"start":{"line":48,"column":8},"end":{"line":48,"column":43}},"2":{"start":{"line":72,"column":8},"end":{"line":72,"column":48}},"3":{"start":{"line":91,"column":8},"end":{"line":91,"column":48}},"4":{"start":{"line":107,"column":8},"end":{"line":107,"column":46}},"5":{"start":{"line":124,"column":8},"end":{"line":124,"column":56}},"6":{"start":{"line":139,"column":8},"end":{"line":139,"column":49}},"7":{"start":{"line":158,"column":8},"end":{"line":158,"column":4675}},"8":{"start":{"line":165,"column":8},"end":{"line":165,"column":4857}},"9":{"start":{"line":172,"column":8},"end":{"line":172,"column":5050}},"10":{"start":{"line":178,"column":8},"end":{"line":178,"column":50}},"11":{"start":{"line":202,"column":8},"end":{"line":202,"column":5940}},"12":{"start":{"line":207,"column":8},"end":{"line":207,"column":46}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol":{"l":{"64":8,"66":8,"68":8,"76":5,"77":5,"102":0,"119":0,"136":9,"155":1,"171":1,"187":2,"190":2,"197":2,"203":2,"227":1,"228":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol","s":{"1":8,"2":8,"3":8,"4":5,"5":0,"6":0,"7":9,"8":1,"9":1,"10":2,"11":2,"12":2,"13":2,"14":1,"15":1},"b":{"1":[8,0],"2":[5,0]},"f":{"1":30,"2":8,"3":5,"4":0,"5":0,"6":9,"7":1,"8":1,"9":2,"10":1},"fnMap":{"1":{"name":"constructor","line":48,"loc":{"start":{"line":45,"column":4},"end":{"line":49,"column":5}}},"2":{"name":"init","line":59,"loc":{"start":{"line":59,"column":4},"end":{"line":69,"column":4}}},"3":{"name":"onlyInitialized","line":75,"loc":{"start":{"line":75,"column":4},"end":{"line":78,"column":4}}},"4":{"name":"_handleInitiateWithdrawal","line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":103,"column":4}}},"5":{"name":"_handleFinalizeDeposit","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":120,"column":4}}},"6":{"name":"getFinalizeWithdrawalL1Gas","line":128,"loc":{"start":{"line":128,"column":4},"end":{"line":137,"column":4}}},"7":{"name":"withdraw","line":153,"loc":{"start":{"line":148,"column":4},"end":{"line":156,"column":4}}},"8":{"name":"withdrawTo","line":169,"loc":{"start":{"line":163,"column":4},"end":{"line":172,"column":4}}},"9":{"name":"_initiateWithdrawal","line":180,"loc":{"start":{"line":180,"column":4},"end":{"line":204,"column":4}}},"10":{"name":"finalizeDeposit","line":225,"loc":{"start":{"line":218,"column":4},"end":{"line":229,"column":4}}}},"statementMap":{"1":{"start":{"line":64,"column":8},"end":{"line":64,"column":94}},"2":{"start":{"line":66,"column":8},"end":{"line":66,"column":39}},"3":{"start":{"line":68,"column":8},"end":{"line":68,"column":40}},"4":{"start":{"line":76,"column":8},"end":{"line":76,"column":94}},"5":{"start":{"line":102,"column":8},"end":{"line":102,"column":66}},"6":{"start":{"line":119,"column":8},"end":{"line":119,"column":66}},"7":{"start":{"line":136,"column":8},"end":{"line":136,"column":49}},"8":{"start":{"line":155,"column":8},"end":{"line":155,"column":47}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":40}},"10":{"start":{"line":187,"column":8},"end":{"line":187,"column":46}},"11":{"start":{"line":190,"column":8},"end":{"line":190,"column":5686}},"12":{"start":{"line":197,"column":8},"end":{"line":197,"column":5888}},"13":{"start":{"line":203,"column":8},"end":{"line":203,"column":58}},"14":{"start":{"line":227,"column":8},"end":{"line":227,"column":43}},"15":{"start":{"line":228,"column":8},"end":{"line":228,"column":43}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"2":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol":{"l":{"51":24,"76":2,"98":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol","s":{"1":24,"2":2,"3":1},"b":{},"f":{"1":24,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":49,"loc":{"start":{"line":41,"column":4},"end":{"line":52,"column":4}}},"2":{"name":"_handleInitiateDeposit","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":81,"column":4}}},"3":{"name":"_handleFinalizeWithdrawal","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":99,"column":4}}}},"statementMap":{"1":{"start":{"line":51,"column":8},"end":{"line":51,"column":25}},"2":{"start":{"line":76,"column":8},"end":{"line":76,"column":2273}},"3":{"start":{"line":98,"column":8},"end":{"line":98,"column":37}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol":{"l":{"50":24,"51":24,"62":0,"73":2,"87":1,"103":3,"111":3,"117":3,"140":1,"142":1,"161":1,"162":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol","s":{"1":24,"2":24,"3":2,"4":1,"5":3,"6":3,"7":3,"8":1,"9":1,"10":1,"11":1},"b":{"1":[1,0]},"f":{"1":24,"2":2,"3":1,"4":3,"5":1,"6":1},"fnMap":{"1":{"name":"constructor","line":48,"loc":{"start":{"line":43,"column":4},"end":{"line":52,"column":4}}},"2":{"name":"deposit","line":68,"loc":{"start":{"line":68,"column":4},"end":{"line":74,"column":4}}},"3":{"name":"depositTo","line":80,"loc":{"start":{"line":80,"column":4},"end":{"line":88,"column":4}}},"4":{"name":"_initiateDeposit","line":96,"loc":{"start":{"line":96,"column":4},"end":{"line":118,"column":4}}},"5":{"name":"finalizeWithdrawal","line":138,"loc":{"start":{"line":132,"column":4},"end":{"line":143,"column":4}}},"6":{"name":"_safeTransferETH","line":155,"loc":{"start":{"line":155,"column":4},"end":{"line":163,"column":4}}}},"statementMap":{"1":{"start":{"line":50,"column":8},"end":{"line":50,"column":23}},"2":{"start":{"line":51,"column":8},"end":{"line":51,"column":63}},"3":{"start":{"line":73,"column":8},"end":{"line":73,"column":47}},"4":{"start":{"line":87,"column":8},"end":{"line":87,"column":40}},"5":{"start":{"line":103,"column":8},"end":{"line":103,"column":2878}},"6":{"start":{"line":111,"column":8},"end":{"line":111,"column":3097}},"7":{"start":{"line":117,"column":8},"end":{"line":117,"column":52}},"8":{"start":{"line":140,"column":8},"end":{"line":140,"column":37}},"9":{"start":{"line":142,"column":8},"end":{"line":142,"column":46}},"10":{"start":{"line":161,"column":8},"end":{"line":161,"column":64}},"11":{"start":{"line":162,"column":8},"end":{"line":162,"column":79}}},"branchMap":{"1":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol":{"l":{"54":2,"65":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol","s":{"1":2,"2":1},"b":{},"f":{"1":30,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":43,"loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":5}}},"2":{"name":"_handleInitiateWithdrawal","line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":55,"column":4}}},"3":{"name":"_handleFinalizeDeposit","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":66,"column":4}}}},"statementMap":{"1":{"start":{"line":54,"column":8},"end":{"line":54,"column":33}},"2":{"start":{"line":65,"column":8},"end":{"line":65,"column":26}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol":{"l":{"73":222,"74":222,"75":222,"95":559,"112":382,"129":291,"130":291,"145":0,"160":100,"161":100,"176":0,"177":0,"192":0,"193":0,"211":47,"229":0,"245":0,"264":239,"269":238,"274":237,"282":236,"283":236,"287":236,"294":235,"295":235,"296":37600,"299":235,"308":235,"309":235,"314":235,"316":235,"317":235,"322":235,"323":235,"345":1,"397":104,"398":104,"399":104,"400":104,"406":104,"411":103,"416":102,"421":101,"426":100,"428":100,"436":100,"437":100,"442":100,"445":100,"448":100,"451":100,"455":100,"457":100,"458":100,"459":232,"461":232,"463":100,"467":226,"475":221,"478":221,"479":439,"480":439,"484":439,"491":439,"492":439,"493":439,"497":221,"498":179,"503":178,"504":178,"505":178,"509":88,"516":82,"521":81,"527":81,"528":81,"529":81,"530":81,"532":39,"533":39,"539":42,"544":42,"545":42,"551":81,"559":81,"587":2,"588":1,"595":1,"623":232,"624":232,"625":232,"626":232,"627":232,"629":232,"636":232,"659":476,"661":476,"662":476,"663":476,"664":476,"665":476,"673":476,"701":81,"702":81,"710":81,"727":179,"756":267,"757":267,"758":265,"760":265,"761":265,"762":265,"767":265,"790":100,"813":439,"814":419,"817":439,"818":439,"820":439,"821":439,"838":439,"855":1,"856":1,"858":1,"859":1,"860":1,"862":1,"863":1,"880":1,"900":81,"901":81,"903":81,"911":81,"919":81,"920":81,"927":81,"942":100,"943":4,"945":4,"950":2,"957":96,"962":95,"982":178,"988":177,"995":176,"1000":174,"1023":226,"1028":225,"1034":224,"1035":175,"1060":88,"1061":3,"1068":85,"1069":83,"1086":179,"1117":1,"1118":1,"1119":1,"1121":1,"1130":1,"1141":1,"1164":1,"1166":1,"1175":1,"1184":1,"1185":1,"1192":1,"1212":2,"1217":2,"1228":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol","s":{"1":222,"2":222,"3":222,"4":559,"5":382,"6":291,"7":291,"8":0,"9":100,"10":100,"11":0,"12":0,"13":0,"14":0,"15":47,"16":0,"17":0,"18":239,"19":238,"20":237,"21":236,"22":236,"23":236,"24":235,"25":235,"26":235,"27":235,"28":235,"29":235,"30":235,"31":235,"32":235,"33":1,"34":104,"35":104,"36":104,"37":104,"38":103,"39":102,"40":101,"41":100,"42":100,"43":100,"44":100,"45":100,"46":100,"47":100,"48":100,"49":100,"50":100,"51":100,"52":232,"53":232,"54":100,"55":226,"56":221,"57":221,"58":439,"59":439,"60":439,"61":221,"62":179,"63":178,"64":88,"65":82,"66":81,"67":81,"68":81,"69":81,"70":81,"71":39,"72":39,"73":42,"74":42,"75":42,"76":81,"77":81,"78":2,"79":1,"80":1,"81":232,"82":232,"83":232,"84":232,"85":232,"86":232,"87":476,"88":476,"89":476,"90":476,"91":476,"92":476,"93":81,"94":81,"95":179,"96":267,"97":267,"98":265,"99":265,"100":265,"101":265,"102":100,"103":439,"104":419,"105":439,"106":439,"107":439,"108":439,"109":1,"110":1,"111":1,"112":1,"113":1,"114":1,"115":1,"116":81,"117":81,"118":81,"119":81,"120":81,"121":81,"122":81,"123":100,"124":4,"125":4,"126":2,"127":96,"128":95,"129":178,"130":177,"131":176,"132":174,"133":226,"134":225,"135":224,"136":175,"137":88,"138":3,"139":85,"140":83,"141":179,"142":1,"143":1,"144":1,"145":1,"146":1,"147":1,"148":1,"149":1,"150":1,"151":1,"152":1,"153":1,"154":2,"155":2,"156":2},"b":{"1":[238,1],"2":[237,1],"3":[236,1],"4":[235,1],"5":[103,1],"6":[102,1],"7":[101,1],"8":[100,1],"9":[100,0],"10":[100,132],"11":[178,1],"12":[81,1],"13":[81,0],"14":[39,42],"15":[1,1],"16":[419,20],"17":[4,96],"18":[2,2],"19":[0,2],"20":[95,1],"21":[94,1],"22":[176,1],"23":[174,2],"24":[172,2],"25":[225,1],"26":[224,1],"27":[175,49],"28":[3,85],"29":[83,2],"30":[82,1],"31":[1,0],"32":[1,0],"33":[1,0],"34":[1,0],"35":[2,0],"36":[2,0]},"f":{"1":222,"2":559,"3":382,"4":291,"5":0,"6":100,"7":0,"8":0,"9":47,"10":0,"11":0,"12":239,"13":1,"14":104,"15":2,"16":232,"17":476,"18":81,"19":179,"20":267,"21":100,"22":439,"23":1,"24":81,"25":100,"26":178,"27":226,"28":88,"29":179,"30":1,"31":1,"32":2},"fnMap":{"1":{"name":"constructor","line":71,"loc":{"start":{"line":65,"column":4},"end":{"line":76,"column":4}}},"2":{"name":"batches","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":98,"column":4}}},"3":{"name":"queue","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":115,"column":4}}},"4":{"name":"getTotalElements","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":131,"column":4}}},"5":{"name":"getTotalBatches","line":137,"loc":{"start":{"line":137,"column":4},"end":{"line":146,"column":4}}},"6":{"name":"getNextQueueIndex","line":152,"loc":{"start":{"line":152,"column":4},"end":{"line":162,"column":4}}},"7":{"name":"getLastTimestamp","line":168,"loc":{"start":{"line":168,"column":4},"end":{"line":178,"column":4}}},"8":{"name":"getLastBlockNumber","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":194,"column":4}}},"9":{"name":"getQueueElement","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":215,"column":4}}},"10":{"name":"getNumPendingQueueElements","line":221,"loc":{"start":{"line":221,"column":4},"end":{"line":230,"column":4}}},"11":{"name":"getQueueLength","line":237,"loc":{"start":{"line":237,"column":4},"end":{"line":248,"column":4}}},"12":{"name":"enqueue","line":256,"loc":{"start":{"line":256,"column":4},"end":{"line":331,"column":4}}},"13":{"name":"appendQueueBatch","line":337,"loc":{"start":{"line":337,"column":4},"end":{"line":383,"column":4}}},"14":{"name":"appendSequencerBatch","line":393,"loc":{"start":{"line":393,"column":4},"end":{"line":564,"column":4}}},"15":{"name":"verifyTransaction","line":574,"loc":{"start":{"line":574,"column":4},"end":{"line":602,"column":4}}},"16":{"name":"_getBatchContext","line":614,"loc":{"start":{"line":614,"column":4},"end":{"line":642,"column":4}}},"17":{"name":"_getBatchExtraData","line":649,"loc":{"start":{"line":649,"column":4},"end":{"line":679,"column":4}}},"18":{"name":"_makeBatchExtraData","line":689,"loc":{"start":{"line":689,"column":4},"end":{"line":711,"column":4}}},"19":{"name":"_getQueueLeafHash","line":718,"loc":{"start":{"line":718,"column":4},"end":{"line":736,"column":4}}},"20":{"name":"_getQueueElement","line":743,"loc":{"start":{"line":743,"column":4},"end":{"line":772,"column":4}}},"21":{"name":"_getQueueLength","line":778,"loc":{"start":{"line":778,"column":4},"end":{"line":791,"column":4}}},"22":{"name":"_getSequencerLeafHash","line":800,"loc":{"start":{"line":800,"column":4},"end":{"line":839,"column":4}}},"23":{"name":"_getSequencerLeafHash","line":846,"loc":{"start":{"line":846,"column":4},"end":{"line":881,"column":4}}},"24":{"name":"_appendBatch","line":891,"loc":{"start":{"line":891,"column":4},"end":{"line":928,"column":4}}},"25":{"name":"_validateFirstBatchContext","line":934,"loc":{"start":{"line":934,"column":4},"end":{"line":966,"column":4}}},"26":{"name":"_validateContextBeforeEnqueue","line":974,"loc":{"start":{"line":974,"column":4},"end":{"line":1004,"column":4}}},"27":{"name":"_validateNextBatchContext","line":1013,"loc":{"start":{"line":1013,"column":4},"end":{"line":1041,"column":4}}},"28":{"name":"_validateFinalBatchContext","line":1050,"loc":{"start":{"line":1050,"column":4},"end":{"line":1070,"column":4}}},"29":{"name":"_hashTransactionChainElement","line":1077,"loc":{"start":{"line":1077,"column":4},"end":{"line":1095,"column":4}}},"30":{"name":"_verifySequencerTransaction","line":1105,"loc":{"start":{"line":1105,"column":4},"end":{"line":1142,"column":4}}},"31":{"name":"_verifyQueueTransaction","line":1152,"loc":{"start":{"line":1152,"column":4},"end":{"line":1193,"column":4}}},"32":{"name":"_verifyElement","line":1201,"loc":{"start":{"line":1201,"column":4},"end":{"line":1229,"column":4}}}},"statementMap":{"1":{"start":{"line":73,"column":8},"end":{"line":73,"column":65}},"2":{"start":{"line":74,"column":8},"end":{"line":74,"column":63}},"3":{"start":{"line":75,"column":8},"end":{"line":75,"column":55}},"4":{"start":{"line":95,"column":8},"end":{"line":95,"column":3203}},"5":{"start":{"line":112,"column":8},"end":{"line":112,"column":3582}},"6":{"start":{"line":129,"column":8},"end":{"line":129,"column":56}},"7":{"start":{"line":130,"column":8},"end":{"line":130,"column":37}},"8":{"start":{"line":145,"column":8},"end":{"line":145,"column":33}},"9":{"start":{"line":160,"column":8},"end":{"line":160,"column":57}},"10":{"start":{"line":161,"column":8},"end":{"line":161,"column":29}},"11":{"start":{"line":176,"column":8},"end":{"line":176,"column":56}},"12":{"start":{"line":177,"column":8},"end":{"line":177,"column":28}},"13":{"start":{"line":192,"column":8},"end":{"line":192,"column":58}},"14":{"start":{"line":193,"column":8},"end":{"line":193,"column":30}},"15":{"start":{"line":211,"column":8},"end":{"line":211,"column":5827}},"16":{"start":{"line":229,"column":8},"end":{"line":229,"column":53}},"17":{"start":{"line":245,"column":8},"end":{"line":245,"column":6538}},"18":{"start":{"line":264,"column":8},"end":{"line":264,"column":6982}},"19":{"start":{"line":269,"column":8},"end":{"line":269,"column":7135}},"20":{"start":{"line":274,"column":8},"end":{"line":274,"column":7289}},"21":{"start":{"line":282,"column":8},"end":{"line":282,"column":64}},"22":{"start":{"line":283,"column":8},"end":{"line":283,"column":39}},"23":{"start":{"line":287,"column":8},"end":{"line":287,"column":7932}},"24":{"start":{"line":294,"column":8},"end":{"line":294,"column":17}},"25":{"start":{"line":295,"column":8},"end":{"line":295,"column":8239}},"26":{"start":{"line":299,"column":8},"end":{"line":299,"column":8324}},"27":{"start":{"line":308,"column":8},"end":{"line":308,"column":39}},"28":{"start":{"line":314,"column":8},"end":{"line":314,"column":53}},"29":{"start":{"line":316,"column":8},"end":{"line":316,"column":37}},"30":{"start":{"line":317,"column":8},"end":{"line":317,"column":45}},"31":{"start":{"line":322,"column":8},"end":{"line":322,"column":54}},"32":{"start":{"line":323,"column":8},"end":{"line":323,"column":9103}},"33":{"start":{"line":345,"column":8},"end":{"line":345,"column":56}},"34":{"start":{"line":397,"column":8},"end":{"line":397,"column":35}},"35":{"start":{"line":398,"column":8},"end":{"line":398,"column":36}},"36":{"start":{"line":399,"column":8},"end":{"line":399,"column":26}},"37":{"start":{"line":406,"column":8},"end":{"line":406,"column":12031}},"38":{"start":{"line":411,"column":8},"end":{"line":411,"column":12192}},"39":{"start":{"line":416,"column":8},"end":{"line":416,"column":12333}},"40":{"start":{"line":421,"column":8},"end":{"line":421,"column":12446}},"41":{"start":{"line":426,"column":8},"end":{"line":426,"column":102}},"42":{"start":{"line":428,"column":8},"end":{"line":428,"column":12667}},"43":{"start":{"line":436,"column":8},"end":{"line":436,"column":53}},"44":{"start":{"line":437,"column":8},"end":{"line":437,"column":54}},"45":{"start":{"line":442,"column":8},"end":{"line":442,"column":90}},"46":{"start":{"line":445,"column":8},"end":{"line":445,"column":70}},"47":{"start":{"line":448,"column":8},"end":{"line":448,"column":28}},"48":{"start":{"line":451,"column":8},"end":{"line":451,"column":43}},"49":{"start":{"line":455,"column":8},"end":{"line":455,"column":51}},"50":{"start":{"line":457,"column":8},"end":{"line":457,"column":38}},"51":{"start":{"line":458,"column":8},"end":{"line":458,"column":14097}},"52":{"start":{"line":459,"column":12},"end":{"line":459,"column":65}},"53":{"start":{"line":461,"column":12},"end":{"line":461,"column":14224}},"54":{"start":{"line":463,"column":16},"end":{"line":463,"column":54}},"55":{"start":{"line":467,"column":12},"end":{"line":467,"column":14468}},"56":{"start":{"line":475,"column":12},"end":{"line":475,"column":35}},"57":{"start":{"line":478,"column":12},"end":{"line":478,"column":14783}},"58":{"start":{"line":479,"column":16},"end":{"line":479,"column":36}},"59":{"start":{"line":484,"column":16},"end":{"line":484,"column":15033}},"60":{"start":{"line":491,"column":16},"end":{"line":491,"column":79}},"61":{"start":{"line":497,"column":12},"end":{"line":497,"column":15473}},"62":{"start":{"line":498,"column":16},"end":{"line":498,"column":15566}},"63":{"start":{"line":503,"column":16},"end":{"line":503,"column":68}},"64":{"start":{"line":509,"column":8},"end":{"line":509,"column":15868}},"65":{"start":{"line":516,"column":8},"end":{"line":516,"column":16014}},"66":{"start":{"line":521,"column":8},"end":{"line":521,"column":16155}},"67":{"start":{"line":527,"column":8},"end":{"line":527,"column":87}},"68":{"start":{"line":528,"column":8},"end":{"line":528,"column":29}},"69":{"start":{"line":529,"column":8},"end":{"line":529,"column":26}},"70":{"start":{"line":530,"column":8},"end":{"line":530,"column":16545}},"71":{"start":{"line":532,"column":12},"end":{"line":532,"column":56}},"72":{"start":{"line":533,"column":12},"end":{"line":533,"column":55}},"73":{"start":{"line":539,"column":12},"end":{"line":539,"column":17265}},"74":{"start":{"line":544,"column":12},"end":{"line":544,"column":49}},"75":{"start":{"line":545,"column":12},"end":{"line":545,"column":48}},"76":{"start":{"line":551,"column":8},"end":{"line":551,"column":17737}},"77":{"start":{"line":559,"column":8},"end":{"line":559,"column":17944}},"78":{"start":{"line":587,"column":8},"end":{"line":587,"column":18958}},"79":{"start":{"line":588,"column":12},"end":{"line":588,"column":19018}},"80":{"start":{"line":595,"column":12},"end":{"line":595,"column":19223}},"81":{"start":{"line":623,"column":8},"end":{"line":623,"column":61}},"82":{"start":{"line":624,"column":8},"end":{"line":624,"column":40}},"83":{"start":{"line":625,"column":8},"end":{"line":625,"column":46}},"84":{"start":{"line":626,"column":8},"end":{"line":626,"column":28}},"85":{"start":{"line":627,"column":8},"end":{"line":627,"column":30}},"86":{"start":{"line":636,"column":8},"end":{"line":636,"column":20452}},"87":{"start":{"line":659,"column":8},"end":{"line":659,"column":57}},"88":{"start":{"line":661,"column":8},"end":{"line":661,"column":28}},"89":{"start":{"line":662,"column":8},"end":{"line":662,"column":29}},"90":{"start":{"line":663,"column":8},"end":{"line":663,"column":28}},"91":{"start":{"line":664,"column":8},"end":{"line":664,"column":30}},"92":{"start":{"line":673,"column":8},"end":{"line":673,"column":21814}},"93":{"start":{"line":701,"column":8},"end":{"line":701,"column":25}},"94":{"start":{"line":710,"column":8},"end":{"line":710,"column":24}},"95":{"start":{"line":727,"column":8},"end":{"line":727,"column":23233}},"96":{"start":{"line":756,"column":8},"end":{"line":756,"column":45}},"97":{"start":{"line":757,"column":8},"end":{"line":757,"column":58}},"98":{"start":{"line":758,"column":8},"end":{"line":758,"column":70}},"99":{"start":{"line":760,"column":8},"end":{"line":760,"column":31}},"100":{"start":{"line":761,"column":8},"end":{"line":761,"column":33}},"101":{"start":{"line":767,"column":8},"end":{"line":767,"column":24663}},"102":{"start":{"line":790,"column":8},"end":{"line":790,"column":45}},"103":{"start":{"line":813,"column":8},"end":{"line":813,"column":25984}},"104":{"start":{"line":814,"column":12},"end":{"line":814,"column":70}},"105":{"start":{"line":817,"column":8},"end":{"line":817,"column":49}},"106":{"start":{"line":818,"column":8},"end":{"line":818,"column":53}},"107":{"start":{"line":820,"column":8},"end":{"line":820,"column":24}},"108":{"start":{"line":838,"column":8},"end":{"line":838,"column":23}},"109":{"start":{"line":855,"column":8},"end":{"line":855,"column":52}},"110":{"start":{"line":856,"column":8},"end":{"line":856,"column":60}},"111":{"start":{"line":858,"column":8},"end":{"line":858,"column":80}},"112":{"start":{"line":859,"column":8},"end":{"line":859,"column":56}},"113":{"start":{"line":860,"column":8},"end":{"line":860,"column":60}},"114":{"start":{"line":862,"column":8},"end":{"line":862,"column":24}},"115":{"start":{"line":880,"column":8},"end":{"line":880,"column":23}},"116":{"start":{"line":900,"column":8},"end":{"line":900,"column":57}},"117":{"start":{"line":901,"column":8},"end":{"line":901,"column":78}},"118":{"start":{"line":903,"column":8},"end":{"line":903,"column":29394}},"119":{"start":{"line":911,"column":8},"end":{"line":911,"column":29688}},"120":{"start":{"line":919,"column":8},"end":{"line":919,"column":70}},"121":{"start":{"line":920,"column":8},"end":{"line":920,"column":29969}},"122":{"start":{"line":927,"column":8},"end":{"line":927,"column":59}},"123":{"start":{"line":942,"column":8},"end":{"line":942,"column":30681}},"124":{"start":{"line":943,"column":12},"end":{"line":943,"column":84}},"125":{"start":{"line":945,"column":12},"end":{"line":945,"column":30814}},"126":{"start":{"line":950,"column":12},"end":{"line":950,"column":30982}},"127":{"start":{"line":957,"column":8},"end":{"line":957,"column":31241}},"128":{"start":{"line":962,"column":8},"end":{"line":962,"column":31409}},"129":{"start":{"line":982,"column":12},"end":{"line":982,"column":32133}},"130":{"start":{"line":988,"column":12},"end":{"line":988,"column":32405}},"131":{"start":{"line":995,"column":12},"end":{"line":995,"column":32840}},"132":{"start":{"line":1000,"column":12},"end":{"line":1000,"column":33029}},"133":{"start":{"line":1023,"column":8},"end":{"line":1023,"column":34010}},"134":{"start":{"line":1028,"column":8},"end":{"line":1028,"column":34169}},"135":{"start":{"line":1034,"column":8},"end":{"line":1034,"column":34414}},"136":{"start":{"line":1035,"column":12},"end":{"line":1035,"column":34485}},"137":{"start":{"line":1060,"column":8},"end":{"line":1060,"column":35385}},"138":{"start":{"line":1061,"column":12},"end":{"line":1061,"column":35496}},"139":{"start":{"line":1068,"column":8},"end":{"line":1068,"column":99}},"140":{"start":{"line":1069,"column":8},"end":{"line":1069,"column":101}},"141":{"start":{"line":1086,"column":8},"end":{"line":1086,"column":36314}},"142":{"start":{"line":1117,"column":8},"end":{"line":1117,"column":104}},"143":{"start":{"line":1118,"column":8},"end":{"line":1118,"column":74}},"144":{"start":{"line":1119,"column":8},"end":{"line":1119,"column":65}},"145":{"start":{"line":1121,"column":8},"end":{"line":1121,"column":37737}},"146":{"start":{"line":1130,"column":8},"end":{"line":1130,"column":37958}},"147":{"start":{"line":1141,"column":8},"end":{"line":1141,"column":19}},"148":{"start":{"line":1164,"column":8},"end":{"line":1164,"column":57}},"149":{"start":{"line":1166,"column":8},"end":{"line":1166,"column":39506}},"150":{"start":{"line":1175,"column":8},"end":{"line":1175,"column":39724}},"151":{"start":{"line":1184,"column":8},"end":{"line":1184,"column":74}},"152":{"start":{"line":1185,"column":8},"end":{"line":1185,"column":40049}},"153":{"start":{"line":1192,"column":8},"end":{"line":1192,"column":19}},"154":{"start":{"line":1212,"column":8},"end":{"line":1212,"column":40839}},"155":{"start":{"line":1217,"column":8},"end":{"line":1217,"column":41010}},"156":{"start":{"line":1228,"column":8},"end":{"line":1228,"column":19}}},"branchMap":{"1":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":8},"end":{"line":264,"column":8}},{"start":{"line":264,"column":8},"end":{"line":264,"column":8}}]},"2":{"line":269,"type":"if","locations":[{"start":{"line":269,"column":8},"end":{"line":269,"column":8}},{"start":{"line":269,"column":8},"end":{"line":269,"column":8}}]},"3":{"line":274,"type":"if","locations":[{"start":{"line":274,"column":8},"end":{"line":274,"column":8}},{"start":{"line":274,"column":8},"end":{"line":274,"column":8}}]},"4":{"line":287,"type":"if","locations":[{"start":{"line":287,"column":8},"end":{"line":287,"column":8}},{"start":{"line":287,"column":8},"end":{"line":287,"column":8}}]},"5":{"line":406,"type":"if","locations":[{"start":{"line":406,"column":8},"end":{"line":406,"column":8}},{"start":{"line":406,"column":8},"end":{"line":406,"column":8}}]},"6":{"line":411,"type":"if","locations":[{"start":{"line":411,"column":8},"end":{"line":411,"column":8}},{"start":{"line":411,"column":8},"end":{"line":411,"column":8}}]},"7":{"line":416,"type":"if","locations":[{"start":{"line":416,"column":8},"end":{"line":416,"column":8}},{"start":{"line":416,"column":8},"end":{"line":416,"column":8}}]},"8":{"line":421,"type":"if","locations":[{"start":{"line":421,"column":8},"end":{"line":421,"column":8}},{"start":{"line":421,"column":8},"end":{"line":421,"column":8}}]},"9":{"line":428,"type":"if","locations":[{"start":{"line":428,"column":8},"end":{"line":428,"column":8}},{"start":{"line":428,"column":8},"end":{"line":428,"column":8}}]},"10":{"line":461,"type":"if","locations":[{"start":{"line":461,"column":12},"end":{"line":461,"column":12}},{"start":{"line":461,"column":12},"end":{"line":461,"column":12}}]},"11":{"line":498,"type":"if","locations":[{"start":{"line":498,"column":16},"end":{"line":498,"column":16}},{"start":{"line":498,"column":16},"end":{"line":498,"column":16}}]},"12":{"line":516,"type":"if","locations":[{"start":{"line":516,"column":8},"end":{"line":516,"column":8}},{"start":{"line":516,"column":8},"end":{"line":516,"column":8}}]},"13":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":8},"end":{"line":521,"column":8}},{"start":{"line":521,"column":8},"end":{"line":521,"column":8}}]},"14":{"line":530,"type":"if","locations":[{"start":{"line":530,"column":8},"end":{"line":530,"column":8}},{"start":{"line":530,"column":8},"end":{"line":530,"column":8}}]},"15":{"line":587,"type":"if","locations":[{"start":{"line":587,"column":8},"end":{"line":587,"column":8}},{"start":{"line":587,"column":8},"end":{"line":587,"column":8}}]},"16":{"line":813,"type":"if","locations":[{"start":{"line":813,"column":8},"end":{"line":813,"column":8}},{"start":{"line":813,"column":8},"end":{"line":813,"column":8}}]},"17":{"line":942,"type":"if","locations":[{"start":{"line":942,"column":8},"end":{"line":942,"column":8}},{"start":{"line":942,"column":8},"end":{"line":942,"column":8}}]},"18":{"line":945,"type":"if","locations":[{"start":{"line":945,"column":12},"end":{"line":945,"column":12}},{"start":{"line":945,"column":12},"end":{"line":945,"column":12}}]},"19":{"line":950,"type":"if","locations":[{"start":{"line":950,"column":12},"end":{"line":950,"column":12}},{"start":{"line":950,"column":12},"end":{"line":950,"column":12}}]},"20":{"line":957,"type":"if","locations":[{"start":{"line":957,"column":8},"end":{"line":957,"column":8}},{"start":{"line":957,"column":8},"end":{"line":957,"column":8}}]},"21":{"line":962,"type":"if","locations":[{"start":{"line":962,"column":8},"end":{"line":962,"column":8}},{"start":{"line":962,"column":8},"end":{"line":962,"column":8}}]},"22":{"line":988,"type":"if","locations":[{"start":{"line":988,"column":12},"end":{"line":988,"column":12}},{"start":{"line":988,"column":12},"end":{"line":988,"column":12}}]},"23":{"line":995,"type":"if","locations":[{"start":{"line":995,"column":12},"end":{"line":995,"column":12}},{"start":{"line":995,"column":12},"end":{"line":995,"column":12}}]},"24":{"line":1000,"type":"if","locations":[{"start":{"line":1000,"column":12},"end":{"line":1000,"column":12}},{"start":{"line":1000,"column":12},"end":{"line":1000,"column":12}}]},"25":{"line":1023,"type":"if","locations":[{"start":{"line":1023,"column":8},"end":{"line":1023,"column":8}},{"start":{"line":1023,"column":8},"end":{"line":1023,"column":8}}]},"26":{"line":1028,"type":"if","locations":[{"start":{"line":1028,"column":8},"end":{"line":1028,"column":8}},{"start":{"line":1028,"column":8},"end":{"line":1028,"column":8}}]},"27":{"line":1034,"type":"if","locations":[{"start":{"line":1034,"column":8},"end":{"line":1034,"column":8}},{"start":{"line":1034,"column":8},"end":{"line":1034,"column":8}}]},"28":{"line":1060,"type":"if","locations":[{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}},{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}}]},"29":{"line":1068,"type":"if","locations":[{"start":{"line":1068,"column":8},"end":{"line":1068,"column":8}},{"start":{"line":1068,"column":8},"end":{"line":1068,"column":8}}]},"30":{"line":1069,"type":"if","locations":[{"start":{"line":1069,"column":8},"end":{"line":1069,"column":8}},{"start":{"line":1069,"column":8},"end":{"line":1069,"column":8}}]},"31":{"line":1121,"type":"if","locations":[{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}},{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}}]},"32":{"line":1130,"type":"if","locations":[{"start":{"line":1130,"column":8},"end":{"line":1130,"column":8}},{"start":{"line":1130,"column":8},"end":{"line":1130,"column":8}}]},"33":{"line":1166,"type":"if","locations":[{"start":{"line":1166,"column":8},"end":{"line":1166,"column":8}},{"start":{"line":1166,"column":8},"end":{"line":1166,"column":8}}]},"34":{"line":1185,"type":"if","locations":[{"start":{"line":1185,"column":8},"end":{"line":1185,"column":8}},{"start":{"line":1185,"column":8},"end":{"line":1185,"column":8}}]},"35":{"line":1212,"type":"if","locations":[{"start":{"line":1212,"column":8},"end":{"line":1212,"column":8}},{"start":{"line":1212,"column":8},"end":{"line":1212,"column":8}}]},"36":{"line":1217,"type":"if","locations":[{"start":{"line":1217,"column":8},"end":{"line":1217,"column":8}},{"start":{"line":1217,"column":8},"end":{"line":1217,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol":{"l":{"56":504,"65":573,"69":573,"87":0,"101":550,"115":441,"128":470,"142":102,"158":538,"171":0,"187":1,"203":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol","s":{"1":504,"2":573,"3":0,"4":550,"5":441,"6":470,"7":102,"8":538,"9":0,"10":1,"11":0},"b":{"1":[573,0]},"f":{"1":504,"2":573,"3":0,"4":550,"5":441,"6":470,"7":102,"8":538,"9":0,"10":1,"11":0},"fnMap":{"1":{"name":"constructor","line":54,"loc":{"start":{"line":50,"column":4},"end":{"line":57,"column":4}}},"2":{"name":"onlyOwner","line":64,"loc":{"start":{"line":64,"column":4},"end":{"line":70,"column":4}}},"3":{"name":"setGlobalMetadata","line":85,"loc":{"start":{"line":80,"column":4},"end":{"line":88,"column":4}}},"4":{"name":"getGlobalMetadata","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":102,"column":4}}},"5":{"name":"length","line":107,"loc":{"start":{"line":107,"column":4},"end":{"line":116,"column":4}}},"6":{"name":"push","line":126,"loc":{"start":{"line":121,"column":4},"end":{"line":129,"column":4}}},"7":{"name":"push","line":140,"loc":{"start":{"line":134,"column":4},"end":{"line":143,"column":4}}},"8":{"name":"get","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":159,"column":4}}},"9":{"name":"deleteElementsAfterInclusive","line":169,"loc":{"start":{"line":164,"column":4},"end":{"line":174,"column":4}}},"10":{"name":"deleteElementsAfterInclusive","line":185,"loc":{"start":{"line":179,"column":4},"end":{"line":191,"column":4}}},"11":{"name":"setNextOverwritableIndex","line":201,"loc":{"start":{"line":196,"column":4},"end":{"line":204,"column":4}}}},"statementMap":{"1":{"start":{"line":56,"column":8},"end":{"line":56,"column":21}},"2":{"start":{"line":65,"column":8},"end":{"line":65,"column":1959}},"3":{"start":{"line":87,"column":8},"end":{"line":87,"column":51}},"4":{"start":{"line":101,"column":8},"end":{"line":101,"column":36}},"5":{"start":{"line":115,"column":8},"end":{"line":115,"column":42}},"6":{"start":{"line":128,"column":8},"end":{"line":128,"column":27}},"7":{"start":{"line":142,"column":8},"end":{"line":142,"column":44}},"8":{"start":{"line":158,"column":8},"end":{"line":158,"column":41}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":3842}},"10":{"start":{"line":187,"column":8},"end":{"line":187,"column":4155}},"11":{"start":{"line":203,"column":8},"end":{"line":203,"column":44}}},"branchMap":{"1":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol":{"l":{"54":60,"55":60,"74":125,"90":52,"91":52,"105":24,"119":0,"120":0,"135":25,"141":24,"146":24,"151":23,"158":22,"173":4,"178":3,"183":1,"188":1,"206":0,"211":0,"222":0,"238":1,"243":1,"247":1,"268":74,"270":74,"271":74,"272":74,"278":74,"300":22,"301":22,"307":22,"321":22,"322":22,"324":22,"325":20,"331":2,"340":21,"348":21,"356":21,"374":1,"379":1,"384":1,"392":1,"412":4},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol","s":{"1":60,"2":60,"3":125,"4":52,"5":52,"6":24,"7":0,"8":0,"9":25,"10":24,"11":24,"12":23,"13":22,"14":4,"15":3,"16":1,"17":1,"18":0,"19":0,"20":0,"21":1,"22":1,"23":1,"24":74,"25":74,"26":74,"27":74,"28":22,"29":22,"30":22,"31":22,"32":22,"33":20,"34":2,"35":21,"36":21,"37":21,"38":1,"39":1,"40":1,"41":1,"42":4},"b":{"1":[24,1],"2":[24,0],"3":[23,1],"4":[22,1],"5":[3,1],"6":[1,2],"7":[1,0],"8":[0,0],"9":[0,0],"10":[1,0],"11":[20,2],"12":[1,1],"13":[1,0],"14":[1,0]},"f":{"1":60,"2":125,"3":52,"4":24,"5":0,"6":25,"7":4,"8":0,"9":1,"10":74,"11":22,"12":22,"13":1,"14":4},"fnMap":{"1":{"name":"constructor","line":52,"loc":{"start":{"line":47,"column":4},"end":{"line":56,"column":4}}},"2":{"name":"batches","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":77,"column":4}}},"3":{"name":"getTotalElements","line":82,"loc":{"start":{"line":82,"column":4},"end":{"line":92,"column":4}}},"4":{"name":"getTotalBatches","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":106,"column":4}}},"5":{"name":"getLastSequencerTimestamp","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":121,"column":4}}},"6":{"name":"appendStateBatch","line":126,"loc":{"start":{"line":126,"column":4},"end":{"line":162,"column":4}}},"7":{"name":"deleteStateBatch","line":167,"loc":{"start":{"line":167,"column":4},"end":{"line":189,"column":4}}},"8":{"name":"verifyStateCommitment","line":194,"loc":{"start":{"line":194,"column":4},"end":{"line":223,"column":4}}},"9":{"name":"insideFraudProofWindow","line":228,"loc":{"start":{"line":228,"column":4},"end":{"line":248,"column":4}}},"10":{"name":"_getBatchExtraData","line":260,"loc":{"start":{"line":260,"column":4},"end":{"line":282,"column":4}}},"11":{"name":"_makeBatchExtraData","line":290,"loc":{"start":{"line":290,"column":4},"end":{"line":308,"column":4}}},"12":{"name":"_appendBatch","line":315,"loc":{"start":{"line":315,"column":4},"end":{"line":363,"column":4}}},"13":{"name":"_deleteBatch","line":369,"loc":{"start":{"line":369,"column":4},"end":{"line":396,"column":4}}},"14":{"name":"_isValidBatchHeader","line":403,"loc":{"start":{"line":403,"column":4},"end":{"line":413,"column":4}}}},"statementMap":{"1":{"start":{"line":54,"column":8},"end":{"line":54,"column":45}},"2":{"start":{"line":55,"column":8},"end":{"line":55,"column":57}},"3":{"start":{"line":74,"column":8},"end":{"line":74,"column":2401}},"4":{"start":{"line":90,"column":8},"end":{"line":90,"column":55}},"5":{"start":{"line":91,"column":8},"end":{"line":91,"column":37}},"6":{"start":{"line":105,"column":8},"end":{"line":105,"column":33}},"7":{"start":{"line":119,"column":8},"end":{"line":119,"column":64}},"8":{"start":{"line":120,"column":8},"end":{"line":120,"column":46}},"9":{"start":{"line":135,"column":8},"end":{"line":135,"column":3782}},"10":{"start":{"line":141,"column":8},"end":{"line":141,"column":4012}},"11":{"start":{"line":146,"column":8},"end":{"line":146,"column":4190}},"12":{"start":{"line":151,"column":8},"end":{"line":151,"column":4300}},"13":{"start":{"line":158,"column":8},"end":{"line":158,"column":4670}},"14":{"start":{"line":173,"column":8},"end":{"line":173,"column":4976}},"15":{"start":{"line":178,"column":8},"end":{"line":178,"column":5135}},"16":{"start":{"line":183,"column":8},"end":{"line":183,"column":5247}},"17":{"start":{"line":188,"column":8},"end":{"line":188,"column":33}},"18":{"start":{"line":206,"column":8},"end":{"line":206,"column":5787}},"19":{"start":{"line":211,"column":8},"end":{"line":211,"column":5899}},"20":{"start":{"line":222,"column":8},"end":{"line":222,"column":19}},"21":{"start":{"line":238,"column":8},"end":{"line":238,"column":6480}},"22":{"start":{"line":243,"column":8},"end":{"line":243,"column":6601}},"23":{"start":{"line":247,"column":8},"end":{"line":247,"column":76}},"24":{"start":{"line":268,"column":8},"end":{"line":268,"column":57}},"25":{"start":{"line":270,"column":8},"end":{"line":270,"column":28}},"26":{"start":{"line":271,"column":8},"end":{"line":271,"column":37}},"27":{"start":{"line":278,"column":8},"end":{"line":278,"column":7685}},"28":{"start":{"line":300,"column":8},"end":{"line":300,"column":25}},"29":{"start":{"line":307,"column":8},"end":{"line":307,"column":24}},"30":{"start":{"line":321,"column":8},"end":{"line":321,"column":51}},"31":{"start":{"line":322,"column":8},"end":{"line":322,"column":84}},"32":{"start":{"line":324,"column":8},"end":{"line":324,"column":8914}},"33":{"start":{"line":325,"column":12},"end":{"line":325,"column":59}},"34":{"start":{"line":331,"column":12},"end":{"line":331,"column":9429}},"35":{"start":{"line":340,"column":8},"end":{"line":340,"column":9854}},"36":{"start":{"line":348,"column":8},"end":{"line":348,"column":10179}},"37":{"start":{"line":356,"column":8},"end":{"line":356,"column":10406}},"38":{"start":{"line":374,"column":8},"end":{"line":374,"column":10922}},"39":{"start":{"line":379,"column":8},"end":{"line":379,"column":11044}},"40":{"start":{"line":384,"column":8},"end":{"line":384,"column":11156}},"41":{"start":{"line":392,"column":8},"end":{"line":392,"column":11375}},"42":{"start":{"line":412,"column":8},"end":{"line":412,"column":99}}},"branchMap":{"1":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]},"2":{"line":141,"type":"if","locations":[{"start":{"line":141,"column":8},"end":{"line":141,"column":8}},{"start":{"line":141,"column":8},"end":{"line":141,"column":8}}]},"3":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"4":{"line":151,"type":"if","locations":[{"start":{"line":151,"column":8},"end":{"line":151,"column":8}},{"start":{"line":151,"column":8},"end":{"line":151,"column":8}}]},"5":{"line":173,"type":"if","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":8}},{"start":{"line":173,"column":8},"end":{"line":173,"column":8}}]},"6":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":8},"end":{"line":178,"column":8}},{"start":{"line":178,"column":8},"end":{"line":178,"column":8}}]},"7":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":8},"end":{"line":183,"column":8}},{"start":{"line":183,"column":8},"end":{"line":183,"column":8}}]},"8":{"line":206,"type":"if","locations":[{"start":{"line":206,"column":8},"end":{"line":206,"column":8}},{"start":{"line":206,"column":8},"end":{"line":206,"column":8}}]},"9":{"line":211,"type":"if","locations":[{"start":{"line":211,"column":8},"end":{"line":211,"column":8}},{"start":{"line":211,"column":8},"end":{"line":211,"column":8}}]},"10":{"line":243,"type":"if","locations":[{"start":{"line":243,"column":8},"end":{"line":243,"column":8}},{"start":{"line":243,"column":8},"end":{"line":243,"column":8}}]},"11":{"line":324,"type":"if","locations":[{"start":{"line":324,"column":8},"end":{"line":324,"column":8}},{"start":{"line":324,"column":8},"end":{"line":324,"column":8}}]},"12":{"line":331,"type":"if","locations":[{"start":{"line":331,"column":12},"end":{"line":331,"column":12}},{"start":{"line":331,"column":12},"end":{"line":331,"column":12}}]},"13":{"line":374,"type":"if","locations":[{"start":{"line":374,"column":8},"end":{"line":374,"column":8}},{"start":{"line":374,"column":8},"end":{"line":374,"column":8}}]},"14":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol":{"l":{"85":27,"86":27,"87":27,"88":27,"104":55,"105":55,"106":55,"109":55,"110":46,"122":201,"123":201,"124":192,"127":192,"128":165,"131":27,"139":42,"140":4,"142":38,"162":0,"165":0,"170":0,"178":0,"186":0,"187":0,"188":0,"196":0,"208":0,"211":0,"231":4,"246":150,"261":1,"276":1,"291":1,"306":1,"325":1,"340":1,"357":6,"384":28,"388":28,"391":27,"396":27,"423":1,"427":1,"430":0,"436":0,"458":3,"472":1,"501":1,"510":1,"511":0,"515":1,"516":0,"520":1,"523":1,"524":1,"528":1,"531":1,"534":1,"540":1,"570":154,"571":154,"572":154,"574":154,"604":8,"605":8,"606":8,"607":8,"609":8,"639":10,"641":10,"670":48,"672":48,"693":7,"695":7,"730":2,"732":2,"753":3,"772":2,"789":0,"807":29,"812":29,"814":29,"815":2,"841":27,"845":27,"846":27,"847":27,"851":27,"860":24,"889":172,"894":1,"898":171,"903":169,"938":196,"939":196,"945":196,"946":196,"947":196,"955":196,"961":196,"965":196,"969":196,"970":23,"980":23,"981":5,"987":18,"993":14,"998":18,"1002":10,"1004":8,"1012":18,"1016":191,"1018":191,"1047":27,"1050":0,"1060":27,"1061":0,"1071":27,"1074":27,"1076":27,"1079":10,"1080":10,"1081":10,"1082":10,"1090":10,"1095":17,"1096":17,"1097":1,"1108":16,"1115":16,"1135":0,"1136":0,"1152":28,"1153":28,"1167":29,"1168":29,"1184":57,"1185":57,"1201":369,"1202":367,"1217":28,"1218":28,"1236":17,"1237":17,"1259":55,"1260":55,"1281":7,"1282":0,"1285":7,"1286":7,"1300":535,"1301":0,"1305":535,"1306":2,"1311":533,"1317":533,"1318":144,"1336":53,"1340":53,"1346":53,"1347":47,"1348":47,"1372":62,"1373":0,"1379":62,"1380":0,"1385":62,"1391":62,"1392":46,"1410":7,"1414":7,"1420":7,"1423":7,"1425":7,"1426":7,"1452":20,"1455":0,"1459":20,"1460":7,"1469":13,"1498":23,"1499":3,"1508":20,"1523":19,"1528":19,"1542":13,"1567":196,"1581":244,"1582":0,"1585":244,"1602":0,"1608":0,"1613":0,"1620":0,"1646":0,"1647":0,"1651":0,"1652":0,"1656":0,"1687":0,"1688":0,"1689":0,"1691":0,"1694":0,"1718":0,"1735":0,"1759":392,"1760":202,"1764":392,"1765":308,"1769":392,"1770":16,"1783":0,"1784":0,"1785":0,"1786":0,"1787":0,"1788":0,"1790":0,"1799":27,"1800":27,"1801":27,"1802":27,"1803":27,"1804":27,"1806":27,"1808":27,"1809":27,"1810":27,"1812":27,"1837":0,"1839":0,"1840":0,"1841":0,"1843":0,"1845":0,"1846":0,"1847":0,"1848":0,"1849":0,"1853":0,"1856":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol","s":{"1":27,"2":27,"3":27,"4":27,"5":55,"6":55,"7":55,"8":46,"9":201,"10":192,"11":192,"12":165,"13":27,"14":42,"15":4,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":4,"27":150,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":6,"35":28,"36":28,"37":27,"38":27,"39":1,"40":1,"41":0,"42":0,"43":3,"44":1,"45":1,"46":1,"47":0,"48":1,"49":0,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":154,"58":154,"59":154,"60":154,"61":8,"62":8,"63":8,"64":8,"65":8,"66":10,"67":10,"68":48,"69":48,"70":7,"71":7,"72":2,"73":2,"74":3,"75":2,"76":0,"77":29,"78":29,"79":29,"80":2,"81":27,"82":27,"83":27,"84":27,"85":27,"86":24,"87":172,"88":1,"89":171,"90":169,"91":196,"92":196,"93":196,"94":196,"95":196,"96":196,"97":196,"98":196,"99":196,"100":23,"101":23,"102":5,"103":18,"104":14,"105":18,"106":10,"107":8,"108":18,"109":191,"110":191,"111":27,"112":0,"113":27,"114":0,"115":27,"116":27,"117":27,"118":10,"119":10,"120":10,"121":17,"122":17,"123":1,"124":16,"125":16,"126":0,"127":0,"128":28,"129":28,"130":29,"131":29,"132":57,"133":57,"134":369,"135":367,"136":28,"137":28,"138":17,"139":17,"140":55,"141":55,"142":7,"143":0,"144":7,"145":7,"146":535,"147":0,"148":535,"149":2,"150":533,"151":533,"152":144,"153":53,"154":53,"155":53,"156":47,"157":47,"158":62,"159":0,"160":62,"161":0,"162":62,"163":62,"164":46,"165":7,"166":7,"167":7,"168":7,"169":7,"170":7,"171":20,"172":0,"173":20,"174":7,"175":13,"176":23,"177":3,"178":20,"179":19,"180":13,"181":196,"182":244,"183":0,"184":244,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":392,"202":202,"203":392,"204":308,"205":392,"206":16,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":27,"215":27,"216":27,"217":27,"218":27,"219":27,"220":27,"221":27,"222":27,"223":27,"224":27,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0},"b":{"1":[46,9],"2":[165,27],"3":[4,38],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,1],"8":[0,1],"9":[2,27],"10":[1,171],"11":[23,173],"12":[5,18],"13":[14,4],"14":[10,8],"15":[0,27],"16":[0,27],"17":[10,17],"18":[1,16],"19":[0,7],"20":[0,535],"21":[2,533],"22":[144,389],"23":[47,6],"24":[0,62],"25":[0,62],"26":[46,16],"27":[7,0],"28":[0,20],"29":[7,13],"30":[3,20],"31":[0,244],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[202,190],"37":[308,84],"38":[16,376],"39":[0,0],"40":[0,0],"41":[0,0]},"f":{"1":27,"2":55,"3":201,"4":42,"5":0,"6":4,"7":150,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":6,"15":28,"16":1,"17":3,"18":1,"19":1,"20":154,"21":8,"22":10,"23":48,"24":7,"25":2,"26":3,"27":2,"28":0,"29":29,"30":27,"31":172,"32":196,"33":27,"34":0,"35":28,"36":29,"37":57,"38":369,"39":28,"40":17,"41":55,"42":7,"43":535,"44":53,"45":62,"46":7,"47":20,"48":23,"49":19,"50":13,"51":196,"52":244,"53":0,"54":0,"55":0,"56":0,"57":0,"58":392,"59":0,"60":27,"61":0},"fnMap":{"1":{"name":"constructor","line":83,"loc":{"start":{"line":78,"column":4},"end":{"line":89,"column":4}}},"2":{"name":"netGasCost","line":101,"loc":{"start":{"line":101,"column":4},"end":{"line":112,"column":4}}},"3":{"name":"fixedGasDiscount","line":119,"loc":{"start":{"line":119,"column":4},"end":{"line":133,"column":4}}},"4":{"name":"notStatic","line":138,"loc":{"start":{"line":138,"column":4},"end":{"line":143,"column":4}}},"5":{"name":"run","line":155,"loc":{"start":{"line":155,"column":4},"end":{"line":212,"column":4}}},"6":{"name":"ovmCALLER","line":223,"loc":{"start":{"line":223,"column":4},"end":{"line":232,"column":4}}},"7":{"name":"ovmADDRESS","line":238,"loc":{"start":{"line":238,"column":4},"end":{"line":247,"column":4}}},"8":{"name":"ovmTIMESTAMP","line":253,"loc":{"start":{"line":253,"column":4},"end":{"line":262,"column":4}}},"9":{"name":"ovmNUMBER","line":268,"loc":{"start":{"line":268,"column":4},"end":{"line":277,"column":4}}},"10":{"name":"ovmGASLIMIT","line":283,"loc":{"start":{"line":283,"column":4},"end":{"line":292,"column":4}}},"11":{"name":"ovmCHAINID","line":298,"loc":{"start":{"line":298,"column":4},"end":{"line":307,"column":4}}},"12":{"name":"ovmL1QUEUEORIGIN","line":317,"loc":{"start":{"line":317,"column":4},"end":{"line":326,"column":4}}},"13":{"name":"ovmL1TXORIGIN","line":332,"loc":{"start":{"line":332,"column":4},"end":{"line":341,"column":4}}},"14":{"name":"ovmREVERT","line":351,"loc":{"start":{"line":351,"column":4},"end":{"line":358,"column":4}}},"15":{"name":"ovmCREATE","line":377,"loc":{"start":{"line":371,"column":4},"end":{"line":400,"column":4}}},"16":{"name":"ovmCREATE2","line":416,"loc":{"start":{"line":409,"column":4},"end":{"line":440,"column":4}}},"17":{"name":"ovmGETNONCE","line":451,"loc":{"start":{"line":451,"column":4},"end":{"line":459,"column":4}}},"18":{"name":"ovmSETNONCE","line":470,"loc":{"start":{"line":465,"column":4},"end":{"line":473,"column":4}}},"19":{"name":"ovmCREATEEOA","line":494,"loc":{"start":{"line":486,"column":4},"end":{"line":541,"column":4}}},"20":{"name":"ovmCALL","line":563,"loc":{"start":{"line":556,"column":4},"end":{"line":580,"column":4}}},"21":{"name":"ovmSTATICCALL","line":597,"loc":{"start":{"line":590,"column":4},"end":{"line":615,"column":4}}},"22":{"name":"ovmDELEGATECALL","line":632,"loc":{"start":{"line":625,"column":4},"end":{"line":647,"column":4}}},"23":{"name":"ovmSLOAD","line":664,"loc":{"start":{"line":659,"column":4},"end":{"line":676,"column":4}}},"24":{"name":"ovmSSTORE","line":690,"loc":{"start":{"line":683,"column":4},"end":{"line":700,"column":4}}},"25":{"name":"ovmEXTCODECOPY","line":714,"loc":{"start":{"line":714,"column":4},"end":{"line":737,"column":4}}},"26":{"name":"ovmEXTCODESIZE","line":744,"loc":{"start":{"line":744,"column":4},"end":{"line":756,"column":4}}},"27":{"name":"ovmEXTCODEHASH","line":763,"loc":{"start":{"line":763,"column":4},"end":{"line":775,"column":4}}},"28":{"name":"getMaxTransactionGasLimit","line":781,"loc":{"start":{"line":781,"column":4},"end":{"line":790,"column":4}}},"29":{"name":"_checkDeployerAllowed","line":800,"loc":{"start":{"line":800,"column":4},"end":{"line":817,"column":4}}},"30":{"name":"_createContract","line":830,"loc":{"start":{"line":830,"column":4},"end":{"line":864,"column":4}}},"31":{"name":"_callContract","line":875,"loc":{"start":{"line":875,"column":4},"end":{"line":910,"column":4}}},"32":{"name":"_handleExternalMessage","line":924,"loc":{"start":{"line":924,"column":4},"end":{"line":1022,"column":4}}},"33":{"name":"_handleContractCreation","line":1035,"loc":{"start":{"line":1035,"column":4},"end":{"line":1116,"column":4}}},"34":{"name":"_hasAccount","line":1127,"loc":{"start":{"line":1127,"column":4},"end":{"line":1137,"column":4}}},"35":{"name":"_hasEmptyAccount","line":1144,"loc":{"start":{"line":1144,"column":4},"end":{"line":1154,"column":4}}},"36":{"name":"_setAccountNonce","line":1161,"loc":{"start":{"line":1161,"column":4},"end":{"line":1169,"column":4}}},"37":{"name":"_getAccountNonce","line":1176,"loc":{"start":{"line":1176,"column":4},"end":{"line":1186,"column":4}}},"38":{"name":"_getAccountEthAddress","line":1193,"loc":{"start":{"line":1193,"column":4},"end":{"line":1203,"column":4}}},"39":{"name":"_initPendingAccount","line":1209,"loc":{"start":{"line":1209,"column":4},"end":{"line":1219,"column":4}}},"40":{"name":"_commitPendingAccount","line":1229,"loc":{"start":{"line":1229,"column":4},"end":{"line":1242,"column":4}}},"41":{"name":"_getContractStorage","line":1250,"loc":{"start":{"line":1250,"column":4},"end":{"line":1261,"column":4}}},"42":{"name":"_putContractStorage","line":1269,"loc":{"start":{"line":1269,"column":4},"end":{"line":1287,"column":4}}},"43":{"name":"_checkAccountLoad","line":1294,"loc":{"start":{"line":1294,"column":4},"end":{"line":1322,"column":4}}},"44":{"name":"_checkAccountChange","line":1329,"loc":{"start":{"line":1329,"column":4},"end":{"line":1352,"column":4}}},"45":{"name":"_checkContractStorageLoad","line":1360,"loc":{"start":{"line":1360,"column":4},"end":{"line":1394,"column":4}}},"46":{"name":"_checkContractStorageChange","line":1402,"loc":{"start":{"line":1402,"column":4},"end":{"line":1428,"column":4}}},"47":{"name":"_encodeRevertData","line":1441,"loc":{"start":{"line":1441,"column":4},"end":{"line":1475,"column":4}}},"48":{"name":"_decodeRevertData","line":1485,"loc":{"start":{"line":1485,"column":4},"end":{"line":1509,"column":4}}},"49":{"name":"_revertWithFlag","line":1516,"loc":{"start":{"line":1516,"column":4},"end":{"line":1531,"column":4}}},"50":{"name":"_revertWithFlag","line":1537,"loc":{"start":{"line":1537,"column":4},"end":{"line":1543,"column":4}}},"51":{"name":"_getNuisanceGasLimit","line":1558,"loc":{"start":{"line":1558,"column":4},"end":{"line":1568,"column":4}}},"52":{"name":"_useNuisanceGas","line":1574,"loc":{"start":{"line":1574,"column":4},"end":{"line":1586,"column":4}}},"53":{"name":"_checkNeedsNewEpoch","line":1597,"loc":{"start":{"line":1597,"column":4},"end":{"line":1627,"column":4}}},"54":{"name":"_isValidGasLimit","line":1635,"loc":{"start":{"line":1635,"column":4},"end":{"line":1674,"column":4}}},"55":{"name":"_updateCumulativeGas","line":1681,"loc":{"start":{"line":1681,"column":4},"end":{"line":1703,"column":4}}},"56":{"name":"_getGasMetadata","line":1710,"loc":{"start":{"line":1710,"column":4},"end":{"line":1722,"column":4}}},"57":{"name":"_putGasMetadata","line":1729,"loc":{"start":{"line":1729,"column":4},"end":{"line":1740,"column":4}}},"58":{"name":"_switchMessageContext","line":1752,"loc":{"start":{"line":1752,"column":4},"end":{"line":1772,"column":4}}},"59":{"name":"_initContext","line":1778,"loc":{"start":{"line":1778,"column":4},"end":{"line":1791,"column":4}}},"60":{"name":"_resetContext","line":1796,"loc":{"start":{"line":1796,"column":4},"end":{"line":1813,"column":4}}},"61":{"name":"simulateMessage","line":1825,"loc":{"start":{"line":1825,"column":4},"end":{"line":1862,"column":4}}}},"statementMap":{"1":{"start":{"line":85,"column":8},"end":{"line":85,"column":74}},"2":{"start":{"line":86,"column":8},"end":{"line":86,"column":39}},"3":{"start":{"line":87,"column":8},"end":{"line":87,"column":37}},"4":{"start":{"line":88,"column":8},"end":{"line":88,"column":22}},"5":{"start":{"line":104,"column":8},"end":{"line":104,"column":39}},"6":{"start":{"line":106,"column":8},"end":{"line":106,"column":49}},"7":{"start":{"line":109,"column":8},"end":{"line":109,"column":3969}},"8":{"start":{"line":110,"column":12},"end":{"line":110,"column":60}},"9":{"start":{"line":122,"column":8},"end":{"line":122,"column":39}},"10":{"start":{"line":124,"column":8},"end":{"line":124,"column":49}},"11":{"start":{"line":127,"column":8},"end":{"line":127,"column":4602}},"12":{"start":{"line":128,"column":12},"end":{"line":128,"column":54}},"13":{"start":{"line":131,"column":12},"end":{"line":131,"column":52}},"14":{"start":{"line":139,"column":8},"end":{"line":139,"column":4939}},"15":{"start":{"line":140,"column":12},"end":{"line":140,"column":55}},"16":{"start":{"line":162,"column":8},"end":{"line":162,"column":99}},"17":{"start":{"line":165,"column":8},"end":{"line":165,"column":60}},"18":{"start":{"line":170,"column":8},"end":{"line":170,"column":6129}},"19":{"start":{"line":178,"column":8},"end":{"line":178,"column":33}},"20":{"start":{"line":186,"column":8},"end":{"line":186,"column":6951}},"21":{"start":{"line":187,"column":12},"end":{"line":187,"column":26}},"22":{"start":{"line":188,"column":12},"end":{"line":188,"column":18}},"23":{"start":{"line":196,"column":8},"end":{"line":196,"column":7365}},"24":{"start":{"line":208,"column":8},"end":{"line":208,"column":22}},"25":{"start":{"line":211,"column":8},"end":{"line":211,"column":54}},"26":{"start":{"line":231,"column":8},"end":{"line":231,"column":39}},"27":{"start":{"line":246,"column":8},"end":{"line":246,"column":40}},"28":{"start":{"line":261,"column":8},"end":{"line":261,"column":46}},"29":{"start":{"line":276,"column":8},"end":{"line":276,"column":43}},"30":{"start":{"line":291,"column":8},"end":{"line":291,"column":45}},"31":{"start":{"line":306,"column":8},"end":{"line":306,"column":39}},"32":{"start":{"line":325,"column":8},"end":{"line":325,"column":50}},"33":{"start":{"line":340,"column":8},"end":{"line":340,"column":47}},"34":{"start":{"line":357,"column":8},"end":{"line":357,"column":60}},"35":{"start":{"line":384,"column":8},"end":{"line":384,"column":38}},"36":{"start":{"line":388,"column":8},"end":{"line":388,"column":37}},"37":{"start":{"line":391,"column":8},"end":{"line":391,"column":12120}},"38":{"start":{"line":396,"column":8},"end":{"line":396,"column":12259}},"39":{"start":{"line":423,"column":8},"end":{"line":423,"column":38}},"40":{"start":{"line":427,"column":8},"end":{"line":427,"column":37}},"41":{"start":{"line":430,"column":8},"end":{"line":430,"column":13215}},"42":{"start":{"line":436,"column":8},"end":{"line":436,"column":13358}},"43":{"start":{"line":458,"column":8},"end":{"line":458,"column":45}},"44":{"start":{"line":472,"column":8},"end":{"line":472,"column":45}},"45":{"start":{"line":501,"column":8},"end":{"line":501,"column":15412}},"46":{"start":{"line":510,"column":8},"end":{"line":510,"column":15716}},"47":{"start":{"line":511,"column":12},"end":{"line":511,"column":87}},"48":{"start":{"line":515,"column":8},"end":{"line":515,"column":15949}},"49":{"start":{"line":516,"column":12},"end":{"line":516,"column":18}},"50":{"start":{"line":520,"column":8},"end":{"line":520,"column":31}},"51":{"start":{"line":523,"column":8},"end":{"line":523,"column":55}},"52":{"start":{"line":524,"column":8},"end":{"line":524,"column":38}},"53":{"start":{"line":528,"column":8},"end":{"line":528,"column":92}},"54":{"start":{"line":531,"column":8},"end":{"line":531,"column":46}},"55":{"start":{"line":534,"column":8},"end":{"line":534,"column":16780}},"56":{"start":{"line":540,"column":8},"end":{"line":540,"column":31}},"57":{"start":{"line":570,"column":8},"end":{"line":570,"column":65}},"58":{"start":{"line":571,"column":8},"end":{"line":571,"column":67}},"59":{"start":{"line":572,"column":8},"end":{"line":572,"column":47}},"60":{"start":{"line":574,"column":8},"end":{"line":574,"column":17970}},"61":{"start":{"line":604,"column":8},"end":{"line":604,"column":65}},"62":{"start":{"line":605,"column":8},"end":{"line":605,"column":67}},"63":{"start":{"line":606,"column":8},"end":{"line":606,"column":47}},"64":{"start":{"line":607,"column":8},"end":{"line":607,"column":41}},"65":{"start":{"line":609,"column":8},"end":{"line":609,"column":19091}},"66":{"start":{"line":639,"column":8},"end":{"line":639,"column":65}},"67":{"start":{"line":641,"column":8},"end":{"line":641,"column":20043}},"68":{"start":{"line":670,"column":8},"end":{"line":670,"column":46}},"69":{"start":{"line":672,"column":8},"end":{"line":672,"column":20768}},"70":{"start":{"line":693,"column":8},"end":{"line":693,"column":46}},"71":{"start":{"line":695,"column":8},"end":{"line":695,"column":21293}},"72":{"start":{"line":730,"column":8},"end":{"line":730,"column":51}},"73":{"start":{"line":732,"column":8},"end":{"line":732,"column":22625}},"74":{"start":{"line":753,"column":8},"end":{"line":753,"column":23119}},"75":{"start":{"line":772,"column":8},"end":{"line":772,"column":23567}},"76":{"start":{"line":789,"column":8},"end":{"line":789,"column":52}},"77":{"start":{"line":807,"column":8},"end":{"line":807,"column":24656}},"78":{"start":{"line":812,"column":8},"end":{"line":812,"column":49}},"79":{"start":{"line":814,"column":8},"end":{"line":814,"column":24934}},"80":{"start":{"line":815,"column":12},"end":{"line":815,"column":58}},"81":{"start":{"line":841,"column":8},"end":{"line":841,"column":73}},"82":{"start":{"line":845,"column":8},"end":{"line":845,"column":65}},"83":{"start":{"line":846,"column":8},"end":{"line":846,"column":63}},"84":{"start":{"line":847,"column":8},"end":{"line":847,"column":55}},"85":{"start":{"line":851,"column":8},"end":{"line":851,"column":26479}},"86":{"start":{"line":860,"column":8},"end":{"line":860,"column":26781}},"87":{"start":{"line":889,"column":8},"end":{"line":889,"column":27852}},"88":{"start":{"line":894,"column":12},"end":{"line":894,"column":32}},"89":{"start":{"line":898,"column":8},"end":{"line":898,"column":28436}},"90":{"start":{"line":903,"column":8},"end":{"line":903,"column":28544}},"91":{"start":{"line":938,"column":8},"end":{"line":938,"column":65}},"92":{"start":{"line":939,"column":8},"end":{"line":939,"column":69}},"93":{"start":{"line":945,"column":8},"end":{"line":945,"column":67}},"94":{"start":{"line":946,"column":8},"end":{"line":946,"column":66}},"95":{"start":{"line":947,"column":8},"end":{"line":947,"column":55}},"96":{"start":{"line":955,"column":8},"end":{"line":955,"column":30971}},"97":{"start":{"line":961,"column":8},"end":{"line":961,"column":69}},"98":{"start":{"line":965,"column":8},"end":{"line":965,"column":63}},"99":{"start":{"line":969,"column":8},"end":{"line":969,"column":31643}},"100":{"start":{"line":970,"column":12},"end":{"line":970,"column":31716}},"101":{"start":{"line":980,"column":12},"end":{"line":980,"column":32198}},"102":{"start":{"line":981,"column":16},"end":{"line":981,"column":36}},"103":{"start":{"line":987,"column":12},"end":{"line":987,"column":32623}},"104":{"start":{"line":993,"column":16},"end":{"line":993,"column":60}},"105":{"start":{"line":998,"column":12},"end":{"line":998,"column":33142}},"106":{"start":{"line":1002,"column":16},"end":{"line":1002,"column":46}},"107":{"start":{"line":1004,"column":16},"end":{"line":1004,"column":33}},"108":{"start":{"line":1012,"column":12},"end":{"line":1012,"column":54}},"109":{"start":{"line":1016,"column":8},"end":{"line":1016,"column":97}},"110":{"start":{"line":1018,"column":8},"end":{"line":1018,"column":34093}},"111":{"start":{"line":1047,"column":8},"end":{"line":1047,"column":35080}},"112":{"start":{"line":1050,"column":12},"end":{"line":1050,"column":35291}},"113":{"start":{"line":1060,"column":8},"end":{"line":1060,"column":35634}},"114":{"start":{"line":1061,"column":12},"end":{"line":1061,"column":35714}},"115":{"start":{"line":1071,"column":8},"end":{"line":1071,"column":36}},"116":{"start":{"line":1074,"column":8},"end":{"line":1074,"column":71}},"117":{"start":{"line":1076,"column":8},"end":{"line":1076,"column":36312}},"118":{"start":{"line":1079,"column":12},"end":{"line":1079,"column":34}},"119":{"start":{"line":1081,"column":12},"end":{"line":1081,"column":63}},"120":{"start":{"line":1090,"column":12},"end":{"line":1090,"column":38}},"121":{"start":{"line":1095,"column":8},"end":{"line":1095,"column":68}},"122":{"start":{"line":1096,"column":8},"end":{"line":1096,"column":37248}},"123":{"start":{"line":1097,"column":12},"end":{"line":1097,"column":37327}},"124":{"start":{"line":1108,"column":8},"end":{"line":1108,"column":37793}},"125":{"start":{"line":1115,"column":8},"end":{"line":1115,"column":28}},"126":{"start":{"line":1135,"column":8},"end":{"line":1135,"column":34}},"127":{"start":{"line":1136,"column":8},"end":{"line":1136,"column":51}},"128":{"start":{"line":1152,"column":8},"end":{"line":1152,"column":34}},"129":{"start":{"line":1153,"column":8},"end":{"line":1153,"column":56}},"130":{"start":{"line":1167,"column":8},"end":{"line":1167,"column":36}},"131":{"start":{"line":1168,"column":8},"end":{"line":1168,"column":56}},"132":{"start":{"line":1184,"column":8},"end":{"line":1184,"column":34}},"133":{"start":{"line":1185,"column":8},"end":{"line":1185,"column":56}},"134":{"start":{"line":1201,"column":8},"end":{"line":1201,"column":34}},"135":{"start":{"line":1202,"column":8},"end":{"line":1202,"column":61}},"136":{"start":{"line":1217,"column":8},"end":{"line":1217,"column":34}},"137":{"start":{"line":1218,"column":8},"end":{"line":1218,"column":51}},"138":{"start":{"line":1236,"column":8},"end":{"line":1236,"column":36}},"139":{"start":{"line":1237,"column":8},"end":{"line":1237,"column":41463}},"140":{"start":{"line":1259,"column":8},"end":{"line":1259,"column":49}},"141":{"start":{"line":1260,"column":8},"end":{"line":1260,"column":66}},"142":{"start":{"line":1281,"column":8},"end":{"line":1281,"column":42888}},"143":{"start":{"line":1282,"column":12},"end":{"line":1282,"column":18}},"144":{"start":{"line":1285,"column":8},"end":{"line":1285,"column":51}},"145":{"start":{"line":1286,"column":8},"end":{"line":1286,"column":66}},"146":{"start":{"line":1300,"column":8},"end":{"line":1300,"column":43493}},"147":{"start":{"line":1301,"column":12},"end":{"line":1301,"column":49}},"148":{"start":{"line":1305,"column":8},"end":{"line":1305,"column":43681}},"149":{"start":{"line":1306,"column":12},"end":{"line":1306,"column":59}},"150":{"start":{"line":1311,"column":8},"end":{"line":1311,"column":44063}},"151":{"start":{"line":1317,"column":8},"end":{"line":1317,"column":44270}},"152":{"start":{"line":1318,"column":12},"end":{"line":1318,"column":44327}},"153":{"start":{"line":1336,"column":8},"end":{"line":1336,"column":34}},"154":{"start":{"line":1340,"column":8},"end":{"line":1340,"column":45260}},"155":{"start":{"line":1346,"column":8},"end":{"line":1346,"column":45468}},"156":{"start":{"line":1347,"column":12},"end":{"line":1347,"column":62}},"157":{"start":{"line":1348,"column":12},"end":{"line":1348,"column":45591}},"158":{"start":{"line":1372,"column":8},"end":{"line":1372,"column":46695}},"159":{"start":{"line":1373,"column":12},"end":{"line":1373,"column":49}},"160":{"start":{"line":1379,"column":8},"end":{"line":1379,"column":47096}},"161":{"start":{"line":1380,"column":12},"end":{"line":1380,"column":59}},"162":{"start":{"line":1385,"column":8},"end":{"line":1385,"column":47501}},"163":{"start":{"line":1391,"column":8},"end":{"line":1391,"column":47698}},"164":{"start":{"line":1392,"column":12},"end":{"line":1392,"column":46}},"165":{"start":{"line":1410,"column":8},"end":{"line":1410,"column":49}},"166":{"start":{"line":1414,"column":8},"end":{"line":1414,"column":48692}},"167":{"start":{"line":1420,"column":8},"end":{"line":1420,"column":48891}},"168":{"start":{"line":1423,"column":12},"end":{"line":1423,"column":41}},"169":{"start":{"line":1425,"column":12},"end":{"line":1425,"column":69}},"170":{"start":{"line":1426,"column":12},"end":{"line":1426,"column":47}},"171":{"start":{"line":1452,"column":8},"end":{"line":1452,"column":49929}},"172":{"start":{"line":1455,"column":12},"end":{"line":1455,"column":28}},"173":{"start":{"line":1459,"column":8},"end":{"line":1459,"column":50123}},"174":{"start":{"line":1460,"column":12},"end":{"line":1460,"column":50188}},"175":{"start":{"line":1469,"column":8},"end":{"line":1469,"column":50379}},"176":{"start":{"line":1498,"column":8},"end":{"line":1498,"column":51255}},"177":{"start":{"line":1499,"column":12},"end":{"line":1499,"column":51303}},"178":{"start":{"line":1508,"column":8},"end":{"line":1508,"column":77}},"179":{"start":{"line":1523,"column":8},"end":{"line":1523,"column":51849}},"180":{"start":{"line":1542,"column":8},"end":{"line":1542,"column":40}},"181":{"start":{"line":1567,"column":8},"end":{"line":1567,"column":60}},"182":{"start":{"line":1581,"column":8},"end":{"line":1581,"column":53501}},"183":{"start":{"line":1582,"column":12},"end":{"line":1582,"column":59}},"184":{"start":{"line":1585,"column":8},"end":{"line":1585,"column":47}},"185":{"start":{"line":1602,"column":8},"end":{"line":1602,"column":54058}},"186":{"start":{"line":1608,"column":12},"end":{"line":1608,"column":54260}},"187":{"start":{"line":1613,"column":12},"end":{"line":1613,"column":54394}},"188":{"start":{"line":1620,"column":12},"end":{"line":1620,"column":54619}},"189":{"start":{"line":1646,"column":8},"end":{"line":1646,"column":55372}},"190":{"start":{"line":1647,"column":12},"end":{"line":1647,"column":24}},"191":{"start":{"line":1651,"column":8},"end":{"line":1651,"column":55532}},"192":{"start":{"line":1652,"column":12},"end":{"line":1652,"column":24}},"193":{"start":{"line":1656,"column":8},"end":{"line":1656,"column":19}},"194":{"start":{"line":1687,"column":8},"end":{"line":1687,"column":39}},"195":{"start":{"line":1688,"column":8},"end":{"line":1688,"column":56851}},"196":{"start":{"line":1689,"column":12},"end":{"line":1689,"column":75}},"197":{"start":{"line":1691,"column":12},"end":{"line":1691,"column":72}},"198":{"start":{"line":1694,"column":8},"end":{"line":1694,"column":57104}},"199":{"start":{"line":1718,"column":8},"end":{"line":1718,"column":57699}},"200":{"start":{"line":1735,"column":8},"end":{"line":1735,"column":58099}},"201":{"start":{"line":1759,"column":8},"end":{"line":1759,"column":58790}},"202":{"start":{"line":1760,"column":12},"end":{"line":1760,"column":67}},"203":{"start":{"line":1764,"column":8},"end":{"line":1764,"column":58990}},"204":{"start":{"line":1765,"column":12},"end":{"line":1765,"column":69}},"205":{"start":{"line":1769,"column":8},"end":{"line":1769,"column":59194}},"206":{"start":{"line":1770,"column":12},"end":{"line":1770,"column":65}},"207":{"start":{"line":1783,"column":8},"end":{"line":1783,"column":63}},"208":{"start":{"line":1784,"column":8},"end":{"line":1784,"column":62}},"209":{"start":{"line":1785,"column":8},"end":{"line":1785,"column":63}},"210":{"start":{"line":1786,"column":8},"end":{"line":1786,"column":71}},"211":{"start":{"line":1787,"column":8},"end":{"line":1787,"column":65}},"212":{"start":{"line":1788,"column":8},"end":{"line":1788,"column":77}},"213":{"start":{"line":1790,"column":8},"end":{"line":1790,"column":82}},"214":{"start":{"line":1799,"column":8},"end":{"line":1799,"column":52}},"215":{"start":{"line":1800,"column":8},"end":{"line":1800,"column":42}},"216":{"start":{"line":1801,"column":8},"end":{"line":1801,"column":39}},"217":{"start":{"line":1802,"column":8},"end":{"line":1802,"column":41}},"218":{"start":{"line":1803,"column":8},"end":{"line":1803,"column":43}},"219":{"start":{"line":1804,"column":8},"end":{"line":1804,"column":85}},"220":{"start":{"line":1806,"column":8},"end":{"line":1806,"column":41}},"221":{"start":{"line":1808,"column":8},"end":{"line":1808,"column":44}},"222":{"start":{"line":1809,"column":8},"end":{"line":1809,"column":45}},"223":{"start":{"line":1810,"column":8},"end":{"line":1810,"column":38}},"224":{"start":{"line":1812,"column":8},"end":{"line":1812,"column":40}},"225":{"start":{"line":1837,"column":8},"end":{"line":1837,"column":40}},"226":{"start":{"line":1839,"column":8},"end":{"line":1839,"column":41}},"227":{"start":{"line":1840,"column":8},"end":{"line":1840,"column":33}},"228":{"start":{"line":1841,"column":8},"end":{"line":1841,"column":47}},"229":{"start":{"line":1843,"column":8},"end":{"line":1843,"column":40}},"230":{"start":{"line":1845,"column":8},"end":{"line":1845,"column":61}},"231":{"start":{"line":1846,"column":8},"end":{"line":1846,"column":61862}},"232":{"start":{"line":1847,"column":12},"end":{"line":1847,"column":85}},"233":{"start":{"line":1848,"column":12},"end":{"line":1848,"column":61981}},"234":{"start":{"line":1849,"column":16},"end":{"line":1849,"column":42}},"235":{"start":{"line":1853,"column":16},"end":{"line":1853,"column":60}},"236":{"start":{"line":1856,"column":12},"end":{"line":1856,"column":62361}}},"branchMap":{"1":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":8},"end":{"line":109,"column":8}},{"start":{"line":109,"column":8},"end":{"line":109,"column":8}}]},"2":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":8},"end":{"line":127,"column":8}},{"start":{"line":127,"column":8},"end":{"line":127,"column":8}}]},"3":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"4":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]},"5":{"line":170,"type":"if","locations":[{"start":{"line":170,"column":8},"end":{"line":170,"column":8}},{"start":{"line":170,"column":8},"end":{"line":170,"column":8}}]},"6":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"7":{"line":510,"type":"if","locations":[{"start":{"line":510,"column":8},"end":{"line":510,"column":8}},{"start":{"line":510,"column":8},"end":{"line":510,"column":8}}]},"8":{"line":515,"type":"if","locations":[{"start":{"line":515,"column":8},"end":{"line":515,"column":8}},{"start":{"line":515,"column":8},"end":{"line":515,"column":8}}]},"9":{"line":814,"type":"if","locations":[{"start":{"line":814,"column":8},"end":{"line":814,"column":8}},{"start":{"line":814,"column":8},"end":{"line":814,"column":8}}]},"10":{"line":889,"type":"if","locations":[{"start":{"line":889,"column":8},"end":{"line":889,"column":8}},{"start":{"line":889,"column":8},"end":{"line":889,"column":8}}]},"11":{"line":969,"type":"if","locations":[{"start":{"line":969,"column":8},"end":{"line":969,"column":8}},{"start":{"line":969,"column":8},"end":{"line":969,"column":8}}]},"12":{"line":980,"type":"if","locations":[{"start":{"line":980,"column":12},"end":{"line":980,"column":12}},{"start":{"line":980,"column":12},"end":{"line":980,"column":12}}]},"13":{"line":987,"type":"if","locations":[{"start":{"line":987,"column":12},"end":{"line":987,"column":12}},{"start":{"line":987,"column":12},"end":{"line":987,"column":12}}]},"14":{"line":998,"type":"if","locations":[{"start":{"line":998,"column":12},"end":{"line":998,"column":12}},{"start":{"line":998,"column":12},"end":{"line":998,"column":12}}]},"15":{"line":1047,"type":"if","locations":[{"start":{"line":1047,"column":8},"end":{"line":1047,"column":8}},{"start":{"line":1047,"column":8},"end":{"line":1047,"column":8}}]},"16":{"line":1060,"type":"if","locations":[{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}},{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}}]},"17":{"line":1076,"type":"if","locations":[{"start":{"line":1076,"column":8},"end":{"line":1076,"column":8}},{"start":{"line":1076,"column":8},"end":{"line":1076,"column":8}}]},"18":{"line":1096,"type":"if","locations":[{"start":{"line":1096,"column":8},"end":{"line":1096,"column":8}},{"start":{"line":1096,"column":8},"end":{"line":1096,"column":8}}]},"19":{"line":1281,"type":"if","locations":[{"start":{"line":1281,"column":8},"end":{"line":1281,"column":8}},{"start":{"line":1281,"column":8},"end":{"line":1281,"column":8}}]},"20":{"line":1300,"type":"if","locations":[{"start":{"line":1300,"column":8},"end":{"line":1300,"column":8}},{"start":{"line":1300,"column":8},"end":{"line":1300,"column":8}}]},"21":{"line":1305,"type":"if","locations":[{"start":{"line":1305,"column":8},"end":{"line":1305,"column":8}},{"start":{"line":1305,"column":8},"end":{"line":1305,"column":8}}]},"22":{"line":1317,"type":"if","locations":[{"start":{"line":1317,"column":8},"end":{"line":1317,"column":8}},{"start":{"line":1317,"column":8},"end":{"line":1317,"column":8}}]},"23":{"line":1346,"type":"if","locations":[{"start":{"line":1346,"column":8},"end":{"line":1346,"column":8}},{"start":{"line":1346,"column":8},"end":{"line":1346,"column":8}}]},"24":{"line":1372,"type":"if","locations":[{"start":{"line":1372,"column":8},"end":{"line":1372,"column":8}},{"start":{"line":1372,"column":8},"end":{"line":1372,"column":8}}]},"25":{"line":1379,"type":"if","locations":[{"start":{"line":1379,"column":8},"end":{"line":1379,"column":8}},{"start":{"line":1379,"column":8},"end":{"line":1379,"column":8}}]},"26":{"line":1391,"type":"if","locations":[{"start":{"line":1391,"column":8},"end":{"line":1391,"column":8}},{"start":{"line":1391,"column":8},"end":{"line":1391,"column":8}}]},"27":{"line":1420,"type":"if","locations":[{"start":{"line":1420,"column":8},"end":{"line":1420,"column":8}},{"start":{"line":1420,"column":8},"end":{"line":1420,"column":8}}]},"28":{"line":1452,"type":"if","locations":[{"start":{"line":1452,"column":8},"end":{"line":1452,"column":8}},{"start":{"line":1452,"column":8},"end":{"line":1452,"column":8}}]},"29":{"line":1459,"type":"if","locations":[{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}},{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}}]},"30":{"line":1498,"type":"if","locations":[{"start":{"line":1498,"column":8},"end":{"line":1498,"column":8}},{"start":{"line":1498,"column":8},"end":{"line":1498,"column":8}}]},"31":{"line":1581,"type":"if","locations":[{"start":{"line":1581,"column":8},"end":{"line":1581,"column":8}},{"start":{"line":1581,"column":8},"end":{"line":1581,"column":8}}]},"32":{"line":1602,"type":"if","locations":[{"start":{"line":1602,"column":8},"end":{"line":1602,"column":8}},{"start":{"line":1602,"column":8},"end":{"line":1602,"column":8}}]},"33":{"line":1646,"type":"if","locations":[{"start":{"line":1646,"column":8},"end":{"line":1646,"column":8}},{"start":{"line":1646,"column":8},"end":{"line":1646,"column":8}}]},"34":{"line":1651,"type":"if","locations":[{"start":{"line":1651,"column":8},"end":{"line":1651,"column":8}},{"start":{"line":1651,"column":8},"end":{"line":1651,"column":8}}]},"35":{"line":1688,"type":"if","locations":[{"start":{"line":1688,"column":8},"end":{"line":1688,"column":8}},{"start":{"line":1688,"column":8},"end":{"line":1688,"column":8}}]},"36":{"line":1759,"type":"if","locations":[{"start":{"line":1759,"column":8},"end":{"line":1759,"column":8}},{"start":{"line":1759,"column":8},"end":{"line":1759,"column":8}}]},"37":{"line":1764,"type":"if","locations":[{"start":{"line":1764,"column":8},"end":{"line":1764,"column":8}},{"start":{"line":1764,"column":8},"end":{"line":1764,"column":8}}]},"38":{"line":1769,"type":"if","locations":[{"start":{"line":1769,"column":8},"end":{"line":1769,"column":8}},{"start":{"line":1769,"column":8},"end":{"line":1769,"column":8}}]},"39":{"line":1837,"type":"if","locations":[{"start":{"line":1837,"column":8},"end":{"line":1837,"column":8}},{"start":{"line":1837,"column":8},"end":{"line":1837,"column":8}}]},"40":{"line":1846,"type":"if","locations":[{"start":{"line":1846,"column":8},"end":{"line":1846,"column":8}},{"start":{"line":1846,"column":8},"end":{"line":1846,"column":8}}]},"41":{"line":1848,"type":"if","locations":[{"start":{"line":1848,"column":12},"end":{"line":1848,"column":12}},{"start":{"line":1848,"column":12},"end":{"line":1848,"column":12}}]}}},"contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol":{"l":{"43":277,"54":277,"56":277,"58":277,"60":277,"61":277,"62":277,"65":277,"66":277,"146":152},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol","s":{"1":277,"2":277,"3":277,"4":277,"5":277,"6":277,"7":277,"8":152},"b":{},"f":{"1":277},"fnMap":{"1":{"name":"isBytecodeSafe","line":31,"loc":{"start":{"line":31,"column":4},"end":{"line":147,"column":4}}}},"statementMap":{"1":{"start":{"line":43,"column":8},"end":{"line":43,"column":1492}},"2":{"start":{"line":54,"column":8},"end":{"line":54,"column":109}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":112}},"4":{"start":{"line":58,"column":8},"end":{"line":58,"column":77}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":26}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":19}},"7":{"start":{"line":65,"column":8},"end":{"line":65,"column":42}},"8":{"start":{"line":146,"column":8},"end":{"line":146,"column":19}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol":{"l":{"57":207,"71":921,"75":920,"97":0,"111":12,"127":12,"141":0,"142":0,"143":0,"161":4,"179":537,"197":31,"216":31,"234":60,"252":369,"270":0,"284":30,"285":30,"286":30,"287":30,"288":30,"306":18,"307":18,"308":18,"326":538,"347":61,"368":7,"369":7,"370":3,"373":4,"374":4,"376":4,"387":70,"402":5,"420":0,"421":0,"439":0,"440":0,"466":14,"473":14,"474":8,"497":57,"501":6,"505":51,"525":74,"545":69,"568":19,"591":9,"592":9,"593":3,"596":6,"597":6,"599":6,"610":30,"625":5,"645":0,"646":0,"666":0,"667":0,"689":606,"708":97,"730":687,"732":687,"733":268,"736":687},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol","s":{"1":207,"2":921,"3":0,"4":12,"5":12,"6":0,"7":0,"8":0,"9":4,"10":537,"11":31,"12":31,"13":60,"14":369,"15":0,"16":30,"17":30,"18":30,"19":30,"20":30,"21":18,"22":18,"23":18,"24":538,"25":61,"26":7,"27":7,"28":3,"29":4,"30":4,"31":4,"32":70,"33":5,"34":0,"35":0,"36":0,"37":0,"38":14,"39":14,"40":8,"41":57,"42":6,"43":51,"44":74,"45":69,"46":19,"47":9,"48":9,"49":3,"50":6,"51":6,"52":6,"53":30,"54":5,"55":0,"56":0,"57":0,"58":0,"59":606,"60":97,"61":687,"62":687,"63":268,"64":687},"b":{"1":[920,1],"2":[3,4],"3":[8,6],"4":[6,51],"5":[3,6],"6":[268,419]},"f":{"1":207,"2":921,"3":0,"4":12,"5":12,"6":0,"7":4,"8":537,"9":31,"10":31,"11":60,"12":369,"13":0,"14":30,"15":18,"16":538,"17":61,"18":7,"19":70,"20":5,"21":0,"22":0,"23":14,"24":57,"25":74,"26":69,"27":19,"28":9,"29":30,"30":5,"31":0,"32":0,"33":606,"34":97,"35":687},"fnMap":{"1":{"name":"constructor","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":58,"column":4}}},"2":{"name":"authenticated","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":76,"column":4}}},"3":{"name":"isAuthenticated","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":98,"column":4}}},"4":{"name":"setExecutionManager","line":109,"loc":{"start":{"line":104,"column":4},"end":{"line":112,"column":4}}},"5":{"name":"putAccount","line":125,"loc":{"start":{"line":119,"column":4},"end":{"line":128,"column":4}}},"6":{"name":"putEmptyAccount","line":139,"loc":{"start":{"line":134,"column":4},"end":{"line":144,"column":4}}},"7":{"name":"getAccount","line":151,"loc":{"start":{"line":151,"column":4},"end":{"line":162,"column":4}}},"8":{"name":"hasAccount","line":169,"loc":{"start":{"line":169,"column":4},"end":{"line":180,"column":4}}},"9":{"name":"hasEmptyAccount","line":187,"loc":{"start":{"line":187,"column":4},"end":{"line":201,"column":4}}},"10":{"name":"setAccountNonce","line":214,"loc":{"start":{"line":208,"column":4},"end":{"line":217,"column":4}}},"11":{"name":"getAccountNonce","line":224,"loc":{"start":{"line":224,"column":4},"end":{"line":235,"column":4}}},"12":{"name":"getAccountEthAddress","line":242,"loc":{"start":{"line":242,"column":4},"end":{"line":253,"column":4}}},"13":{"name":"getAccountStorageRoot","line":260,"loc":{"start":{"line":260,"column":4},"end":{"line":271,"column":4}}},"14":{"name":"initPendingAccount","line":282,"loc":{"start":{"line":277,"column":4},"end":{"line":289,"column":4}}},"15":{"name":"commitPendingAccount","line":304,"loc":{"start":{"line":297,"column":4},"end":{"line":309,"column":4}}},"16":{"name":"testAndSetAccountLoaded","line":321,"loc":{"start":{"line":316,"column":4},"end":{"line":330,"column":4}}},"17":{"name":"testAndSetAccountChanged","line":342,"loc":{"start":{"line":337,"column":4},"end":{"line":351,"column":4}}},"18":{"name":"commitAccount","line":363,"loc":{"start":{"line":358,"column":4},"end":{"line":377,"column":4}}},"19":{"name":"incrementTotalUncommittedAccounts","line":385,"loc":{"start":{"line":382,"column":4},"end":{"line":388,"column":4}}},"20":{"name":"getTotalUncommittedAccounts","line":394,"loc":{"start":{"line":394,"column":4},"end":{"line":403,"column":4}}},"21":{"name":"wasAccountChanged","line":410,"loc":{"start":{"line":410,"column":4},"end":{"line":422,"column":4}}},"22":{"name":"wasAccountCommitted","line":429,"loc":{"start":{"line":429,"column":4},"end":{"line":441,"column":4}}},"23":{"name":"putContractStorage","line":461,"loc":{"start":{"line":454,"column":4},"end":{"line":476,"column":4}}},"24":{"name":"getContractStorage","line":484,"loc":{"start":{"line":484,"column":4},"end":{"line":506,"column":4}}},"25":{"name":"hasContractStorage","line":514,"loc":{"start":{"line":514,"column":4},"end":{"line":526,"column":4}}},"26":{"name":"testAndSetContractStorageLoaded","line":540,"loc":{"start":{"line":534,"column":4},"end":{"line":549,"column":4}}},"27":{"name":"testAndSetContractStorageChanged","line":563,"loc":{"start":{"line":557,"column":4},"end":{"line":572,"column":4}}},"28":{"name":"commitContractStorage","line":586,"loc":{"start":{"line":580,"column":4},"end":{"line":600,"column":4}}},"29":{"name":"incrementTotalUncommittedContractStorage","line":608,"loc":{"start":{"line":605,"column":4},"end":{"line":611,"column":4}}},"30":{"name":"getTotalUncommittedContractStorage","line":617,"loc":{"start":{"line":617,"column":4},"end":{"line":626,"column":4}}},"31":{"name":"wasContractStorageChanged","line":634,"loc":{"start":{"line":634,"column":4},"end":{"line":647,"column":4}}},"32":{"name":"wasContractStorageCommitted","line":655,"loc":{"start":{"line":655,"column":4},"end":{"line":668,"column":4}}},"33":{"name":"_getItemHash","line":680,"loc":{"start":{"line":680,"column":4},"end":{"line":690,"column":4}}},"34":{"name":"_getItemHash","line":698,"loc":{"start":{"line":698,"column":4},"end":{"line":712,"column":4}}},"35":{"name":"_testAndSetItemState","line":721,"loc":{"start":{"line":721,"column":4},"end":{"line":737,"column":4}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":21}},"2":{"start":{"line":71,"column":8},"end":{"line":71,"column":2475}},"3":{"start":{"line":97,"column":8},"end":{"line":97,"column":69}},"4":{"start":{"line":111,"column":8},"end":{"line":111,"column":49}},"5":{"start":{"line":127,"column":8},"end":{"line":127,"column":36}},"6":{"start":{"line":141,"column":8},"end":{"line":141,"column":65}},"7":{"start":{"line":142,"column":8},"end":{"line":142,"column":55}},"8":{"start":{"line":143,"column":8},"end":{"line":143,"column":49}},"9":{"start":{"line":161,"column":8},"end":{"line":161,"column":33}},"10":{"start":{"line":179,"column":8},"end":{"line":179,"column":56}},"11":{"start":{"line":197,"column":8},"end":{"line":197,"column":5447}},"12":{"start":{"line":216,"column":8},"end":{"line":216,"column":40}},"13":{"start":{"line":234,"column":8},"end":{"line":234,"column":39}},"14":{"start":{"line":252,"column":8},"end":{"line":252,"column":44}},"15":{"start":{"line":270,"column":8},"end":{"line":270,"column":45}},"16":{"start":{"line":284,"column":8},"end":{"line":284,"column":65}},"17":{"start":{"line":285,"column":8},"end":{"line":285,"column":24}},"18":{"start":{"line":286,"column":8},"end":{"line":286,"column":55}},"19":{"start":{"line":287,"column":8},"end":{"line":287,"column":49}},"20":{"start":{"line":288,"column":8},"end":{"line":288,"column":29}},"21":{"start":{"line":306,"column":8},"end":{"line":306,"column":65}},"22":{"start":{"line":307,"column":8},"end":{"line":307,"column":39}},"23":{"start":{"line":308,"column":8},"end":{"line":308,"column":35}},"24":{"start":{"line":326,"column":8},"end":{"line":326,"column":8632}},"25":{"start":{"line":347,"column":8},"end":{"line":347,"column":9161}},"26":{"start":{"line":368,"column":8},"end":{"line":368,"column":45}},"27":{"start":{"line":369,"column":8},"end":{"line":369,"column":9676}},"28":{"start":{"line":370,"column":12},"end":{"line":370,"column":24}},"29":{"start":{"line":373,"column":8},"end":{"line":373,"column":50}},"30":{"start":{"line":374,"column":8},"end":{"line":374,"column":36}},"31":{"start":{"line":376,"column":8},"end":{"line":376,"column":19}},"32":{"start":{"line":387,"column":8},"end":{"line":387,"column":36}},"33":{"start":{"line":402,"column":8},"end":{"line":402,"column":39}},"34":{"start":{"line":420,"column":8},"end":{"line":420,"column":45}},"35":{"start":{"line":421,"column":8},"end":{"line":421,"column":57}},"36":{"start":{"line":439,"column":8},"end":{"line":439,"column":45}},"37":{"start":{"line":440,"column":8},"end":{"line":440,"column":59}},"38":{"start":{"line":466,"column":8},"end":{"line":466,"column":68}},"39":{"start":{"line":473,"column":8},"end":{"line":473,"column":12609}},"40":{"start":{"line":474,"column":12},"end":{"line":474,"column":58}},"41":{"start":{"line":497,"column":8},"end":{"line":497,"column":13277}},"42":{"start":{"line":501,"column":12},"end":{"line":501,"column":29}},"43":{"start":{"line":505,"column":8},"end":{"line":505,"column":67}},"44":{"start":{"line":525,"column":8},"end":{"line":525,"column":86}},"45":{"start":{"line":545,"column":8},"end":{"line":545,"column":14610}},"46":{"start":{"line":568,"column":8},"end":{"line":568,"column":15225}},"47":{"start":{"line":591,"column":8},"end":{"line":591,"column":52}},"48":{"start":{"line":592,"column":8},"end":{"line":592,"column":15834}},"49":{"start":{"line":593,"column":12},"end":{"line":593,"column":24}},"50":{"start":{"line":596,"column":8},"end":{"line":596,"column":50}},"51":{"start":{"line":597,"column":8},"end":{"line":597,"column":43}},"52":{"start":{"line":599,"column":8},"end":{"line":599,"column":19}},"53":{"start":{"line":610,"column":8},"end":{"line":610,"column":43}},"54":{"start":{"line":625,"column":8},"end":{"line":625,"column":46}},"55":{"start":{"line":645,"column":8},"end":{"line":645,"column":52}},"56":{"start":{"line":646,"column":8},"end":{"line":646,"column":57}},"57":{"start":{"line":666,"column":8},"end":{"line":666,"column":52}},"58":{"start":{"line":667,"column":8},"end":{"line":667,"column":59}},"59":{"start":{"line":689,"column":8},"end":{"line":689,"column":52}},"60":{"start":{"line":708,"column":8},"end":{"line":708,"column":18596}},"61":{"start":{"line":730,"column":8},"end":{"line":730,"column":62}},"62":{"start":{"line":732,"column":8},"end":{"line":732,"column":19270}},"63":{"start":{"line":733,"column":12},"end":{"line":733,"column":44}},"64":{"start":{"line":736,"column":8},"end":{"line":736,"column":27}}},"branchMap":{"1":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":8}},{"start":{"line":71,"column":8},"end":{"line":71,"column":8}}]},"2":{"line":369,"type":"if","locations":[{"start":{"line":369,"column":8},"end":{"line":369,"column":8}},{"start":{"line":369,"column":8},"end":{"line":369,"column":8}}]},"3":{"line":473,"type":"if","locations":[{"start":{"line":473,"column":8},"end":{"line":473,"column":8}},{"start":{"line":473,"column":8},"end":{"line":473,"column":8}}]},"4":{"line":497,"type":"if","locations":[{"start":{"line":497,"column":8},"end":{"line":497,"column":8}},{"start":{"line":497,"column":8},"end":{"line":497,"column":8}}]},"5":{"line":592,"type":"if","locations":[{"start":{"line":592,"column":8},"end":{"line":592,"column":8}},{"start":{"line":592,"column":8},"end":{"line":592,"column":8}}]},"6":{"line":732,"type":"if","locations":[{"start":{"line":732,"column":8},"end":{"line":732,"column":8}},{"start":{"line":732,"column":8},"end":{"line":732,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol":{"l":{"39":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol","s":{"1":0},"b":{},"f":{"1":0},"fnMap":{"1":{"name":"create","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":40,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":43}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol":{"l":{"57":0,"58":0,"59":0,"60":0,"62":0,"74":0,"75":0,"77":0,"78":0,"79":0,"85":0,"86":0,"94":0,"95":0,"96":0,"104":0,"105":0,"107":0,"115":0,"125":0,"127":0,"138":0,"139":0,"141":0,"149":0,"150":0,"152":0,"153":0,"154":0,"157":0,"158":0,"159":0,"162":0,"163":0,"164":0,"166":0,"173":0,"180":0,"182":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0},"fnMap":{"1":{"name":"getInterfaceImplementer","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":63,"column":4}}},"2":{"name":"setInterfaceImplementer","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":87,"column":4}}},"3":{"name":"setManager","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":97,"column":4}}},"4":{"name":"getManager","line":102,"loc":{"start":{"line":102,"column":4},"end":{"line":109,"column":4}}},"5":{"name":"interfaceHash","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":116,"column":4}}},"6":{"name":"updateERC165Cache","line":124,"loc":{"start":{"line":124,"column":4},"end":{"line":128,"column":4}}},"7":{"name":"implementsERC165Interface","line":137,"loc":{"start":{"line":137,"column":4},"end":{"line":142,"column":4}}},"8":{"name":"implementsERC165InterfaceNoCache","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":167,"column":4}}},"9":{"name":"isERC165Interface","line":172,"loc":{"start":{"line":172,"column":4},"end":{"line":174,"column":4}}},"10":{"name":"noThrowCall","line":177,"loc":{"start":{"line":177,"column":4},"end":{"line":198,"column":4}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":63}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":3386}},"3":{"start":{"line":59,"column":12},"end":{"line":59,"column":63}},"4":{"start":{"line":60,"column":12},"end":{"line":60,"column":91}},"5":{"start":{"line":62,"column":8},"end":{"line":62,"column":47}},"6":{"start":{"line":74,"column":8},"end":{"line":74,"column":63}},"7":{"start":{"line":75,"column":8},"end":{"line":75,"column":65}},"8":{"start":{"line":77,"column":8},"end":{"line":77,"column":80}},"9":{"start":{"line":78,"column":8},"end":{"line":78,"column":4625}},"10":{"start":{"line":79,"column":12},"end":{"line":79,"column":4705}},"11":{"start":{"line":85,"column":8},"end":{"line":85,"column":54}},"12":{"start":{"line":86,"column":8},"end":{"line":86,"column":72}},"13":{"start":{"line":94,"column":8},"end":{"line":94,"column":66}},"14":{"start":{"line":95,"column":8},"end":{"line":95,"column":72}},"15":{"start":{"line":96,"column":8},"end":{"line":96,"column":47}},"16":{"start":{"line":104,"column":8},"end":{"line":104,"column":5986}},"17":{"start":{"line":105,"column":12},"end":{"line":105,"column":24}},"18":{"start":{"line":107,"column":12},"end":{"line":107,"column":34}},"19":{"start":{"line":115,"column":8},"end":{"line":115,"column":58}},"20":{"start":{"line":125,"column":8},"end":{"line":125,"column":6972}},"21":{"start":{"line":127,"column":8},"end":{"line":127,"column":51}},"22":{"start":{"line":138,"column":8},"end":{"line":138,"column":7770}},"23":{"start":{"line":139,"column":12},"end":{"line":139,"column":76}},"24":{"start":{"line":141,"column":8},"end":{"line":141,"column":63}},"25":{"start":{"line":149,"column":8},"end":{"line":149,"column":23}},"26":{"start":{"line":150,"column":8},"end":{"line":150,"column":22}},"27":{"start":{"line":152,"column":8},"end":{"line":152,"column":59}},"28":{"start":{"line":153,"column":8},"end":{"line":153,"column":8523}},"29":{"start":{"line":154,"column":12},"end":{"line":154,"column":24}},"30":{"start":{"line":157,"column":8},"end":{"line":157,"column":61}},"31":{"start":{"line":158,"column":8},"end":{"line":158,"column":8667}},"32":{"start":{"line":159,"column":12},"end":{"line":159,"column":24}},"33":{"start":{"line":162,"column":8},"end":{"line":162,"column":63}},"34":{"start":{"line":163,"column":8},"end":{"line":163,"column":8813}},"35":{"start":{"line":164,"column":12},"end":{"line":164,"column":23}},"36":{"start":{"line":166,"column":8},"end":{"line":166,"column":20}},"37":{"start":{"line":173,"column":8},"end":{"line":173,"column":103}},"38":{"start":{"line":180,"column":8},"end":{"line":180,"column":34}}},"branchMap":{"1":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":8},"end":{"line":58,"column":8}},{"start":{"line":58,"column":8},"end":{"line":58,"column":8}}]},"2":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":8},"end":{"line":75,"column":8}},{"start":{"line":75,"column":8},"end":{"line":75,"column":8}}]},"3":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":77,"column":8}},{"start":{"line":77,"column":8},"end":{"line":77,"column":8}}]},"4":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]},"5":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":12},"end":{"line":79,"column":12}},{"start":{"line":79,"column":12},"end":{"line":79,"column":12}}]},"6":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":8},"end":{"line":94,"column":8}},{"start":{"line":94,"column":8},"end":{"line":94,"column":8}}]},"7":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":8},"end":{"line":104,"column":8}},{"start":{"line":104,"column":8},"end":{"line":104,"column":8}}]},"8":{"line":138,"type":"if","locations":[{"start":{"line":138,"column":8},"end":{"line":138,"column":8}},{"start":{"line":138,"column":8},"end":{"line":138,"column":8}}]},"9":{"line":153,"type":"if","locations":[{"start":{"line":153,"column":8},"end":{"line":153,"column":8}},{"start":{"line":153,"column":8},"end":{"line":153,"column":8}}]},"10":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":8},"end":{"line":158,"column":8}},{"start":{"line":158,"column":8},"end":{"line":158,"column":8}}]},"11":{"line":163,"type":"if","locations":[{"start":{"line":163,"column":8},"end":{"line":163,"column":8}},{"start":{"line":163,"column":8},"end":{"line":163,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol":{"l":{"40":0,"46":0,"50":0,"70":0,"74":0,"75":0,"78":0,"82":0,"86":0,"102":0,"122":0,"139":0,"156":0,"170":0,"171":0,"188":29,"192":29,"193":25,"196":4,"200":4,"201":1,"204":3,"210":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":29,"16":29,"17":25,"18":4,"19":4,"20":1,"21":3,"22":3},"b":{"1":[0,0],"2":[25,4],"3":[1,3]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":29},"fnMap":{"1":{"name":"onlyOwner","line":39,"loc":{"start":{"line":39,"column":4},"end":{"line":51,"column":4}}},"2":{"name":"initialize","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":90,"column":4}}},"3":{"name":"getOwner","line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":107,"column":4}}},"4":{"name":"setWhitelistedDeployer","line":120,"loc":{"start":{"line":114,"column":4},"end":{"line":126,"column":4}}},"5":{"name":"setOwner","line":137,"loc":{"start":{"line":132,"column":4},"end":{"line":143,"column":4}}},"6":{"name":"setAllowArbitraryDeployment","line":154,"loc":{"start":{"line":149,"column":4},"end":{"line":160,"column":4}}},"7":{"name":"enableArbitraryContractDeployment","line":168,"loc":{"start":{"line":165,"column":4},"end":{"line":172,"column":4}}},"8":{"name":"isDeployerAllowed","line":179,"loc":{"start":{"line":179,"column":4},"end":{"line":211,"column":4}}}},"statementMap":{"1":{"start":{"line":40,"column":8},"end":{"line":40,"column":1617}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":1775}},"3":{"start":{"line":70,"column":8},"end":{"line":70,"column":2421}},"4":{"start":{"line":74,"column":8},"end":{"line":74,"column":2555}},"5":{"start":{"line":75,"column":12},"end":{"line":75,"column":18}},"6":{"start":{"line":78,"column":8},"end":{"line":78,"column":2621}},"7":{"start":{"line":82,"column":8},"end":{"line":82,"column":2757}},"8":{"start":{"line":86,"column":8},"end":{"line":86,"column":2892}},"9":{"start":{"line":102,"column":8},"end":{"line":102,"column":3237}},"10":{"start":{"line":122,"column":8},"end":{"line":122,"column":3758}},"11":{"start":{"line":139,"column":8},"end":{"line":139,"column":4149}},"12":{"start":{"line":156,"column":8},"end":{"line":156,"column":4591}},"13":{"start":{"line":170,"column":8},"end":{"line":170,"column":40}},"14":{"start":{"line":171,"column":8},"end":{"line":171,"column":27}},"15":{"start":{"line":188,"column":8},"end":{"line":188,"column":5404}},"16":{"start":{"line":192,"column":8},"end":{"line":192,"column":5538}},"17":{"start":{"line":193,"column":12},"end":{"line":193,"column":23}},"18":{"start":{"line":196,"column":8},"end":{"line":196,"column":5611}},"19":{"start":{"line":200,"column":8},"end":{"line":200,"column":5773}},"20":{"start":{"line":201,"column":12},"end":{"line":201,"column":23}},"21":{"start":{"line":204,"column":8},"end":{"line":204,"column":5858}},"22":{"start":{"line":210,"column":8},"end":{"line":210,"column":28}}},"branchMap":{"1":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":8},"end":{"line":74,"column":8}},{"start":{"line":74,"column":8},"end":{"line":74,"column":8}}]},"2":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":8},"end":{"line":192,"column":8}},{"start":{"line":192,"column":8},"end":{"line":192,"column":8}}]},"3":{"line":200,"type":"if","locations":[{"start":{"line":200,"column":8},"end":{"line":200,"column":8}},{"start":{"line":200,"column":8},"end":{"line":200,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol":{"l":{"32":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol","s":{"1":0},"b":{},"f":{"1":0},"fnMap":{"1":{"name":"constructor","line":30,"loc":{"start":{"line":22,"column":4},"end":{"line":33,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":47}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol":{"l":{"41":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol","s":{"1":1},"b":{},"f":{"1":1},"fnMap":{"1":{"name":"getL1MessageSender","line":32,"loc":{"start":{"line":32,"column":4},"end":{"line":42,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":64}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol":{"l":{"43":31},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol","s":{"1":31},"b":{},"f":{"1":31},"fnMap":{"1":{"name":"passMessageToL1","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":49,"column":4}}}},"statementMap":{"1":{"start":{"line":43,"column":8},"end":{"line":43,"column":1351}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol":{"l":{"25":1,"43":2,"47":2,"48":2,"56":2,"61":2,"74":4,"86":1,"98":2,"110":4},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol","s":{"1":1,"2":2,"3":2,"4":2,"5":2,"6":2,"7":4,"8":1,"9":2,"10":4},"b":{},"f":{"1":1,"2":2,"3":2,"4":4,"5":1,"6":2,"7":4},"fnMap":{"1":{"name":null,"line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":30,"column":4}}},"2":{"name":"init","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"upgrade","line":51,"loc":{"start":{"line":51,"column":4},"end":{"line":62,"column":4}}},"4":{"name":"_setImplementation","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":78,"column":4}}},"5":{"name":"_getImplementation","line":80,"loc":{"start":{"line":80,"column":4},"end":{"line":91,"column":4}}},"6":{"name":"_setOwner","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":102,"column":4}}},"7":{"name":"_getOwner","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":115,"column":4}}}},"statementMap":{"1":{"start":{"line":25,"column":8},"end":{"line":25,"column":678}},"2":{"start":{"line":43,"column":8},"end":{"line":43,"column":1017}},"3":{"start":{"line":47,"column":8},"end":{"line":47,"column":24}},"4":{"start":{"line":48,"column":8},"end":{"line":48,"column":42}},"5":{"start":{"line":56,"column":8},"end":{"line":56,"column":1345}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":42}},"7":{"start":{"line":74,"column":8},"end":{"line":74,"column":1768}},"8":{"start":{"line":86,"column":8},"end":{"line":86,"column":2050}},"9":{"start":{"line":98,"column":8},"end":{"line":98,"column":2288}},"10":{"start":{"line":110,"column":8},"end":{"line":110,"column":2543}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol":{"l":{"52":7,"54":5,"55":5,"56":5,"59":5,"60":5,"63":5,"68":5,"76":5,"78":2,"79":2,"83":5,"92":5,"117":7,"118":3,"120":2,"122":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol","s":{"1":7,"2":5,"3":5,"4":5,"5":5,"6":5,"7":5,"8":5,"9":5,"10":2,"11":2,"12":5,"13":5,"14":7,"15":3,"16":4,"17":2,"18":2},"b":{"1":[2,3],"2":[3,4],"3":[2,2]},"f":{"1":7,"2":7},"fnMap":{"1":{"name":null,"line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":97,"column":4}}},"2":{"name":"_getTransactionType","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":126,"column":4}}}},"statementMap":{"1":{"start":{"line":52,"column":8},"end":{"line":52,"column":98}},"2":{"start":{"line":54,"column":8},"end":{"line":54,"column":83}},"3":{"start":{"line":55,"column":8},"end":{"line":55,"column":84}},"4":{"start":{"line":56,"column":8},"end":{"line":56,"column":54}},"5":{"start":{"line":59,"column":8},"end":{"line":59,"column":70}},"6":{"start":{"line":60,"column":8},"end":{"line":60,"column":87}},"7":{"start":{"line":63,"column":8},"end":{"line":63,"column":2436}},"8":{"start":{"line":68,"column":8},"end":{"line":68,"column":2618}},"9":{"start":{"line":76,"column":8},"end":{"line":76,"column":2784}},"10":{"start":{"line":78,"column":12},"end":{"line":78,"column":94}},"11":{"start":{"line":79,"column":12},"end":{"line":79,"column":85}},"12":{"start":{"line":83,"column":8},"end":{"line":83,"column":3190}},"13":{"start":{"line":92,"column":8},"end":{"line":92,"column":3423}},"14":{"start":{"line":117,"column":8},"end":{"line":117,"column":3983}},"15":{"start":{"line":118,"column":12},"end":{"line":118,"column":57}},"16":{"start":{"line":119,"column":10},"end":{"line":119,"column":4081}},"17":{"start":{"line":120,"column":12},"end":{"line":120,"column":53}},"18":{"start":{"line":122,"column":12},"end":{"line":122,"column":4198}}},"branchMap":{"1":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"2":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":8},"end":{"line":117,"column":8}},{"start":{"line":117,"column":8},"end":{"line":117,"column":8}}]},"3":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":10},"end":{"line":119,"column":10}},{"start":{"line":119,"column":10},"end":{"line":119,"column":10}}]}}},"contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol":{"l":{"13":28,"14":28,"15":14,"16":14},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol","s":{"1":28,"2":14,"3":14},"b":{},"f":{"1":28},"fnMap":{"1":{"name":"contributesToFraudProof","line":12,"loc":{"start":{"line":12,"column":4},"end":{"line":17,"column":4}}}},"statementMap":{"1":{"start":{"line":13,"column":8},"end":{"line":13,"column":36}},"2":{"start":{"line":15,"column":8},"end":{"line":15,"column":47}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":110}}},"branchMap":{}},"contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol":{"l":{"69":63,"80":46,"81":46,"83":45,"84":45,"90":13,"91":12,"95":11,"97":11,"98":11,"99":8,"100":8,"101":8,"108":1,"109":1,"118":11,"123":1,"127":10,"133":18,"139":18,"144":7,"145":7,"146":7,"148":6,"149":6,"154":5,"156":5,"160":4,"163":3,"164":3,"166":3,"175":6,"176":6,"182":5,"183":5,"186":5,"190":4,"193":4,"196":4,"201":3,"206":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol","s":{"1":63,"2":46,"3":46,"4":45,"5":45,"6":13,"7":12,"8":11,"9":11,"10":11,"11":8,"12":8,"13":8,"14":3,"15":1,"16":1,"17":11,"18":1,"19":10,"20":18,"21":18,"22":7,"23":7,"24":7,"25":6,"26":6,"27":5,"28":5,"29":4,"30":3,"31":3,"32":3,"33":6,"34":6,"35":5,"36":5,"37":5,"38":4,"39":4,"40":4,"41":3,"42":2},"b":{"1":[45,1],"2":[12,1],"3":[11,1],"4":[8,3],"5":[1,2],"6":[1,10],"7":[18,0],"8":[7,0],"9":[6,1],"10":[4,1],"11":[3,1],"12":[3,0],"13":[5,1],"14":[4,1],"15":[4,0]},"f":{"1":63,"2":46,"3":13,"4":18,"5":7,"6":5,"7":6,"8":3,"9":2},"fnMap":{"1":{"name":"constructor","line":67,"loc":{"start":{"line":63,"column":4},"end":{"line":70,"column":4}}},"2":{"name":"recordGasSpent","line":78,"loc":{"start":{"line":78,"column":4},"end":{"line":85,"column":4}}},"3":{"name":"finalize","line":89,"loc":{"start":{"line":89,"column":4},"end":{"line":128,"column":4}}},"4":{"name":"deposit","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"5":{"name":"startWithdrawal","line":143,"loc":{"start":{"line":143,"column":4},"end":{"line":150,"column":4}}},"6":{"name":"finalizeWithdrawal","line":153,"loc":{"start":{"line":153,"column":4},"end":{"line":170,"column":4}}},"7":{"name":"claim","line":174,"loc":{"start":{"line":174,"column":4},"end":{"line":197,"column":4}}},"8":{"name":"isCollateralized","line":200,"loc":{"start":{"line":200,"column":4},"end":{"line":202,"column":4}}},"9":{"name":"getGasSpent","line":205,"loc":{"start":{"line":205,"column":4},"end":{"line":207,"column":4}}}},"statementMap":{"1":{"start":{"line":69,"column":8},"end":{"line":69,"column":21}},"2":{"start":{"line":80,"column":8},"end":{"line":80,"column":133}},"3":{"start":{"line":81,"column":8},"end":{"line":81,"column":68}},"4":{"start":{"line":83,"column":8},"end":{"line":83,"column":56}},"5":{"start":{"line":84,"column":8},"end":{"line":84,"column":64}},"6":{"start":{"line":90,"column":8},"end":{"line":90,"column":86}},"7":{"start":{"line":91,"column":8},"end":{"line":91,"column":91}},"8":{"start":{"line":95,"column":8},"end":{"line":95,"column":54}},"9":{"start":{"line":97,"column":8},"end":{"line":97,"column":44}},"10":{"start":{"line":98,"column":8},"end":{"line":98,"column":3657}},"11":{"start":{"line":99,"column":12},"end":{"line":99,"column":48}},"12":{"start":{"line":100,"column":12},"end":{"line":100,"column":57}},"13":{"start":{"line":101,"column":12},"end":{"line":101,"column":45}},"14":{"start":{"line":102,"column":15},"end":{"line":102,"column":3863}},"15":{"start":{"line":108,"column":12},"end":{"line":108,"column":57}},"16":{"start":{"line":109,"column":12},"end":{"line":109,"column":45}},"17":{"start":{"line":118,"column":8},"end":{"line":118,"column":4758}},"18":{"start":{"line":123,"column":12},"end":{"line":123,"column":18}},"19":{"start":{"line":127,"column":8},"end":{"line":127,"column":44}},"20":{"start":{"line":133,"column":8},"end":{"line":133,"column":5212}},"21":{"start":{"line":139,"column":8},"end":{"line":139,"column":53}},"22":{"start":{"line":144,"column":8},"end":{"line":144,"column":45}},"23":{"start":{"line":145,"column":8},"end":{"line":145,"column":72}},"24":{"start":{"line":146,"column":8},"end":{"line":146,"column":70}},"25":{"start":{"line":148,"column":8},"end":{"line":148,"column":37}},"26":{"start":{"line":149,"column":8},"end":{"line":149,"column":57}},"27":{"start":{"line":154,"column":8},"end":{"line":154,"column":45}},"28":{"start":{"line":156,"column":8},"end":{"line":156,"column":5998}},"29":{"start":{"line":160,"column":8},"end":{"line":160,"column":63}},"30":{"start":{"line":163,"column":8},"end":{"line":163,"column":44}},"31":{"start":{"line":164,"column":8},"end":{"line":164,"column":35}},"32":{"start":{"line":166,"column":8},"end":{"line":166,"column":6334}},"33":{"start":{"line":175,"column":8},"end":{"line":175,"column":38}},"34":{"start":{"line":176,"column":8},"end":{"line":176,"column":6686}},"35":{"start":{"line":182,"column":8},"end":{"line":182,"column":62}},"36":{"start":{"line":183,"column":8},"end":{"line":183,"column":65}},"37":{"start":{"line":186,"column":8},"end":{"line":186,"column":53}},"38":{"start":{"line":190,"column":8},"end":{"line":190,"column":98}},"39":{"start":{"line":193,"column":8},"end":{"line":193,"column":39}},"40":{"start":{"line":196,"column":8},"end":{"line":196,"column":68}},"41":{"start":{"line":201,"column":8},"end":{"line":201,"column":55}},"42":{"start":{"line":206,"column":8},"end":{"line":206,"column":59}}},"branchMap":{"1":{"line":81,"type":"if","locations":[{"start":{"line":81,"column":8},"end":{"line":81,"column":8}},{"start":{"line":81,"column":8},"end":{"line":81,"column":8}}]},"2":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]},"3":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"4":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"5":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":15},"end":{"line":102,"column":15}},{"start":{"line":102,"column":15},"end":{"line":102,"column":15}}]},"6":{"line":118,"type":"if","locations":[{"start":{"line":118,"column":8},"end":{"line":118,"column":8}},{"start":{"line":118,"column":8},"end":{"line":118,"column":8}}]},"7":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":8}},{"start":{"line":133,"column":8},"end":{"line":133,"column":8}}]},"8":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":145,"column":8}},{"start":{"line":145,"column":8},"end":{"line":145,"column":8}}]},"9":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"10":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"11":{"line":160,"type":"if","locations":[{"start":{"line":160,"column":8},"end":{"line":160,"column":8}},{"start":{"line":160,"column":8},"end":{"line":160,"column":8}}]},"12":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":8},"end":{"line":166,"column":8}},{"start":{"line":166,"column":8},"end":{"line":166,"column":8}}]},"13":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":8},"end":{"line":176,"column":8}},{"start":{"line":176,"column":8},"end":{"line":176,"column":8}}]},"14":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"15":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol":{"l":{"74":21,"105":12,"107":12,"108":0,"111":12,"112":12,"114":12,"123":11,"133":10,"138":9,"140":9,"171":6,"172":6,"174":6,"179":5,"184":4,"193":3,"203":2,"208":1,"211":1,"213":1,"241":12,"257":9,"278":1,"279":1,"282":1,"287":1,"290":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol","s":{"1":21,"2":12,"3":12,"4":0,"5":12,"6":12,"7":12,"8":11,"9":10,"10":9,"11":9,"12":6,"13":6,"14":6,"15":5,"16":4,"17":3,"18":2,"19":1,"20":1,"21":1,"22":12,"23":9,"24":1,"25":1,"26":1,"27":1,"28":1},"b":{"1":[0,12],"2":[11,1],"3":[10,1],"4":[9,1],"5":[5,1],"6":[4,1],"7":[3,1],"8":[2,1],"9":[1,1]},"f":{"1":33,"2":21,"3":12,"4":6,"5":12,"6":9,"7":1},"fnMap":{"1":{"name":"constructor","line":50,"loc":{"start":{"line":47,"column":4},"end":{"line":51,"column":5}}},"2":{"name":"getStateTransitioner","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":75,"column":4}}},"3":{"name":"initializeFraudVerification","line":103,"loc":{"start":{"line":92,"column":4},"end":{"line":146,"column":4}}},"4":{"name":"finalizeFraudVerification","line":169,"loc":{"start":{"line":158,"column":4},"end":{"line":219,"column":4}}},"5":{"name":"_hasStateTransitioner","line":231,"loc":{"start":{"line":231,"column":4},"end":{"line":242,"column":4}}},"6":{"name":"_deployTransitioner","line":250,"loc":{"start":{"line":250,"column":4},"end":{"line":265,"column":4}}},"7":{"name":"_cancelStateTransition","line":272,"loc":{"start":{"line":272,"column":4},"end":{"line":295,"column":4}}}},"statementMap":{"1":{"start":{"line":74,"column":8},"end":{"line":74,"column":81}},"2":{"start":{"line":105,"column":8},"end":{"line":105,"column":68}},"3":{"start":{"line":107,"column":8},"end":{"line":107,"column":3959}},"4":{"start":{"line":108,"column":12},"end":{"line":108,"column":18}},"5":{"start":{"line":111,"column":8},"end":{"line":111,"column":122}},"6":{"start":{"line":112,"column":8},"end":{"line":112,"column":142}},"7":{"start":{"line":114,"column":8},"end":{"line":114,"column":4320}},"8":{"start":{"line":123,"column":8},"end":{"line":123,"column":4585}},"9":{"start":{"line":133,"column":8},"end":{"line":133,"column":4878}},"10":{"start":{"line":138,"column":8},"end":{"line":138,"column":76}},"11":{"start":{"line":140,"column":8},"end":{"line":140,"column":5238}},"12":{"start":{"line":171,"column":8},"end":{"line":171,"column":90}},"13":{"start":{"line":172,"column":8},"end":{"line":172,"column":122}},"14":{"start":{"line":174,"column":8},"end":{"line":174,"column":6732}},"15":{"start":{"line":179,"column":8},"end":{"line":179,"column":6888}},"16":{"start":{"line":184,"column":8},"end":{"line":184,"column":7179}},"17":{"start":{"line":193,"column":8},"end":{"line":193,"column":7444}},"18":{"start":{"line":203,"column":8},"end":{"line":203,"column":7814}},"19":{"start":{"line":208,"column":8},"end":{"line":208,"column":71}},"20":{"start":{"line":211,"column":8},"end":{"line":211,"column":142}},"21":{"start":{"line":213,"column":8},"end":{"line":213,"column":8258}},"22":{"start":{"line":241,"column":8},"end":{"line":241,"column":82}},"23":{"start":{"line":257,"column":8},"end":{"line":257,"column":9503}},"24":{"start":{"line":278,"column":8},"end":{"line":278,"column":122}},"25":{"start":{"line":279,"column":8},"end":{"line":279,"column":86}},"26":{"start":{"line":282,"column":8},"end":{"line":282,"column":10441}},"27":{"start":{"line":287,"column":8},"end":{"line":287,"column":116}},"28":{"start":{"line":290,"column":8},"end":{"line":290,"column":10767}}},"branchMap":{"1":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"2":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":8},"end":{"line":114,"column":8}},{"start":{"line":114,"column":8},"end":{"line":114,"column":8}}]},"3":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"4":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":8}},{"start":{"line":133,"column":8},"end":{"line":133,"column":8}}]},"5":{"line":174,"type":"if","locations":[{"start":{"line":174,"column":8},"end":{"line":174,"column":8}},{"start":{"line":174,"column":8},"end":{"line":174,"column":8}}]},"6":{"line":179,"type":"if","locations":[{"start":{"line":179,"column":8},"end":{"line":179,"column":8}},{"start":{"line":179,"column":8},"end":{"line":179,"column":8}}]},"7":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":8},"end":{"line":184,"column":8}},{"start":{"line":184,"column":8},"end":{"line":184,"column":8}}]},"8":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"9":{"line":203,"type":"if","locations":[{"start":{"line":203,"column":8},"end":{"line":203,"column":8}},{"start":{"line":203,"column":8},"end":{"line":203,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol":{"l":{"97":42,"98":42,"99":42,"100":42,"102":42,"117":13,"121":13,"141":0,"156":1,"171":1,"196":2,"205":2,"214":1,"216":1,"220":1,"221":1,"224":0,"228":1,"234":1,"247":0,"268":3,"273":3,"278":2,"279":2,"281":2,"283":0,"286":2,"295":1,"298":1,"303":0,"307":1,"331":1,"340":0,"345":0,"350":0,"355":0,"357":0,"379":2,"384":2,"389":1,"391":1,"401":1,"422":2,"427":1,"428":1,"430":1,"439":1,"442":1,"461":3,"466":2,"471":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol","s":{"1":42,"2":42,"3":42,"4":42,"5":42,"6":13,"7":0,"8":1,"9":1,"10":2,"11":2,"12":1,"13":1,"14":1,"15":1,"16":0,"17":1,"18":1,"19":0,"20":3,"21":3,"22":2,"23":2,"24":2,"25":0,"26":2,"27":1,"28":1,"29":0,"30":1,"31":1,"32":0,"33":0,"34":0,"35":0,"36":0,"37":2,"38":2,"39":1,"40":1,"41":1,"42":2,"43":1,"44":1,"45":1,"46":1,"47":1,"48":3,"49":2,"50":1},"b":{"1":[13,0],"2":[2,0],"3":[1,0],"4":[0,1],"5":[1,0],"6":[3,0],"7":[2,1],"8":[0,2],"9":[1,0],"10":[0,1],"11":[0,0],"12":[2,0],"13":[1,1],"14":[1,1],"15":[2,1],"16":[1,1]},"f":{"1":42,"2":13,"3":0,"4":1,"5":1,"6":2,"7":3,"8":1,"9":2,"10":2,"11":3},"fnMap":{"1":{"name":"constructor","line":95,"loc":{"start":{"line":89,"column":4},"end":{"line":103,"column":4}}},"2":{"name":"onlyDuringPhase","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":122,"column":4}}},"3":{"name":"getPreStateRoot","line":133,"loc":{"start":{"line":133,"column":4},"end":{"line":142,"column":4}}},"4":{"name":"getPostStateRoot","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":157,"column":4}}},"5":{"name":"isComplete","line":163,"loc":{"start":{"line":163,"column":4},"end":{"line":172,"column":4}}},"6":{"name":"proveContractState","line":193,"loc":{"start":{"line":185,"column":4},"end":{"line":249,"column":4}}},"7":{"name":"proveStorageSlot","line":265,"loc":{"start":{"line":257,"column":4},"end":{"line":312,"column":4}}},"8":{"name":"applyTransaction","line":329,"loc":{"start":{"line":323,"column":4},"end":{"line":358,"column":4}}},"9":{"name":"commitContractState","line":377,"loc":{"start":{"line":370,"column":4},"end":{"line":404,"column":4}}},"10":{"name":"commitStorageSlot","line":420,"loc":{"start":{"line":412,"column":4},"end":{"line":446,"column":4}}},"11":{"name":"completeTransition","line":459,"loc":{"start":{"line":456,"column":4},"end":{"line":472,"column":4}}}},"statementMap":{"1":{"start":{"line":97,"column":8},"end":{"line":97,"column":51}},"2":{"start":{"line":98,"column":8},"end":{"line":98,"column":35}},"3":{"start":{"line":99,"column":8},"end":{"line":99,"column":36}},"4":{"start":{"line":100,"column":8},"end":{"line":100,"column":41}},"5":{"start":{"line":102,"column":8},"end":{"line":102,"column":107}},"6":{"start":{"line":117,"column":8},"end":{"line":117,"column":4442}},"7":{"start":{"line":141,"column":8},"end":{"line":141,"column":27}},"8":{"start":{"line":156,"column":8},"end":{"line":156,"column":28}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":48}},"10":{"start":{"line":196,"column":8},"end":{"line":196,"column":6424}},"11":{"start":{"line":205,"column":8},"end":{"line":205,"column":6778}},"12":{"start":{"line":214,"column":8},"end":{"line":214,"column":7009}},"13":{"start":{"line":216,"column":12},"end":{"line":216,"column":7108}},"14":{"start":{"line":220,"column":12},"end":{"line":220,"column":60}},"15":{"start":{"line":221,"column":12},"end":{"line":221,"column":7300}},"16":{"start":{"line":224,"column":16},"end":{"line":224,"column":78}},"17":{"start":{"line":228,"column":16},"end":{"line":228,"column":7787}},"18":{"start":{"line":234,"column":12},"end":{"line":234,"column":8038}},"19":{"start":{"line":247,"column":12},"end":{"line":247,"column":63}},"20":{"start":{"line":268,"column":8},"end":{"line":268,"column":9237}},"21":{"start":{"line":273,"column":8},"end":{"line":273,"column":9402}},"22":{"start":{"line":278,"column":8},"end":{"line":278,"column":88}},"23":{"start":{"line":279,"column":8},"end":{"line":279,"column":21}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":9685}},"25":{"start":{"line":283,"column":12},"end":{"line":283,"column":29}},"26":{"start":{"line":286,"column":12},"end":{"line":286,"column":9989}},"27":{"start":{"line":295,"column":12},"end":{"line":295,"column":10236}},"28":{"start":{"line":298,"column":16},"end":{"line":298,"column":10392}},"29":{"start":{"line":303,"column":16},"end":{"line":303,"column":33}},"30":{"start":{"line":307,"column":8},"end":{"line":307,"column":10652}},"31":{"start":{"line":331,"column":8},"end":{"line":331,"column":11252}},"32":{"start":{"line":340,"column":8},"end":{"line":340,"column":11732}},"33":{"start":{"line":345,"column":8},"end":{"line":345,"column":106}},"34":{"start":{"line":350,"column":8},"end":{"line":350,"column":72}},"35":{"start":{"line":355,"column":8},"end":{"line":355,"column":70}},"36":{"start":{"line":357,"column":8},"end":{"line":357,"column":45}},"37":{"start":{"line":379,"column":8},"end":{"line":379,"column":13348}},"38":{"start":{"line":384,"column":8},"end":{"line":384,"column":13526}},"39":{"start":{"line":389,"column":8},"end":{"line":389,"column":93}},"40":{"start":{"line":391,"column":8},"end":{"line":391,"column":13798}},"41":{"start":{"line":401,"column":8},"end":{"line":401,"column":14153}},"42":{"start":{"line":422,"column":8},"end":{"line":422,"column":14795}},"43":{"start":{"line":427,"column":8},"end":{"line":427,"column":93}},"44":{"start":{"line":428,"column":8},"end":{"line":428,"column":85}},"45":{"start":{"line":430,"column":8},"end":{"line":430,"column":15172}},"46":{"start":{"line":439,"column":8},"end":{"line":439,"column":63}},"47":{"start":{"line":442,"column":8},"end":{"line":442,"column":15596}},"48":{"start":{"line":461,"column":8},"end":{"line":461,"column":16010}},"49":{"start":{"line":466,"column":8},"end":{"line":466,"column":16180}},"50":{"start":{"line":471,"column":8},"end":{"line":471,"column":39}}},"branchMap":{"1":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":8},"end":{"line":117,"column":8}},{"start":{"line":117,"column":8},"end":{"line":117,"column":8}}]},"2":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]},"3":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]},"4":{"line":221,"type":"if","locations":[{"start":{"line":221,"column":12},"end":{"line":221,"column":12}},{"start":{"line":221,"column":12},"end":{"line":221,"column":12}}]},"5":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":16},"end":{"line":228,"column":16}},{"start":{"line":228,"column":16},"end":{"line":228,"column":16}}]},"6":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":8},"end":{"line":268,"column":8}},{"start":{"line":268,"column":8},"end":{"line":268,"column":8}}]},"7":{"line":273,"type":"if","locations":[{"start":{"line":273,"column":8},"end":{"line":273,"column":8}},{"start":{"line":273,"column":8},"end":{"line":273,"column":8}}]},"8":{"line":281,"type":"if","locations":[{"start":{"line":281,"column":8},"end":{"line":281,"column":8}},{"start":{"line":281,"column":8},"end":{"line":281,"column":8}}]},"9":{"line":295,"type":"if","locations":[{"start":{"line":295,"column":12},"end":{"line":295,"column":12}},{"start":{"line":295,"column":12},"end":{"line":295,"column":12}}]},"10":{"line":331,"type":"if","locations":[{"start":{"line":331,"column":8},"end":{"line":331,"column":8}},{"start":{"line":331,"column":8},"end":{"line":331,"column":8}}]},"11":{"line":340,"type":"if","locations":[{"start":{"line":340,"column":8},"end":{"line":340,"column":8}},{"start":{"line":340,"column":8},"end":{"line":340,"column":8}}]},"12":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"13":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":8},"end":{"line":384,"column":8}},{"start":{"line":384,"column":8},"end":{"line":384,"column":8}}]},"14":{"line":422,"type":"if","locations":[{"start":{"line":422,"column":8},"end":{"line":422,"column":8}},{"start":{"line":422,"column":8},"end":{"line":422,"column":8}}]},"15":{"line":461,"type":"if","locations":[{"start":{"line":461,"column":8},"end":{"line":461,"column":8}},{"start":{"line":461,"column":8},"end":{"line":461,"column":8}}]},"16":{"line":466,"type":"if","locations":[{"start":{"line":466,"column":8},"end":{"line":466,"column":8}},{"start":{"line":466,"column":8},"end":{"line":466,"column":8}}]}}},"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol":{"l":{"56":1,"60":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol","s":{"1":1,"2":0},"b":{"1":[0,1]},"f":{"1":3,"2":1},"fnMap":{"1":{"name":"constructor","line":29,"loc":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}}},"2":{"name":"create","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":66,"column":4}}}},"statementMap":{"1":{"start":{"line":56,"column":8},"end":{"line":56,"column":1919}},"2":{"start":{"line":60,"column":8},"end":{"line":60,"column":2068}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]}}}} \ No newline at end of file diff --git a/coverage/OVM/accounts/OVM_ECDSAContractAccount.sol.html b/coverage/OVM/accounts/OVM_ECDSAContractAccount.sol.html deleted file mode 100644 index f86195d44..000000000 --- a/coverage/OVM/accounts/OVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - Code coverage report for OVM/accounts/OVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / OVM/accounts/ OVM_ECDSAContractAccount.sol -

-
-
- 93.75% - Statements - 15/16 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 1/1 -
-
- 93.75% - Lines - 15/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  -  - -  -  -  -  -  - - -  -  -  -  -  - - -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
-import { Lib_SafeMathWrapper } from "../../libraries/wrappers/Lib_SafeMathWrapper.sol";
- 
-/**
- * @title OVM_ECDSAContractAccount
- * @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the
- * ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by 
- * providing eth_sign and EIP155 formatted transaction encodings.
- *
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    // TODO: should be the amount sufficient to cover the gas costs of all of the transactions up
-    // to and including the CALL/CREATE which forms the entrypoint of the transaction.
-    uint256 constant EXECUTION_VALIDATION_GAS_OVERHEAD = 25000;
-    address constant ETH_ERC20_ADDRESS = 0x4200000000000000000000000000000000000006;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Executes a signed transaction.
-     * @param _transaction Signed EOA transaction.
-     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     * @return Whether or not the call returned (rather than reverted).
-     * @return Data returned by the call.
-     */
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        override
-        public
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
- 
-        // Address of this contract within the ovm (ovmADDRESS) should be the same as the
-        // recovered address of the user who signed this message. This is how we manage to shim
-        // account abstraction even though the user isn't a contract.
-        // Need to make sure that the transaction nonce is right and bump it if so.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_ECDSAUtils.recover(
-                _transaction,
-                isEthSign,
-                _v,
-                _r,
-                _s
-            ) == Lib_SafeExecutionManagerWrapper.safeADDRESS(),
-            "Signature provided for EOA transaction execution is invalid."
-        );
- 
-        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
- 
-        // Need to make sure that the transaction chainId is correct.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.chainId == Lib_SafeExecutionManagerWrapper.safeCHAINID(),
-            "Transaction chainId does not match expected OVM chainId."
-        );
- 
-        // Need to make sure that the transaction nonce is right.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
-            "Transaction nonce does not match the expected nonce."
-        );
- 
-        // TEMPORARY: Disable gas checks for mainnet.
-        // // Need to make sure that the gas is sufficient to execute the transaction.
-        // Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-        //    gasleft() >= Lib_SafeMathWrapper.add(decodedTx.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD),
-        //    "Gas is not sufficient to execute the transaction."
-        // );
- 
-        // Transfer fee to relayer.
-        address relayer = Lib_SafeExecutionManagerWrapper.safeCALLER();
-        uint256 fee = Lib_SafeMathWrapper.mul(decodedTx.gasLimit, decodedTx.gasPrice);
-        (bool success, ) = Lib_SafeExecutionManagerWrapper.safeCALL(
-            gasleft(),
-            ETH_ERC20_ADDRESS,
-            abi.encodeWithSignature("transfer(address,uint256)", relayer, fee)
-        );
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            success == true,
-            "Fee was not transferred to relayer."
-        );
- 
-        // Contract creations are signalled by sending a transaction to the zero address.
-        if (decodedTx.to == address(0)) {
-            (address created, bytes memory revertData) = Lib_SafeExecutionManagerWrapper.safeCREATE(
-                decodedTx.gasLimit,
-                decodedTx.data
-            );
- 
-            // Return true if the contract creation succeeded, false w/ revertData otherwise.
-            Eif (created != address(0)) {
-                return (true, abi.encode(created));
-            } else {
-                return (false, revertData);
-            }
-        } else {
-            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
-            // the nonce of the calling account. Normally an EOA would bump the nonce for both
-            // cases, but since this is a contract we'd end up bumping the nonce twice.
-            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
- 
-            return Lib_SafeExecutionManagerWrapper.safeCALL(
-                decodedTx.gasLimit,
-                decodedTx.to,
-                decodedTx.data
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/accounts/OVM_ProxyEOA.sol.html b/coverage/OVM/accounts/OVM_ProxyEOA.sol.html deleted file mode 100644 index d8de28f6d..000000000 --- a/coverage/OVM/accounts/OVM_ProxyEOA.sol.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - Code coverage report for OVM/accounts/OVM_ProxyEOA.sol - - - - - - - -
-
-

- all files / OVM/accounts/ OVM_ProxyEOA.sol -

-
-
- 87.5% - Statements - 7/8 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 5/5 -
-
- 88.89% - Lines - 8/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_ProxyEOA
- * @dev The Proxy EOA contract uses a delegate call to execute the logic in an implementation contract.
- * In combination with the logic implemented in the ECDSA Contract Account, this enables a form of upgradable 
- * 'account abstraction' on layer 2. 
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ProxyEOA {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _implementation Address of the initial implementation contract.
-     */
-    constructor(
-        address _implementation
-    )
-    {
-        _setImplementation(_implementation);
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        (bool success, bytes memory returndata) = Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
-            gasleft(),
-            getImplementation(),
-            msg.data
-        );
- 
-        Eif (success) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            Lib_SafeExecutionManagerWrapper.safeREVERT(
-                string(returndata)
-            );
-        }
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Changes the implementation address.
-     * @param _implementation New implementation address.
-     */
-    function upgrade(
-        address _implementation
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_SafeExecutionManagerWrapper.safeADDRESS() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
-            "EOAs can only upgrade their own EOA implementation"
-        );
- 
-        _setImplementation(_implementation);
-    }
- 
-    /**
-     * Gets the address of the current implementation.
-     * @return Current implementation address.
-     */
-    function getImplementation()
-        public
-        returns (
-            address
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                IMPLEMENTATION_KEY
-            )
-        );
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _setImplementation(
-        address _implementation
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            IMPLEMENTATION_KEY,
-            Lib_Bytes32Utils.fromAddress(_implementation)
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/accounts/index.html b/coverage/OVM/accounts/index.html deleted file mode 100644 index a286f49e4..000000000 --- a/coverage/OVM/accounts/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for OVM/accounts/ - - - - - - - -
-
-

- all files OVM/accounts/ -

-
-
- 91.67% - Statements - 22/24 -
-
- 66.67% - Branches - 4/6 -
-
- 100% - Functions - 6/6 -
-
- 92% - Lines - 23/25 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_ECDSAContractAccount.sol
93.75%15/1675%3/4100%1/193.75%15/16
OVM_ProxyEOA.sol
87.5%7/850%1/2100%5/588.89%8/9
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html b/coverage/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html deleted file mode 100644 index 6457a4c5d..000000000 --- a/coverage/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / OVM/bridge/messaging/ Abs_BaseCrossDomainMessenger.sol -

-
-
- 77.78% - Statements - 7/9 -
-
- 50% - Branches - 1/2 -
-
- 80% - Functions - 4/5 -
-
- 77.78% - Lines - 7/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/* Library Imports */
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/**
- * @title Abs_BaseCrossDomainMessenger
- * @dev The Base Cross Domain Messenger is an abstract contract providing the interface and common functionality used in the
- * L1 and L2 Cross Domain Messengers. It can also serve as a template for developers wishing to implement a custom bridge 
- * contract to suit their needs.
- *
- * Compiler used: defined by child contract
- * Runtime target: defined by child contract
- */
-abstract contract Abs_BaseCrossDomainMessenger is iAbs_BaseCrossDomainMessenger, Lib_ReentrancyGuard {
-    /**************
-     *  Constants *
-     **************/
- 
-    // The default x-domain message sender being set to a non-zero value makes
-    // deployment a bit more expensive, but in exchange the refund on every call to
-    // `relayMessage` by the L1 and L2 messengers will be higher.
-    address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    mapping (bytes32 => bool) public relayedMessages;
-    mapping (bytes32 => bool) public successfulMessages;
-    mapping (bytes32 => bool) public sentMessages;
-    uint256 public messageNonce;
-    address internal xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    constructor() Lib_ReentrancyGuard() {}
- 
-    function xDomainMessageSender() public override view returns (address) {
-        Irequire(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set");
-        return xDomainMsgSender;
-    }
- 
-    /**
-     * Sends a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _message Message to send to the target.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function sendMessage(
-        address _target,
-        bytes memory _message,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            msg.sender,
-            _message,
-            messageNonce
-        );
- 
-        messageNonce += 1;
-        sentMessages[keccak256(xDomainCalldata)] = true;
- 
-        _sendXDomainMessage(xDomainCalldata, _gasLimit);
-        emit SentMessage(xDomainCalldata);
-    }
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Generates the correct cross domain calldata for a message.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @return ABI encoded cross domain calldata.
-     */
-    function _getXDomainCalldata(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodeWithSignature(
-            "relayMessage(address,address,bytes,uint256)",
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * param // Message to send.
-     * param // Gas limit for the provided message.
-     */
-    function _sendXDomainMessage(
-        bytes memory, // _message,
-        uint256 // _gasLimit
-    )
-        virtual
-        internal
-    {
-        revert("Implement me in child contracts!");
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html b/coverage/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html deleted file mode 100644 index 07a375b6a..000000000 --- a/coverage/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html +++ /dev/null @@ -1,947 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / OVM/bridge/messaging/ OVM_L1CrossDomainMessenger.sol -

-
-
- 100% - Statements - 30/30 -
-
- 75% - Branches - 12/16 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 31/31 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -12× -12× -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  - -  -  -  -  - - - -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_AddressManager } from "../../../libraries/resolver/Lib_AddressManager.sol";
-import { Lib_SecureMerkleTrie } from "../../../libraries/trie/Lib_SecureMerkleTrie.sol";
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-import { iOVM_CanonicalTransactionChain } from "../../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_StateCommitmentChain } from "../../../iOVM/chain/iOVM_StateCommitmentChain.sol";
- 
-/* Contract Imports */
-import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_L1CrossDomainMessenger
- * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. 
- * In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted 
- * via this contract's replay function. 
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * Pass a default zero address to the address resolver. This will be updated when initialized.
-     */
-    constructor()
-        Lib_AddressResolver(address(0))
-    {}
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    function initialize(
-        address _libAddressManager
-    )
-        public
-    {
-        Erequire(address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized.");
-        libAddressManager = Lib_AddressManager(_libAddressManager);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may successfully call a method.
-     */
-    modifier onlyRelayer() {
-        address relayer = resolve("OVM_L2MessageRelayer");
-        if (relayer != address(0)) {
-            Irequire(
-                msg.sender == relayer,
-                "Only OVM_L2MessageRelayer can relay L2-to-L1 messages."
-            );
-        }
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @inheritdoc iOVM_L1CrossDomainMessenger
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        L2MessageInclusionProof memory _proof
-    )
-        override
-        public
-        nonReentrant
-        onlyRelayer()
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        require(
-            _verifyXDomainMessage(
-                xDomainCalldata,
-                _proof
-            ) == true,
-            "Provided message could not be verified."
-        );
- 
-        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
- 
-        require(
-            successfulMessages[xDomainCalldataHash] == false,
-            "Provided message has already been received."
-        );
- 
-        xDomainMsgSender = _sender;
-        (bool success, ) = _target.call(_message);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-        // Mark the message as received if the call was successful. Ensures that a message can be
-        // relayed multiple times in the case that the call reverted.
-        Eif (success == true) {
-            successfulMessages[xDomainCalldataHash] = true;
-            emit RelayedMessage(xDomainCalldataHash);
-        }
- 
-        // Store an identifier that can be used to prove that the given message was relayed by some
-        // user. Gives us an easy way to pay relayers for their work.
-        bytes32 relayId = keccak256(
-            abi.encodePacked(
-                xDomainCalldata,
-                msg.sender,
-                block.number
-            )
-        );
-        relayedMessages[relayId] = true;
-    }
- 
-    /**
-     * Replays a cross domain message to the target messenger.
-     * @inheritdoc iOVM_L1CrossDomainMessenger
-     */
-    function replayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        require(
-            sentMessages[keccak256(xDomainCalldata)] == true,
-            "Provided message has not already been sent."
-        );
- 
-        _sendXDomainMessage(xDomainCalldata, _gasLimit);
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Verifies that the given message is valid.
-     * @param _xDomainCalldata Calldata to verify.
-     * @param _proof Inclusion proof for the message.
-     * @return Whether or not the provided message is valid.
-     */
-    function _verifyXDomainMessage(
-        bytes memory _xDomainCalldata,
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        return (
-            _verifyStateRootProof(_proof)
-            && _verifyStorageProof(_xDomainCalldata, _proof)
-        );
-    }
- 
-    /**
-     * Verifies that the state root within an inclusion proof is valid.
-     * @param _proof Message inclusion proof.
-     * @return Whether or not the provided proof is valid.
-     */
-    function _verifyStateRootProof(
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
- 
-        return (
-            ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) == false
-            && ovmStateCommitmentChain.verifyStateCommitment(
-                _proof.stateRoot,
-                _proof.stateRootBatchHeader,
-                _proof.stateRootProof
-            )
-        );
-    }
- 
-    /**
-     * Verifies that the storage proof within an inclusion proof is valid.
-     * @param _xDomainCalldata Encoded message calldata.
-     * @param _proof Message inclusion proof.
-     * @return Whether or not the provided proof is valid.
-     */
-    function _verifyStorageProof(
-        bytes memory _xDomainCalldata,
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 storageKey = keccak256(
-            abi.encodePacked(
-                keccak256(
-                    abi.encodePacked(
-                        _xDomainCalldata,
-                        resolve("OVM_L2CrossDomainMessenger")
-                    )
-                ),
-                uint256(0)
-            )
-        );
- 
-        (
-            bool exists,
-            bytes memory encodedMessagePassingAccount
-        ) = Lib_SecureMerkleTrie.get(
-            abi.encodePacked(0x4200000000000000000000000000000000000000),
-            _proof.stateTrieWitness,
-            _proof.stateRoot
-        );
- 
-        Erequire(
-            exists == true,
-            "Message passing predeploy has not been initialized or invalid proof provided."
-        );
- 
-        Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
-            encodedMessagePassingAccount
-        );
- 
-        return Lib_SecureMerkleTrie.verifyInclusionProof(
-            abi.encodePacked(storageKey),
-            abi.encodePacked(uint8(1)),
-            _proof.storageTrieWitness,
-            account.storageRoot
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * @param _message Message to send.
-     * @param _gasLimit OVM gas limit for the message.
-     */
-    function _sendXDomainMessage(
-        bytes memory _message,
-        uint256 _gasLimit
-    )
-        override
-        internal
-    {
-        iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).enqueue(
-            resolve("OVM_L2CrossDomainMessenger"),
-            _gasLimit,
-            _message
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html b/coverage/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html deleted file mode 100644 index 421554d4f..000000000 --- a/coverage/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol - - - - - - - -
-
-

- all files / OVM/bridge/messaging/ OVM_L1MultiMessageRelayer.sol -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 6/6 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-import { iOVM_L1MultiMessageRelayer } from "../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol";
- 
-/* Contract Imports */
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
- 
- 
-/**
- * @title OVM_L1MultiMessageRelayer
- * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the 
- * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain
- * Message Sender.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
-    constructor(
-        address _libAddressManager
-    ) 
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyBatchRelayer() {
-        require(
-            msg.sender == resolve("OVM_L2BatchMessageRelayer"),
-            "OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer"
-        );
-        _;
-    }
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying
-     * @param _messages An array of L2 to L1 messages
-     */
-    function batchRelayMessages(L2ToL1Message[] calldata _messages) 
-        override
-        external
-        onlyBatchRelayer 
-    {
-        iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(resolve("Proxy__OVM_L1CrossDomainMessenger"));
-        for (uint256 i = 0; i < _messages.length; i++) {
-            L2ToL1Message memory message = _messages[i];
-            messenger.relayMessage(
-                message.target,
-                message.sender,
-                message.message,
-                message.messageNonce,
-                message.proof
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html b/coverage/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html deleted file mode 100644 index 16a8bd88d..000000000 --- a/coverage/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / OVM/bridge/messaging/ OVM_L2CrossDomainMessenger.sol -

-
-
- 100% - Statements - 14/14 -
-
- 83.33% - Branches - 5/6 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 14/14 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  - -  - -  -  -  -  - - - -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/* Interface Imports */
-import { iOVM_L2CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol";
-import { iOVM_L1MessageSender } from "../../../iOVM/predeploys/iOVM_L1MessageSender.sol";
-import { iOVM_L2ToL1MessagePasser } from "../../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
- 
-/* Contract Imports */
-import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_L2CrossDomainMessenger
- * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point
- * for L2 messages sent via the L1 Cross Domain Messenger.
- * 
- * Compiler used: optimistic-solc
- * Runtime target: OVM
-  */
-contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @inheritdoc iOVM_L2CrossDomainMessenger
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    )
-        override
-        nonReentrant
-        public
-    {
-        require(
-            _verifyXDomainMessage() == true,
-            "Provided message could not be verified."
-        );
- 
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
- 
-        require(
-            successfulMessages[xDomainCalldataHash] == false,
-            "Provided message has already been received."
-        );
- 
-        xDomainMsgSender = _sender;
-        (bool success, ) = _target.call(_message);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-        // Mark the message as received if the call was successful. Ensures that a message can be
-        // relayed multiple times in the case that the call reverted.
-        Eif (success == true) {
-            successfulMessages[xDomainCalldataHash] = true;
-            emit RelayedMessage(xDomainCalldataHash);
-        }
- 
-        // Store an identifier that can be used to prove that the given message was relayed by some
-        // user. Gives us an easy way to pay relayers for their work.
-        bytes32 relayId = keccak256(
-            abi.encodePacked(
-                xDomainCalldata,
-                msg.sender,
-                block.number
-            )
-        );
-        relayedMessages[relayId] = true;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Verifies that a received cross domain message is valid.
-     * @return _valid Whether or not the message is valid.
-     */
-    function _verifyXDomainMessage()
-        view
-        internal
-        returns (
-            bool _valid
-        )
-    {
-        return (
-            iOVM_L1MessageSender(resolve("OVM_L1MessageSender")).getL1MessageSender() == resolve("OVM_L1CrossDomainMessenger")
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * @param _message Message to send.
-     * param _gasLimit Gas limit for the provided message.
-     */
-    function _sendXDomainMessage(
-        bytes memory _message,
-        uint256 // _gasLimit
-    )
-        override
-        internal
-    {
-        iOVM_L2ToL1MessagePasser(resolve("OVM_L2ToL1MessagePasser")).passMessageToL1(_message);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/messaging/index.html b/coverage/OVM/bridge/messaging/index.html deleted file mode 100644 index d1b88f421..000000000 --- a/coverage/OVM/bridge/messaging/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/ - - - - - - - -
-
-

- all files OVM/bridge/messaging/ -

-
-
- 96.55% - Statements - 56/58 -
-
- 76.92% - Branches - 20/26 -
-
- 95.24% - Functions - 20/21 -
-
- 96.67% - Lines - 58/60 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_BaseCrossDomainMessenger.sol
77.78%7/950%1/280%4/577.78%7/9
OVM_L1CrossDomainMessenger.sol
100%30/3075%12/16100%9/9100%31/31
OVM_L1MultiMessageRelayer.sol
100%5/5100%2/2100%3/3100%6/6
OVM_L2CrossDomainMessenger.sol
100%14/1483.33%5/6100%4/4100%14/14
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html b/coverage/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html deleted file mode 100644 index d4b0621e5..000000000 --- a/coverage/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html +++ /dev/null @@ -1,692 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/Abs_L1TokenGateway.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ Abs_L1TokenGateway.sol -

-
-
- 83.33% - Statements - 10/12 -
-
- 100% - Branches - 0/0 -
-
- 75% - Functions - 6/8 -
-
- 83.33% - Lines - 10/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm 
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
- 
-/**
- * @title Abs_L1TokenGateway
- * @dev An L1 Token Gateway is a contract which stores deposited L1 funds that are in use on L2.
- * It synchronizes a corresponding L2 representation of the "deposited token", informing it
- * of new deposits and releasing L1 funds when there are newly finalized withdrawals.
- *
- * NOTE: This abstract contract gives all the core functionality of an L1 token gateway, 
- * but provides easy hooks in case developers need extensions in child contracts.
- * In many cases, the default OVM_L1ERC20Gateway will suffice.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-abstract contract Abs_L1TokenGateway is iOVM_L1TokenGateway, OVM_CrossDomainEnabled {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    address public l2DepositedToken;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l2DepositedToken iOVM_L2DepositedToken-compatible address on the chain being deposited into.
-     * @param _l1messenger L1 Messenger address being used for cross-chain communications.
-     */
-    constructor(
-        address _l2DepositedToken,
-        address _l1messenger 
-    )
-        OVM_CrossDomainEnabled(_l1messenger)
-    {
-        l2DepositedToken = _l2DepositedToken;
-    }
- 
-    /********************************
-     * Overridable Accounting logic *
-     ********************************/
- 
-    // Default gas value which can be overridden if more complex logic runs on L2.
-    uint32 public DEFAULT_FINALIZE_DEPOSIT_L2_GAS = 1200000;
- 
-    /**
-     * @dev Core logic to be performed when a withdrawal is finalized on L1.
-     * In most cases, this will simply send locked funds to the withdrawer.
-     *
-     * param _to Address being withdrawn to.
-     * param _amount Amount being withdrawn.
-     */
-    function _handleFinalizeWithdrawal(
-        address, // _to,
-        uint256 // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Implement me in child contracts");
-    }
- 
-    /**
-     * @dev Core logic to be performed when a deposit is initiated on L1.
-     * In most cases, this will simply send locked funds to the withdrawer.
-     *
-     * param _from Address being deposited from on L1.
-     * param _to Address being deposited into on L2.
-     * param _amount Amount being deposited.
-     */
-    function _handleInitiateDeposit(
-        address, // _from,
-        address, // _to,
-        uint256 // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Implement me in child contracts");
-    }
- 
-    /**
-     * @dev Overridable getter for the L2 gas limit, in the case it may be
-     * dynamic, and the above public constant does not suffice.
-     *
-     */
- 
-    function getFinalizeDepositL2Gas()
-        public
-        view
-        returns(
-            uint32
-        )
-    {
-        return DEFAULT_FINALIZE_DEPOSIT_L2_GAS;
-    }
- 
-    /**************
-     * Depositing *
-     **************/
- 
-    /**
-     * @dev deposit an amount of the ERC20 to the caller's balance on L2
-     * @param _amount Amount of the ERC20 to deposit
-     */
-    function deposit(
-        uint _amount
-    )
-        public
-        override
-    {
-        _initiateDeposit(msg.sender, msg.sender, _amount);
-    }
- 
-    /**
-     * @dev deposit an amount of ERC20 to a recipients's balance on L2
-     * @param _to L2 address to credit the withdrawal to
-     * @param _amount Amount of the ERC20 to deposit
-     */
-    function depositTo(
-        address _to,
-        uint _amount
-    )
-        public
-        override
-    {
-        _initiateDeposit(msg.sender, _to, _amount);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by informing the L2 Deposited Token
-     * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)
-     *
-     * @param _from Account to pull the deposit from on L1
-     * @param _to Account to give the deposit to on L2
-     * @param _amount Amount of the ERC20 to deposit.
-     */
-    function _initiateDeposit(
-        address _from,
-        address _to,
-        uint _amount
-    )
-        internal
-    {
-        // Call our deposit accounting handler implemented by child contracts.
-        _handleInitiateDeposit(
-            _from,
-            _to,
-            _amount
-        );
- 
-        // Construct calldata for l2DepositedToken.finalizeDeposit(_to, _amount)
-        bytes memory data = abi.encodeWithSelector(
-            iOVM_L2DepositedToken.finalizeDeposit.selector,
-            _to,
-            _amount
-        );
- 
-        // Send calldata into L2
-        sendCrossDomainMessage(
-            l2DepositedToken,
-            data,
-            getFinalizeDepositL2Gas()
-        );
- 
-        emit DepositInitiated(_from, _to, _amount);
-    }
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    /**
-     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the 
-     * L1 ERC20 token. 
-     * This call will fail if the initialized withdrawal from L2 has not been finalized. 
-     *
-     * @param _to L1 address to credit the withdrawal to
-     * @param _amount Amount of the ERC20 to withdraw
-     */
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external
-        override 
-        onlyFromCrossDomainAccount(l2DepositedToken)
-    {
-        // Call our withdrawal accounting handler implemented by child contracts.
-        _handleFinalizeWithdrawal(
-            _to,
-            _amount
-        );
- 
-        emit WithdrawalFinalized(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html b/coverage/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html deleted file mode 100644 index ba6d6780c..000000000 --- a/coverage/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html +++ /dev/null @@ -1,755 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/Abs_L2DepositedToken.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ Abs_L2DepositedToken.sol -

-
-
- 86.67% - Statements - 13/15 -
-
- 50% - Branches - 2/4 -
-
- 80% - Functions - 8/10 -
-
- 87.5% - Lines - 14/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  - -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
- 
-/**
- * @title Abs_L2DepositedToken
- * @dev An L2 Deposited Token is an L2 representation of funds which were deposited from L1.
- * Usually contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
- * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
- *
- * NOTE: This abstract contract gives all the core functionality of a deposited token implementation except for the
- * token's internal accounting itself.  This gives developers an easy way to implement children with their own token code.
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-abstract contract Abs_L2DepositedToken is iOVM_L2DepositedToken, OVM_CrossDomainEnabled {
- 
-    /*******************
-     * Contract Events *
-     *******************/
- 
-    event Initialized(iOVM_L1TokenGateway _l1TokenGateway);
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    iOVM_L1TokenGateway public l1TokenGateway;
- 
-    /********************************
-     * Constructor & Initialization *
-     ********************************/
- 
-    /**
-     * @param _l2CrossDomainMessenger L1 Messenger address being used for cross-chain communications.
-     */
-    constructor(
-        address _l2CrossDomainMessenger
-    )
-        OVM_CrossDomainEnabled(_l2CrossDomainMessenger)
-    {}
- 
-    /**
-     * @dev Initialize this contract with the L1 token gateway address.
-     * The flow: 1) this contract gets deployed on L2, 2) the L1
-     * gateway is deployed with addr from (1), 3) L1 gateway address passed here.
-     *
-     * @param _l1TokenGateway Address of the corresponding L1 gateway deployed to the main chain
-     */
- 
-    function init(
-        iOVM_L1TokenGateway _l1TokenGateway
-    )
-        public
-    {
-        Erequire(address(l1TokenGateway) == address(0), "Contract has already been initialized");
- 
-        l1TokenGateway = _l1TokenGateway;
-        
-        emit Initialized(l1TokenGateway);
-    }
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyInitialized() {
-        Erequire(address(l1TokenGateway) != address(0), "Contract has not yet been initialized");
-        _;
-    }
- 
-    /********************************
-     * Overridable Accounting logic *
-     ********************************/
- 
-    // Default gas value which can be overridden if more complex logic runs on L2.
-    uint32 constant DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS = 100000;
- 
-    /**
-     * @dev Core logic to be performed when a withdrawal from L2 is initialized.
-     * In most cases, this will simply burn the withdrawn L2 funds.
-     *
-     * param _to Address being withdrawn to
-     * param _amount Amount being withdrawn
-     */
- 
-    function _handleInitiateWithdrawal(
-        address, // _to,
-        uint // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Accounting must be implemented by child contract.");
-    }
- 
-    /**
-     * @dev Core logic to be performed when a deposit from L2 is finalized on L2.
-     * In most cases, this will simply _mint() to credit L2 funds to the recipient.
-     *
-     * param _to Address being deposited to on L2
-     * param _amount Amount which was deposited on L1
-     */
-    function _handleFinalizeDeposit(
-        address, // _to
-        uint // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Accounting must be implemented by child contract.");
-    }
- 
-    /**
-     * @dev Overridable getter for the *L1* gas limit of settling the withdrawal, in the case it may be
-     * dynamic, and the above public constant does not suffice.
-     *
-     */
- 
-    function getFinalizeWithdrawalL1Gas()
-        public
-        view
-        virtual
-        returns(
-            uint32
-        )
-    {
-        return DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS;
-    }
- 
- 
-    /***************
-     * Withdrawing *
-     ***************/
- 
-    /**
-     * @dev initiate a withdraw of some tokens to the caller's account on L1
-     * @param _amount Amount of the token to withdraw
-     */
-    function withdraw(
-        uint _amount
-    )
-        external
-        override
-        onlyInitialized()
-    {
-        _initiateWithdrawal(msg.sender, _amount);
-    }
- 
-    /**
-     * @dev initiate a withdraw of some token to a recipient's account on L1
-     * @param _to L1 adress to credit the withdrawal to
-     * @param _amount Amount of the token to withdraw
-     */
-    function withdrawTo(
-        address _to,
-        uint _amount
-    )
-        external
-        override
-        onlyInitialized()
-    {
-        _initiateWithdrawal(_to, _amount);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by storing the token and informing the L2 token Gateway of the deposit.
-     *
-     * @param _to Account to give the withdrawal to on L1
-     * @param _amount Amount of the token to withdraw
-     */
-    function _initiateWithdrawal(
-        address _to,
-        uint _amount
-    )
-        internal
-    {
-        // Call our withdrawal accounting handler implemented by child contracts (usually a _burn)
-        _handleInitiateWithdrawal(_to, _amount);
- 
-        // Construct calldata for l1TokenGateway.finalizeWithdrawal(_to, _amount)
-        bytes memory data = abi.encodeWithSelector(
-            iOVM_L1TokenGateway.finalizeWithdrawal.selector,
-            _to,
-            _amount
-        );
- 
-        // Send message up to L1 gateway
-        sendCrossDomainMessage(
-            address(l1TokenGateway),
-            data,
-            getFinalizeWithdrawalL1Gas()
-        );
- 
-        emit WithdrawalInitiated(msg.sender, _to, _amount);
-    }
- 
-    /************************************
-     * Cross-chain Function: Depositing *
-     ************************************/
- 
-    /**
-     * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this 
-     * L2 token. 
-     * This call will fail if it did not originate from a corresponding deposit in OVM_l1TokenGateway. 
-     *
-     * @param _to Address to receive the withdrawal at
-     * @param _amount Amount of the token to withdraw
-     */
-    function finalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        external
-        override 
-        onlyInitialized()
-        onlyFromCrossDomainAccount(address(l1TokenGateway))
-    {
-        _handleFinalizeDeposit(_to, _amount);
-        emit DepositFinalized(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html b/coverage/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html deleted file mode 100644 index ca0c061f1..000000000 --- a/coverage/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/OVM_L1ERC20Gateway.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ OVM_L1ERC20Gateway.sol -

-
-
- 100% - Statements - 3/3 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 3/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm 
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
-import { Abs_L1TokenGateway } from "./Abs_L1TokenGateway.sol";
-import { iOVM_ERC20 } from "../../../iOVM/predeploys/iOVM_ERC20.sol";
- 
-/**
- * @title OVM_L1ERC20Gateway
- * @dev The L1 ERC20 Gateway is a contract which stores deposited L1 funds that are in use on L2.
- * It synchronizes a corresponding L2 ERC20 Gateway, informing it of deposits, and listening to it
- * for newly finalized withdrawals.
- *
- * NOTE: This contract extends Abs_L1TokenGateway, which is where we
- * takes care of most of the initialization and the cross-chain logic.
- * If you are looking to implement your own deposit/withdrawal contracts, you
- * may also want to extend the abstract contract in a similar manner.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1ERC20Gateway is Abs_L1TokenGateway {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
-    
-    iOVM_ERC20 public l1ERC20;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l1ERC20 L1 ERC20 address this contract stores deposits for
-     * @param _l2DepositedERC20 L2 Gateway address on the chain being deposited into
-     */
-    constructor(
-        iOVM_ERC20 _l1ERC20,
-        address _l2DepositedERC20,
-        address _l1messenger 
-    )
-        Abs_L1TokenGateway(
-            _l2DepositedERC20,
-            _l1messenger
-        )
-    {
-        l1ERC20 = _l1ERC20;
-    }
- 
- 
-    /**************
-     * Accounting *
-     **************/
- 
-    /**
-     * @dev When a deposit is initiated on L1, the L1 Gateway
-     * transfers the funds to itself for future withdrawals
-     *
-     * @param _from L1 address ETH is being deposited from
-     * param _to L2 address that the ETH is being deposited to
-     * @param _amount Amount of ERC20 to send
-     */
-    function _handleInitiateDeposit(
-        address _from,
-        address, // _to,
-        uint256 _amount
-    )
-        internal
-        override
-    {
-         // Hold on to the newly deposited funds
-        l1ERC20.transferFrom(
-            _from,
-            address(this),
-            _amount
-        );
-    }
- 
-    /**
-     * @dev When a withdrawal is finalized on L1, the L1 Gateway
-     * transfers the funds to the withdrawer
-     *
-     * @param _to L1 address that the ERC20 is being withdrawn to
-     * @param _amount Amount of ERC20 to send
-     */
-    function _handleFinalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        // Transfer withdrawn funds out to withdrawer
-        l1ERC20.transfer(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html b/coverage/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html deleted file mode 100644 index af1be607b..000000000 --- a/coverage/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html +++ /dev/null @@ -1,557 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/OVM_L1ETHGateway.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ OVM_L1ETHGateway.sol -

-
-
- 100% - Statements - 11/11 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 6/6 -
-
- 91.67% - Lines - 11/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1ETHGateway } from "../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol";
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/**
- * @title OVM_L1ETHGateway
- * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {
- 
-    /********************
-     * Public Constants *
-     ********************/
- 
-    uint32 public constant override getFinalizeDepositL2Gas = 1200000;
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    address public ovmEth;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address manager for this OE deployment
-     * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken
-     */
-    constructor(
-        address _libAddressManager,
-        address _ovmEth
-    )
-        OVM_CrossDomainEnabled(address(0)) // overridden in constructor code
-        Lib_AddressResolver(_libAddressManager)
-    {
-        ovmEth = _ovmEth;
-        messenger = resolve("Proxy__OVM_L1CrossDomainMessenger"); // overrides OVM_CrossDomainEnabled constructor setting because resolve() is not yet accessible
-    }
- 
-    /**************
-     * Depositing *
-     **************/
- 
-    receive()
-        external
-        payable
-    {
-        _initiateDeposit(msg.sender, msg.sender);
-    }
- 
-    /**
-     * @dev deposit an amount of the ETH to the caller's balance on L2
-     */
-    function deposit() 
-        external
-        override
-        payable
-    {
-        _initiateDeposit(msg.sender, msg.sender);
-    }
- 
-    /**
-     * @dev deposit an amount of ETH to a recipients's balance on L2
-     * @param _to L2 address to credit the withdrawal to
-     */
-    function depositTo(
-        address _to
-    )
-        external
-        override
-        payable
-    {
-        _initiateDeposit(msg.sender, _to);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.
-     *
-     * @param _from Account to pull the deposit from on L1
-     * @param _to Account to give the deposit to on L2
-     */
-    function _initiateDeposit(
-        address _from,
-        address _to
-    )
-        internal
-    {
-        // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)
-        bytes memory data =
-            abi.encodeWithSelector(
-                iOVM_L2DepositedToken.finalizeDeposit.selector,
-                _to,
-                msg.value
-            );
- 
-        // Send calldata into L2
-        sendCrossDomainMessage(
-            ovmEth,
-            data,
-            getFinalizeDepositL2Gas
-        );
- 
-        emit DepositInitiated(_from, _to, msg.value);
-    }
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    /**
-     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the
-     * L1 ETH token.
-     * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized. 
-     *
-     * @param _to L1 address to credit the withdrawal to
-     * @param _amount Amount of the ETH to withdraw
-     */
-    function finalizeWithdrawal(
-        address _to,
-        uint256 _amount
-    )
-        external
-        override
-        onlyFromCrossDomainAccount(ovmEth)
-    {
-        _safeTransferETH(_to, _amount);
- 
-        emit WithdrawalFinalized(_to, _amount);
-    }
- 
-    /**********************************
-     * Internal Functions: Accounting *
-     **********************************/
- 
-    /**
-     * @dev Internal accounting function for moving around L1 ETH.
-     *
-     * @param _to L1 address to transfer ETH to
-     * @param _value Amount of ETH to send to
-     */
-    function _safeTransferETH(
-        address _to,
-        uint256 _value
-    )
-        internal
-    {
-        (bool success, ) = _to.call{value: _value}(new bytes(0));
-        Erequire(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html b/coverage/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html deleted file mode 100644 index 74ff02ea8..000000000 --- a/coverage/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/OVM_L2DepositedERC20.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ OVM_L2DepositedERC20.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Contract Imports */
-import { UniswapV2ERC20 } from "../../../libraries/standards/UniswapV2ERC20.sol";
- 
-/* Library Imports */
-import { Abs_L2DepositedToken } from "./Abs_L2DepositedToken.sol";
- 
-/**
- * @title OVM_L2DepositedERC20
- * @dev The L2 Deposited ERC20 is an ERC20 implementation which represents L1 assets deposited into L2.
- * This contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
- * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
- *
- * NOTE: This contract implements the Abs_L2DepositedToken contract using Uniswap's ERC20 as the implementation.
- * Alternative implementations can be used in this similar manner.
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract OVM_L2DepositedERC20 is Abs_L2DepositedToken, UniswapV2ERC20 {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.
-     * @param _name ERC20 name
-     * @param _symbol ERC20 symbol
-     */
-    constructor(
-        address _l2CrossDomainMessenger,
-        string memory _name,
-        string memory _symbol
-    )
-        Abs_L2DepositedToken(_l2CrossDomainMessenger)
-        UniswapV2ERC20(_name, _symbol)
-    {}
- 
-    // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2 usage.
-    function _handleInitiateWithdrawal(
-        address, // _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        _burn(msg.sender, _amount);
-    }
- 
-    // When a deposit is finalized, we credit the account on L2 with the same amount of tokens.
-    function _handleFinalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        _mint(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/bridge/tokens/index.html b/coverage/OVM/bridge/tokens/index.html deleted file mode 100644 index 81e37f18b..000000000 --- a/coverage/OVM/bridge/tokens/index.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/ - - - - - - - -
-
-

- all files OVM/bridge/tokens/ -

-
-
- 90.7% - Statements - 39/43 -
-
- 50% - Branches - 3/6 -
-
- 86.67% - Functions - 26/30 -
-
- 88.89% - Lines - 40/45 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_L1TokenGateway.sol
83.33%10/12100%0/075%6/883.33%10/12
Abs_L2DepositedToken.sol
86.67%13/1550%2/480%8/1087.5%14/16
OVM_L1ERC20Gateway.sol
100%3/3100%0/0100%3/3100%3/3
OVM_L1ETHGateway.sol
100%11/1150%1/2100%6/691.67%11/12
OVM_L2DepositedERC20.sol
100%2/2100%0/0100%3/3100%2/2
-
-
- - - - - - - diff --git a/coverage/OVM/chain/OVM_CanonicalTransactionChain.sol.html b/coverage/OVM/chain/OVM_CanonicalTransactionChain.sol.html deleted file mode 100644 index c0026a36e..000000000 --- a/coverage/OVM/chain/OVM_CanonicalTransactionChain.sol.html +++ /dev/null @@ -1,3755 +0,0 @@ - - - - Code coverage report for OVM/chain/OVM_CanonicalTransactionChain.sol - - - - - - - -
-
-

- all files / OVM/chain/ OVM_CanonicalTransactionChain.sol -

-
-
- 95.51% - Statements - 149/156 -
-
- 87.5% - Branches - 63/72 -
-
- 84.38% - Functions - 27/32 -
-
- 95.88% - Lines - 163/170 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -222× -222× -222× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -559× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -382× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -291× -291× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -100× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -47× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -239× -  -  -  -  -238× -  -  -  -  -237× -  -  -  -  -  -  -  -236× -236× -  -  -  -236× -  -  -  -  -  -  -235× -235× -37600× -  -  -235× -  -  -  -  -  -  -  -  -235× -235× -  -  -  -  -235× -  -235× -235× -  -  -  -  -235× -235× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -104× -104× -104× -104× -  -  -  -  -  -104× -  -  -  -  -103× -  -  -  -  -102× -  -  -  -  -101× -  -  -  -  -100× -  -100× -  -  -  -  -  -  -  -100× -100× -  -  -  -  -100× -  -  -100× -  -  -100× -  -  -100× -  -  -  -100× -  -100× -100× -232× -  -232× -  -100× -  -  -  -226× -  -  -  -  -  -  -  -221× -  -  -221× -439× -439× -  -  -  -439× -  -  -  -  -  -  -439× -439× -439× -  -  -  -221× -179× -  -  -  -  -178× -178× -178× -  -  -  -88× -  -  -  -  -  -  -82× -  -  -  -  -81× -  -  -  -  -  -81× -81× -81× -81× -  -39× -39× -  -  -  -  -  -42× -  -  -  -  -42× -42× -  -  -  -  -  -81× -  -  -  -  -  -  -  -81× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -232× -232× -232× -232× -232× -  -232× -  -  -  -  -  -  -232× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -476× -  -476× -476× -476× -476× -476× -  -  -  -  -  -  -  -476× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -81× -81× -  -  -  -  -  -  -  -81× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -179× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -267× -267× -265× -  -265× -265× -265× -  -  -  -  -265× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -439× -419× -  -  -439× -439× -  -439× -439× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -439× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -81× -81× -  -81× -  -  -  -  -  -  -  -81× -  -  -  -  -  -  -  -81× -81× -  -  -  -  -  -  -81× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× - -  - -  -  -  -  - -  -  -  -  -  -  -96× -  -  -  -  -95× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -178× -  -  -  -  -  -177× -  -  -  -  -  -  -176× -  -  -  -  -174× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -226× -  -  -  -  -225× -  -  -  -  -  -224× -175× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -88× - -  -  -  -  -  -  -85× -83× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -179× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
-import { Lib_Math } from "../../libraries/utils/Lib_Math.sol";
- 
-/* Interface Imports */
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/* Contract Imports */
-import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
- 
- 
-/**
- * @title OVM_CanonicalTransactionChain
- * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions
- * which must be applied to the rollup state. It defines the ordering of rollup transactions by
- * writing them to the 'CTC:batches' instance of the Chain Storage Container.
- * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer
- * will eventually append it to the rollup state.
- * If the Sequencer does not include an enqueued transaction within the 'force inclusion period',
- * then any account may force it to be included by calling appendQueueBatch().
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_AddressResolver {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    // L2 tx gas-related
-    uint256 constant public MIN_ROLLUP_TX_GAS = 100000;
-    uint256 constant public MAX_ROLLUP_TX_SIZE = 10000;
-    uint256 constant public L2_GAS_DISCOUNT_DIVISOR = 32;
- 
-    // Encoding-related (all in bytes)
-    uint256 constant internal BATCH_CONTEXT_SIZE = 16;
-    uint256 constant internal BATCH_CONTEXT_LENGTH_POS = 12;
-    uint256 constant internal BATCH_CONTEXT_START_POS = 15;
-    uint256 constant internal TX_DATA_HEADER_SIZE = 3;
-    uint256 constant internal BYTES_TILL_TX_DATA = 65;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    uint256 public forceInclusionPeriodSeconds;
-    uint256 public forceInclusionPeriodBlocks;
-    uint256 public maxTransactionGasLimit;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    constructor(
-        address _libAddressManager,
-        uint256 _forceInclusionPeriodSeconds,
-        uint256 _forceInclusionPeriodBlocks,
-        uint256 _maxTransactionGasLimit
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        forceInclusionPeriodSeconds = _forceInclusionPeriodSeconds;
-        forceInclusionPeriodBlocks = _forceInclusionPeriodBlocks;
-        maxTransactionGasLimit = _maxTransactionGasLimit;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        override
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:CTC:batches")
-        );
-    }
- 
-    /**
-     * Accesses the queue storage container.
-     * @return Reference to the queue storage container.
-     */
-    function queue()
-        override
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:CTC:queue")
-        );
-    }
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        override
-        public
-        view
-        returns (
-            uint256 _totalElements
-        )
-    {
-        (uint40 totalElements,,,) = _getBatchExtraData();
-        return uint256(totalElements);
-    }
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        override
-        public
-        view
-        returns (
-            uint256 _totalBatches
-        )
-    {
-        return batches().length();
-    }
- 
-    /**
-     * Returns the index of the next element to be enqueued.
-     * @return Index for the next queue element.
-     */
-    function getNextQueueIndex()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,uint40 nextQueueIndex,,) = _getBatchExtraData();
-        return nextQueueIndex;
-    }
- 
-    /**
-     * Returns the timestamp of the last transaction.
-     * @return Timestamp for the last transaction.
-     */
-    function getLastTimestamp()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,,uint40 lastTimestamp,) = _getBatchExtraData();
-        return lastTimestamp;
-    }
- 
-    /**
-     * Returns the blocknumber of the last transaction.
-     * @return Blocknumber for the last transaction.
-     */
-    function getLastBlockNumber()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,,,uint40 lastBlockNumber) = _getBatchExtraData();
-        return lastBlockNumber;
-    }
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function getQueueElement(
-        uint256 _index
-    )
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        )
-    {
-        return _getQueueElement(
-            _index,
-            queue()
-        );
-    }
- 
-    /**
-     * Get the number of queue elements which have not yet been included.
-     * @return Number of pending queue elements.
-     */
-    function getNumPendingQueueElements()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        return getQueueLength() - getNextQueueIndex();
-    }
- 
-   /**
-     * Retrieves the length of the queue, including
-     * both pending and canonical transactions.
-     * @return Length of the queue.
-     */
-    function getQueueLength()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        return _getQueueLength(
-            queue()
-        );
-    }
- 
-    /**
-     * Adds a transaction to the queue.
-     * @param _target Target L2 contract to send the transaction to.
-     * @param _gasLimit Gas limit for the enqueued L2 transaction.
-     * @param _data Transaction data.
-     */
-    function enqueue(
-        address _target,
-        uint256 _gasLimit,
-        bytes memory _data
-    )
-        override
-        public
-    {
-        require(
-            _data.length <= MAX_ROLLUP_TX_SIZE,
-            "Transaction data size exceeds maximum for rollup transaction."
-        );
- 
-        require(
-            _gasLimit <= maxTransactionGasLimit,
-            "Transaction gas limit exceeds maximum for rollup transaction."
-        );
- 
-        require(
-            _gasLimit >= MIN_ROLLUP_TX_GAS,
-            "Transaction gas limit too low to enqueue."
-        );
- 
-        // We need to consume some amount of L1 gas in order to rate limit transactions going into
-        // L2. However, L2 is cheaper than L1 so we only need to burn some small proportion of the
-        // provided L1 gas.
-        uint256 gasToConsume = _gasLimit/L2_GAS_DISCOUNT_DIVISOR;
-        uint256 startingGas = gasleft();
- 
-        // Although this check is not necessary (burn below will run out of gas if not true), it
-        // gives the user an explicit reason as to why the enqueue attempt failed.
-        require(
-            startingGas > gasToConsume,
-            "Insufficient gas for L2 rate limiting burn."
-        );
- 
-        // Here we do some "dumb" work in order to burn gas, although we should probably replace
-        // this with something like minting gas token later on.
-        uint256 i;
-        while(startingGas - gasleft() < gasToConsume) {
-            i++;
-        }
- 
-        bytes32 transactionHash = keccak256(
-            abi.encode(
-                msg.sender,
-                _target,
-                _gasLimit,
-                _data
-            )
-        );
- 
-        bytes32 timestampAndBlockNumber;
-        assembly {
-            timestampAndBlockNumber := timestamp()
-            timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
-        }
- 
-        iOVM_ChainStorageContainer queueRef = queue();
- 
-        queueRef.push(transactionHash);
-        queueRef.push(timestampAndBlockNumber);
- 
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the real queue length we need
-        // to divide by 2 and subtract 1.
-        uint256 queueIndex = queueRef.length() / 2 - 1;
-        emit TransactionEnqueued(
-            msg.sender,
-            _target,
-            _gasLimit,
-            _data,
-            queueIndex,
-            block.timestamp
-        );
-    }
- 
-    /**
-     * Appends a given number of queued transactions as a single batch.
-     * param _numQueuedTransactions Number of transactions to append.
-     */
-    function appendQueueBatch(
-        uint256 // _numQueuedTransactions
-    )
-        override
-        public
-        pure
-    {
-        // TEMPORARY: Disable `appendQueueBatch` for minnet
-        revert("appendQueueBatch is currently disabled.");
- 
-        // _numQueuedTransactions = Lib_Math.min(_numQueuedTransactions, getNumPendingQueueElements());
-        // require(
-        //     _numQueuedTransactions > 0,
-        //     "Must append more than zero transactions."
-        // );
- 
-        // bytes32[] memory leaves = new bytes32[](_numQueuedTransactions);
-        // uint40 nextQueueIndex = getNextQueueIndex();
- 
-        // for (uint256 i = 0; i < _numQueuedTransactions; i++) {
-        //     if (msg.sender != resolve("OVM_Sequencer")) {
-        //         Lib_OVMCodec.QueueElement memory el = getQueueElement(nextQueueIndex);
-        //         require(
-        //             el.timestamp + forceInclusionPeriodSeconds < block.timestamp,
-        //             "Queue transactions cannot be submitted during the sequencer inclusion period."
-        //         );
-        //     }
-        //     leaves[i] = _getQueueLeafHash(nextQueueIndex);
-        //     nextQueueIndex++;
-        // }
- 
-        // Lib_OVMCodec.QueueElement memory lastElement = getQueueElement(nextQueueIndex - 1);
- 
-        // _appendBatch(
-        //     Lib_MerkleTree.getMerkleRoot(leaves),
-        //     _numQueuedTransactions,
-        //     _numQueuedTransactions,
-        //     lastElement.timestamp,
-        //     lastElement.blockNumber
-        // );
- 
-        // emit QueueBatchAppended(
-        //     nextQueueIndex - _numQueuedTransactions,
-        //     _numQueuedTransactions,
-        //     getTotalElements()
-        // );
-    }
- 
-    /**
-     * Allows the sequencer to append a batch of transactions.
-     * @dev This function uses a custom encoding scheme for efficiency reasons.
-     * .param _shouldStartAtElement Specific batch we expect to start appending to.
-     * .param _totalElementsToAppend Total number of batch elements we expect to append.
-     * .param _contexts Array of batch contexts.
-     * .param _transactionDataFields Array of raw transaction data.
-     */
-    function appendSequencerBatch()
-        override
-        public
-    {
-        uint40 shouldStartAtElement;
-        uint24 totalElementsToAppend;
-        uint24 numContexts;
-        assembly {
-            shouldStartAtElement  := shr(216, calldataload(4))
-            totalElementsToAppend := shr(232, calldataload(9))
-            numContexts           := shr(232, calldataload(12))
-        }
- 
-        require(
-            shouldStartAtElement == getTotalElements(),
-            "Actual batch start index does not match expected start index."
-        );
- 
-        require(
-            msg.sender == resolve("OVM_Sequencer"),
-            "Function can only be called by the Sequencer."
-        );
- 
-        require(
-            numContexts > 0,
-            "Must provide at least one batch context."
-        );
- 
-        require(
-            totalElementsToAppend > 0,
-            "Must append at least one element."
-        );
- 
-        uint40 nextTransactionPtr = uint40(BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts);
- 
-        Erequire(
-            msg.data.length >= nextTransactionPtr,
-            "Not enough BatchContexts provided."
-        );
- 
-        // Take a reference to the queue and its length so we don't have to keep resolving it.
-        // Length isn't going to change during the course of execution, so it's fine to simply
-        // resolve this once at the start. Saves gas.
-        iOVM_ChainStorageContainer queueRef = queue();
-        uint40 queueLength = _getQueueLength(queueRef);
- 
-        // Reserve some memory to save gas on hashing later on. This is a relatively safe estimate
-        // for the average transaction size that will prevent having to resize this chunk of memory
-        // later on. Saves gas.
-        bytes memory hashMemory = new bytes((msg.data.length / totalElementsToAppend) * 2);
- 
-        // Initialize the array of canonical chain leaves that we will append.
-        bytes32[] memory leaves = new bytes32[](totalElementsToAppend);
- 
-        // Each leaf index corresponds to a tx, either sequenced or enqueued.
-        uint32 leafIndex = 0;
- 
-        // Counter for number of sequencer transactions appended so far.
-        uint32 numSequencerTransactions = 0;
- 
-        // We will sequentially append leaves which are pointers to the queue.
-        // The initial queue index is what is currently in storage.
-        uint40 nextQueueIndex = getNextQueueIndex();
- 
-        BatchContext memory curContext;
-        for (uint32 i = 0; i < numContexts; i++) {
-            BatchContext memory nextContext = _getBatchContext(i);
- 
-            if (i == 0) {
-                // Execute a special check for the first batch.
-                _validateFirstBatchContext(nextContext);
-            }
- 
-            // Execute this check on every single batch, including the first one.
-            _validateNextBatchContext(
-                curContext,
-                nextContext,
-                nextQueueIndex,
-                queueRef
-            );
- 
-            // Now we can update our current context.
-            curContext = nextContext;
- 
-            // Process sequencer transactions first.
-            for (uint32 j = 0; j < curContext.numSequencedTransactions; j++) {
-                uint256 txDataLength;
-                assembly {
-                    txDataLength := shr(232, calldataload(nextTransactionPtr))
-                }
- 
-                leaves[leafIndex] = _getSequencerLeafHash(
-                    curContext,
-                    nextTransactionPtr,
-                    txDataLength,
-                    hashMemory
-                );
- 
-                nextTransactionPtr += uint40(TX_DATA_HEADER_SIZE + txDataLength);
-                numSequencerTransactions++;
-                leafIndex++;
-            }
- 
-            // Now process any subsequent queue transactions.
-            for (uint32 j = 0; j < curContext.numSubsequentQueueTransactions; j++) {
-                require(
-                    nextQueueIndex < queueLength,
-                    "Not enough queued transactions to append."
-                );
- 
-                leaves[leafIndex] = _getQueueLeafHash(nextQueueIndex);
-                nextQueueIndex++;
-                leafIndex++;
-            }
-        }
- 
-        _validateFinalBatchContext(
-            curContext,
-            nextQueueIndex,
-            queueLength,
-            queueRef
-        );
- 
-        require(
-            msg.data.length == nextTransactionPtr,
-            "Not all sequencer transactions were processed."
-        );
- 
-        Erequire(
-            leafIndex == totalElementsToAppend,
-            "Actual transaction index does not match expected total elements to append."
-        );
- 
-        // Generate the required metadata that we need to append this batch
-        uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
-        uint40 blockTimestamp;
-        uint40 blockNumber;
-        if (curContext.numSubsequentQueueTransactions == 0) {
-            // The last element is a sequencer tx, therefore pull timestamp and block number from the last context.
-            blockTimestamp = uint40(curContext.timestamp);
-            blockNumber = uint40(curContext.blockNumber);
-        } else {
-            // The last element is a queue tx, therefore pull timestamp and block number from the queue element.
-            // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at least one queue element.
-            // We increment nextQueueIndex after processing each queue element,
-            // so the index of the last element we processed is nextQueueIndex - 1.
-            Lib_OVMCodec.QueueElement memory lastElement = _getQueueElement(
-                nextQueueIndex - 1,
-                queueRef
-            );
- 
-            blockTimestamp = lastElement.timestamp;
-            blockNumber = lastElement.blockNumber;
-        }
- 
-        // For efficiency reasons getMerkleRoot modifies the `leaves` argument in place
-        // while calculating the root hash therefore any arguments passed to it must not
-        // be used again afterwards
-        _appendBatch(
-            Lib_MerkleTree.getMerkleRoot(leaves),
-            totalElementsToAppend,
-            numQueuedTransactions,
-            blockTimestamp,
-            blockNumber
-        );
- 
-        emit SequencerBatchAppended(
-            nextQueueIndex - numQueuedTransactions,
-            numQueuedTransactions,
-            getTotalElements()
-        );
-    }
- 
-    /**
-     * Verifies whether a transaction is included in the chain.
-     * @param _transaction Transaction to verify.
-     * @param _txChainElement Transaction chain element corresponding to the transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
-     * @return True if the transaction exists in the CTC, false if not.
-     */
-    function verifyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        if (_txChainElement.isSequenced == true) {
-            return _verifySequencerTransaction(
-                _transaction,
-                _txChainElement,
-                _batchHeader,
-                _inclusionProof
-            );
-        } else {
-            return _verifyQueueTransaction(
-                _transaction,
-                _txChainElement.queueIndex,
-                _batchHeader,
-                _inclusionProof
-            );
-        }
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Returns the BatchContext located at a particular index.
-     * @param _index The index of the BatchContext
-     * @return The BatchContext at the specified index.
-     */
-    function _getBatchContext(
-        uint256 _index
-    )
-        internal
-        pure
-        returns (
-            BatchContext memory
-        )
-    {
-        uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;
-        uint256 numSequencedTransactions;
-        uint256 numSubsequentQueueTransactions;
-        uint256 ctxTimestamp;
-        uint256 ctxBlockNumber;
- 
-        assembly {
-            numSequencedTransactions       := shr(232, calldataload(contextPtr))
-            numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))
-            ctxTimestamp                   := shr(216, calldataload(add(contextPtr, 6)))
-            ctxBlockNumber                 := shr(216, calldataload(add(contextPtr, 11)))
-        }
- 
-        return BatchContext({
-            numSequencedTransactions: numSequencedTransactions,
-            numSubsequentQueueTransactions: numSubsequentQueueTransactions,
-            timestamp: ctxTimestamp,
-            blockNumber: ctxBlockNumber
-        });
-    }
- 
-    /**
-     * Parses the batch context from the extra data.
-     * @return Total number of elements submitted.
-     * @return Index of the next queue element.
-     */
-    function _getBatchExtraData()
-        internal
-        view
-        returns (
-            uint40,
-            uint40,
-            uint40,
-            uint40
-        )
-    {
-        bytes27 extraData = batches().getGlobalMetadata();
- 
-        uint40 totalElements;
-        uint40 nextQueueIndex;
-        uint40 lastTimestamp;
-        uint40 lastBlockNumber;
-        assembly {
-            extraData       :=  shr(40, extraData)
-            totalElements   :=  and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            nextQueueIndex  :=  shr(40, and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000))
-            lastTimestamp   :=  shr(80, and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000))
-            lastBlockNumber :=  shr(120, and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000))
-        }
- 
-        return (
-            totalElements,
-            nextQueueIndex,
-            lastTimestamp,
-            lastBlockNumber
-        );
-    }
- 
-    /**
-     * Encodes the batch context for the extra data.
-     * @param _totalElements Total number of elements submitted.
-     * @param _nextQueueIndex Index of the next queue element.
-     * @param _timestamp Timestamp for the last batch.
-     * @param _blockNumber Block number of the last batch.
-     * @return Encoded batch context.
-     */
-    function _makeBatchExtraData(
-        uint40 _totalElements,
-        uint40 _nextQueueIndex,
-        uint40 _timestamp,
-        uint40 _blockNumber
-    )
-        internal
-        pure
-        returns (
-            bytes27
-        )
-    {
-        bytes27 extraData;
-        assembly {
-            extraData := _totalElements
-            extraData := or(extraData, shl(40, _nextQueueIndex))
-            extraData := or(extraData, shl(80, _timestamp))
-            extraData := or(extraData, shl(120, _blockNumber))
-            extraData := shl(40, extraData)
-        }
- 
-        return extraData;
-    }
- 
-    /**
-     * Retrieves the hash of a queue element.
-     * @param _index Index of the queue element to retrieve a hash for.
-     * @return Hash of the queue element.
-     */
-    function _getQueueLeafHash(
-        uint256 _index
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return _hashTransactionChainElement(
-            Lib_OVMCodec.TransactionChainElement({
-                isSequenced: false,
-                queueIndex: _index,
-                timestamp: 0,
-                blockNumber: 0,
-                txData: hex""
-            })
-        );
-    }
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function _getQueueElement(
-        uint256 _index,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        )
-    {
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the actual desired queue index
-        // we need to multiply by 2.
-        uint40 trueIndex = uint40(_index * 2);
-        bytes32 transactionHash = _queueRef.get(trueIndex);
-        bytes32 timestampAndBlockNumber = _queueRef.get(trueIndex + 1);
- 
-        uint40 elementTimestamp;
-        uint40 elementBlockNumber;
-        assembly {
-            elementTimestamp   :=         and(timestampAndBlockNumber, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            elementBlockNumber := shr(40, and(timestampAndBlockNumber, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
-        }
- 
-        return Lib_OVMCodec.QueueElement({
-            transactionHash: transactionHash,
-            timestamp: elementTimestamp,
-            blockNumber: elementBlockNumber
-        });
-    }
- 
-    /**
-     * Retrieves the length of the queue.
-     * @return Length of the queue.
-     */
-    function _getQueueLength(
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the real queue length we need
-        // to divide by 2.
-        return uint40(_queueRef.length() / 2);
-    }
- 
-    /**
-     * Retrieves the hash of a sequencer element.
-     * @param _context Batch context for the given element.
-     * @param _nextTransactionPtr Pointer to the next transaction in the calldata.
-     * @param _txDataLength Length of the transaction item.
-     * @return Hash of the sequencer element.
-     */
-    function _getSequencerLeafHash(
-        BatchContext memory _context,
-        uint256 _nextTransactionPtr,
-        uint256 _txDataLength,
-        bytes memory _hashMemory
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        // Only allocate more memory if we didn't reserve enough to begin with.
-        if (BYTES_TILL_TX_DATA + _txDataLength > _hashMemory.length) {
-            _hashMemory = new bytes(BYTES_TILL_TX_DATA + _txDataLength);
-        }
- 
-        uint256 ctxTimestamp = _context.timestamp;
-        uint256 ctxBlockNumber = _context.blockNumber;
- 
-        bytes32 leafHash;
-        assembly {
-            let chainElementStart := add(_hashMemory, 0x20)
- 
-            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
-            // This distinguishes sequencer ChainElements from queue ChainElements because
-            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
-            // elements is always zero
-            mstore8(chainElementStart, 1)
- 
-            mstore(add(chainElementStart, 1), ctxTimestamp)
-            mstore(add(chainElementStart, 33), ctxBlockNumber)
- 
-            calldatacopy(add(chainElementStart, BYTES_TILL_TX_DATA), add(_nextTransactionPtr, 3), _txDataLength)
- 
-            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, _txDataLength))
-        }
- 
-        return leafHash;
-    }
- 
-    /**
-     * Retrieves the hash of a sequencer element.
-     * @param _txChainElement The chain element which is hashed to calculate the leaf.
-     * @return Hash of the sequencer element.
-     */
-    function _getSequencerLeafHash(
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement
-    )
-        internal
-        view
-        returns(
-            bytes32
-        )
-    {
-        bytes memory txData = _txChainElement.txData;
-        uint256 txDataLength = _txChainElement.txData.length;
- 
-        bytes memory chainElement = new bytes(BYTES_TILL_TX_DATA + txDataLength);
-        uint256 ctxTimestamp = _txChainElement.timestamp;
-        uint256 ctxBlockNumber = _txChainElement.blockNumber;
- 
-        bytes32 leafHash;
-        assembly {
-            let chainElementStart := add(chainElement, 0x20)
- 
-            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
-            // This distinguishes sequencer ChainElements from queue ChainElements because
-            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
-            // elements is always zero
-            mstore8(chainElementStart, 1)
- 
-            mstore(add(chainElementStart, 1), ctxTimestamp)
-            mstore(add(chainElementStart, 33), ctxBlockNumber)
- 
-            pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart, BYTES_TILL_TX_DATA), txDataLength))
- 
-            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, txDataLength))
-        }
- 
-        return leafHash;
-    }
- 
-    /**
-     * Inserts a batch into the chain of batches.
-     * @param _transactionRoot Root of the transaction tree for this batch.
-     * @param _batchSize Number of elements in the batch.
-     * @param _numQueuedTransactions Number of queue transactions in the batch.
-     * @param _timestamp The latest batch timestamp.
-     * @param _blockNumber The latest batch blockNumber.
-     */
-    function _appendBatch(
-        bytes32 _transactionRoot,
-        uint256 _batchSize,
-        uint256 _numQueuedTransactions,
-        uint40 _timestamp,
-        uint40 _blockNumber
-    )
-        internal
-    {
-        iOVM_ChainStorageContainer batchesRef = batches();
-        (uint40 totalElements, uint40 nextQueueIndex,,) = _getBatchExtraData();
- 
-        Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({
-            batchIndex: batchesRef.length(),
-            batchRoot: _transactionRoot,
-            batchSize: _batchSize,
-            prevTotalElements: totalElements,
-            extraData: hex""
-        });
- 
-        emit TransactionBatchAppended(
-            header.batchIndex,
-            header.batchRoot,
-            header.batchSize,
-            header.prevTotalElements,
-            header.extraData
-        );
- 
-        bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);
-        bytes27 latestBatchContext = _makeBatchExtraData(
-            totalElements + uint40(header.batchSize),
-            nextQueueIndex + uint40(_numQueuedTransactions),
-            _timestamp,
-            _blockNumber
-        );
- 
-        batchesRef.push(batchHeaderHash, latestBatchContext);
-    }
- 
-    /**
-     * Checks that the first batch context in a sequencer submission is valid
-     * @param _firstContext The batch context to validate.
-     */
-    function _validateFirstBatchContext(
-        BatchContext memory _firstContext
-    )
-        internal
-        view
-    {
-        // If there are existing elements, this batch must have the same context 
-        // or a later timestamp and block number.
-        if (getTotalElements() > 0) {
-            (,, uint40 lastTimestamp, uint40 lastBlockNumber) = _getBatchExtraData();
- 
-            require(
-                _firstContext.blockNumber >= lastBlockNumber,
-                "Context block number is lower than last submitted."
-            );
- 
-            Irequire(
-                _firstContext.timestamp >= lastTimestamp,
-                "Context timestamp is lower than last submitted."
-            );
-        }
- 
-        // Sequencer cannot submit contexts which are more than the force inclusion period old.
-        require(
-            _firstContext.timestamp + forceInclusionPeriodSeconds >= block.timestamp,
-            "Context timestamp too far in the past."
-        );
- 
-        require(
-            _firstContext.blockNumber + forceInclusionPeriodBlocks >= block.number,
-            "Context block number too far in the past."
-        );
-    }
- 
-    /**
-     * Checks that a given batch context has a time context which is below a given que element
-     * @param _context The batch context to validate has values lower.
-     * @param _queueIndex Index of the queue element we are validating came later than the context.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateContextBeforeEnqueue(
-        BatchContext memory _context,
-        uint40 _queueIndex,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-            Lib_OVMCodec.QueueElement memory nextQueueElement = _getQueueElement(
-                _queueIndex,
-                _queueRef
-            );
- 
-            // If the force inclusion period has passed for an enqueued transaction, it MUST be the next chain element.
-            require(
-                block.timestamp < nextQueueElement.timestamp + forceInclusionPeriodSeconds,
-                "Previously enqueued batches have expired and must be appended before a new sequencer batch."
-            );
- 
-            // Just like sequencer transaction times must be increasing relative to each other,
-            // We also require that they be increasing relative to any interspersed queue elements.
-            require(
-                _context.timestamp <= nextQueueElement.timestamp,
-                "Sequencer transaction timestamp exceeds that of next queue element."
-            );
- 
-            require(
-                _context.blockNumber <= nextQueueElement.blockNumber,
-                "Sequencer transaction blockNumber exceeds that of next queue element."
-            );
-    }
- 
-    /**
-     * Checks that a given batch context is valid based on its previous context, and the next queue elemtent.
-     * @param _prevContext The previously validated batch context.
-     * @param _nextContext The batch context to validate with this call.
-     * @param _nextQueueIndex Index of the next queue element to process for the _nextContext's subsequentQueueElements.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateNextBatchContext(
-        BatchContext memory _prevContext,
-        BatchContext memory _nextContext,
-        uint40 _nextQueueIndex,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-        // All sequencer transactions' times must be greater than or equal to the previous ones.
-        require(
-            _nextContext.timestamp >= _prevContext.timestamp,
-            "Context timestamp values must monotonically increase."
-        );
- 
-        require(
-            _nextContext.blockNumber >= _prevContext.blockNumber,
-            "Context blockNumber values must monotonically increase."
-        );
- 
-        // If there is going to be a queue element pulled in from this context:
-        if (_nextContext.numSubsequentQueueTransactions > 0) {
-            _validateContextBeforeEnqueue(
-                _nextContext,
-                _nextQueueIndex,
-                _queueRef
-            );
-        }
-    }
- 
-    /**
-     * Checks that the final batch context in a sequencer submission is valid.
-     * @param _finalContext The batch context to validate.
-     * @param _queueLength The length of the queue at the start of the batchAppend call.
-     * @param _nextQueueIndex The next element in the queue that will be pulled into the CTC.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateFinalBatchContext(
-        BatchContext memory _finalContext,
-        uint40 _nextQueueIndex,
-        uint40 _queueLength,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-        // If the queue is not now empty, check the mononoticity of whatever the next batch that will come in is.
-        if (_queueLength - _nextQueueIndex > 0 && _finalContext.numSubsequentQueueTransactions == 0) {
-            _validateContextBeforeEnqueue(
-                _finalContext,
-                _nextQueueIndex,
-                _queueRef
-            );
-        }
-        // Batches cannot be added from the future, or subsequent enqueue() contexts would violate monotonicity.
-        require(_finalContext.timestamp <= block.timestamp, "Context timestamp is from the future.");
-        require(_finalContext.blockNumber <= block.number, "Context block number is from the future.");
-    }
- 
-    /**
-     * Hashes a transaction chain element.
-     * @param _element Chain element to hash.
-     * @return Hash of the chain element.
-     */
-    function _hashTransactionChainElement(
-        Lib_OVMCodec.TransactionChainElement memory _element
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(
-            abi.encode(
-                _element.isSequenced,
-                _element.queueIndex,
-                _element.timestamp,
-                _element.blockNumber,
-                _element.txData
-            )
-        );
-    }
- 
-    /**
-     * Verifies a sequencer transaction, returning true if it was indeed included in the CTC
-     * @param _transaction The transaction we are verifying inclusion of.
-     * @param _txChainElement The chain element that the transaction is claimed to be a part of.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof An inclusion proof into the CTC at a particular index.
-     * @return True if the transaction was included in the specified location, else false.
-     */
-    function _verifySequencerTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        OVM_ExecutionManager ovmExecutionManager = OVM_ExecutionManager(resolve("OVM_ExecutionManager"));
-        uint256 gasLimit = ovmExecutionManager.getMaxTransactionGasLimit();
-        bytes32 leafHash = _getSequencerLeafHash(_txChainElement);
- 
-        Erequire(
-            _verifyElement(
-                leafHash,
-                _batchHeader,
-                _inclusionProof
-            ),
-            "Invalid Sequencer transaction inclusion proof."
-        );
- 
-        Erequire(
-            _transaction.blockNumber        == _txChainElement.blockNumber
-            && _transaction.timestamp       == _txChainElement.timestamp
-            && _transaction.entrypoint      == resolve("OVM_DecompressionPrecompileAddress")
-            && _transaction.gasLimit        == gasLimit
-            && _transaction.l1TxOrigin      == address(0)
-            && _transaction.l1QueueOrigin   == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
-            && keccak256(_transaction.data) == keccak256(_txChainElement.txData),
-            "Invalid Sequencer transaction."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * Verifies a queue transaction, returning true if it was indeed included in the CTC
-     * @param _transaction The transaction we are verifying inclusion of.
-     * @param _queueIndex The queueIndex of the queued transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof An inclusion proof into the CTC at a particular index (should point to queue tx).
-     * @return True if the transaction was included in the specified location, else false.
-     */
-    function _verifyQueueTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        uint256 _queueIndex,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 leafHash = _getQueueLeafHash(_queueIndex);
- 
-        Erequire(
-            _verifyElement(
-                leafHash,
-                _batchHeader,
-                _inclusionProof
-            ),
-            "Invalid Queue transaction inclusion proof."
-        );
- 
-        bytes32 transactionHash = keccak256(
-            abi.encode(
-                _transaction.l1TxOrigin,
-                _transaction.entrypoint,
-                _transaction.gasLimit,
-                _transaction.data
-            )
-        );
- 
-        Lib_OVMCodec.QueueElement memory el = getQueueElement(_queueIndex);
-        Erequire(
-            el.transactionHash      == transactionHash
-            && el.timestamp   == _transaction.timestamp
-            && el.blockNumber == _transaction.blockNumber,
-            "Invalid Queue transaction."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * Verifies a batch inclusion proof.
-     * @param _element Hash of the element to verify a proof for.
-     * @param _batchHeader Header of the batch in which the element was included.
-     * @param _proof Merkle inclusion proof for the element.
-     */
-    function _verifyElement(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        Erequire(
-            Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(uint32(_batchHeader.batchIndex)),
-            "Invalid batch header."
-        );
- 
-        Erequire(
-            Lib_MerkleTree.verify(
-                _batchHeader.batchRoot,
-                _element,
-                _proof.index,
-                _proof.siblings,
-                _batchHeader.batchSize
-            ),
-            "Invalid inclusion proof."
-        );
- 
-        return true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/chain/OVM_ChainStorageContainer.sol.html b/coverage/OVM/chain/OVM_ChainStorageContainer.sol.html deleted file mode 100644 index 537ad24b1..000000000 --- a/coverage/OVM/chain/OVM_ChainStorageContainer.sol.html +++ /dev/null @@ -1,680 +0,0 @@ - - - - Code coverage report for OVM/chain/OVM_ChainStorageContainer.sol - - - - - - - -
-
-

- all files / OVM/chain/ OVM_ChainStorageContainer.sol -

-
-
- 72.73% - Statements - 8/11 -
-
- 50% - Branches - 1/2 -
-
- 72.73% - Functions - 8/11 -
-
- 75% - Lines - 9/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -504× -  -  -  -  -  -  -  -  -573× -  -  -  -573× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -550× -  -  -  -  -  -  -  -  -  -  -  -  -  -441× -  -  -  -  -  -  -  -  -  -  -  -  -470× -  -  -  -  -  -  -  -  -  -  -  -  -  -102× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_RingBuffer } from "../../libraries/utils/Lib_RingBuffer.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/**
- * @title OVM_ChainStorageContainer
- * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.
- * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used
- * in a fraud proof due to the fraud window having passed, and the associated chain state or
- * transactions being finalized.
- * Three distinct Chain Storage Containers will be deployed on Layer 1:
- * 1. Stores transaction batches for the Canonical Transaction Chain
- * 2. Stores queued transactions for the Canonical Transaction Chain
- * 3. Stores chain state batches for the State Commitment Chain
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {
- 
-    /*************
-     * Libraries *
-     *************/
- 
-    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    string public owner;
-    Lib_RingBuffer.RingBuffer internal buffer;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _owner Name of the contract that owns this container (will be resolved later).
-     */
-    constructor(
-        address _libAddressManager,
-        string memory _owner
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        owner = _owner;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyOwner() {
-        Erequire(
-            msg.sender == resolve(owner),
-            "OVM_ChainStorageContainer: Function can only be called by the owner."
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function setGlobalMetadata(
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        return buffer.setExtraData(_globalMetadata);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function getGlobalMetadata()
-        override
-        public
-        view
-        returns (
-            bytes27
-        )
-    {
-        return buffer.getExtraData();
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function length()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return uint256(buffer.getLength());
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function push(
-        bytes32 _object
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.push(_object);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function push(
-        bytes32 _object,
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.push(_object, _globalMetadata);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function get(
-        uint256 _index
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        return buffer.get(uint40(_index));
-    }
-    
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.deleteElementsAfterInclusive(
-            uint40(_index)
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index,
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.deleteElementsAfterInclusive(
-            uint40(_index),
-            _globalMetadata
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function setNextOverwritableIndex(
-        uint256 _index
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.nextOverwritableIndex = _index;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/chain/OVM_StateCommitmentChain.sol.html b/coverage/OVM/chain/OVM_StateCommitmentChain.sol.html deleted file mode 100644 index 059e03525..000000000 --- a/coverage/OVM/chain/OVM_StateCommitmentChain.sol.html +++ /dev/null @@ -1,1307 +0,0 @@ - - - - Code coverage report for OVM/chain/OVM_StateCommitmentChain.sol - - - - - - - -
-
-

- all files / OVM/chain/ OVM_StateCommitmentChain.sol -

-
-
- 88.1% - Statements - 37/42 -
-
- 67.86% - Branches - 19/28 -
-
- 85.71% - Functions - 12/14 -
-
- 88.64% - Lines - 39/44 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -60× -60× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -125× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -24× -  -  -  -  -24× -  -  -  -  -23× -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -74× -  -74× -74× -74× -  -  -  -  -  -74× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -  -22× -20× -  -  -  -  -  - -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
- 
-/* Interface Imports */
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
-import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/* External Imports */
-import '@openzeppelin/contracts/math/SafeMath.sol';
- 
-/**
- * @title OVM_StateCommitmentChain
- * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which
- * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).
- * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique
- * state root calculated off-chain by applying the canonical transactions one by one.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 public FRAUD_PROOF_WINDOW;
-    uint256 public SEQUENCER_PUBLISH_WINDOW;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager,
-        uint256 _fraudProofWindow,
-        uint256 _sequencerPublishWindow
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        FRAUD_PROOF_WINDOW = _fraudProofWindow;
-        SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:SCC:batches")
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getTotalElements()
-        override
-        public
-        view
-        returns (
-            uint256 _totalElements
-        )
-    {
-        (uint40 totalElements, ) = _getBatchExtraData();
-        return uint256(totalElements);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getTotalBatches()
-        override
-        public
-        view
-        returns (
-            uint256 _totalBatches
-        )
-    {
-        return batches().length();
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getLastSequencerTimestamp()
-        override
-        public
-        view
-        returns (
-            uint256 _lastSequencerTimestamp
-        )
-    {
-        (, uint40 lastSequencerTimestamp) = _getBatchExtraData();
-        return uint256(lastSequencerTimestamp);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function appendStateBatch(
-        bytes32[] memory _batch,
-        uint256 _shouldStartAtElement
-    )
-        override
-        public
-    {
-        // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the
-        // publication of batches by some other user.
-        require(
-            _shouldStartAtElement == getTotalElements(),
-            "Actual batch start index does not match expected start index."
-        );
- 
-        // Proposers must have previously staked at the BondManager
-        Erequire(
-            iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender),
-            "Proposer does not have enough collateral posted"
-        );
- 
-        require(
-            _batch.length > 0,
-            "Cannot submit an empty state batch."
-        );
- 
-        require(
-            getTotalElements() + _batch.length <= iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(),
-            "Number of state roots cannot exceed the number of canonical transactions."
-        );
- 
-        // Pass the block's timestamp and the publisher of the data
-        // to be used in the fraud proofs
-        _appendBatch(
-            _batch,
-            abi.encode(block.timestamp, msg.sender)
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function deleteStateBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        override
-        public
-    {
-        require(
-            msg.sender == resolve("OVM_FraudVerifier"),
-            "State batches can only be deleted by the OVM_FraudVerifier."
-        );
- 
-        require(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        Erequire(
-            insideFraudProofWindow(_batchHeader),
-            "State batches can only be deleted within the fraud proof window."
-        );
- 
-        _deleteBatch(_batchHeader);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function verifyStateCommitment(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        require(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        require(
-            Lib_MerkleTree.verify(
-                _batchHeader.batchRoot,
-                _element,
-                _proof.index,
-                _proof.siblings,
-                _batchHeader.batchSize
-            ),
-            "Invalid inclusion proof."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function insideFraudProofWindow(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        override
-        public
-        view
-        returns (
-            bool _inside
-        )
-    {
-        (uint256 timestamp,) = abi.decode(
-            _batchHeader.extraData,
-            (uint256, address)
-        );
- 
-        Erequire(
-            timestamp != 0,
-            "Batch header timestamp cannot be zero"
-        );
-        return SafeMath.add(timestamp, FRAUD_PROOF_WINDOW) > block.timestamp;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Parses the batch context from the extra data.
-     * @return Total number of elements submitted.
-     * @return Timestamp of the last batch submitted by the sequencer.
-     */
-    function _getBatchExtraData()
-        internal
-        view
-        returns (
-            uint40,
-            uint40
-        )
-    {
-        bytes27 extraData = batches().getGlobalMetadata();
- 
-        uint40 totalElements;
-        uint40 lastSequencerTimestamp;
-        assembly {
-            extraData              := shr(40, extraData)
-            totalElements          :=         and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            lastSequencerTimestamp := shr(40, and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
-        }
- 
-        return (
-            totalElements,
-            lastSequencerTimestamp
-        );
-    }
- 
-    /**
-     * Encodes the batch context for the extra data.
-     * @param _totalElements Total number of elements submitted.
-     * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.
-     * @return Encoded batch context.
-     */
-    function _makeBatchExtraData(
-        uint40 _totalElements,
-        uint40 _lastSequencerTimestamp
-    )
-        internal
-        pure
-        returns (
-            bytes27
-        )
-    {
-        bytes27 extraData;
-        assembly {
-            extraData := _totalElements
-            extraData := or(extraData, shl(40, _lastSequencerTimestamp))
-            extraData := shl(40, extraData)
-        }
- 
-        return extraData;
-    }
- 
-    /**
-     * Appends a batch to the chain.
-     * @param _batch Elements within the batch.
-     * @param _extraData Any extra data to append to the batch.
-     */
-    function _appendBatch(
-        bytes32[] memory _batch,
-        bytes memory _extraData
-    )
-        internal
-    {
-        address sequencer = resolve("OVM_Proposer");
-        (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();
- 
-        if (msg.sender == sequencer) {
-            lastSequencerTimestamp = uint40(block.timestamp);
-        } else {
-            // We keep track of the last batch submitted by the sequencer so there's a window in
-            // which only the sequencer can publish state roots. A window like this just reduces
-            // the chance of "system breaking" state roots being published while we're still in
-            // testing mode. This window should be removed or significantly reduced in the future.
-            require(
-                lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,
-                "Cannot publish state roots within the sequencer publication window."
-            );
-        }
- 
-        // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place
-        // while calculating the root hash therefore any arguments passed to it must not
-        // be used again afterwards
-        Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({
-            batchIndex: getTotalBatches(),
-            batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),
-            batchSize: _batch.length,
-            prevTotalElements: totalElements,
-            extraData: _extraData
-        });
- 
-        emit StateBatchAppended(
-            batchHeader.batchIndex,
-            batchHeader.batchRoot,
-            batchHeader.batchSize,
-            batchHeader.prevTotalElements,
-            batchHeader.extraData
-        );
- 
-        batches().push(
-            Lib_OVMCodec.hashBatchHeader(batchHeader),
-            _makeBatchExtraData(
-                uint40(batchHeader.prevTotalElements + batchHeader.batchSize),
-                lastSequencerTimestamp
-            )
-        );
-    }
- 
-    /**
-     * Removes a batch and all subsequent batches from the chain.
-     * @param _batchHeader Header of the batch to remove.
-     */
-    function _deleteBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-    {
-        Erequire(
-            _batchHeader.batchIndex < batches().length(),
-            "Invalid batch index."
-        );
- 
-        Erequire(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        batches().deleteElementsAfterInclusive(
-            _batchHeader.batchIndex,
-            _makeBatchExtraData(
-                uint40(_batchHeader.prevTotalElements),
-                0
-            )
-        );
- 
-        emit StateBatchDeleted(
-            _batchHeader.batchIndex,
-            _batchHeader.batchRoot
-        );
-    }
- 
-    /**
-     * Checks that a batch header matches the stored hash for the given index.
-     * @param _batchHeader Batch header to validate.
-     * @return Whether or not the header matches the stored one.
-     */
-    function _isValidBatchHeader(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/chain/index.html b/coverage/OVM/chain/index.html deleted file mode 100644 index 3b8188133..000000000 --- a/coverage/OVM/chain/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for OVM/chain/ - - - - - - - -
-
-

- all files OVM/chain/ -

-
-
- 92.82% - Statements - 194/209 -
-
- 81.37% - Branches - 83/102 -
-
- 82.46% - Functions - 47/57 -
-
- 93.36% - Lines - 211/226 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_CanonicalTransactionChain.sol
95.51%149/15687.5%63/7284.38%27/3295.88%163/170
OVM_ChainStorageContainer.sol
72.73%8/1150%1/272.73%8/1175%9/12
OVM_StateCommitmentChain.sol
88.1%37/4267.86%19/2885.71%12/1488.64%39/44
-
-
- - - - - - - diff --git a/coverage/OVM/execution/OVM_ExecutionManager.sol.html b/coverage/OVM/execution/OVM_ExecutionManager.sol.html deleted file mode 100644 index 774beb5aa..000000000 --- a/coverage/OVM/execution/OVM_ExecutionManager.sol.html +++ /dev/null @@ -1,5654 +0,0 @@ - - - - Code coverage report for OVM/execution/OVM_ExecutionManager.sol - - - - - - - -
-
-

- all files / OVM/execution/ OVM_ExecutionManager.sol -

-
-
- 74.58% - Statements - 176/236 -
-
- 62.2% - Branches - 51/82 -
-
- 83.61% - Functions - 51/61 -
-
- 75.21% - Lines - 182/242 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231 -1232 -1233 -1234 -1235 -1236 -1237 -1238 -1239 -1240 -1241 -1242 -1243 -1244 -1245 -1246 -1247 -1248 -1249 -1250 -1251 -1252 -1253 -1254 -1255 -1256 -1257 -1258 -1259 -1260 -1261 -1262 -1263 -1264 -1265 -1266 -1267 -1268 -1269 -1270 -1271 -1272 -1273 -1274 -1275 -1276 -1277 -1278 -1279 -1280 -1281 -1282 -1283 -1284 -1285 -1286 -1287 -1288 -1289 -1290 -1291 -1292 -1293 -1294 -1295 -1296 -1297 -1298 -1299 -1300 -1301 -1302 -1303 -1304 -1305 -1306 -1307 -1308 -1309 -1310 -1311 -1312 -1313 -1314 -1315 -1316 -1317 -1318 -1319 -1320 -1321 -1322 -1323 -1324 -1325 -1326 -1327 -1328 -1329 -1330 -1331 -1332 -1333 -1334 -1335 -1336 -1337 -1338 -1339 -1340 -1341 -1342 -1343 -1344 -1345 -1346 -1347 -1348 -1349 -1350 -1351 -1352 -1353 -1354 -1355 -1356 -1357 -1358 -1359 -1360 -1361 -1362 -1363 -1364 -1365 -1366 -1367 -1368 -1369 -1370 -1371 -1372 -1373 -1374 -1375 -1376 -1377 -1378 -1379 -1380 -1381 -1382 -1383 -1384 -1385 -1386 -1387 -1388 -1389 -1390 -1391 -1392 -1393 -1394 -1395 -1396 -1397 -1398 -1399 -1400 -1401 -1402 -1403 -1404 -1405 -1406 -1407 -1408 -1409 -1410 -1411 -1412 -1413 -1414 -1415 -1416 -1417 -1418 -1419 -1420 -1421 -1422 -1423 -1424 -1425 -1426 -1427 -1428 -1429 -1430 -1431 -1432 -1433 -1434 -1435 -1436 -1437 -1438 -1439 -1440 -1441 -1442 -1443 -1444 -1445 -1446 -1447 -1448 -1449 -1450 -1451 -1452 -1453 -1454 -1455 -1456 -1457 -1458 -1459 -1460 -1461 -1462 -1463 -1464 -1465 -1466 -1467 -1468 -1469 -1470 -1471 -1472 -1473 -1474 -1475 -1476 -1477 -1478 -1479 -1480 -1481 -1482 -1483 -1484 -1485 -1486 -1487 -1488 -1489 -1490 -1491 -1492 -1493 -1494 -1495 -1496 -1497 -1498 -1499 -1500 -1501 -1502 -1503 -1504 -1505 -1506 -1507 -1508 -1509 -1510 -1511 -1512 -1513 -1514 -1515 -1516 -1517 -1518 -1519 -1520 -1521 -1522 -1523 -1524 -1525 -1526 -1527 -1528 -1529 -1530 -1531 -1532 -1533 -1534 -1535 -1536 -1537 -1538 -1539 -1540 -1541 -1542 -1543 -1544 -1545 -1546 -1547 -1548 -1549 -1550 -1551 -1552 -1553 -1554 -1555 -1556 -1557 -1558 -1559 -1560 -1561 -1562 -1563 -1564 -1565 -1566 -1567 -1568 -1569 -1570 -1571 -1572 -1573 -1574 -1575 -1576 -1577 -1578 -1579 -1580 -1581 -1582 -1583 -1584 -1585 -1586 -1587 -1588 -1589 -1590 -1591 -1592 -1593 -1594 -1595 -1596 -1597 -1598 -1599 -1600 -1601 -1602 -1603 -1604 -1605 -1606 -1607 -1608 -1609 -1610 -1611 -1612 -1613 -1614 -1615 -1616 -1617 -1618 -1619 -1620 -1621 -1622 -1623 -1624 -1625 -1626 -1627 -1628 -1629 -1630 -1631 -1632 -1633 -1634 -1635 -1636 -1637 -1638 -1639 -1640 -1641 -1642 -1643 -1644 -1645 -1646 -1647 -1648 -1649 -1650 -1651 -1652 -1653 -1654 -1655 -1656 -1657 -1658 -1659 -1660 -1661 -1662 -1663 -1664 -1665 -1666 -1667 -1668 -1669 -1670 -1671 -1672 -1673 -1674 -1675 -1676 -1677 -1678 -1679 -1680 -1681 -1682 -1683 -1684 -1685 -1686 -1687 -1688 -1689 -1690 -1691 -1692 -1693 -1694 -1695 -1696 -1697 -1698 -1699 -1700 -1701 -1702 -1703 -1704 -1705 -1706 -1707 -1708 -1709 -1710 -1711 -1712 -1713 -1714 -1715 -1716 -1717 -1718 -1719 -1720 -1721 -1722 -1723 -1724 -1725 -1726 -1727 -1728 -1729 -1730 -1731 -1732 -1733 -1734 -1735 -1736 -1737 -1738 -1739 -1740 -1741 -1742 -1743 -1744 -1745 -1746 -1747 -1748 -1749 -1750 -1751 -1752 -1753 -1754 -1755 -1756 -1757 -1758 -1759 -1760 -1761 -1762 -1763 -1764 -1765 -1766 -1767 -1768 -1769 -1770 -1771 -1772 -1773 -1774 -1775 -1776 -1777 -1778 -1779 -1780 -1781 -1782 -1783 -1784 -1785 -1786 -1787 -1788 -1789 -1790 -1791 -1792 -1793 -1794 -1795 -1796 -1797 -1798 -1799 -1800 -1801 -1802 -1803 -1804 -1805 -1806 -1807 -1808 -1809 -1810 -1811 -1812 -1813 -1814 -1815 -1816 -1817 -1818 -1819 -1820 -1821 -1822 -1823 -1824 -1825 -1826 -1827 -1828 -1829 -1830 -1831 -1832 -1833 -1834 -1835 -1836 -1837 -1838 -1839 -1840 -1841 -1842 -1843 -1844 -1845 -1846 -1847 -1848 -1849 -1850 -1851 -1852 -1853 -1854 -1855 -1856 -1857 -1858 -1859 -1860 -1861 -1862 -1863 -1864  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -27× -27× -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -55× -55× -55× -  -  -55× -46× -  -  -  -  -  -  -  -  -  -  -  -201× -201× -192× -  -  -192× -165× -  -  -27× -  -  -  -  -  -  -  -42× - -  -38× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -150× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -  -  -  -28× -  -  -27× -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  - - -  -  -  - -  -  - -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -154× -154× -154× -  -154× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -48× -  -48× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -  -29× -  -29× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -27× -27× -27× -  -  -  -27× -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -172× -  -  -  -  - -  -  -  -171× -  -  -  -  -169× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -196× -196× -  -  -  -  -  -196× -196× -196× -  -  -  -  -  -  -  -196× -  -  -  -  -  -196× -  -  -  -196× -  -  -  -196× -23× -  -  -  -  -  -  -  -  -  -23× - -  -  -  -  -  -18× -  -  -  -  -  -14× -  -  -  -  -18× -  -  -  -10× -  - -  -  -  -  -  -  -  -18× -  -  -  -191× -  -191× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -27× -  -  -27× -  -27× -  -  -10× -10× -10× -10× -  -  -  -  -  -  -  -10× -  -  -  -  -17× -17× - -  -  -  -  -  -  -  -  -  -  -16× -  -  -  -  -  -  -16× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -29× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -57× -57× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -369× -367× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -17× -17× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -55× -55× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -535× -  -  -  -  -535× - -  -  -  -  -533× -  -  -  -  -  -533× -144× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -53× -  -  -  -53× -  -  -  -  -  -53× -47× -47× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -62× -  -  -  -  -  -  -62× -  -  -  -  -  -62× -  -  -  -  -  -62× -46× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  - -  -  - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -20× -  -  -  -  -  -  -20× - -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -23× - -  -  -  -  -  -  -  -  -20× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -196× -  -  -  -  -  -  -  -  -  -  -  -  -  -244× -  -  -  -244× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -392× -202× -  -  -  -392× -308× -  -  -  -392× -16× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -27× -27× -27× -27× -27× -  -27× -  -27× -27× -27× -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
-import { Lib_ErrorUtils } from "../../libraries/utils/Lib_ErrorUtils.sol";
- 
-/* Interface Imports */
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
- 
-/* Contract Imports */
-import { OVM_ECDSAContractAccount } from "../accounts/OVM_ECDSAContractAccount.sol";
-import { OVM_ProxyEOA } from "../accounts/OVM_ProxyEOA.sol";
-import { OVM_DeployerWhitelist } from "../predeploys/OVM_DeployerWhitelist.sol";
- 
-/**
- * @title OVM_ExecutionManager
- * @dev The Execution Manager (EM) is the core of our OVM implementation, and provides a sandboxed
- * environment allowing us to execute OVM transactions deterministically on either Layer 1 or
- * Layer 2.
- * The EM's run() function is the first function called during the execution of any
- * transaction on L2.
- * For each context-dependent EVM operation the EM has a function which implements a corresponding
- * OVM operation, which will read state from the State Manager contract.
- * The EM relies on the Safety Checker to verify that code deployed to Layer 2 does not contain any
- * context-dependent operations.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    iOVM_SafetyChecker internal ovmSafetyChecker;
-    iOVM_StateManager internal ovmStateManager;
- 
- 
-    /*******************************
-     * Execution Context Variables *
-     *******************************/
- 
-    GasMeterConfig internal gasMeterConfig;
-    GlobalContext internal globalContext;
-    TransactionContext internal transactionContext;
-    MessageContext internal messageContext;
-    TransactionRecord internal transactionRecord;
-    MessageRecord internal messageRecord;
- 
- 
-    /**************************
-     * Gas Metering Constants *
-     **************************/
- 
-    address constant GAS_METADATA_ADDRESS = 0x06a506A506a506A506a506a506A506A506A506A5;
-    uint256 constant NUISANCE_GAS_SLOAD = 20000;
-    uint256 constant NUISANCE_GAS_SSTORE = 20000;
-    uint256 constant MIN_NUISANCE_GAS_PER_CONTRACT = 30000;
-    uint256 constant NUISANCE_GAS_PER_CONTRACT_BYTE = 100;
-    uint256 constant MIN_GAS_FOR_INVALID_STATE_ACCESS = 30000;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager,
-        GasMeterConfig memory _gasMeterConfig,
-        GlobalContext memory _globalContext
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        ovmSafetyChecker = iOVM_SafetyChecker(resolve("OVM_SafetyChecker"));
-        gasMeterConfig = _gasMeterConfig;
-        globalContext = _globalContext;
-        _resetContext();
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Applies dynamically-sized refund to a transaction to account for the difference in execution
-     * between L1 and L2, so that the overall cost of the ovmOPCODE is fixed.
-     * @param _cost Desired gas cost for the function after the refund.
-     */
-    modifier netGasCost(
-        uint256 _cost
-    ) {
-        uint256 gasProvided = gasleft();
-        _;
-        uint256 gasUsed = gasProvided - gasleft();
- 
-        // We want to refund everything *except* the specified cost.
-        if (_cost < gasUsed) {
-            transactionRecord.ovmGasRefund += gasUsed - _cost;
-        }
-    }
- 
-    /**
-     * Applies a fixed-size gas refund to a transaction to account for the difference in execution
-     * between L1 and L2, so that the overall cost of an ovmOPCODE can be lowered.
-     * @param _discount Amount of gas cost to refund for the ovmOPCODE.
-     */
-    modifier fixedGasDiscount(
-        uint256 _discount
-    ) {
-        uint256 gasProvided = gasleft();
-        _;
-        uint256 gasUsed = gasProvided - gasleft();
- 
-        // We want to refund the specified _discount, unless this risks underflow.
-        if (_discount < gasUsed) {
-            transactionRecord.ovmGasRefund += _discount;
-        } else {
-            // refund all we can without risking underflow.
-            transactionRecord.ovmGasRefund += gasUsed;
-        }
-    }
- 
-    /**
-     * Makes sure we're not inside a static context.
-     */
-    modifier notStatic() {
-        if (messageContext.isStatic == true) {
-            _revertWithFlag(RevertFlag.STATIC_VIOLATION);
-        }
-        _;
-    }
- 
- 
-    /************************************
-     * Transaction Execution Entrypoint *
-     ************************************/
- 
-    /**
-     * Starts the execution of a transaction via the OVM_ExecutionManager.
-     * @param _transaction Transaction data to be executed.
-     * @param _ovmStateManager iOVM_StateManager implementation providing account state.
-     */
-    function run(
-        Lib_OVMCodec.Transaction memory _transaction,
-        address _ovmStateManager
-    )
-        override
-        public
-    {
-        require(transactionContext.ovmNUMBER == 0, "Only be callable at the start of a transaction");
-        // Store our OVM_StateManager instance (significantly easier than attempting to pass the
-        // address around in calldata).
-        ovmStateManager = iOVM_StateManager(_ovmStateManager);
- 
-        // Make sure this function can't be called by anyone except the owner of the
-        // OVM_StateManager (expected to be an OVM_StateTransitioner). We can revert here because
-        // this would make the `run` itself invalid.
-        require(
-            // This method may return false during fraud proofs, but always returns true in L2 nodes' State Manager precompile.
-            ovmStateManager.isAuthenticated(msg.sender),
-            "Only authenticated addresses in ovmStateManager can call this function"
-        );
- 
-        // Initialize the execution context, must be initialized before we perform any gas metering
-        // or we'll throw a nuisance gas error.
-        _initContext(_transaction);
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Check whether we need to start a new epoch, do so if necessary.
-        // _checkNeedsNewEpoch(_transaction.timestamp);
- 
-        // Make sure the transaction's gas limit is valid. We don't revert here because we reserve
-        // reverts for INVALID_STATE_ACCESS.
-        if (_isValidGasLimit(_transaction.gasLimit, _transaction.l1QueueOrigin) == false) {
-            _resetContext();
-            return;
-        }
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Check gas right before the call to get total gas consumed by OVM transaction.
-        // uint256 gasProvided = gasleft();
- 
-        // Run the transaction, make sure to meter the gas usage.
-        ovmCALL(
-            _transaction.gasLimit - gasMeterConfig.minTransactionGasLimit,
-            _transaction.entrypoint,
-            _transaction.data
-        );
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Update the cumulative gas based on the amount of gas used.
-        // uint256 gasUsed = gasProvided - gasleft();
-        // _updateCumulativeGas(gasUsed, _transaction.l1QueueOrigin);
- 
-        // Wipe the execution context.
-        _resetContext();
- 
-        // Reset the ovmStateManager.
-        ovmStateManager = iOVM_StateManager(address(0));
-    }
- 
- 
-    /******************************
-     * Opcodes: Execution Context *
-     ******************************/
- 
-    /**
-     * @notice Overrides CALLER.
-     * @return _CALLER Address of the CALLER within the current message context.
-     */
-    function ovmCALLER()
-        override
-        public
-        view
-        returns (
-            address _CALLER
-        )
-    {
-        return messageContext.ovmCALLER;
-    }
- 
-    /**
-     * @notice Overrides ADDRESS.
-     * @return _ADDRESS Active ADDRESS within the current message context.
-     */
-    function ovmADDRESS()
-        override
-        public
-        view
-        returns (
-            address _ADDRESS
-        )
-    {
-        return messageContext.ovmADDRESS;
-    }
- 
-    /**
-     * @notice Overrides TIMESTAMP.
-     * @return _TIMESTAMP Value of the TIMESTAMP within the transaction context.
-     */
-    function ovmTIMESTAMP()
-        override
-        public
-        view
-        returns (
-            uint256 _TIMESTAMP
-        )
-    {
-        return transactionContext.ovmTIMESTAMP;
-    }
- 
-    /**
-     * @notice Overrides NUMBER.
-     * @return _NUMBER Value of the NUMBER within the transaction context.
-     */
-    function ovmNUMBER()
-        override
-        public
-        view
-        returns (
-            uint256 _NUMBER
-        )
-    {
-        return transactionContext.ovmNUMBER;
-    }
- 
-    /**
-     * @notice Overrides GASLIMIT.
-     * @return _GASLIMIT Value of the block's GASLIMIT within the transaction context.
-     */
-    function ovmGASLIMIT()
-        override
-        public
-        view
-        returns (
-            uint256 _GASLIMIT
-        )
-    {
-        return transactionContext.ovmGASLIMIT;
-    }
- 
-    /**
-     * @notice Overrides CHAINID.
-     * @return _CHAINID Value of the chain's CHAINID within the global context.
-     */
-    function ovmCHAINID()
-        override
-        public
-        view
-        returns (
-            uint256 _CHAINID
-        )
-    {
-        return globalContext.ovmCHAINID;
-    }
- 
-    /*********************************
-     * Opcodes: L2 Execution Context *
-     *********************************/
- 
-    /**
-     * @notice Specifies from which L1 rollup queue this transaction originated from.
-     * @return _queueOrigin Address of the ovmL1QUEUEORIGIN within the current message context.
-     */
-    function ovmL1QUEUEORIGIN()
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.QueueOrigin _queueOrigin
-        )
-    {
-        return transactionContext.ovmL1QUEUEORIGIN;
-    }
- 
-    /**
-     * @notice Specifies which L1 account, if any, sent this transaction by calling enqueue().
-     * @return _l1TxOrigin Address of the account which sent the tx into L2 from L1.
-     */
-    function ovmL1TXORIGIN()
-        override
-        public
-        view
-        returns (
-            address _l1TxOrigin
-        )
-    {
-        return transactionContext.ovmL1TXORIGIN;
-    }
- 
-    /********************
-     * Opcodes: Halting *
-     ********************/
- 
-    /**
-     * @notice Overrides REVERT.
-     * @param _data Bytes data to pass along with the REVERT.
-     */
-    function ovmREVERT(
-        bytes memory _data
-    )
-        override
-        public
-    {
-        _revertWithFlag(RevertFlag.INTENTIONAL_REVERT, _data);
-    }
- 
- 
-    /******************************
-     * Opcodes: Contract Creation *
-     ******************************/
- 
-    /**
-     * @notice Overrides CREATE.
-     * @param _bytecode Code to be used to CREATE a new contract.
-     * @return Address of the created contract.
-     * @return Revert data, if and only if the creation threw an exception.
-     */
-    function ovmCREATE(
-        bytes memory _bytecode
-    )
-        override
-        public
-        notStatic
-        fixedGasDiscount(40000)
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // Creator is always the current ADDRESS.
-        address creator = ovmADDRESS();
- 
-        // Check that the deployer is whitelisted, or
-        // that arbitrary contract deployment has been enabled.
-        _checkDeployerAllowed(creator);
- 
-        // Generate the correct CREATE address.
-        address contractAddress = Lib_EthUtils.getAddressForCREATE(
-            creator,
-            _getAccountNonce(creator)
-        );
- 
-        return _createContract(
-            contractAddress,
-            _bytecode
-        );
-    }
- 
-    /**
-     * @notice Overrides CREATE2.
-     * @param _bytecode Code to be used to CREATE2 a new contract.
-     * @param _salt Value used to determine the contract's address.
-     * @return Address of the created contract.
-     * @return Revert data, if and only if the creation threw an exception.
-     */
-    function ovmCREATE2(
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        override
-        public
-        notStatic
-        fixedGasDiscount(40000)
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // Creator is always the current ADDRESS.
-        address creator = ovmADDRESS();
- 
-        // Check that the deployer is whitelisted, or
-        // that arbitrary contract deployment has been enabled.
-        _checkDeployerAllowed(creator);
- 
-        // Generate the correct CREATE2 address.
-        address contractAddress = Lib_EthUtils.getAddressForCREATE2(
-            creator,
-            _bytecode,
-            _salt
-        );
- 
-        return _createContract(
-            contractAddress,
-            _bytecode
-        );
-    }
- 
- 
-    /*******************************
-     * Account Abstraction Opcodes *
-     ******************************/
- 
-    /**
-     * Retrieves the nonce of the current ovmADDRESS.
-     * @return _nonce Nonce of the current contract.
-     */
-    function ovmGETNONCE()
-        override
-        public
-        returns (
-            uint256 _nonce
-        )
-    {
-        return _getAccountNonce(ovmADDRESS());
-    }
- 
-    /**
-     * Sets the nonce of the current ovmADDRESS.
-     * @param _nonce New nonce for the current contract.
-     */
-    function ovmSETNONCE(
-        uint256 _nonce
-    )
-        override
-        public
-        notStatic
-    {
-        _setAccountNonce(ovmADDRESS(), _nonce);
-    }
- 
-    /**
-     * Creates a new EOA contract account, for account abstraction.
-     * @dev Essentially functions like ovmCREATE or ovmCREATE2, but we can bypass a lot of checks
-     *      because the contract we're creating is trusted (no need to do safety checking or to
-     *      handle unexpected reverts). Doesn't need to return an address because the address is
-     *      assumed to be the user's actual address.
-     * @param _messageHash Hash of a message signed by some user, for verification.
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     */
-    function ovmCREATEEOA(
-        bytes32 _messageHash,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        override
-        public
-        notStatic
-    {
-        // Recover the EOA address from the message hash and signature parameters. Since we do the
-        // hashing in advance, we don't have handle different message hashing schemes. Even if this
-        // function were to return the wrong address (rather than explicitly returning the zero
-        // address), the rest of the transaction would simply fail (since there's no EOA account to
-        // actually execute the transaction).
-        address eoa = ecrecover(
-            _messageHash,
-            _v + 27,
-            _r,
-            _s
-        );
- 
-        // Invalid signature is a case we proactively handle with a revert. We could alternatively
-        // have this function return a `success` boolean, but this is just easier.
-        Iif (eoa == address(0)) {
-            ovmREVERT(bytes("Signature provided for EOA contract creation is invalid."));
-        }
- 
-        // If the user already has an EOA account, then there's no need to perform this operation.
-        Iif (_hasEmptyAccount(eoa) == false) {
-            return;
-        }
- 
-        // We always need to initialize the contract with the default account values.
-        _initPendingAccount(eoa);
- 
-        // Temporarily set the current address so it's easier to access on L2.
-        address prevADDRESS = messageContext.ovmADDRESS;
-        messageContext.ovmADDRESS = eoa;
- 
-        // Now actually create the account and get its bytecode. We're not worried about reverts
-        // (other than out of gas, which we can't capture anyway) because this contract is trusted.
-        OVM_ProxyEOA proxyEOA = new OVM_ProxyEOA(0x4200000000000000000000000000000000000003);
- 
-        // Reset the address now that we're done deploying.
-        messageContext.ovmADDRESS = prevADDRESS;
- 
-        // Commit the account with its final values.
-        _commitPendingAccount(
-            eoa,
-            address(proxyEOA),
-            keccak256(Lib_EthUtils.getCode(address(proxyEOA)))
-        );
- 
-        _setAccountNonce(eoa, 0);
-    }
- 
- 
-    /*********************************
-     * Opcodes: Contract Interaction *
-     *********************************/
- 
-    /**
-     * @notice Overrides CALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmCALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(100000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // CALL updates the CALLER and ADDRESS.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _address;
- 
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
-    /**
-     * @notice Overrides STATICCALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmSTATICCALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(80000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // STATICCALL updates the CALLER, updates the ADDRESS, and runs in a static context.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _address;
-        nextMessageContext.isStatic = true;
- 
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
-    /**
-     * @notice Overrides DELEGATECALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmDELEGATECALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(40000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // DELEGATECALL does not change anything about the message context.
-        MessageContext memory nextMessageContext = messageContext;
-        
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
- 
-    /************************************
-     * Opcodes: Contract Storage Access *
-     ************************************/
- 
-    /**
-     * @notice Overrides SLOAD.
-     * @param _key 32 byte key of the storage slot to load.
-     * @return _value 32 byte value of the requested storage slot.
-     */
-    function ovmSLOAD(
-        bytes32 _key
-    )
-        override
-        public
-        netGasCost(40000)
-        returns (
-            bytes32 _value
-        )
-    {
-        // We always SLOAD from the storage of ADDRESS.
-        address contractAddress = ovmADDRESS();
- 
-        return _getContractStorage(
-            contractAddress,
-            _key
-        );
-    }
- 
-    /**
-     * @notice Overrides SSTORE.
-     * @param _key 32 byte key of the storage slot to set.
-     * @param _value 32 byte value for the storage slot.
-     */
-    function ovmSSTORE(
-        bytes32 _key,
-        bytes32 _value
-    )
-        override
-        public
-        notStatic
-        netGasCost(60000)
-    {
-        // We always SSTORE to the storage of ADDRESS.
-        address contractAddress = ovmADDRESS();
- 
-        _putContractStorage(
-            contractAddress,
-            _key,
-            _value
-        );
-    }
- 
- 
-    /*********************************
-     * Opcodes: Contract Code Access *
-     *********************************/
- 
-    /**
-     * @notice Overrides EXTCODECOPY.
-     * @param _contract Address of the contract to copy code from.
-     * @param _offset Offset in bytes from the start of contract code to copy beyond.
-     * @param _length Total number of bytes to copy from the contract's code.
-     * @return _code Bytes of code copied from the requested contract.
-     */
-    function ovmEXTCODECOPY(
-        address _contract,
-        uint256 _offset,
-        uint256 _length
-    )
-        override
-        public
-        returns (
-            bytes memory _code
-        )
-    {
-        // `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of
-        // return data. By blocking reads of one byte, we're able to use the condition that an
-        // OVM_ExecutionManager function return value having a length of exactly one byte indicates
-        // an error without an explicit revert. If users were able to read a single byte, they
-        // could forcibly trigger behavior that should only be available to this contract.
-        uint256 length = _length == 1 ? 2 : _length;
- 
-        return Lib_EthUtils.getCode(
-            _getAccountEthAddress(_contract),
-            _offset,
-            length
-        );
-    }
- 
-    /**
-     * @notice Overrides EXTCODESIZE.
-     * @param _contract Address of the contract to query the size of.
-     * @return _EXTCODESIZE Size of the requested contract in bytes.
-     */
-    function ovmEXTCODESIZE(
-        address _contract
-    )
-        override
-        public
-        returns (
-            uint256 _EXTCODESIZE
-        )
-    {
-        return Lib_EthUtils.getCodeSize(
-            _getAccountEthAddress(_contract)
-        );
-    }
- 
-    /**
-     * @notice Overrides EXTCODEHASH.
-     * @param _contract Address of the contract to query the hash of.
-     * @return _EXTCODEHASH Hash of the requested contract.
-     */
-    function ovmEXTCODEHASH(
-        address _contract
-    )
-        override
-        public
-        returns (
-            bytes32 _EXTCODEHASH
-        )
-    {
-        return Lib_EthUtils.getCodeHash(
-            _getAccountEthAddress(_contract)
-        );
-    }
- 
-    /***************************************
-     * Public Functions: Execution Context *
-     ***************************************/
- 
-    function getMaxTransactionGasLimit()
-        external
-        view
-        override
-        returns (
-            uint256 _maxTransactionGasLimit
-        )
-    {
-        return gasMeterConfig.maxTransactionGasLimit;
-    }
- 
-    /********************************************
-     * Public Functions: Deployment Whitelisting *
-     ********************************************/
- 
-    /**
-     * Checks whether the given address is on the whitelist to ovmCREATE/ovmCREATE2, and reverts if not.
-     * @param _deployerAddress Address attempting to deploy a contract.
-     */
-    function _checkDeployerAllowed(
-        address _deployerAddress
-    )
-        internal
-    {
-        // From an OVM semantics perspective, this will appear identical to
-        // the deployer ovmCALLing the whitelist.  This is fine--in a sense, we are forcing them to.
-        (bool success, bytes memory data) = ovmCALL(
-            gasleft(),
-            0x4200000000000000000000000000000000000002,
-            abi.encodeWithSignature("isDeployerAllowed(address)", _deployerAddress)
-        );
-        bool isAllowed = abi.decode(data, (bool));
- 
-        if (!isAllowed || !success) {
-            _revertWithFlag(RevertFlag.CREATOR_NOT_ALLOWED);
-        }
-    }
- 
-    /********************************************
-     * Internal Functions: Contract Interaction *
-     ********************************************/
- 
-    /**
-     * Creates a new contract and associates it with some contract address.
-     * @param _contractAddress Address to associate the created contract with.
-     * @param _bytecode Bytecode to be used to create the contract.
-     * @return Final OVM contract address.
-     * @return Revertdata, if and only if the creation threw an exception.
-     */
-    function _createContract(
-        address _contractAddress,
-        bytes memory _bytecode
-    )
-        internal
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // We always update the nonce of the creating account, even if the creation fails.
-        _setAccountNonce(ovmADDRESS(), _getAccountNonce(ovmADDRESS()) + 1);
- 
-        // We're stepping into a CREATE or CREATE2, so we need to update ADDRESS to point
-        // to the contract's associated address and CALLER to point to the previous ADDRESS.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = messageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _contractAddress;
- 
-        // Run the common logic which occurs between call-type and create-type messages,
-        // passing in the creation bytecode and `true` to trigger create-specific logic.
-        (bool success, bytes memory data) = _handleExternalMessage(
-            nextMessageContext,
-            gasleft(),
-            _contractAddress,
-            _bytecode,
-            true
-        );
- 
-        // Yellow paper requires that address returned is zero if the contract deployment fails.
-        return (
-            success ? _contractAddress : address(0),
-            data
-        );
-    }
- 
-    /**
-     * Calls the deployed contract associated with a given address.
-     * @param _nextMessageContext Message context to be used for the call.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _contract OVM address to be called.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function _callContract(
-        MessageContext memory _nextMessageContext,
-        uint256 _gasLimit,
-        address _contract,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // We reserve addresses of the form 0xdeaddeaddead...NNNN for the container contracts in L2 geth.
-        // So, we block calls to these addresses since they are not safe to run as an OVM contract itself.
-        if (
-            (uint256(_contract) & uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000))
-            == uint256(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000)
-        ) {
-            // EVM does not return data in the success case, see: https://github.com/ethereum/go-ethereum/blob/aae7660410f0ef90279e14afaaf2f429fdc2a186/core/vm/instructions.go#L600-L604
-            return (true, hex'');
-        }
- 
-        // Both 0x0000... and the EVM precompiles have the same address on L1 and L2 --> no trie lookup needed.
-        address codeContractAddress =
-            uint(_contract) < 100
-            ? _contract
-            : _getAccountEthAddress(_contract);
- 
-        return _handleExternalMessage(
-            _nextMessageContext,
-            _gasLimit,
-            codeContractAddress,
-            _calldata,
-            false
-        );
-    }
- 
-    /**
-     * Handles all interactions which involve the execution manager calling out to untrusted code (both calls and creates).
-     * Ensures that OVM-related measures are enforced, including L2 gas refunds, nuisance gas, and flagged reversions.
-     * 
-     * @param _nextMessageContext Message context to be used for the external message.
-     * @param _gasLimit Amount of gas to be passed into this message.
-     * @param _contract OVM address being called or deployed to
-     * @param _data Data for the message (either calldata or creation code)
-     * @param _isCreate Whether this is a create-type message.
-     * @return Whether or not the message (either a call or deployment) succeeded.
-     * @return Data returned by the message.
-     */
-    function _handleExternalMessage(
-        MessageContext memory _nextMessageContext,
-        uint256 _gasLimit,
-        address _contract,
-        bytes memory _data,
-        bool _isCreate
-    )
-        internal
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        // We need to switch over to our next message context for the duration of this call.
-        MessageContext memory prevMessageContext = messageContext;
-        _switchMessageContext(prevMessageContext, _nextMessageContext);
- 
-        // Nuisance gas is a system used to bound the ability for an attacker to make fraud proofs
-        // expensive by touching a lot of different accounts or storage slots. Since most contracts
-        // only use a few storage slots during any given transaction, this shouldn't be a limiting
-        // factor.
-        uint256 prevNuisanceGasLeft = messageRecord.nuisanceGasLeft;
-        uint256 nuisanceGasLimit = _getNuisanceGasLimit(_gasLimit);
-        messageRecord.nuisanceGasLeft = nuisanceGasLimit;
- 
-        // Make the call and make sure to pass in the gas limit. Another instance of hidden
-        // complexity. `_contract` is guaranteed to be a safe contract, meaning its return/revert
-        // behavior can be controlled. In particular, we enforce that flags are passed through
-        // revert data as to retrieve execution metadata that would normally be reverted out of
-        // existence.
- 
-        (bool success, bytes memory returndata) =
-            _isCreate
-            ? _handleContractCreation(_gasLimit, _data, _contract)
-            : _contract.call{gas: _gasLimit}(_data);
- 
-        // Switch back to the original message context now that we're out of the call.
-        _switchMessageContext(_nextMessageContext, prevMessageContext);
- 
-        // Assuming there were no reverts, the message record should be accurate here. We'll update
-        // this value in the case of a revert.
-        uint256 nuisanceGasLeft = messageRecord.nuisanceGasLeft;
- 
-        // Reverts at this point are completely OK, but we need to make a few updates based on the
-        // information passed through the revert.
-        if (success == false) {
-            (
-                RevertFlag flag,
-                uint256 nuisanceGasLeftPostRevert,
-                uint256 ovmGasRefund,
-                bytes memory returndataFromFlag
-            ) = _decodeRevertData(returndata);
- 
-            // INVALID_STATE_ACCESS is the only flag that triggers an immediate abort of the
-            // parent EVM message. This behavior is necessary because INVALID_STATE_ACCESS must
-            // halt any further transaction execution that could impact the execution result.
-            if (flag == RevertFlag.INVALID_STATE_ACCESS) {
-                _revertWithFlag(flag);
-            }
- 
-            // INTENTIONAL_REVERT, UNSAFE_BYTECODE, STATIC_VIOLATION, and CREATOR_NOT_ALLOWED aren't
-            // dependent on the input state, so we can just handle them like standard reverts. Our only change here
-            // is to record the gas refund reported by the call (enforced by safety checking).
-            if (
-                flag == RevertFlag.INTENTIONAL_REVERT
-                || flag == RevertFlag.UNSAFE_BYTECODE
-                || flag == RevertFlag.STATIC_VIOLATION
-                || flag == RevertFlag.CREATOR_NOT_ALLOWED
-            ) {
-                transactionRecord.ovmGasRefund = ovmGasRefund;
-            }
- 
-            // INTENTIONAL_REVERT needs to pass up the user-provided return data encoded into the
-            // flag, *not* the full encoded flag. All other revert types return no data.
-            if (
-                flag == RevertFlag.INTENTIONAL_REVERT
-                || _isCreate
-            ) {
-                returndata = returndataFromFlag;
-            } else {
-                returndata = hex'';
-            }
- 
-            // Reverts mean we need to use up whatever "nuisance gas" was used by the call.
-            // EXCEEDS_NUISANCE_GAS explicitly reduces the remaining nuisance gas for this message
-            // to zero. OUT_OF_GAS is a "pseudo" flag given that messages return no data when they
-            // run out of gas, so we have to treat this like EXCEEDS_NUISANCE_GAS. All other flags
-            // will simply pass up the remaining nuisance gas.
-            nuisanceGasLeft = nuisanceGasLeftPostRevert;
-        }
- 
-        // We need to reset the nuisance gas back to its original value minus the amount used here.
-        messageRecord.nuisanceGasLeft = prevNuisanceGasLeft - (nuisanceGasLimit - nuisanceGasLeft);
- 
-        return (
-            success,
-            returndata
-        );
-    }
- 
-    /**
-     * Handles the creation-specific safety measures required for OVM contract deployment.
-     * This function sanitizes the return types for creation messages to match calls (bool, bytes).
-     * This allows for consistent handling of both types of messages in _handleExternalMessage().
-     * 
-     * @param _gasLimit Amount of gas to be passed into this creation.
-     * @param _creationCode Code to pass into CREATE for deployment.
-     * @param _address OVM address being deployed to.
-     * @return Whether or not the call succeeded.
-     * @return If creation fails: revert data. Otherwise: empty.
-     */
-    function _handleContractCreation(
-        uint _gasLimit,
-        bytes memory _creationCode,
-        address _address
-    )
-        internal
-        returns(
-            bool,
-            bytes memory
-        )
-    {
-        // Check that there is not already code at this address.
-        Iif (_hasEmptyAccount(_address) == false) {
-            // Note: in the EVM, this case burns all allotted gas.  For improved
-            // developer experience, we do return the remaining ones.
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.CREATE_COLLISION,
-                    Lib_ErrorUtils.encodeRevertString("A contract has already been deployed to this address")
-                )
-            );
-        }
- 
-        // Check the creation bytecode against the OVM_SafetyChecker.
-        Iif (ovmSafetyChecker.isBytecodeSafe(_creationCode) == false) {
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.UNSAFE_BYTECODE,
-                    Lib_ErrorUtils.encodeRevertString("Contract creation code contains unsafe opcodes. Did you use the right compiler or pass an unsafe constructor argument?")
-                )
-            );
-        }
- 
-        // We always need to initialize the contract with the default account values.
-        _initPendingAccount(_address);
- 
-        // Actually execute the EVM create message,
-        address ethAddress = Lib_EthUtils.createContract(_creationCode);
-        
-        if (ethAddress == address(0)) {
-            // If the creation fails, the EVM lets us grab its revert data. This may contain a revert flag
-            // to be used above in _handleExternalMessage.
-            uint256 revertDataSize;
-            assembly { revertDataSize := returndatasize() }
-            bytes memory revertdata = new bytes(revertDataSize);
-            assembly {
-                returndatacopy(
-                    add(revertdata, 0x20),
-                    0,
-                    revertDataSize
-                )
-            }
-            // Return that the creation failed, and the data it reverted with.
-            return (false, revertdata);
-        }
- 
-        // Again simply checking that the deployed code is safe too. Contracts can generate
-        // arbitrary deployment code, so there's no easy way to analyze this beforehand.
-        bytes memory deployedCode = Lib_EthUtils.getCode(ethAddress);
-        if (ovmSafetyChecker.isBytecodeSafe(deployedCode) == false) {
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.UNSAFE_BYTECODE,
-                    Lib_ErrorUtils.encodeRevertString("Constructor attempted to deploy unsafe bytecode.")
-                )
-            );
-        }
- 
-        // Contract creation didn't need to be reverted and the bytecode is safe. We finish up by
-        // associating the desired address with the newly created contract's code hash and address.
-        _commitPendingAccount(
-            _address,
-            ethAddress,
-            Lib_EthUtils.getCodeHash(ethAddress)
-        );
- 
-        // Successful deployments will not give access to returndata, in both the EVM and the OVM.
-        return (true, hex'');
-    }
- 
-    /******************************************
-     * Internal Functions: State Manipulation *
-     ******************************************/
- 
-    /**
-     * Checks whether an account exists within the OVM_StateManager.
-     * @param _address Address of the account to check.
-     * @return _exists Whether or not the account exists.
-     */
-    function _hasAccount(
-        address _address
-    )
-        internal
-        returns (
-            bool _exists
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.hasAccount(_address);
-    }
- 
-    /**
-     * Checks whether a known empty account exists within the OVM_StateManager.
-     * @param _address Address of the account to check.
-     * @return _exists Whether or not the account empty exists.
-     */
-    function _hasEmptyAccount(
-        address _address
-    )
-        internal
-        returns (
-            bool _exists
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.hasEmptyAccount(_address);
-    }
- 
-    /**
-     * Sets the nonce of an account.
-     * @param _address Address of the account to modify.
-     * @param _nonce New account nonce.
-     */
-    function _setAccountNonce(
-        address _address,
-        uint256 _nonce
-    )
-        internal
-    {
-        _checkAccountChange(_address);
-        ovmStateManager.setAccountNonce(_address, _nonce);
-    }
- 
-    /**
-     * Gets the nonce of an account.
-     * @param _address Address of the account to access.
-     * @return _nonce Nonce of the account.
-     */
-    function _getAccountNonce(
-        address _address
-    )
-        internal
-        returns (
-            uint256 _nonce
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.getAccountNonce(_address);
-    }
- 
-    /**
-     * Retrieves the Ethereum address of an account.
-     * @param _address Address of the account to access.
-     * @return _ethAddress Corresponding Ethereum address.
-     */
-    function _getAccountEthAddress(
-        address _address
-    )
-        internal
-        returns (
-            address _ethAddress
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.getAccountEthAddress(_address);
-    }
- 
-    /**
-     * Creates the default account object for the given address.
-     * @param _address Address of the account create.
-     */
-    function _initPendingAccount(
-        address _address
-    )
-        internal
-    {
-        // Although it seems like `_checkAccountChange` would be more appropriate here, we don't
-        // actually consider an account "changed" until it's inserted into the state (in this case
-        // by `_commitPendingAccount`).
-        _checkAccountLoad(_address);
-        ovmStateManager.initPendingAccount(_address);
-    }
- 
-    /**
-     * Stores additional relevant data for a new account, thereby "committing" it to the state.
-     * This function is only called during `ovmCREATE` and `ovmCREATE2` after a successful contract
-     * creation.
-     * @param _address Address of the account to commit.
-     * @param _ethAddress Address of the associated deployed contract.
-     * @param _codeHash Hash of the code stored at the address.
-     */
-    function _commitPendingAccount(
-        address _address,
-        address _ethAddress,
-        bytes32 _codeHash
-    )
-        internal
-    {
-        _checkAccountChange(_address);
-        ovmStateManager.commitPendingAccount(
-            _address,
-            _ethAddress,
-            _codeHash
-        );
-    }
- 
-    /**
-     * Retrieves the value of a storage slot.
-     * @param _contract Address of the contract to query.
-     * @param _key 32 byte key of the storage slot.
-     * @return _value 32 byte storage slot value.
-     */
-    function _getContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-        returns (
-            bytes32 _value
-        )
-    {
-        _checkContractStorageLoad(_contract, _key);
-        return ovmStateManager.getContractStorage(_contract, _key);
-    }
- 
-    /**
-     * Sets the value of a storage slot.
-     * @param _contract Address of the contract to modify.
-     * @param _key 32 byte key of the storage slot.
-     * @param _value 32 byte storage slot value.
-     */
-    function _putContractStorage(
-        address _contract,
-        bytes32 _key,
-        bytes32 _value
-    )
-        internal
-    {
-        // We don't set storage if the value didn't change. Although this acts as a convenient
-        // optimization, it's also necessary to avoid the case in which a contract with no storage
-        // attempts to store the value "0" at any key. Putting this value (and therefore requiring
-        // that the value be committed into the storage trie after execution) would incorrectly
-        // modify the storage root.
-        Iif (_getContractStorage(_contract, _key) == _value) {
-            return;
-        }
- 
-        _checkContractStorageChange(_contract, _key);
-        ovmStateManager.putContractStorage(_contract, _key, _value);
-    }
- 
-    /**
-     * Validation whenever a contract needs to be loaded. Checks that the account exists, charges
-     * nuisance gas if the account hasn't been loaded before.
-     * @param _address Address of the account to load.
-     */
-    function _checkAccountLoad(
-        address _address
-    )
-        internal
-    {
-        // See `_checkContractStorageLoad` for more information.
-        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
-            _revertWithFlag(RevertFlag.OUT_OF_GAS);
-        }
- 
-        // See `_checkContractStorageLoad` for more information.
-        if (ovmStateManager.hasAccount(_address) == false) {
-            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
-        }
- 
-        // Check whether the account has been loaded before and mark it as loaded if not. We need
-        // this because "nuisance gas" only applies to the first time that an account is loaded.
-        (
-            bool _wasAccountAlreadyLoaded
-        ) = ovmStateManager.testAndSetAccountLoaded(_address);
- 
-        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
-        // on the size of the contract code.
-        if (_wasAccountAlreadyLoaded == false) {
-            _useNuisanceGas(
-                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
-            );
-        }
-    }
- 
-    /**
-     * Validation whenever a contract needs to be changed. Checks that the account exists, charges
-     * nuisance gas if the account hasn't been changed before.
-     * @param _address Address of the account to change.
-     */
-    function _checkAccountChange(
-        address _address
-    )
-        internal
-    {
-        // Start by checking for a load as we only want to charge nuisance gas proportional to
-        // contract size once.
-        _checkAccountLoad(_address);
- 
-        // Check whether the account has been changed before and mark it as changed if not. We need
-        // this because "nuisance gas" only applies to the first time that an account is changed.
-        (
-            bool _wasAccountAlreadyChanged
-        ) = ovmStateManager.testAndSetAccountChanged(_address);
- 
-        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
-        // on the size of the contract code.
-        if (_wasAccountAlreadyChanged == false) {
-            ovmStateManager.incrementTotalUncommittedAccounts();
-            _useNuisanceGas(
-                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
-            );
-        }
-    }
- 
-    /**
-     * Validation whenever a slot needs to be loaded. Checks that the account exists, charges
-     * nuisance gas if the slot hasn't been loaded before.
-     * @param _contract Address of the account to load from.
-     * @param _key 32 byte key to load.
-     */
-    function _checkContractStorageLoad(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-    {
-        // Another case of hidden complexity. If we didn't enforce this requirement, then a
-        // contract could pass in just enough gas to cause the INVALID_STATE_ACCESS check to fail
-        // on L1 but not on L2. A contract could use this behavior to prevent the
-        // OVM_ExecutionManager from detecting an invalid state access. Reverting with OUT_OF_GAS
-        // allows us to also charge for the full message nuisance gas, because you deserve that for
-        // trying to break the contract in this way.
-        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
-            _revertWithFlag(RevertFlag.OUT_OF_GAS);
-        }
- 
-        // We need to make sure that the transaction isn't trying to access storage that hasn't
-        // been provided to the OVM_StateManager. We'll immediately abort if this is the case.
-        // We know that we have enough gas to do this check because of the above test.
-        Iif (ovmStateManager.hasContractStorage(_contract, _key) == false) {
-            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
-        }
- 
-        // Check whether the slot has been loaded before and mark it as loaded if not. We need
-        // this because "nuisance gas" only applies to the first time that a slot is loaded.
-        (
-            bool _wasContractStorageAlreadyLoaded
-        ) = ovmStateManager.testAndSetContractStorageLoaded(_contract, _key);
- 
-        // If we hadn't already loaded the account, then we'll need to charge some fixed amount of
-        // "nuisance gas".
-        if (_wasContractStorageAlreadyLoaded == false) {
-            _useNuisanceGas(NUISANCE_GAS_SLOAD);
-        }
-    }
- 
-    /**
-     * Validation whenever a slot needs to be changed. Checks that the account exists, charges
-     * nuisance gas if the slot hasn't been changed before.
-     * @param _contract Address of the account to change.
-     * @param _key 32 byte key to change.
-     */
-    function _checkContractStorageChange(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-    {
-        // Start by checking for load to make sure we have the storage slot and that we charge the
-        // "nuisance gas" necessary to prove the storage slot state.
-        _checkContractStorageLoad(_contract, _key);
- 
-        // Check whether the slot has been changed before and mark it as changed if not. We need
-        // this because "nuisance gas" only applies to the first time that a slot is changed.
-        (
-            bool _wasContractStorageAlreadyChanged
-        ) = ovmStateManager.testAndSetContractStorageChanged(_contract, _key);
- 
-        // If we hadn't already changed the account, then we'll need to charge some fixed amount of
-        // "nuisance gas".
-        Eif (_wasContractStorageAlreadyChanged == false) {
-            // Changing a storage slot means that we're also going to have to change the
-            // corresponding account, so do an account change check.
-            _checkAccountChange(_contract);
- 
-            ovmStateManager.incrementTotalUncommittedContractStorage();
-            _useNuisanceGas(NUISANCE_GAS_SSTORE);
-        }
-    }
- 
- 
-    /************************************
-     * Internal Functions: Revert Logic *
-     ************************************/
- 
-    /**
-     * Simple encoding for revert data.
-     * @param _flag Flag to revert with.
-     * @param _data Additional user-provided revert data.
-     * @return _revertdata Encoded revert data.
-     */
-    function _encodeRevertData(
-        RevertFlag _flag,
-        bytes memory _data
-    )
-        internal
-        view
-        returns (
-            bytes memory _revertdata
-        )
-    {
-        // Out of gas and create exceptions will fundamentally return no data, so simulating it shouldn't either.
-        Iif (
-            _flag == RevertFlag.OUT_OF_GAS
-        ) {
-            return bytes('');
-        }
- 
-        // INVALID_STATE_ACCESS doesn't need to return any data other than the flag.
-        if (_flag == RevertFlag.INVALID_STATE_ACCESS) {
-            return abi.encode(
-                _flag,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        // Just ABI encode the rest of the parameters.
-        return abi.encode(
-            _flag,
-            messageRecord.nuisanceGasLeft,
-            transactionRecord.ovmGasRefund,
-            _data
-        );
-    }
- 
-    /**
-     * Simple decoding for revert data.
-     * @param _revertdata Revert data to decode.
-     * @return _flag Flag used to revert.
-     * @return _nuisanceGasLeft Amount of nuisance gas unused by the message.
-     * @return _ovmGasRefund Amount of gas refunded during the message.
-     * @return _data Additional user-provided revert data.
-     */
-    function _decodeRevertData(
-        bytes memory _revertdata
-    )
-        internal
-        pure
-        returns (
-            RevertFlag _flag,
-            uint256 _nuisanceGasLeft,
-            uint256 _ovmGasRefund,
-            bytes memory _data
-        )
-    {
-        // A length of zero means the call ran out of gas, just return empty data.
-        if (_revertdata.length == 0) {
-            return (
-                RevertFlag.OUT_OF_GAS,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        // ABI decode the incoming data.
-        return abi.decode(_revertdata, (RevertFlag, uint256, uint256, bytes));
-    }
- 
-    /**
-     * Causes a message to revert or abort.
-     * @param _flag Flag to revert with.
-     * @param _data Additional user-provided data.
-     */
-    function _revertWithFlag(
-        RevertFlag _flag,
-        bytes memory _data
-    )
-        internal
-        view
-    {
-        bytes memory revertdata = _encodeRevertData(
-            _flag,
-            _data
-        );
- 
-        assembly {
-            revert(add(revertdata, 0x20), mload(revertdata))
-        }
-    }
- 
-    /**
-     * Causes a message to revert or abort.
-     * @param _flag Flag to revert with.
-     */
-    function _revertWithFlag(
-        RevertFlag _flag
-    )
-        internal
-    {
-        _revertWithFlag(_flag, bytes(''));
-    }
- 
- 
-    /******************************************
-     * Internal Functions: Nuisance Gas Logic *
-     ******************************************/
- 
-    /**
-     * Computes the nuisance gas limit from the gas limit.
-     * @dev This function is currently using a naive implementation whereby the nuisance gas limit
-     *      is set to exactly equal the lesser of the gas limit or remaining gas. It's likely that
-     *      this implementation is perfectly fine, but we may change this formula later.
-     * @param _gasLimit Gas limit to compute from.
-     * @return _nuisanceGasLimit Computed nuisance gas limit.
-     */
-    function _getNuisanceGasLimit(
-        uint256 _gasLimit
-    )
-        internal
-        view
-        returns (
-            uint256 _nuisanceGasLimit
-        )
-    {
-        return _gasLimit < gasleft() ? _gasLimit : gasleft();
-    }
- 
-    /**
-     * Uses a certain amount of nuisance gas.
-     * @param _amount Amount of nuisance gas to use.
-     */
-    function _useNuisanceGas(
-        uint256 _amount
-    )
-        internal
-    {
-        // Essentially the same as a standard OUT_OF_GAS, except we also retain a record of the gas
-        // refund to be given at the end of the transaction.
-        Iif (messageRecord.nuisanceGasLeft < _amount) {
-            _revertWithFlag(RevertFlag.EXCEEDS_NUISANCE_GAS);
-        }
- 
-        messageRecord.nuisanceGasLeft -= _amount;
-    }
- 
- 
-    /************************************
-     * Internal Functions: Gas Metering *
-     ************************************/
- 
-    /**
-     * Checks whether a transaction needs to start a new epoch and does so if necessary.
-     * @param _timestamp Transaction timestamp.
-     */
-    function _checkNeedsNewEpoch(
-        uint256 _timestamp
-    )
-        internal
-    {
-        if (
-            _timestamp >= (
-                _getGasMetadata(GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP)
-                + gasMeterConfig.secondsPerEpoch
-            )
-        ) {
-            _putGasMetadata(
-                GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP,
-                _timestamp
-            );
- 
-            _putGasMetadata(
-                GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS,
-                _getGasMetadata(
-                    GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS
-                )
-            );
- 
-            _putGasMetadata(
-                GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS,
-                _getGasMetadata(
-                    GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS
-                )
-            );
-        }
-    }
- 
-    /**
-     * Validates the gas limit for a given transaction.
-     * @param _gasLimit Gas limit provided by the transaction.
-     * param _queueOrigin Queue from which the transaction originated.
-     * @return _valid Whether or not the gas limit is valid.
-     */
-    function _isValidGasLimit(
-        uint256 _gasLimit,
-        Lib_OVMCodec.QueueOrigin // _queueOrigin
-    )
-        view
-        internal
-        returns (
-            bool _valid
-        )
-    {
-        // Always have to be below the maximum gas limit.
-        if (_gasLimit > gasMeterConfig.maxTransactionGasLimit) {
-            return false;
-        }
- 
-        // Always have to be above the minimum gas limit.
-        if (_gasLimit < gasMeterConfig.minTransactionGasLimit) {
-            return false;
-        }
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        return true;
-        // GasMetadataKey cumulativeGasKey;
-        // GasMetadataKey prevEpochGasKey;
-        // if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
-        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
-        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS;
-        // } else {
-        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
-        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS;
-        // }
- 
-        // return (
-        //     (
-        //         _getGasMetadata(cumulativeGasKey)
-        //         - _getGasMetadata(prevEpochGasKey)
-        //         + _gasLimit
-        //     ) < gasMeterConfig.maxGasPerQueuePerEpoch
-        // );
-    }
- 
-    /**
-     * Updates the cumulative gas after a transaction.
-     * @param _gasUsed Gas used by the transaction.
-     * @param _queueOrigin Queue from which the transaction originated.
-     */
-    function _updateCumulativeGas(
-        uint256 _gasUsed,
-        Lib_OVMCodec.QueueOrigin _queueOrigin
-    )
-        internal
-    {
-        GasMetadataKey cumulativeGasKey;
-        if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
-            cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
-        } else {
-            cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
-        }
- 
-        _putGasMetadata(
-            cumulativeGasKey,
-            (
-                _getGasMetadata(cumulativeGasKey)
-                + gasMeterConfig.minTransactionGasLimit
-                + _gasUsed
-                - transactionRecord.ovmGasRefund
-            )
-        );
-    }
- 
-    /**
-     * Retrieves the value of a gas metadata key.
-     * @param _key Gas metadata key to retrieve.
-     * @return _value Value stored at the given key.
-     */
-    function _getGasMetadata(
-        GasMetadataKey _key
-    )
-        internal
-        returns (
-            uint256 _value
-        )
-    {
-        return uint256(_getContractStorage(
-            GAS_METADATA_ADDRESS,
-            bytes32(uint256(_key))
-        ));
-    }
- 
-    /**
-     * Sets the value of a gas metadata key.
-     * @param _key Gas metadata key to set.
-     * @param _value Value to store at the given key.
-     */
-    function _putGasMetadata(
-        GasMetadataKey _key,
-        uint256 _value
-    )
-        internal
-    {
-        _putContractStorage(
-            GAS_METADATA_ADDRESS,
-            bytes32(uint256(_key)),
-            bytes32(uint256(_value))
-        );
-    }
- 
- 
-    /*****************************************
-     * Internal Functions: Execution Context *
-     *****************************************/
- 
-    /**
-     * Swaps over to a new message context.
-     * @param _prevMessageContext Context we're switching from.
-     * @param _nextMessageContext Context we're switching to.
-     */
-    function _switchMessageContext(
-        MessageContext memory _prevMessageContext,
-        MessageContext memory _nextMessageContext
-    )
-        internal
-    {
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.ovmCALLER != _nextMessageContext.ovmCALLER) {
-            messageContext.ovmCALLER = _nextMessageContext.ovmCALLER;
-        }
- 
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.ovmADDRESS != _nextMessageContext.ovmADDRESS) {
-            messageContext.ovmADDRESS = _nextMessageContext.ovmADDRESS;
-        }
- 
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.isStatic != _nextMessageContext.isStatic) {
-            messageContext.isStatic = _nextMessageContext.isStatic;
-        }
-    }
- 
-    /**
-     * Initializes the execution context.
-     * @param _transaction OVM transaction being executed.
-     */
-    function _initContext(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        internal
-    {
-        transactionContext.ovmTIMESTAMP = _transaction.timestamp;
-        transactionContext.ovmNUMBER = _transaction.blockNumber;
-        transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
-        transactionContext.ovmL1QUEUEORIGIN = _transaction.l1QueueOrigin;
-        transactionContext.ovmL1TXORIGIN = _transaction.l1TxOrigin;
-        transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
- 
-        messageRecord.nuisanceGasLeft = _getNuisanceGasLimit(_transaction.gasLimit);
-    }
- 
-    /**
-     * Resets the transaction and message context.
-     */
-    function _resetContext()
-        internal
-    {
-        transactionContext.ovmL1TXORIGIN = address(0);
-        transactionContext.ovmTIMESTAMP = 0;
-        transactionContext.ovmNUMBER = 0;
-        transactionContext.ovmGASLIMIT = 0;
-        transactionContext.ovmTXGASLIMIT = 0;
-        transactionContext.ovmL1QUEUEORIGIN = Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE;
- 
-        transactionRecord.ovmGasRefund = 0;
- 
-        messageContext.ovmCALLER = address(0);
-        messageContext.ovmADDRESS = address(0);
-        messageContext.isStatic = false;
- 
-        messageRecord.nuisanceGasLeft = 0;
-    }
- 
-    /*****************************
-     * L2-only Helper Functions *
-     *****************************/
- 
-    /**
-     * Unreachable helper function for simulating eth_calls with an OVM message context.
-     * This function will throw an exception in all cases other than when used as a custom entrypoint in L2 Geth to simulate eth_call.
-     * @param _transaction the message transaction to simulate.
-     * @param _from the OVM account the simulated call should be from.
-     */
-    function simulateMessage(
-        Lib_OVMCodec.Transaction memory _transaction,
-        address _from,
-        iOVM_StateManager _ovmStateManager
-    )
-        external
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        // Prevent this call from having any effect unless in a custom-set VM frame
-        require(msg.sender == address(0));
- 
-        ovmStateManager = _ovmStateManager;
-        _initContext(_transaction);
-        messageRecord.nuisanceGasLeft = uint(-1);
- 
-        messageContext.ovmADDRESS = _from;
- 
-        bool isCreate = _transaction.entrypoint == address(0);
-        if (isCreate) {
-            (address created, bytes memory revertData) = ovmCREATE(_transaction.data);
-            if (created == address(0)) {
-                return (false, revertData);
-            } else {
-                // The eth_call RPC endpoint for to = undefined will return the deployed bytecode 
-                // in the success case, differing from standard create messages.
-                return (true, Lib_EthUtils.getCode(created));
-            }
-        } else {
-            return ovmCALL(
-                _transaction.gasLimit,
-                _transaction.entrypoint,
-                _transaction.data
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/execution/OVM_SafetyChecker.sol.html b/coverage/OVM/execution/OVM_SafetyChecker.sol.html deleted file mode 100644 index 7c3a8f6b4..000000000 --- a/coverage/OVM/execution/OVM_SafetyChecker.sol.html +++ /dev/null @@ -1,509 +0,0 @@ - - - - Code coverage report for OVM/execution/OVM_SafetyChecker.sol - - - - - - - -
-
-

- all files / OVM/execution/ OVM_SafetyChecker.sol -

-
-
- 100% - Statements - 8/8 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 10/10 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -277× -  -  -  -  -  -  -  -  -  -  -277× -  -277× -  -277× -  -277× -277× -277× -  -  -277× -277× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -152× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
- 
-/**
- * @title OVM_SafetyChecker
- * @dev  The Safety Checker verifies that contracts deployed on L2 do not contain any
- * "unsafe" operations. An operation is considered unsafe if it would access state variables which
- * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used
- * to "escape the sandbox" of the OVM, resulting in non-deterministic fraud proofs. 
- * That is, an attacker would be able to "prove fraud" on an honestly applied transaction.
- * Note that a "safe" contract requires opcodes to appear in a particular pattern;
- * omission of "unsafe" opcodes is necessary, but not sufficient.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_SafetyChecker is iOVM_SafetyChecker {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Returns whether or not all of the provided bytecode is safe.
-     * @param _bytecode The bytecode to safety check.
-     * @return `true` if the bytecode is safe, `false` otherwise.
-     */
-    function isBytecodeSafe(
-        bytes memory _bytecode
-    )
-        override
-        external
-        pure
-        returns (
-            bool
-        )
-    {
-        // autogenerated by gen_safety_checker_constants.py
-        // number of bytes to skip for each opcode
-        uint256[8] memory opcodeSkippableBytes = [
-            uint256(0x0001010101010101010101010000000001010101010101010101010101010000),
-            uint256(0x0100000000000000000000000000000000000000010101010101000000010100),
-            uint256(0x0000000000000000000000000000000001010101000000010101010100000000),
-            uint256(0x0203040500000000000000000000000000000000000000000000000000000000),
-            uint256(0x0101010101010101010101010101010101010101010101010101010101010101),
-            uint256(0x0101010101000000000000000000000000000000000000000000000000000000),
-            uint256(0x0000000000000000000000000000000000000000000000000000000000000000),
-            uint256(0x0000000000000000000000000000000000000000000000000000000000000000)
-        ];
-        // Mask to gate opcode specific cases
-        uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);
-        // Halting opcodes
-        uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);
-        // PUSH opcodes
-        uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);
- 
-        uint256 codeLength;
-        uint256 _pc;
-        assembly {
-            _pc := add(_bytecode, 0x20)
-        }
-        codeLength = _pc + _bytecode.length;
-        do {
-            // current opcode: 0x00...0xff
-            uint256 opNum;
- 
-            // inline assembly removes the extra add + bounds check
-            assembly {
-                let word := mload(_pc) //load the next 32 bytes at pc into word
- 
-                // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord
-                // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4
-                // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).
-                // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,
-                // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.
-                let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                _pc := add(_pc, indexInWord)
- 
-                opNum := byte(indexInWord, word)
-            }
- 
-            // + push opcodes
-            // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]
-            // + caller opcode CALLER(0x33)
-            // + blacklisted opcodes
-            uint256 opBit = 1 << opNum;
-            if (opBit & opcodeGateMask == 0) {
-                if (opBit & opcodePushMask == 0) {
-                    // all pushes are valid opcodes
-                    // subsequent bytes are not opcodes. Skip them.
-                    _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to
-                    // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)
-                    continue;
-                } else if (opBit & opcodeHaltingMask == 0) {
-                    // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)
-                    // We are now inside unreachable code until we hit a JUMPDEST!
-                    do {
-                        _pc++;
-                        assembly {
-                            opNum := byte(0, mload(_pc))
-                        }
-                        // encountered a JUMPDEST
-                        if (opNum == 0x5b) break;
-                        // skip PUSHed bytes
-                        if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)
-                    } while (_pc < codeLength);
-                    // opNum is 0x5b, so we don't continue here since the pc++ is fine
-                } else if (opNum == 0x33) { // Caller opcode
-                    uint256 firstOps; // next 32 bytes of bytecode
-                    uint256 secondOps; // following 32 bytes of bytecode
- 
-                    assembly {
-                        firstOps := mload(_pc)
-                        // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits
-                        secondOps := shr(216, mload(add(_pc, 0x20)))
-                    }
- 
-                    // Call identity precompile
-                    // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL
-                    // 32 - 8 bytes = 24 bytes = 192
-                    if ((firstOps >> 192) == 0x3350600060045af1) {
-                        _pc += 8;
-                    // Call EM and abort execution if instructed
-                    // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST 
-                    } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {
-                        _pc += 37;
-                    } else {
-                        return false;
-                    }
-                    continue;
-                } else {
-                    // encountered a non-whitelisted opcode!
-                    return false;
-                }
-            }
-            _pc++;
-        } while (_pc < codeLength);
-        return true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/execution/OVM_StateManager.sol.html b/coverage/OVM/execution/OVM_StateManager.sol.html deleted file mode 100644 index 43f0df6b4..000000000 --- a/coverage/OVM/execution/OVM_StateManager.sol.html +++ /dev/null @@ -1,2279 +0,0 @@ - - - - Code coverage report for OVM/execution/OVM_StateManager.sol - - - - - - - -
-
-

- all files / OVM/execution/ OVM_StateManager.sol -

-
-
- 79.69% - Statements - 51/64 -
-
- 100% - Branches - 12/12 -
-
- 80% - Functions - 28/35 -
-
- 80% - Lines - 52/65 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -207× -  -  -  -  -  -  -  -  -  -  -  -  -  -921× -  -  -  -920× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -537× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -60× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -369× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -30× -30× -30× -30× -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -18× -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -61× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -70× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -  -  -  -  -14× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -57× -  -  -  - -  -  -  -51× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -74× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -69× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -606× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -97× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -687× -  -687× -268× -  -  -687× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
- 
-/**
- * @title OVM_StateManager
- * @dev The State Manager contract holds all storage values for contracts in the OVM. It can only be written to by the
- * the Execution Manager and State Transitioner. It runs on L1 during the setup and execution of a fraud proof.
- * The same logic runs on L2, but has been implemented as a precompile in the L2 go-ethereum client
- * (see https://github.com/ethereum-optimism/go-ethereum/blob/master/core/vm/ovm_state_manager.go).
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateManager is iOVM_StateManager {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 constant internal EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
-    bytes32 constant internal EMPTY_ACCOUNT_CODE_HASH =    0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
-    bytes32 constant internal STORAGE_XOR_VALUE =          0xFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEF;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    address override public owner;
-    address override public ovmExecutionManager;
-    mapping (address => Lib_OVMCodec.Account) internal accounts;
-    mapping (address => mapping (bytes32 => bytes32)) internal contractStorage;
-    mapping (address => mapping (bytes32 => bool)) internal verifiedContractStorage;
-    mapping (bytes32 => ItemState) internal itemStates;
-    uint256 internal totalUncommittedAccounts;
-    uint256 internal totalUncommittedContractStorage;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _owner Address of the owner of this contract.
-     */
-    constructor(
-        address _owner
-    )
-    {
-        owner = _owner;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Simple authentication, this contract should only be accessible to the owner (which is expected to be the State Transitioner during `PRE_EXECUTION` 
-     * or the OVM_ExecutionManager during transaction execution.
-     */
-    modifier authenticated() {
-        // owner is the State Transitioner
-        require(
-            msg.sender == owner || msg.sender == ovmExecutionManager,
-            "Function can only be called by authenticated addresses"
-        );
-        _;
-    }
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Checks whether a given address is allowed to modify this contract.
-     * @param _address Address to check.
-     * @return Whether or not the address can modify this contract.
-     */
-    function isAuthenticated(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return (_address == owner || _address == ovmExecutionManager);
-    }
- 
-    /**
-     * Sets the address of the OVM_ExecutionManager.
-     * @param _ovmExecutionManager Address of the OVM_ExecutionManager.
-     */
-    function setExecutionManager(
-        address _ovmExecutionManager
-    )
-        override
-        public
-        authenticated
-    {
-        ovmExecutionManager = _ovmExecutionManager;
-    }
- 
-    /**
-     * Inserts an account into the state.
-     * @param _address Address of the account to insert.
-     * @param _account Account to insert for the given address.
-     */
-    function putAccount(
-        address _address,
-        Lib_OVMCodec.Account memory _account
-    )
-        override
-        public
-        authenticated
-    {
-        accounts[_address] = _account;
-    }
- 
-    /**
-     * Marks an account as empty.
-     * @param _address Address of the account to mark.
-     */
-    function putEmptyAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
-        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
-    }
- 
-    /**
-     * Retrieves an account from the state.
-     * @param _address Address of the account to retrieve.
-     * @return Account for the given address.
-     */
-    function getAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.Account memory
-        )
-    {
-        return accounts[_address];
-    }
- 
-    /**
-     * Checks whether the state has a given account.
-     * @param _address Address of the account to check.
-     * @return Whether or not the state has the account.
-     */
-    function hasAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return accounts[_address].codeHash != bytes32(0);
-    }
- 
-    /**
-     * Checks whether the state has a given known empty account.
-     * @param _address Address of the account to check.
-     * @return Whether or not the state has the empty account.
-     */
-    function hasEmptyAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return (
-            accounts[_address].codeHash == EMPTY_ACCOUNT_CODE_HASH
-            && accounts[_address].nonce == 0
-        );
-    }
- 
-    /**
-     * Sets the nonce of an account.
-     * @param _address Address of the account to modify.
-     * @param _nonce New account nonce.
-     */
-    function setAccountNonce(
-        address _address,
-        uint256 _nonce
-    )
-        override
-        public
-        authenticated
-    {
-        accounts[_address].nonce = _nonce;
-    }
- 
-    /**
-     * Gets the nonce of an account.
-     * @param _address Address of the account to access.
-     * @return Nonce of the account.
-     */
-    function getAccountNonce(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return accounts[_address].nonce;
-    }
- 
-    /**
-     * Retrieves the Ethereum address of an account.
-     * @param _address Address of the account to access.
-     * @return Corresponding Ethereum address.
-     */
-    function getAccountEthAddress(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            address
-        )
-    {
-        return accounts[_address].ethAddress;
-    }
- 
-    /**
-     * Retrieves the storage root of an account.
-     * @param _address Address of the account to access.
-     * @return Corresponding storage root.
-     */
-    function getAccountStorageRoot(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        return accounts[_address].storageRoot;
-    }
- 
-    /**
-     * Initializes a pending account (during CREATE or CREATE2) with the default values.
-     * @param _address Address of the account to initialize.
-     */
-    function initPendingAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.nonce = 1;
-        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
-        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
-        account.isFresh = true;
-    }
- 
-    /**
-     * Finalizes the creation of a pending account (during CREATE or CREATE2).
-     * @param _address Address of the account to finalize.
-     * @param _ethAddress Address of the account's associated contract on Ethereum.
-     * @param _codeHash Hash of the account's code.
-     */
-    function commitPendingAccount(
-        address _address,
-        address _ethAddress,
-        bytes32 _codeHash
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.ethAddress = _ethAddress;
-        account.codeHash = _codeHash;
-    }
- 
-    /**
-     * Checks whether an account has already been retrieved, and marks it as retrieved if not.
-     * @param _address Address of the account to check.
-     * @return Whether or not the account was already loaded.
-     */
-    function testAndSetAccountLoaded(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_address),
-            ItemState.ITEM_LOADED
-        );
-    }
- 
-    /**
-     * Checks whether an account has already been modified, and marks it as modified if not.
-     * @param _address Address of the account to check.
-     * @return Whether or not the account was already modified.
-     */
-    function testAndSetAccountChanged(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_address),
-            ItemState.ITEM_CHANGED
-        );
-    }
- 
-    /**
-     * Attempts to mark an account as committed.
-     * @param _address Address of the account to commit.
-     * @return Whether or not the account was committed.
-     */
-    function commitAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        if (itemStates[item] != ItemState.ITEM_CHANGED) {
-            return false;
-        }
- 
-        itemStates[item] = ItemState.ITEM_COMMITTED;
-        totalUncommittedAccounts -= 1;
- 
-        return true;
-    }
- 
-    /**
-     * Increments the total number of uncommitted accounts.
-     */
-    function incrementTotalUncommittedAccounts()
-        override
-        public
-        authenticated
-    {
-        totalUncommittedAccounts += 1;
-    }
- 
-    /**
-     * Gets the total number of uncommitted accounts.
-     * @return Total uncommitted accounts.
-     */
-    function getTotalUncommittedAccounts()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return totalUncommittedAccounts;
-    }
- 
-    /**
-     * Checks whether a given account was changed during execution.
-     * @param _address Address to check.
-     * @return Whether or not the account was changed.
-     */
-    function wasAccountChanged(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        return itemStates[item] >= ItemState.ITEM_CHANGED;
-    }
- 
-    /**
-     * Checks whether a given account was committed after execution.
-     * @param _address Address to check.
-     * @return Whether or not the account was committed.
-     */
-    function wasAccountCommitted(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        return itemStates[item] >= ItemState.ITEM_COMMITTED;
-    }
- 
- 
-    /************************************
-     * Public Functions: Storage Access *
-     ************************************/
- 
-    /**
-     * Changes a contract storage slot value.
-     * @param _contract Address of the contract to modify.
-     * @param _key 32 byte storage slot key.
-     * @param _value 32 byte storage slot value.
-     */
-    function putContractStorage(
-        address _contract,
-        bytes32 _key,
-        bytes32 _value
-    )
-        override
-        public
-        authenticated
-    {
-        // A hilarious optimization. `SSTORE`ing a value of `bytes32(0)` is common enough that it's
-        // worth populating this with a non-zero value in advance (during the fraud proof
-        // initialization phase) to cut the execution-time cost down to 5000 gas.
-        contractStorage[_contract][_key] = _value ^ STORAGE_XOR_VALUE;
- 
-        // Only used when initially populating the contract storage. OVM_ExecutionManager will
-        // perform a `hasContractStorage` INVALID_STATE_ACCESS check before putting any contract
-        // storage because writing to zero when the actual value is nonzero causes a gas
-        // discrepancy. Could be moved into a new `putVerifiedContractStorage` function, or
-        // something along those lines.
-        if (verifiedContractStorage[_contract][_key] == false) {
-            verifiedContractStorage[_contract][_key] = true;
-        }
-    }
- 
-    /**
-     * Retrieves a contract storage slot value.
-     * @param _contract Address of the contract to access.
-     * @param _key 32 byte storage slot key.
-     * @return 32 byte storage slot value.
-     */
-    function getContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        // Storage XOR system doesn't work for newly created contracts that haven't set this
-        // storage slot value yet.
-        if (
-            verifiedContractStorage[_contract][_key] == false
-            && accounts[_contract].isFresh
-        ) {
-            return bytes32(0);
-        }
- 
-        // See `putContractStorage` for more information about the XOR here.
-        return contractStorage[_contract][_key] ^ STORAGE_XOR_VALUE;
-    }
- 
-    /**
-     * Checks whether a contract storage slot exists in the state.
-     * @param _contract Address of the contract to access.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the key was set in the state.
-     */
-    function hasContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return verifiedContractStorage[_contract][_key] || accounts[_contract].isFresh;
-    }
- 
-    /**
-     * Checks whether a storage slot has already been retrieved, and marks it as retrieved if not.
-     * @param _contract Address of the contract to check.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the slot was already loaded.
-     */
-    function testAndSetContractStorageLoaded(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_contract, _key),
-            ItemState.ITEM_LOADED
-        );
-    }
- 
-    /**
-     * Checks whether a storage slot has already been modified, and marks it as modified if not.
-     * @param _contract Address of the contract to check.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the slot was already modified.
-     */
-    function testAndSetContractStorageChanged(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_contract, _key),
-            ItemState.ITEM_CHANGED
-        );
-    }
- 
-    /**
-     * Attempts to mark a storage slot as committed.
-     * @param _contract Address of the account to commit.
-     * @param _key 32 byte slot key to commit.
-     * @return Whether or not the slot was committed.
-     */
-    function commitContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        if (itemStates[item] != ItemState.ITEM_CHANGED) {
-            return false;
-        }
- 
-        itemStates[item] = ItemState.ITEM_COMMITTED;
-        totalUncommittedContractStorage -= 1;
- 
-        return true;
-    }
- 
-    /**
-     * Increments the total number of uncommitted storage slots.
-     */
-    function incrementTotalUncommittedContractStorage()
-        override
-        public
-        authenticated
-    {
-        totalUncommittedContractStorage += 1;
-    }
- 
-    /**
-     * Gets the total number of uncommitted storage slots.
-     * @return Total uncommitted storage slots.
-     */
-    function getTotalUncommittedContractStorage()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return totalUncommittedContractStorage;
-    }
- 
-    /**
-     * Checks whether a given storage slot was changed during execution.
-     * @param _contract Address to check.
-     * @param _key Key of the storage slot to check.
-     * @return Whether or not the storage slot was changed.
-     */
-    function wasContractStorageChanged(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        return itemStates[item] >= ItemState.ITEM_CHANGED;
-    }
- 
-    /**
-     * Checks whether a given storage slot was committed after execution.
-     * @param _contract Address to check.
-     * @param _key Key of the storage slot to check.
-     * @return Whether or not the storage slot was committed.
-     */
-    function wasContractStorageCommitted(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        return itemStates[item] >= ItemState.ITEM_COMMITTED;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Generates a unique hash for an address.
-     * @param _address Address to generate a hash for.
-     * @return Unique hash for the given address.
-     */
-    function _getItemHash(
-        address _address
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(abi.encodePacked(_address));
-    }
- 
-    /**
-     * Generates a unique hash for an address/key pair.
-     * @param _contract Address to generate a hash for.
-     * @param _key Key to generate a hash for.
-     * @return Unique hash for the given pair.
-     */
-    function _getItemHash(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(abi.encodePacked(
-            _contract,
-            _key
-        ));
-    }
- 
-    /**
-     * Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets the
-     * item to the provided state if not.
-     * @param _item 32 byte item ID to check.
-     * @param _minItemState Minimum state that must be satisfied by the item.
-     * @return Whether or not the item was already in the state.
-     */
-    function _testAndSetItemState(
-        bytes32 _item,
-        ItemState _minItemState
-    )
-        internal
-        returns (
-            bool
-        )
-    {
-        bool wasItemState = itemStates[_item] >= _minItemState;
- 
-        if (wasItemState == false) {
-            itemStates[_item] = _minItemState;
-        }
- 
-        return wasItemState;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/execution/OVM_StateManagerFactory.sol.html b/coverage/OVM/execution/OVM_StateManagerFactory.sol.html deleted file mode 100644 index 571e900b2..000000000 --- a/coverage/OVM/execution/OVM_StateManagerFactory.sol.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - Code coverage report for OVM/execution/OVM_StateManagerFactory.sol - - - - - - - -
-
-

- all files / OVM/execution/ OVM_StateManagerFactory.sol -

-
-
- 0% - Statements - 0/1 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
- 
-/* Contract Imports */
-import { OVM_StateManager } from "./OVM_StateManager.sol";
- 
-/**
- * @title OVM_StateManagerFactory
- * @dev The State Manager Factory is called by a State Transitioner's init code, to create a new
- * State Manager for use in the Fraud Verification process.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateManagerFactory is iOVM_StateManagerFactory {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Creates a new OVM_StateManager
-     * @param _owner Owner of the created contract.
-     * @return New OVM_StateManager instance.
-     */
-    function create(
-        address _owner
-    )
-        override
-        public
-        returns (
-            iOVM_StateManager
-        )
-    {
-        return new OVM_StateManager(_owner);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/execution/index.html b/coverage/OVM/execution/index.html deleted file mode 100644 index ede1cb77a..000000000 --- a/coverage/OVM/execution/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for OVM/execution/ - - - - - - - -
-
-

- all files OVM/execution/ -

-
-
- 76.05% - Statements - 235/309 -
-
- 67.02% - Branches - 63/94 -
-
- 81.63% - Functions - 80/98 -
-
- 76.73% - Lines - 244/318 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_ExecutionManager.sol
74.58%176/23662.2%51/8283.61%51/6175.21%182/242
OVM_SafetyChecker.sol
100%8/8100%0/0100%1/1100%10/10
OVM_StateManager.sol
79.69%51/64100%12/1280%28/3580%52/65
OVM_StateManagerFactory.sol
0%0/1100%0/00%0/10%0/1
-
-
- - - - - - - diff --git a/coverage/OVM/predeploys/ERC1820Registry.sol.html b/coverage/OVM/predeploys/ERC1820Registry.sol.html deleted file mode 100644 index e49e79f7c..000000000 --- a/coverage/OVM/predeploys/ERC1820Registry.sol.html +++ /dev/null @@ -1,662 +0,0 @@ - - - - Code coverage report for OVM/predeploys/ERC1820Registry.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ ERC1820Registry.sol -

-
-
- 0% - Statements - 0/38 -
-
- 0% - Branches - 0/22 -
-
- 0% - Functions - 0/10 -
-
- 0% - Lines - 0/39 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: CC0-1.0
-/* ERC1820 Pseudo-introspection Registry Contract
- * This standard defines a universal registry smart contract where any address (contract or regular account) can
- * register which interface it supports and which smart contract is responsible for its implementation.
- *
- * Written in 2019 by Jordi Baylina and Jacques Dafflon
- *
- * To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to
- * this software to the public domain worldwide. This software is distributed without any warranty.
- *
- * You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
- * <http://creativecommons.org/publicdomain/zero/1.0/>.
- */
-pragma solidity >0.5.0 <0.8.0;
- 
-/// @dev The interface a contract MUST implement if it is the implementer of
-/// some (other) interface for any address other than itself.
-interface ERC1820ImplementerInterface {
-    /// @notice Indicates whether the contract implements the interface 'interfaceHash' for the address 'addr' or not.
-    /// @param interfaceHash keccak256 hash of the name of the interface
-    /// @param addr Address for which the contract will implement the interface
-    /// @return ERC1820_ACCEPT_MAGIC only if the contract implements 'interfaceHash' for the address 'addr'.
-    function canImplementInterfaceForAddress(bytes32 interfaceHash, address addr) external view returns(bytes32);
-}
- 
-/**
- * @title ERC1820 Pseudo-introspection Registry Contract
- * @author Jordi Baylina and Jacques Dafflon
- * @dev This contract is the official implementation of the ERC1820 Registry 
- * For more details, see https://eips.ethereum.org/EIPS/eip-1820
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract ERC1820Registry {
-    bytes4 constant internal INVALID_ID = 0xffffffff;
-    bytes4 constant internal ERC165ID = 0x01ffc9a7;
-    bytes32 constant internal ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
- 
-    mapping(address => mapping(bytes32 => address)) internal interfaces;
-    mapping(address => address) internal managers;
-    mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
- 
-    /// @notice Indicates a contract is the 'implementer' of 'interfaceHash' for 'addr'.
-    event InterfaceImplementerSet(address indexed addr, bytes32 indexed interfaceHash, address indexed implementer);
-    /// @notice Indicates 'newManager' is the address of the new manager for 'addr'.
-    event ManagerChanged(address indexed addr, address indexed newManager);
- 
-    /// @notice Query if an address implements an interface and through which contract.
-    /// @param _addr Address being queried for the implementer of an interface.
-    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
-    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
-    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
-    /// @return The address of the contract which implements the interface '_interfaceHash' for '_addr'
-    /// or '0' if '_addr' did not register an implementer for this interface.
-    function getInterfaceImplementer(address _addr, bytes32 _interfaceHash) external view returns (address) {
-        address addr = _addr == address(0) ? msg.sender : _addr;
-        if (isERC165Interface(_interfaceHash)) {
-            bytes4 erc165InterfaceHash = bytes4(_interfaceHash);
-            return implementsERC165Interface(addr, erc165InterfaceHash) ? addr : address(0);
-        }
-        return interfaces[addr][_interfaceHash];
-    }
- 
-    /// @notice Sets the contract which implements a specific interface for an address.
-    /// Only the manager defined for that address can set it.
-    /// (Each address is the manager for itself until it sets a new manager.)
-    /// @param _addr Address for which to set the interface.
-    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
-    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
-    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
-    /// @param _implementer Contract address implementing '_interfaceHash' for '_addr'.
-    function setInterfaceImplementer(address _addr, bytes32 _interfaceHash, address _implementer) external {
-        address addr = _addr == address(0) ? msg.sender : _addr;
-        require(getManager(addr) == msg.sender, "Not the manager");
- 
-        require(!isERC165Interface(_interfaceHash), "Must not be an ERC165 hash");
-        if (_implementer != address(0) && _implementer != msg.sender) {
-            require(
-                ERC1820ImplementerInterface(_implementer)
-                    .canImplementInterfaceForAddress(_interfaceHash, addr) == ERC1820_ACCEPT_MAGIC,
-                "Does not implement the interface"
-            );
-        }
-        interfaces[addr][_interfaceHash] = _implementer;
-        emit InterfaceImplementerSet(addr, _interfaceHash, _implementer);
-    }
- 
-    /// @notice Sets '_newManager' as manager for '_addr'.
-    /// The new manager will be able to call 'setInterfaceImplementer' for '_addr'.
-    /// @param _addr Address for which to set the new manager.
-    /// @param _newManager Address of the new manager for 'addr'. (Pass '0x0' to reset the manager to '_addr'.)
-    function setManager(address _addr, address _newManager) external {
-        require(getManager(_addr) == msg.sender, "Not the manager");
-        managers[_addr] = _newManager == _addr ? address(0) : _newManager;
-        emit ManagerChanged(_addr, _newManager);
-    }
- 
-    /// @notice Get the manager of an address.
-    /// @param _addr Address for which to return the manager.
-    /// @return Address of the manager for a given address.
-    function getManager(address _addr) public view returns(address) {
-        // By default the manager of an address is the same address
-        if (managers[_addr] == address(0)) {
-            return _addr;
-        } else {
-            return managers[_addr];
-        }
-    }
- 
-    /// @notice Compute the keccak256 hash of an interface given its name.
-    /// @param _interfaceName Name of the interface.
-    /// @return The keccak256 hash of an interface name.
-    function interfaceHash(string calldata _interfaceName) external pure returns(bytes32) {
-        return keccak256(abi.encodePacked(_interfaceName));
-    }
- 
-    /* --- ERC165 Related Functions --- */
-    /* --- Developed in collaboration with William Entriken. --- */
- 
-    /// @notice Updates the cache with whether the contract implements an ERC165 interface or not.
-    /// @param _contract Address of the contract for which to update the cache.
-    /// @param _interfaceId ERC165 interface for which to update the cache.
-    function updateERC165Cache(address _contract, bytes4 _interfaceId) external {
-        interfaces[_contract][_interfaceId] = implementsERC165InterfaceNoCache(
-            _contract, _interfaceId) ? _contract : address(0);
-        erc165Cached[_contract][_interfaceId] = true;
-    }
- 
-    /// @notice Checks whether a contract implements an ERC165 interface or not.
-    //  If the result is not cached a direct lookup on the contract address is performed.
-    //  If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
-    //  'updateERC165Cache' with the contract address.
-    /// @param _contract Address of the contract to check.
-    /// @param _interfaceId ERC165 interface to check.
-    /// @return True if '_contract' implements '_interfaceId', false otherwise.
-    function implementsERC165Interface(address _contract, bytes4 _interfaceId) public view returns (bool) {
-        if (!erc165Cached[_contract][_interfaceId]) {
-            return implementsERC165InterfaceNoCache(_contract, _interfaceId);
-        }
-        return interfaces[_contract][_interfaceId] == _contract;
-    }
- 
-    /// @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
-    /// @param _contract Address of the contract to check.
-    /// @param _interfaceId ERC165 interface to check.
-    /// @return True if '_contract' implements '_interfaceId', false otherwise.
-    function implementsERC165InterfaceNoCache(address _contract, bytes4 _interfaceId) public view returns (bool) {
-        uint256 success;
-        uint256 result;
- 
-        (success, result) = noThrowCall(_contract, ERC165ID);
-        if (success == 0 || result == 0) {
-            return false;
-        }
- 
-        (success, result) = noThrowCall(_contract, INVALID_ID);
-        if (success == 0 || result != 0) {
-            return false;
-        }
- 
-        (success, result) = noThrowCall(_contract, _interfaceId);
-        if (success == 1 && result == 1) {
-            return true;
-        }
-        return false;
-    }
- 
-    /// @notice Checks whether the hash is a ERC165 interface (ending with 28 zeroes) or not.
-    /// @param _interfaceHash The hash to check.
-    /// @return True if '_interfaceHash' is an ERC165 interface (ending with 28 zeroes), false otherwise.
-    function isERC165Interface(bytes32 _interfaceHash) internal pure returns (bool) {
-        return _interfaceHash & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0;
-    }
- 
-    /// @dev Make a call on a contract without throwing if the function does not exist.
-    function noThrowCall(address _contract, bytes4 _interfaceId)
-        internal view returns (uint256 success, uint256 result)
-    {
-        bytes4 erc165ID = ERC165ID;
- 
-        assembly {
-            let x := mload(0x40)               // Find empty storage location using "free memory pointer"
-            mstore(x, erc165ID)                // Place signature at beginning of empty storage
-            mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
- 
-            success := staticcall(
-                30000,                         // 30k gas
-                _contract,                     // To addr
-                x,                             // Inputs are stored at location x
-                0x24,                          // Inputs are 36 (4 + 32) bytes long
-                x,                             // Store output over input (saves space)
-                0x20                           // Outputs are 32 bytes long
-            )
- 
-            result := mload(x)                 // Load the result
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/predeploys/OVM_DeployerWhitelist.sol.html b/coverage/OVM/predeploys/OVM_DeployerWhitelist.sol.html deleted file mode 100644 index fb432861c..000000000 --- a/coverage/OVM/predeploys/OVM_DeployerWhitelist.sol.html +++ /dev/null @@ -1,701 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_DeployerWhitelist.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_DeployerWhitelist.sol -

-
-
- 36.36% - Statements - 8/22 -
-
- 66.67% - Branches - 4/6 -
-
- 12.5% - Functions - 1/8 -
-
- 34.78% - Lines - 8/23 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -29× -25× -  -  - -  -  -  - - -  -  - -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
- 
-/* Interface Imports */
-import { iOVM_DeployerWhitelist } from "../../iOVM/predeploys/iOVM_DeployerWhitelist.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_DeployerWhitelist
- * @dev The Deployer Whitelist is a temporary predeploy used to provide additional safety during the
- * initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts
- * which are allowed to deploy contracts on Layer2. The Execution Manager will only allow an 
- * ovmCREATE or ovmCREATE2 operation to proceed if the deployer's address whitelisted.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_DeployerWhitelist is iOVM_DeployerWhitelist {
- 
-    /**********************
-     * Contract Constants *
-     **********************/
- 
-    bytes32 internal constant KEY_INITIALIZED =                0x0000000000000000000000000000000000000000000000000000000000000010;
-    bytes32 internal constant KEY_OWNER =                      0x0000000000000000000000000000000000000000000000000000000000000011;
-    bytes32 internal constant KEY_ALLOW_ARBITRARY_DEPLOYMENT = 0x0000000000000000000000000000000000000000000000000000000000000012;
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
-    
-    /**
-     * Blocks functions to anyone except the contract owner.
-     */
-    modifier onlyOwner() {
-        address owner = Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                KEY_OWNER
-            )
-        );
- 
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_SafeExecutionManagerWrapper.safeCALLER() == owner,
-            "Function can only be called by the owner of this contract."
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
-    
-    /**
-     * Initializes the whitelist.
-     * @param _owner Address of the owner for this contract.
-     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
-     */
-    function initialize(
-        address _owner,
-        bool _allowArbitraryDeployment
-    )
-        override
-        public
-    {
-        bool initialized = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
-        );
- 
-        if (initialized == true) {
-            return;
-        }
- 
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_INITIALIZED,
-            Lib_Bytes32Utils.fromBool(true)
-        );
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_OWNER,
-            Lib_Bytes32Utils.fromAddress(_owner)
-        );
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
-            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
-        );
-    }
- 
-    /**
-     * Gets the owner of the whitelist.
-     */
-    function getOwner()
-        override
-        public
-        returns(
-            address
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                KEY_OWNER
-            )
-        );
-    }
- 
-    /**
-     * Adds or removes an address from the deployment whitelist.
-     * @param _deployer Address to update permissions for.
-     * @param _isWhitelisted Whether or not the address is whitelisted.
-     */
-    function setWhitelistedDeployer(
-        address _deployer,
-        bool _isWhitelisted
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            Lib_Bytes32Utils.fromAddress(_deployer),
-            Lib_Bytes32Utils.fromBool(_isWhitelisted)
-        );
-    }
- 
-    /**
-     * Updates the owner of this contract.
-     * @param _owner Address of the new owner.
-     */
-    function setOwner(
-        address _owner
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_OWNER,
-            Lib_Bytes32Utils.fromAddress(_owner)
-        );
-    }
- 
-    /**
-     * Updates the arbitrary deployment flag.
-     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
-     */
-    function setAllowArbitraryDeployment(
-        bool _allowArbitraryDeployment
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
-            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
-        );
-    }
- 
-    /**
-     * Permanently enables arbitrary contract deployment and deletes the owner.
-     */
-    function enableArbitraryContractDeployment()
-        override
-        public
-        onlyOwner
-    {
-        setAllowArbitraryDeployment(true);
-        setOwner(address(0));
-    }
- 
-    /**
-     * Checks whether an address is allowed to deploy contracts.
-     * @param _deployer Address to check.
-     * @return _allowed Whether or not the address can deploy contracts.
-     */
-    function isDeployerAllowed(
-        address _deployer
-    )
-        override
-        public
-        returns (
-            bool _allowed
-        )
-    {
-        bool initialized = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
-        );
- 
-        if (initialized == false) {
-            return true;
-        }
- 
-        bool allowArbitraryDeployment = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_ALLOW_ARBITRARY_DEPLOYMENT)
-        );
- 
-        if (allowArbitraryDeployment == true) {
-            return true;
-        }
- 
-        bool isWhitelisted = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                Lib_Bytes32Utils.fromAddress(_deployer)
-            )
-        );
- 
-        return isWhitelisted;        
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/predeploys/OVM_ETH.sol.html b/coverage/OVM/predeploys/OVM_ETH.sol.html deleted file mode 100644 index c72919992..000000000 --- a/coverage/OVM/predeploys/OVM_ETH.sol.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_ETH.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_ETH.sol -

-
-
- 0% - Statements - 0/1 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Contract Imports */
-import { OVM_L2DepositedERC20 } from "../bridge/tokens/OVM_L2DepositedERC20.sol";
- 
-/**
- * @title OVM_ETH
- * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that 
- * unlike on Layer 1, Layer 2 accounts do not have a balance field.
- * 
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract OVM_ETH is OVM_L2DepositedERC20 {
-    constructor(
-        address _l2CrossDomainMessenger,
-        address _l1ETHGateway
-    ) 
-        OVM_L2DepositedERC20(
-            _l2CrossDomainMessenger,
-            "Ether",
-            "ETH"
-        )
-    {
-        init(iOVM_L1TokenGateway(_l1ETHGateway));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/predeploys/OVM_L1MessageSender.sol.html b/coverage/OVM/predeploys/OVM_L1MessageSender.sol.html deleted file mode 100644 index 23974fcf0..000000000 --- a/coverage/OVM/predeploys/OVM_L1MessageSender.sol.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_L1MessageSender.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_L1MessageSender.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_L1MessageSender } from "../../iOVM/predeploys/iOVM_L1MessageSender.sol";
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
- 
-/**
- * @title OVM_L1MessageSender
- * @dev The L1MessageSender is a predeploy contract running on L2. During the execution of cross 
- * domain transaction from L1 to L2, it returns the address of the L1 account (either an EOA or
- * contract) which sent the message to L2 via the Canonical Transaction Chain's `enqueue()` 
- * function.
- * 
- * This contract exclusively serves as a getter for the ovmL1TXORIGIN operation. This is necessary 
- * because there is no corresponding operation in the EVM which the the optimistic solidity compiler 
- * can be replaced with a call to the ExecutionManager's ovmL1TXORIGIN() function.
- *
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_L1MessageSender is iOVM_L1MessageSender {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @return _l1MessageSender L1 message sender address (msg.sender).
-     */
-    function getL1MessageSender()
-        override
-        public
-        view
-        returns (
-            address _l1MessageSender
-        )
-    {
-        // Note that on L2 msg.sender (ie. evmCALLER) will always be the Execution Manager 
-        return iOVM_ExecutionManager(msg.sender).ovmL1TXORIGIN();
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html b/coverage/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html deleted file mode 100644 index 78befb65e..000000000 --- a/coverage/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_L2ToL1MessagePasser.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_L2ToL1MessagePasser.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_L2ToL1MessagePasser } from "../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
- 
-/**
- * @title OVM_L2ToL1MessagePasser
- * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the 
- * of a message on L2. The L1 Cross Domain Messenger performs this proof in its
- * _verifyStorageProof function, which verifies the existence of the transaction hash in this 
- * contract's `sentMessages` mapping.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    mapping (bytes32 => bool) public sentMessages;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Passes a message to L1.
-     * @param _message Message to pass to L1.
-     */
-    function passMessageToL1(
-        bytes memory _message
-    )
-        override
-        public
-    {
-        // Note: although this function is public, only messages sent from the OVM_L2CrossDomainMessenger 
-        // will be relayed by the OVM_L1CrossDomainMessenger. This is enforced by a check in 
-        // OVM_L1CrossDomainMessenger._verifyStorageProof().
-        sentMessages[keccak256(
-            abi.encodePacked(
-                _message,
-                msg.sender
-            )
-        )] = true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html b/coverage/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html deleted file mode 100644 index 26ebcbefe..000000000 --- a/coverage/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_ProxySequencerEntrypoint.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_ProxySequencerEntrypoint.sol -

-
-
- 100% - Statements - 10/10 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 7/7 -
-
- 100% - Lines - 10/10 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_ProxySequencerEntrypoint 
- * @dev The Proxy Sequencer Entrypoint is a predeployed proxy to the implementation of the 
- * Sequencer Entrypoint. This will enable the Optimism team to upgrade the Sequencer Entrypoint 
- * contract.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ProxySequencerEntrypoint {
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
-            gasleft(),
-            _getImplementation(),
-            msg.data
-        );
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function init(
-        address _implementation,
-        address _owner
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            _getOwner() == address(0),
-            "ProxySequencerEntrypoint has already been inited"
-        );
-        _setOwner(_owner);
-        _setImplementation(_implementation);
-    }
- 
-    function upgrade(
-        address _implementation
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            _getOwner() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
-            "Only owner can upgrade the Entrypoint"
-        );
- 
-        _setImplementation(_implementation);
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _setImplementation(
-        address _implementation
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            bytes32(uint256(0)),
-            bytes32(uint256(uint160(_implementation)))
-        );
-    }
- 
-    function _getImplementation()
-        internal
-        returns (
-            address _implementation
-        )
-    {
-        return address(uint160(uint256(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                bytes32(uint256(0))
-            )
-        )));
-    }
- 
-    function _setOwner(
-        address _owner
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            bytes32(uint256(1)),
-            bytes32(uint256(uint160(_owner)))
-        );
-    }
- 
-    function _getOwner()
-        internal
-        returns (
-            address _owner
-        )
-    {
-        return address(uint160(uint256(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                bytes32(uint256(1))
-            )
-        )));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/predeploys/OVM_SequencerEntrypoint.sol.html b/coverage/OVM/predeploys/OVM_SequencerEntrypoint.sol.html deleted file mode 100644 index b6e8b5067..000000000 --- a/coverage/OVM/predeploys/OVM_SequencerEntrypoint.sol.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_SequencerEntrypoint.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_SequencerEntrypoint.sol -

-
-
- 100% - Statements - 18/18 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 17/17 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - - - -  -  - - -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  - - -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_SequencerEntrypoint
- * @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by 
- * any account. It accepts a more efficient compressed calldata format, which it decompresses and 
- * encodes to the standard EIP155 transaction format.
- * This contract is the implementation referenced by the Proxy Sequencer Entrypoint, thus enabling
- * the Optimism team to upgrade the decompression of calldata from the Sequencer.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_SequencerEntrypoint {
- 
-    /*********
-     * Enums *
-     *********/
-    
-    enum TransactionType {
-        NATIVE_ETH_TRANSACTION,
-        ETH_SIGNED_MESSAGE
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    /**
-     * Uses a custom "compressed" format to save on calldata gas:
-     * calldata[00:01]: transaction type (0 == EIP 155, 2 == Eth Sign Message)
-     * calldata[01:33]: signature "r" parameter
-     * calldata[33:65]: signature "s" parameter
-     * calldata[65:66]: signature "v" parameter
-     * calldata[66:69]: transaction gas limit
-     * calldata[69:72]: transaction gas price
-     * calldata[72:75]: transaction nonce
-     * calldata[75:95]: transaction target address
-     * calldata[95:XX]: transaction data
-     */
-    fallback()
-        external
-    {
-        TransactionType transactionType = _getTransactionType(Lib_BytesUtils.toUint8(msg.data, 0));
- 
-        bytes32 r = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 1, 32));
-        bytes32 s = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 33, 32));
-        uint8 v = Lib_BytesUtils.toUint8(msg.data, 65);
- 
-        // Remainder is the transaction to execute.
-        bytes memory compressedTx = Lib_BytesUtils.slice(msg.data, 66);
-        bool isEthSignedMessage = transactionType == TransactionType.ETH_SIGNED_MESSAGE;
- 
-        // Need to decompress and then re-encode the transaction based on the original encoding.
-        bytes memory encodedTx = Lib_OVMCodec.encodeEIP155Transaction(
-            Lib_OVMCodec.decompressEIP155Transaction(compressedTx),
-            isEthSignedMessage
-        );
- 
-        address target = Lib_ECDSAUtils.recover(
-            encodedTx,
-            isEthSignedMessage,
-            uint8(v),
-            r,
-            s
-        );
- 
-        if (Lib_SafeExecutionManagerWrapper.safeEXTCODESIZE(target) == 0) {
-            // ProxyEOA has not yet been deployed for this EOA.
-            bytes32 messageHash = Lib_ECDSAUtils.getMessageHash(encodedTx, isEthSignedMessage);
-            Lib_SafeExecutionManagerWrapper.safeCREATEEOA(messageHash, uint8(v), r, s);
-        }
- 
-        // ProxyEOA has been deployed for this EOA, continue to CALL.
-        bytes memory callbytes = abi.encodeWithSignature(
-            "execute(bytes,uint8,uint8,bytes32,bytes32)",
-            encodedTx,
-            isEthSignedMessage,
-            uint8(v),
-            r,
-            s
-        );
- 
-        Lib_SafeExecutionManagerWrapper.safeCALL(
-            gasleft(),
-            target,
-            callbytes
-        );
-    }
-    
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Converts a uint256 into a TransactionType enum.
-     * @param _transactionType Transaction type index.
-     * @return _txType Transaction type enum value.
-     */
-    function _getTransactionType(
-        uint8 _transactionType
-    )
-        internal
-        returns (
-            TransactionType _txType
-        )
-    {
-        if (_transactionType == 0) {
-            return TransactionType.NATIVE_ETH_TRANSACTION;
-        } if (_transactionType == 2) {
-            return TransactionType.ETH_SIGNED_MESSAGE;
-        } else {
-            Lib_SafeExecutionManagerWrapper.safeREVERT(
-                "Transaction type must be 0 or 2"
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/predeploys/index.html b/coverage/OVM/predeploys/index.html deleted file mode 100644 index fab910cad..000000000 --- a/coverage/OVM/predeploys/index.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - Code coverage report for OVM/predeploys/ - - - - - - - -
-
-

- all files OVM/predeploys/ -

-
-
- 41.76% - Statements - 38/91 -
-
- 29.41% - Branches - 10/34 -
-
- 40% - Functions - 12/30 -
-
- 40.22% - Lines - 37/92 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
ERC1820Registry.sol
0%0/380%0/220%0/100%0/39
OVM_DeployerWhitelist.sol
36.36%8/2266.67%4/612.5%1/834.78%8/23
OVM_ETH.sol
0%0/1100%0/00%0/10%0/1
OVM_L1MessageSender.sol
100%1/1100%0/0100%1/1100%1/1
OVM_L2ToL1MessagePasser.sol
100%1/1100%0/0100%1/1100%1/1
OVM_ProxySequencerEntrypoint.sol
100%10/10100%0/0100%7/7100%10/10
OVM_SequencerEntrypoint.sol
100%18/18100%6/6100%2/2100%17/17
-
-
- - - - - - - diff --git a/coverage/OVM/verification/Abs_FraudContributor.sol.html b/coverage/OVM/verification/Abs_FraudContributor.sol.html deleted file mode 100644 index cb75b1904..000000000 --- a/coverage/OVM/verification/Abs_FraudContributor.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for OVM/verification/Abs_FraudContributor.sol - - - - - - - -
-
-

- all files / OVM/verification/ Abs_FraudContributor.sol -

-
-
- 100% - Statements - 3/3 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -14× -14× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/// Minimal contract to be inherited by contracts consumed by users that provide
-/// data for fraud proofs
-abstract contract Abs_FraudContributor is Lib_AddressResolver {
-    /// Decorate your functions with this modifier to store how much total gas was
-    /// consumed by the sender, to reward users fairly
-    modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
-        uint256 startGas = gasleft();
-        _;
-        uint256 gasSpent = startGas - gasleft();
-        iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/verification/OVM_BondManager.sol.html b/coverage/OVM/verification/OVM_BondManager.sol.html deleted file mode 100644 index d90409cfe..000000000 --- a/coverage/OVM/verification/OVM_BondManager.sol.html +++ /dev/null @@ -1,689 +0,0 @@ - - - - Code coverage report for OVM/verification/OVM_BondManager.sol - - - - - - - -
-
-

- all files / OVM/verification/ OVM_BondManager.sol -

-
-
- 100% - Statements - 42/42 -
-
- 86.67% - Branches - 26/30 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 41/41 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -63× -  -  -  -  -  -  -  -  -  -  -46× -46× -  -45× -45× -  -  -  -  -  -13× -12× -  -  -  -11× -  -11× -11× - - - -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -11× -  -  -  -  - -  -  -  -10× -  -  -  -  -  -18× -  -  -  -  -  -18× -  -  -  -  - - - -  - - -  -  -  -  - -  - -  -  -  - -  -  - - -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  - - -  -  - -  -  -  - -  -  - -  -  - -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_BondManager, Errors, ERC20 } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
- 
-/**
- * @title OVM_BondManager
- * @dev The Bond Manager contract handles deposits in the form of an ERC20 token from bonded 
- * Proposers. It also handles the accounting of gas costs spent by a Verifier during the course of a
- * fraud proof. In the event of a successful fraud proof, the fraudulent Proposer's bond is slashed, 
- * and the Verifier's gas costs are refunded.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
- 
-    /****************************
-     * Constants and Parameters *
-     ****************************/
- 
-    /// The period to find the earliest fraud proof for a publisher
-    uint256 public constant multiFraudProofPeriod = 7 days;
- 
-    /// The dispute period
-    uint256 public constant disputePeriodSeconds = 7 days;
- 
-    /// The minimum collateral a sequencer must post
-    uint256 public constant requiredCollateral = 1 ether;
- 
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    /// The bond token
-    ERC20 immutable public token;
- 
- 
-    /********************************************
-     * Contract Variables: Internal Accounting  *
-     *******************************************/
- 
-    /// The bonds posted by each proposer
-    mapping(address => Bond) public bonds;
- 
-    /// For each pre-state root, there's an array of witnessProviders that must be rewarded
-    /// for posting witnesses
-    mapping(bytes32 => Rewards) public witnessProviders;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /// Initializes with a ERC20 token to be used for the fidelity bonds
-    /// and with the Address Manager
-    constructor(
-        ERC20 _token,
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        token = _token;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /// Adds `who` to the list of witnessProviders for the provided `preStateRoot`.
-    function recordGasSpent(bytes32 _preStateRoot, bytes32 _txHash, address who, uint256 gasSpent) override public {
-        // The sender must be the transitioner that corresponds to the claimed pre-state root
-        address transitioner = address(iOVM_FraudVerifier(resolve("OVM_FraudVerifier")).getStateTransitioner(_preStateRoot, _txHash));
-        require(transitioner == msg.sender, Errors.ONLY_TRANSITIONER);
- 
-        witnessProviders[_preStateRoot].total += gasSpent;
-        witnessProviders[_preStateRoot].gasSpent[who] += gasSpent;
-    }
- 
-    /// Slashes + distributes rewards or frees up the sequencer's bond, only called by
-    /// `FraudVerifier.finalizeFraudVerification`
-    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) override public {
-        require(msg.sender == resolve("OVM_FraudVerifier"), Errors.ONLY_FRAUD_VERIFIER);
-        require(witnessProviders[_preStateRoot].canClaim == false, Errors.ALREADY_FINALIZED);
- 
-        // allow users to claim from that state root's
-        // pool of collateral (effectively slashing the sequencer)
-        witnessProviders[_preStateRoot].canClaim = true;
- 
-        Bond storage bond = bonds[publisher];
-        if (bond.firstDisputeAt == 0) {
-            bond.firstDisputeAt = block.timestamp;
-            bond.earliestDisputedStateRoot = _preStateRoot;
-            bond.earliestTimestamp = timestamp;
-        } else if (
-            // only update the disputed state root for the publisher if it's within
-            // the dispute period _and_ if it's before the previous one
-            block.timestamp < bond.firstDisputeAt + multiFraudProofPeriod &&
-            timestamp < bond.earliestTimestamp
-        ) {
-            bond.earliestDisputedStateRoot = _preStateRoot;
-            bond.earliestTimestamp = timestamp;
-        }
- 
-        // if the fraud proof's dispute period does not intersect with the 
-        // withdrawal's timestamp, then the user should not be slashed
-        // e.g if a user at day 10 submits a withdrawal, and a fraud proof
-        // from day 1 gets published, the user won't be slashed since day 8 (1d + 7d)
-        // is before the user started their withdrawal. on the contrary, if the user
-        // had started their withdrawal at, say, day 6, they would be slashed
-        if (
-            bond.withdrawalTimestamp != 0 && 
-            uint256(bond.withdrawalTimestamp) > timestamp + disputePeriodSeconds &&
-            bond.state == State.WITHDRAWING
-        ) {
-            return;
-        }
- 
-        // slash!
-        bond.state = State.NOT_COLLATERALIZED;
-    }
- 
-    /// Sequencers call this function to post collateral which will be used for
-    /// the `appendBatch` call
-    function deposit() override public {
-        Erequire(
-            token.transferFrom(msg.sender, address(this), requiredCollateral),
-            Errors.ERC20_ERR
-        );
- 
-        // This cannot overflow
-        bonds[msg.sender].state = State.COLLATERALIZED;
-    }
- 
-    /// Starts the withdrawal for a publisher
-    function startWithdrawal() override public {
-        Bond storage bond = bonds[msg.sender];
-        Erequire(bond.withdrawalTimestamp == 0, Errors.WITHDRAWAL_PENDING);
-        require(bond.state == State.COLLATERALIZED, Errors.WRONG_STATE);
- 
-        bond.state = State.WITHDRAWING;
-        bond.withdrawalTimestamp = uint32(block.timestamp);
-    }
- 
-    /// Finalizes a pending withdrawal from a publisher
-    function finalizeWithdrawal() override public {
-        Bond storage bond = bonds[msg.sender];
- 
-        require(
-            block.timestamp >= uint256(bond.withdrawalTimestamp) + disputePeriodSeconds, 
-            Errors.TOO_EARLY
-        );
-        require(bond.state == State.WITHDRAWING, Errors.SLASHED);
-        
-        // refunds!
-        bond.state = State.NOT_COLLATERALIZED;
-        bond.withdrawalTimestamp = 0;
-        
-        Erequire(
-            token.transfer(msg.sender, requiredCollateral),
-            Errors.ERC20_ERR
-        );
-    }
- 
-    /// Claims the user's reward for the witnesses they provided for the earliest
-    /// disputed state root of the designated publisher
-    function claim(address who) override public {
-        Bond storage bond = bonds[who];
-        require(
-            block.timestamp >= bond.firstDisputeAt + multiFraudProofPeriod,
-            Errors.WAIT_FOR_DISPUTES
-        );
- 
-        // reward the earliest state root for this publisher
-        bytes32 _preStateRoot = bond.earliestDisputedStateRoot;
-        Rewards storage rewards = witnessProviders[_preStateRoot];
- 
-        // only allow claiming if fraud was proven in `finalize`
-        require(rewards.canClaim, Errors.CANNOT_CLAIM);
- 
-        // proportional allocation - only reward 50% (rest gets locked in the
-        // contract forever
-        uint256 amount = (requiredCollateral * rewards.gasSpent[msg.sender]) / (2 * rewards.total);
- 
-        // reset the user's spent gas so they cannot double claim
-        rewards.gasSpent[msg.sender] = 0;
- 
-        // transfer
-        Erequire(token.transfer(msg.sender, amount), Errors.ERC20_ERR);
-    }
- 
-    /// Checks if the user is collateralized
-    function isCollateralized(address who) override public view returns (bool) {
-        return bonds[who].state == State.COLLATERALIZED;
-    }
- 
-    /// Gets how many witnesses the user has provided for the state root
-    function getGasSpent(bytes32 preStateRoot, address who) override public view returns (uint256) {
-        return witnessProviders[preStateRoot].gasSpent[who];
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/verification/OVM_FraudVerifier.sol.html b/coverage/OVM/verification/OVM_FraudVerifier.sol.html deleted file mode 100644 index 23d1fbb73..000000000 --- a/coverage/OVM/verification/OVM_FraudVerifier.sol.html +++ /dev/null @@ -1,953 +0,0 @@ - - - - Code coverage report for OVM/verification/OVM_FraudVerifier.sol - - - - - - - -
-
-

- all files / OVM/verification/ OVM_FraudVerifier.sol -

-
-
- 96.43% - Statements - 27/28 -
-
- 94.44% - Branches - 17/18 -
-
- 100% - Functions - 7/7 -
-
- 96.43% - Lines - 27/28 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -12× -  -  -  -12× -12× -  -12× -  -  -  -  -  -  -  -  -11× -  -  -  -  -  -  -  -  -  -10× -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - -  -  -  -  - -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
- 
-/* Contract Imports */
-import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
- 
- 
- 
-/**
- * @title OVM_FraudVerifier
- * @dev The Fraud Verifier contract coordinates the entire fraud proof verification process. 
- * If the fraud proof was successful it prunes any state batches from State Commitment Chain
- * which were published after the fraudulent state root.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_FraudVerifier is Lib_AddressResolver, Abs_FraudContributor, iOVM_FraudVerifier {
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    mapping (bytes32 => iOVM_StateTransitioner) internal transitioners;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
- 
-    /***************************************
-     * Public Functions: Transition Status *
-     ***************************************/
- 
-    /**
-     * Retrieves the state transitioner for a given root.
-     * @param _preStateRoot State root to query a transitioner for.
-     * @return _transitioner Corresponding state transitioner contract.
-     */
-    function getStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        override
-        public
-        view
-        returns (
-            iOVM_StateTransitioner _transitioner
-        )
-    {
-        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
-    }
- 
- 
-    /****************************************
-     * Public Functions: Fraud Verification *
-     ****************************************/
- 
-    /**
-     * Begins the fraud verification process.
-     * @param _preStateRoot State root before the fraudulent transaction.
-     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
-     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
-     * @param _transaction OVM transaction claimed to be fraudulent.
-     * @param _txChainElement OVM transaction chain element.
-     * @param _transactionBatchHeader Batch header for the provided transaction.
-     * @param _transactionProof Inclusion proof for the provided transaction.
-     */
-    function initializeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _transactionBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _transactionProof
-    )
-        override
-        public
-        contributesToFraudProof(_preStateRoot, Lib_OVMCodec.hashTransaction(_transaction))
-    {
-        bytes32 _txHash = Lib_OVMCodec.hashTransaction(_transaction);
- 
-        Iif (_hasStateTransitioner(_preStateRoot, _txHash)) {
-            return;
-        }
- 
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
-        iOVM_CanonicalTransactionChain ovmCanonicalTransactionChain = iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain"));
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _preStateRoot,
-                _preStateRootBatchHeader,
-                _preStateRootProof
-            ),
-            "Invalid pre-state root inclusion proof."
-        );
- 
-        require(
-            ovmCanonicalTransactionChain.verifyTransaction(
-                _transaction,
-                _txChainElement,
-                _transactionBatchHeader,
-                _transactionProof
-            ),
-            "Invalid transaction inclusion proof."
-        );
- 
-        require (
-            _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1 == _transactionBatchHeader.prevTotalElements + _transactionProof.index,
-            "Pre-state root global index must equal to the transaction root global index."
-        );
- 
-        _deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index);
- 
-        emit FraudProofInitialized(
-            _preStateRoot,
-            _preStateRootProof.index,
-            _txHash,
-            msg.sender
-        );
-    }
- 
-    /**
-     * Finalizes the fraud verification process.
-     * @param _preStateRoot State root before the fraudulent transaction.
-     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
-     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
-     * @param _txHash The transaction for the state root
-     * @param _postStateRoot State root after the fraudulent transaction.
-     * @param _postStateRootBatchHeader Batch header for the provided post-state root.
-     * @param _postStateRootProof Inclusion proof for the provided post-state root.
-     */
-    function finalizeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
-        bytes32 _txHash,
-        bytes32 _postStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _postStateRootProof
-    )
-        override
-        public
-        contributesToFraudProof(_preStateRoot, _txHash)
-    {
-        iOVM_StateTransitioner transitioner = getStateTransitioner(_preStateRoot, _txHash);
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
- 
-        require(
-            transitioner.isComplete() == true,
-            "State transition process must be completed prior to finalization."
-        );
- 
-        require (
-            _postStateRootBatchHeader.prevTotalElements + _postStateRootProof.index == _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1,
-            "Post-state root global index must equal to the pre state root global index plus one."
-        );
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _preStateRoot,
-                _preStateRootBatchHeader,
-                _preStateRootProof
-            ),
-            "Invalid pre-state root inclusion proof."
-        );
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _postStateRoot,
-                _postStateRootBatchHeader,
-                _postStateRootProof
-            ),
-            "Invalid post-state root inclusion proof."
-        );
- 
-        // If the post state root did not match, then there was fraud and we should delete the batch
-        require(
-            _postStateRoot != transitioner.getPostStateRoot(),
-            "State transition has not been proven fraudulent."
-        );
-        
-        _cancelStateTransition(_postStateRootBatchHeader, _preStateRoot);
- 
-        // TEMPORARY: Remove the transitioner; for minnet.
-        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitioner(0x0000000000000000000000000000000000000000);
- 
-        emit FraudProofFinalized(
-            _preStateRoot,
-            _preStateRootProof.index,
-            _txHash,
-            msg.sender
-        );
-    }
- 
- 
-    /************************************
-     * Internal Functions: Verification *
-     ************************************/
- 
-    /**
-     * Checks whether a transitioner already exists for a given pre-state root.
-     * @param _preStateRoot Pre-state root to check.
-     * @return _exists Whether or not we already have a transitioner for the root.
-     */
-    function _hasStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        internal
-        view
-        returns (
-            bool _exists
-        )
-    {
-        return address(getStateTransitioner(_preStateRoot, _txHash)) != address(0);
-    }
- 
-    /**
-     * Deploys a new state transitioner.
-     * @param _preStateRoot Pre-state root to initialize the transitioner with.
-     * @param _txHash Hash of the transaction this transitioner will execute.
-     * @param _stateTransitionIndex Index of the transaction in the chain.
-     */
-    function _deployTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        uint256 _stateTransitionIndex
-    )
-        internal
-    {
-        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitionerFactory(
-            resolve("OVM_StateTransitionerFactory")
-        ).create(
-            address(libAddressManager),
-            _stateTransitionIndex,
-            _preStateRoot,
-            _txHash
-        );
-    }
- 
-    /**
-     * Removes a state transition from the state commitment chain.
-     * @param _postStateRootBatchHeader Header for the post-state root.
-     * @param _preStateRoot Pre-state root hash.
-     */
-    function _cancelStateTransition(
-        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
-        bytes32 _preStateRoot
-    )
-        internal
-    {
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
-        iOVM_BondManager ovmBondManager = iOVM_BondManager(resolve("OVM_BondManager"));
- 
-        // Delete the state batch.
-        ovmStateCommitmentChain.deleteStateBatch(
-            _postStateRootBatchHeader
-        );
- 
-        // Get the timestamp and publisher for that block.
-        (uint256 timestamp, address publisher) = abi.decode(_postStateRootBatchHeader.extraData, (uint256, address));
- 
-        // Slash the bonds at the bond manager.
-        ovmBondManager.finalize(
-            _preStateRoot,
-            publisher,
-            timestamp
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/verification/OVM_StateTransitioner.sol.html b/coverage/OVM/verification/OVM_StateTransitioner.sol.html deleted file mode 100644 index e163ff151..000000000 --- a/coverage/OVM/verification/OVM_StateTransitioner.sol.html +++ /dev/null @@ -1,1484 +0,0 @@ - - - - Code coverage report for OVM/verification/OVM_StateTransitioner.sol - - - - - - - -
-
-

- all files / OVM/verification/ OVM_StateTransitioner.sol -

-
-
- 80% - Statements - 40/50 -
-
- 62.5% - Branches - 20/32 -
-
- 90.91% - Functions - 10/11 -
-
- 80.39% - Lines - 41/51 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -42× -42× -  -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  - -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
-import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
-import { Lib_SecureMerkleTrie } from "../../libraries/trie/Lib_SecureMerkleTrie.sol";
-import { Lib_RLPWriter } from "../../libraries/rlp/Lib_RLPWriter.sol";
-import { Lib_RLPReader } from "../../libraries/rlp/Lib_RLPReader.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
- 
-/* Contract Imports */
-import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
- 
-/**
- * @title OVM_StateTransitioner
- * @dev The State Transitioner coordinates the execution of a state transition during the evaluation of a
- * fraud proof. It feeds verified input to the Execution Manager's run(), and controls a State Manager (which is
- * uniquely created for each fraud proof).
- * Once a fraud proof has been initialized, this contract is provided with the pre-state root and verifies
- * that the OVM storage slots committed to the State Mangager are contained in that state
- * This contract controls the State Manager and Execution Manager, and uses them to calculate the
- * post-state root by applying the transaction. The Fraud Verifier can then check for fraud by comparing
- * the calculated post-state root with the proposed post-state root.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateTransitioner is Lib_AddressResolver, Abs_FraudContributor, iOVM_StateTransitioner {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum TransitionPhase {
-        PRE_EXECUTION,
-        POST_EXECUTION,
-        COMPLETE
-    }
- 
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    iOVM_StateManager public ovmStateManager;
- 
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    bytes32 internal preStateRoot;
-    bytes32 internal postStateRoot;
-    TransitionPhase public phase;
-    uint256 internal stateTransitionIndex;
-    bytes32 internal transactionHash;
- 
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 internal constant EMPTY_ACCOUNT_CODE_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
-    bytes32 internal constant EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _stateTransitionIndex Index of the state transition being verified.
-     * @param _preStateRoot State root before the transition was executed.
-     * @param _transactionHash Hash of the executed transaction.
-     */
-    constructor(
-        address _libAddressManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        stateTransitionIndex = _stateTransitionIndex;
-        preStateRoot = _preStateRoot;
-        postStateRoot = _preStateRoot;
-        transactionHash = _transactionHash;
- 
-        ovmStateManager = iOVM_StateManagerFactory(resolve("OVM_StateManagerFactory")).create(address(this));
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Checks that a function is only run during a specific phase.
-     * @param _phase Phase the function must run within.
-     */
-    modifier onlyDuringPhase(
-        TransitionPhase _phase
-    ) {
-        Erequire(
-            phase == _phase,
-            "Function must be called during the correct phase."
-        );
-        _;
-    }
- 
- 
-    /**********************************
-     * Public Functions: State Access *
-     **********************************/
- 
-    /**
-     * Retrieves the state root before execution.
-     * @return _preStateRoot State root before execution.
-     */
-    function getPreStateRoot()
-        override
-        public
-        view
-        returns (
-            bytes32 _preStateRoot
-        )
-    {
-        return preStateRoot;
-    }
- 
-    /**
-     * Retrieves the state root after execution.
-     * @return _postStateRoot State root after execution.
-     */
-    function getPostStateRoot()
-        override
-        public
-        view
-        returns (
-            bytes32 _postStateRoot
-        )
-    {
-        return postStateRoot;
-    }
- 
-    /**
-     * Checks whether the transitioner is complete.
-     * @return _complete Whether or not the transition process is finished.
-     */
-    function isComplete()
-        override
-        public
-        view
-        returns (
-            bool _complete
-        )
-    {
-        return phase == TransitionPhase.COMPLETE;
-    }
-    
- 
-    /***********************************
-     * Public Functions: Pre-Execution *
-     ***********************************/
- 
-    /**
-     * Allows a user to prove the initial state of a contract.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _ethContractAddress Address of the corresponding contract on L1.
-     * @param _stateTrieWitness Proof of the account state.
-     */
-    function proveContractState(
-        address _ovmContractAddress,
-        address _ethContractAddress,
-        bytes memory _stateTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        // Exit quickly to avoid unnecessary work.
-        Erequire(
-            (
-                ovmStateManager.hasAccount(_ovmContractAddress) == false
-                && ovmStateManager.hasEmptyAccount(_ovmContractAddress) == false
-            ),
-            "Account state has already been proven."
-        );
- 
-        // Function will fail if the proof is not a valid inclusion or exclusion proof.
-        (
-            bool exists,
-            bytes memory encodedAccount
-        ) = Lib_SecureMerkleTrie.get(
-            abi.encodePacked(_ovmContractAddress),
-            _stateTrieWitness,
-            preStateRoot
-        );
- 
-        Eif (exists == true) {
-            // Account exists, this was an inclusion proof.
-            Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
-                encodedAccount
-            );
- 
-            address ethContractAddress = _ethContractAddress;
-            Iif (account.codeHash == EMPTY_ACCOUNT_CODE_HASH) {
-                // Use a known empty contract to prevent an attack in which a user provides a
-                // contract address here and then later deploys code to it.
-                ethContractAddress = 0x0000000000000000000000000000000000000000;
-            } else {
-                // Otherwise, make sure that the code at the provided eth address matches the hash
-                // of the code stored on L2.
-                Erequire(
-                    Lib_EthUtils.getCodeHash(ethContractAddress) == account.codeHash,
-                    "OVM_StateTransitioner: Provided L1 contract code hash does not match L2 contract code hash."
-                );
-            }
- 
-            ovmStateManager.putAccount(
-                _ovmContractAddress,
-                Lib_OVMCodec.Account({
-                    nonce: account.nonce,
-                    balance: account.balance,
-                    storageRoot: account.storageRoot,
-                    codeHash: account.codeHash,
-                    ethAddress: ethContractAddress,
-                    isFresh: false
-                })
-            );
-        } else {
-            // Account does not exist, this was an exclusion proof.
-            ovmStateManager.putEmptyAccount(_ovmContractAddress);
-        }
-    }
- 
-    /**
-     * Allows a user to prove the initial state of a contract storage slot.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _key Claimed account slot key.
-     * @param _storageTrieWitness Proof of the storage slot.
-     */
-    function proveStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes memory _storageTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        // Exit quickly to avoid unnecessary work.
-        Erequire(
-            ovmStateManager.hasContractStorage(_ovmContractAddress, _key) == false,
-            "Storage slot has already been proven."
-        );
- 
-        require(
-            ovmStateManager.hasAccount(_ovmContractAddress) == true,
-            "Contract must be verified before proving a storage slot."
-        );
- 
-        bytes32 storageRoot = ovmStateManager.getAccountStorageRoot(_ovmContractAddress);
-        bytes32 value;
- 
-        Iif (storageRoot == EMPTY_ACCOUNT_STORAGE_ROOT) {
-            // Storage trie was empty, so the user is always allowed to insert zero-byte values.
-            value = bytes32(0);
-        } else {
-            // Function will fail if the proof is not a valid inclusion or exclusion proof.
-            (
-                bool exists,
-                bytes memory encodedValue
-            ) = Lib_SecureMerkleTrie.get(
-                abi.encodePacked(_key),
-                _storageTrieWitness,
-                storageRoot
-            );
- 
-            Eif (exists == true) {
-                // Inclusion proof.
-                // Stored values are RLP encoded, with leading zeros removed.
-                value = Lib_BytesUtils.toBytes32PadLeft(
-                    Lib_RLPReader.readBytes(encodedValue)
-                );
-            } else {
-                // Exclusion proof, can only be zero bytes.
-                value = bytes32(0);
-            }
-        }
- 
-        ovmStateManager.putContractStorage(
-            _ovmContractAddress,
-            _key,
-            value
-        );
-    }
- 
- 
-    /*******************************
-     * Public Functions: Execution *
-     *******************************/
- 
-    /**
-     * Executes the state transition.
-     * @param _transaction OVM transaction to execute.
-     */
-    function applyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        Irequire(
-            Lib_OVMCodec.hashTransaction(_transaction) == transactionHash,
-            "Invalid transaction provided."
-        );
- 
-        // We require gas to complete the logic here in run() before/after execution,
-        // But must ensure the full _tx.gasLimit can be given to the ovmCALL (determinism)
-        // This includes 1/64 of the gas getting lost because of EIP-150 (lost twice--first 
-        // going into EM, then going into the code contract).
-        require(
-            gasleft() >= 100000 + _transaction.gasLimit * 1032 / 1000, // 1032/1000 = 1.032 = (64/63)^2 rounded up
-            "Not enough gas to execute transaction deterministically."
-        );
- 
-        iOVM_ExecutionManager ovmExecutionManager = iOVM_ExecutionManager(resolve("OVM_ExecutionManager"));
- 
-        // We call `setExecutionManager` right before `run` (and not earlier) just in case the
-        // OVM_ExecutionManager address was updated between the time when this contract was created
-        // and when `applyTransaction` was called.
-        ovmStateManager.setExecutionManager(address(ovmExecutionManager));
- 
-        // `run` always succeeds *unless* the user hasn't provided enough gas to `applyTransaction`
-        // or an INVALID_STATE_ACCESS flag was triggered. Either way, we won't get beyond this line
-        // if that's the case.
-        ovmExecutionManager.run(_transaction, address(ovmStateManager));
- 
-        phase = TransitionPhase.POST_EXECUTION;
-    }
- 
- 
-    /************************************
-     * Public Functions: Post-Execution *
-     ************************************/
- 
-    /**
-     * Allows a user to commit the final state of a contract.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _stateTrieWitness Proof of the account state.
-     */
-    function commitContractState(
-        address _ovmContractAddress,
-        bytes memory _stateTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        Erequire(
-            ovmStateManager.getTotalUncommittedContractStorage() == 0,
-            "All storage must be committed before committing account states."
-        );
- 
-        require (
-            ovmStateManager.commitAccount(_ovmContractAddress) == true,
-            "Account state wasn't changed or has already been committed."
-        );
- 
-        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
- 
-        postStateRoot = Lib_SecureMerkleTrie.update(
-            abi.encodePacked(_ovmContractAddress),
-            Lib_OVMCodec.encodeEVMAccount(
-                Lib_OVMCodec.toEVMAccount(account)
-            ),
-            _stateTrieWitness,
-            postStateRoot
-        );
- 
-        // Emit an event to help clients figure out the proof ordering.
-        emit AccountCommitted(
-            _ovmContractAddress
-        );
-    }
- 
-    /**
-     * Allows a user to commit the final state of a contract storage slot.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _key Claimed account slot key.
-     * @param _storageTrieWitness Proof of the storage slot.
-     */
-    function commitStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes memory _storageTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        require(
-            ovmStateManager.commitContractStorage(_ovmContractAddress, _key) == true,
-            "Storage slot value wasn't changed or has already been committed."
-        );
- 
-        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
-        bytes32 value = ovmStateManager.getContractStorage(_ovmContractAddress, _key);
- 
-        account.storageRoot = Lib_SecureMerkleTrie.update(
-            abi.encodePacked(_key),
-            Lib_RLPWriter.writeBytes(
-                Lib_Bytes32Utils.removeLeadingZeros(value)
-            ),
-            _storageTrieWitness,
-            account.storageRoot
-        );
- 
-        ovmStateManager.putAccount(_ovmContractAddress, account);
- 
-        // Emit an event to help clients figure out the proof ordering.
-        emit ContractStorageCommitted(
-            _ovmContractAddress,
-            _key
-        );
-    }
- 
- 
-    /**********************************
-     * Public Functions: Finalization *
-     **********************************/
- 
-    /**
-     * Finalizes the transition process.
-     */
-    function completeTransition()
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-    {
-        require(
-            ovmStateManager.getTotalUncommittedAccounts() == 0,
-            "All accounts must be committed before completing a transition."
-        );
- 
-        require(
-            ovmStateManager.getTotalUncommittedContractStorage() == 0,
-            "All storage must be committed before completing a transition."
-        );
- 
-        phase = TransitionPhase.COMPLETE;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/verification/OVM_StateTransitionerFactory.sol.html b/coverage/OVM/verification/OVM_StateTransitionerFactory.sol.html deleted file mode 100644 index d817cc23b..000000000 --- a/coverage/OVM/verification/OVM_StateTransitionerFactory.sol.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - Code coverage report for OVM/verification/OVM_StateTransitionerFactory.sol - - - - - - - -
-
-

- all files / OVM/verification/ OVM_StateTransitionerFactory.sol -

-
-
- 50% - Statements - 1/2 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 2/2 -
-
- 50% - Lines - 1/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
- 
-/* Contract Imports */
-import { OVM_StateTransitioner } from "./OVM_StateTransitioner.sol";
- 
-/**
- * @title OVM_StateTransitionerFactory
- * @dev The State Transitioner Factory is used by the Fraud Verifier to create a new State 
- * Transitioner during the initialization of a fraud proof.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateTransitionerFactory is iOVM_StateTransitionerFactory, Lib_AddressResolver {
- 
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    /**
-     * Creates a new OVM_StateTransitioner
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _stateTransitionIndex Index of the state transition being verified.
-     * @param _preStateRoot State root before the transition was executed.
-     * @param _transactionHash Hash of the executed transaction.
-     * @return _ovmStateTransitioner New OVM_StateTransitioner instance.
-     */
-    function create(
-        address _libAddressManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        override
-        public
-        returns (
-            iOVM_StateTransitioner _ovmStateTransitioner
-        )
-    {
-        Irequire(
-            msg.sender == resolve("OVM_FraudVerifier"),
-            "Create can only be done by the OVM_FraudVerifier."
-        );
-        return new OVM_StateTransitioner(
-            _libAddressManager,
-            _stateTransitionIndex,
-            _preStateRoot,
-            _transactionHash
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/OVM/verification/index.html b/coverage/OVM/verification/index.html deleted file mode 100644 index ddf93ed3b..000000000 --- a/coverage/OVM/verification/index.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - Code coverage report for OVM/verification/ - - - - - - - -
-
-

- all files OVM/verification/ -

-
-
- 90.4% - Statements - 113/125 -
-
- 78.05% - Branches - 64/82 -
-
- 96.67% - Functions - 29/30 -
-
- 90.48% - Lines - 114/126 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_FraudContributor.sol
100%3/3100%0/0100%1/1100%4/4
OVM_BondManager.sol
100%42/4286.67%26/30100%9/9100%41/41
OVM_FraudVerifier.sol
96.43%27/2894.44%17/18100%7/796.43%27/28
OVM_StateTransitioner.sol
80%40/5062.5%20/3290.91%10/1180.39%41/51
OVM_StateTransitionerFactory.sol
50%1/250%1/2100%2/250%1/2
-
-
- - - - - - - diff --git a/coverage/base.css b/coverage/base.css deleted file mode 100644 index 29737bcb0..000000000 --- a/coverage/base.css +++ /dev/null @@ -1,213 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.medium .chart { border:1px solid #f9cd0b; } -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } -/* light gray */ -span.cline-neutral { background: #eaeaea; } - -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json deleted file mode 100644 index 2a84143c0..000000000 --- a/coverage/coverage-final.json +++ /dev/null @@ -1,78 +0,0 @@ -{ -"contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol":{"l":{"23":78,"37":9,"42":6,"47":3,"65":22,"79":7},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol","s":{"1":78,"2":9,"3":6,"4":22,"5":7},"b":{"1":[6,3],"2":[3,3]},"f":{"1":78,"2":9,"3":22,"4":7},"fnMap":{"1":{"name":"constructor","line":20,"loc":{"start":{"line":20,"column":4},"end":{"line":24,"column":4}}},"2":{"name":"onlyFromCrossDomainAccount","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"getCrossDomainMessenger","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":66,"column":4}}},"4":{"name":"sendCrossDomainMessage","line":74,"loc":{"start":{"line":74,"column":4},"end":{"line":80,"column":4}}}},"statementMap":{"1":{"start":{"line":23,"column":8},"end":{"line":23,"column":29}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1159}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":1311}},"4":{"start":{"line":65,"column":8},"end":{"line":65,"column":55}},"5":{"start":{"line":79,"column":8},"end":{"line":79,"column":82}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":8}},{"start":{"line":42,"column":8},"end":{"line":42,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol":{"l":{"119":7,"120":1,"131":1,"141":6,"143":6,"168":5,"195":5,"196":2,"205":3,"207":3,"208":3,"209":3,"210":3,"211":1,"213":2,"215":3,"216":3,"217":3,"218":3,"219":3,"221":3,"239":25,"264":25,"281":1,"303":1,"308":1,"313":1,"318":1,"319":1,"321":1,"338":6,"340":6,"362":107},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol","s":{"1":7,"2":1,"3":1,"4":6,"5":6,"6":5,"7":5,"8":2,"9":3,"10":3,"11":3,"12":3,"13":3,"14":1,"15":2,"16":3,"17":3,"18":3,"19":3,"20":3,"21":3,"22":25,"23":25,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":6,"32":6,"33":107},"b":{"1":[1,6],"2":[2,3],"3":[1,2]},"f":{"1":7,"2":5,"3":5,"4":25,"5":25,"6":1,"7":1,"8":6,"9":107},"fnMap":{"1":{"name":"decodeEIP155Transaction","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":153,"column":4}}},"2":{"name":"decompressEIP155Transaction","line":160,"loc":{"start":{"line":160,"column":4},"end":{"line":177,"column":4}}},"3":{"name":"encodeEIP155Transaction","line":185,"loc":{"start":{"line":185,"column":4},"end":{"line":223,"column":4}}},"4":{"name":"encodeTransaction","line":230,"loc":{"start":{"line":230,"column":4},"end":{"line":248,"column":4}}},"5":{"name":"hashTransaction","line":255,"loc":{"start":{"line":255,"column":4},"end":{"line":265,"column":4}}},"6":{"name":"toEVMAccount","line":272,"loc":{"start":{"line":272,"column":4},"end":{"line":287,"column":4}}},"7":{"name":"encodeEVMAccount","line":294,"loc":{"start":{"line":294,"column":4},"end":{"line":322,"column":4}}},"8":{"name":"decodeEVMAccount","line":329,"loc":{"start":{"line":329,"column":4},"end":{"line":346,"column":4}}},"9":{"name":"hashBatchHeader","line":353,"loc":{"start":{"line":353,"column":4},"end":{"line":370,"column":4}}}},"statementMap":{"1":{"start":{"line":119,"column":8},"end":{"line":119,"column":2703}},"2":{"start":{"line":120,"column":12},"end":{"line":120,"column":2747}},"3":{"start":{"line":131,"column":12},"end":{"line":131,"column":3104}},"4":{"start":{"line":141,"column":12},"end":{"line":141,"column":89}},"5":{"start":{"line":143,"column":12},"end":{"line":143,"column":3487}},"6":{"start":{"line":168,"column":8},"end":{"line":168,"column":4339}},"7":{"start":{"line":195,"column":8},"end":{"line":195,"column":5277}},"8":{"start":{"line":196,"column":12},"end":{"line":196,"column":5321}},"9":{"start":{"line":205,"column":12},"end":{"line":205,"column":47}},"10":{"start":{"line":207,"column":12},"end":{"line":207,"column":63}},"11":{"start":{"line":208,"column":12},"end":{"line":208,"column":66}},"12":{"start":{"line":209,"column":12},"end":{"line":209,"column":66}},"13":{"start":{"line":210,"column":12},"end":{"line":210,"column":5856}},"14":{"start":{"line":211,"column":16},"end":{"line":211,"column":52}},"15":{"start":{"line":213,"column":16},"end":{"line":213,"column":67}},"16":{"start":{"line":215,"column":12},"end":{"line":215,"column":46}},"17":{"start":{"line":216,"column":12},"end":{"line":216,"column":63}},"18":{"start":{"line":217,"column":12},"end":{"line":217,"column":65}},"19":{"start":{"line":218,"column":12},"end":{"line":218,"column":55}},"20":{"start":{"line":219,"column":12},"end":{"line":219,"column":55}},"21":{"start":{"line":221,"column":12},"end":{"line":221,"column":47}},"22":{"start":{"line":239,"column":8},"end":{"line":239,"column":6746}},"23":{"start":{"line":264,"column":8},"end":{"line":264,"column":57}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":7723}},"25":{"start":{"line":303,"column":8},"end":{"line":303,"column":43}},"26":{"start":{"line":308,"column":8},"end":{"line":308,"column":8466}},"27":{"start":{"line":313,"column":8},"end":{"line":313,"column":8623}},"28":{"start":{"line":318,"column":8},"end":{"line":318,"column":80}},"29":{"start":{"line":319,"column":8},"end":{"line":319,"column":77}},"30":{"start":{"line":321,"column":8},"end":{"line":321,"column":43}},"31":{"start":{"line":338,"column":8},"end":{"line":338,"column":86}},"32":{"start":{"line":340,"column":8},"end":{"line":340,"column":9427}},"33":{"start":{"line":362,"column":8},"end":{"line":362,"column":10058}}},"branchMap":{"1":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":8},"end":{"line":119,"column":8}},{"start":{"line":119,"column":8},"end":{"line":119,"column":8}}]},"2":{"line":195,"type":"if","locations":[{"start":{"line":195,"column":8},"end":{"line":195,"column":8}},{"start":{"line":195,"column":8},"end":{"line":195,"column":8}}]},"3":{"line":210,"type":"if","locations":[{"start":{"line":210,"column":12},"end":{"line":210,"column":12}},{"start":{"line":210,"column":12},"end":{"line":210,"column":12}}]}}}, -"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol":{"l":{"39":379,"40":379,"50":2107,"67":2486},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol","s":{"1":379,"2":379,"3":2107,"4":2486},"b":{},"f":{"1":379,"2":2107,"3":2486},"fnMap":{"1":{"name":"setAddress","line":37,"loc":{"start":{"line":32,"column":4},"end":{"line":41,"column":4}}},"2":{"name":"getAddress","line":43,"loc":{"start":{"line":43,"column":4},"end":{"line":51,"column":4}}},"3":{"name":"_getNameHash","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":68,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":40}},"2":{"start":{"line":40,"column":8},"end":{"line":40,"column":48}},"3":{"start":{"line":50,"column":8},"end":{"line":50,"column":45}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":49}}},"branchMap":{}}, -"contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol":{"l":{"29":1041,"46":2076},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol","s":{"1":1041,"2":2076},"b":{},"f":{"1":1041,"2":2076},"fnMap":{"1":{"name":"constructor","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":30,"column":4}}},"2":{"name":"resolve","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":47,"column":4}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":65}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":50}}},"branchMap":{}}, -"contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol":{"l":{"32":120,"33":120,"42":379,"46":379,"59":0,"60":0,"68":0,"73":0,"74":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol","s":{"1":120,"2":120,"3":379,"4":0,"5":0,"6":0,"7":0,"8":0},"b":{"1":[379,0],"2":[0,0]},"f":{"1":120,"2":379,"3":0,"4":0},"fnMap":{"1":{"name":"constructor","line":31,"loc":{"start":{"line":31,"column":4},"end":{"line":34,"column":4}}},"2":{"name":"onlyOwner","line":41,"loc":{"start":{"line":41,"column":4},"end":{"line":47,"column":4}}},"3":{"name":"renounceOwnership","line":57,"loc":{"start":{"line":54,"column":4},"end":{"line":61,"column":4}}},"4":{"name":"transferOwnership","line":66,"loc":{"start":{"line":63,"column":4},"end":{"line":75,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":25}},"2":{"start":{"line":33,"column":8},"end":{"line":33,"column":52}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":791}},"4":{"start":{"line":59,"column":8},"end":{"line":59,"column":52}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":25}},"6":{"start":{"line":68,"column":8},"end":{"line":68,"column":1280}},"7":{"start":{"line":73,"column":8},"end":{"line":73,"column":51}},"8":{"start":{"line":74,"column":8},"end":{"line":74,"column":24}}},"branchMap":{"1":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":8}},{"start":{"line":42,"column":8},"end":{"line":42,"column":8}}]},"2":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":8},"end":{"line":68,"column":8}},{"start":{"line":68,"column":8},"end":{"line":68,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol":{"l":{"42":36,"43":36,"54":31,"55":31,"60":31,"62":31,"63":22,"67":9},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol","s":{"1":36,"2":36,"3":31,"4":31,"5":31,"6":31},"b":{"1":[31,0],"2":[22,9]},"f":{"1":36,"2":31},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":4}}},"2":{"name":null,"line":51,"loc":{"start":{"line":51,"column":4},"end":{"line":71,"column":4}}}},"statementMap":{"1":{"start":{"line":42,"column":8},"end":{"line":42,"column":77}},"2":{"start":{"line":43,"column":8},"end":{"line":43,"column":62}},"3":{"start":{"line":54,"column":8},"end":{"line":54,"column":102}},"4":{"start":{"line":55,"column":8},"end":{"line":55,"column":1765}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":79}},"6":{"start":{"line":62,"column":8},"end":{"line":62,"column":1960}}},"branchMap":{"1":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":8},"end":{"line":55,"column":8}},{"start":{"line":55,"column":8},"end":{"line":55,"column":8}}]},"2":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol":{"l":{"55":512,"56":512,"60":512,"80":450,"86":446,"95":446,"97":446,"98":446,"99":446,"100":4230,"105":4230,"113":4230,"118":4230,"119":4230,"123":446,"127":446,"144":450,"163":651,"169":651,"174":651,"191":4,"210":5,"227":5,"246":68,"251":68,"257":68,"262":68,"263":68,"264":68,"273":68,"290":0,"309":56,"326":8,"345":2,"350":2,"351":2,"352":2,"356":2,"373":2,"392":7,"393":1,"396":6,"401":6,"418":1,"437":776,"463":5399,"468":5395,"469":5395,"470":5395,"474":5395,"477":33,"481":4334,"483":4334,"488":4334,"491":536,"493":536,"498":536,"499":536,"507":536,"512":536,"515":89,"517":89,"522":89,"525":403,"527":403,"532":403,"533":403,"541":403,"546":403,"568":1427,"569":1427,"570":1,"573":1426,"574":1426,"575":1426,"580":1426,"581":2634,"585":2634,"586":2634,"590":1426,"591":1426,"601":1426,"618":776},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol","s":{"1":512,"2":512,"3":450,"4":446,"5":446,"6":446,"7":446,"8":446,"9":4230,"10":4230,"11":4230,"12":4230,"13":4230,"14":446,"15":450,"16":651,"17":651,"18":651,"19":4,"20":5,"21":5,"22":68,"23":68,"24":68,"25":68,"26":68,"27":68,"28":0,"29":56,"30":8,"31":2,"32":2,"33":2,"34":2,"35":2,"36":7,"37":1,"38":6,"39":6,"40":1,"41":776,"42":5399,"43":5395,"44":5395,"45":5395,"46":33,"47":5362,"48":4334,"49":4334,"50":4334,"51":1028,"52":536,"53":536,"54":536,"55":536,"56":536,"57":492,"58":89,"59":89,"60":89,"61":403,"62":403,"63":403,"64":403,"65":403,"66":1427,"67":1427,"68":1,"69":1426,"70":1426,"71":1426,"72":2634,"73":2634,"74":1426,"75":1426,"76":776},"b":{"1":[446,0],"2":[4230,0],"3":[651,0],"4":[68,0],"5":[68,0],"6":[2,0],"7":[1,6],"8":[6,0],"9":[5395,4],"10":[33,5362],"11":[4334,1028],"12":[4334,0],"13":[536,492],"14":[536,0],"15":[536,0],"16":[89,403],"17":[89,0],"18":[403,0],"19":[403,0],"20":[1,1426]},"f":{"1":512,"2":450,"3":450,"4":651,"5":4,"6":5,"7":5,"8":68,"9":0,"10":56,"11":8,"12":2,"13":2,"14":7,"15":1,"16":776,"17":5399,"18":1427,"19":776},"fnMap":{"1":{"name":"toRLPItem","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":64,"column":4}}},"2":{"name":"readList","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":128,"column":4}}},"3":{"name":"readList","line":135,"loc":{"start":{"line":135,"column":4},"end":{"line":147,"column":4}}},"4":{"name":"readBytes","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":175,"column":4}}},"5":{"name":"readBytes","line":182,"loc":{"start":{"line":182,"column":4},"end":{"line":194,"column":4}}},"6":{"name":"readString","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":211,"column":4}}},"7":{"name":"readString","line":218,"loc":{"start":{"line":218,"column":4},"end":{"line":230,"column":4}}},"8":{"name":"readBytes32","line":237,"loc":{"start":{"line":237,"column":4},"end":{"line":274,"column":4}}},"9":{"name":"readBytes32","line":281,"loc":{"start":{"line":281,"column":4},"end":{"line":293,"column":4}}},"10":{"name":"readUint256","line":300,"loc":{"start":{"line":300,"column":4},"end":{"line":310,"column":4}}},"11":{"name":"readUint256","line":317,"loc":{"start":{"line":317,"column":4},"end":{"line":329,"column":4}}},"12":{"name":"readBool","line":336,"loc":{"start":{"line":336,"column":4},"end":{"line":357,"column":4}}},"13":{"name":"readBool","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":376,"column":4}}},"14":{"name":"readAddress","line":383,"loc":{"start":{"line":383,"column":4},"end":{"line":402,"column":4}}},"15":{"name":"readAddress","line":409,"loc":{"start":{"line":409,"column":4},"end":{"line":421,"column":4}}},"16":{"name":"readRawBytes","line":428,"loc":{"start":{"line":428,"column":4},"end":{"line":438,"column":4}}},"17":{"name":"_decodeLength","line":452,"loc":{"start":{"line":452,"column":4},"end":{"line":548,"column":4}}},"18":{"name":"_copy","line":557,"loc":{"start":{"line":557,"column":4},"end":{"line":602,"column":4}}},"19":{"name":"_copy","line":609,"loc":{"start":{"line":609,"column":4},"end":{"line":619,"column":4}}}},"statementMap":{"1":{"start":{"line":55,"column":8},"end":{"line":55,"column":19}},"2":{"start":{"line":60,"column":8},"end":{"line":60,"column":1063}},"3":{"start":{"line":80,"column":8},"end":{"line":80,"column":1475}},"4":{"start":{"line":86,"column":8},"end":{"line":86,"column":1575}},"5":{"start":{"line":95,"column":8},"end":{"line":95,"column":61}},"6":{"start":{"line":97,"column":8},"end":{"line":97,"column":29}},"7":{"start":{"line":98,"column":8},"end":{"line":98,"column":35}},"8":{"start":{"line":99,"column":8},"end":{"line":99,"column":2213}},"9":{"start":{"line":100,"column":12},"end":{"line":100,"column":2259}},"10":{"start":{"line":105,"column":12},"end":{"line":105,"column":2405}},"11":{"start":{"line":113,"column":12},"end":{"line":113,"column":2630}},"12":{"start":{"line":118,"column":12},"end":{"line":118,"column":25}},"13":{"start":{"line":119,"column":12},"end":{"line":119,"column":44}},"14":{"start":{"line":127,"column":8},"end":{"line":127,"column":18}},"15":{"start":{"line":144,"column":8},"end":{"line":144,"column":3303}},"16":{"start":{"line":163,"column":8},"end":{"line":163,"column":3665}},"17":{"start":{"line":169,"column":8},"end":{"line":169,"column":3783}},"18":{"start":{"line":174,"column":8},"end":{"line":174,"column":53}},"19":{"start":{"line":191,"column":8},"end":{"line":191,"column":4230}},"20":{"start":{"line":210,"column":8},"end":{"line":210,"column":37}},"21":{"start":{"line":227,"column":8},"end":{"line":227,"column":4903}},"22":{"start":{"line":246,"column":8},"end":{"line":246,"column":5252}},"23":{"start":{"line":251,"column":8},"end":{"line":251,"column":5374}},"24":{"start":{"line":257,"column":8},"end":{"line":257,"column":5492}},"25":{"start":{"line":262,"column":8},"end":{"line":262,"column":42}},"26":{"start":{"line":263,"column":8},"end":{"line":263,"column":19}},"27":{"start":{"line":273,"column":8},"end":{"line":273,"column":18}},"28":{"start":{"line":290,"column":8},"end":{"line":290,"column":6212}},"29":{"start":{"line":309,"column":8},"end":{"line":309,"column":40}},"30":{"start":{"line":326,"column":8},"end":{"line":326,"column":6888}},"31":{"start":{"line":345,"column":8},"end":{"line":345,"column":7220}},"32":{"start":{"line":350,"column":8},"end":{"line":350,"column":29}},"33":{"start":{"line":351,"column":8},"end":{"line":351,"column":19}},"34":{"start":{"line":356,"column":8},"end":{"line":356,"column":23}},"35":{"start":{"line":373,"column":8},"end":{"line":373,"column":7731}},"36":{"start":{"line":392,"column":8},"end":{"line":392,"column":8078}},"37":{"start":{"line":393,"column":12},"end":{"line":393,"column":29}},"38":{"start":{"line":396,"column":8},"end":{"line":396,"column":8151}},"39":{"start":{"line":401,"column":8},"end":{"line":401,"column":40}},"40":{"start":{"line":418,"column":8},"end":{"line":418,"column":8577}},"41":{"start":{"line":437,"column":8},"end":{"line":437,"column":25}},"42":{"start":{"line":463,"column":8},"end":{"line":463,"column":9468}},"43":{"start":{"line":468,"column":8},"end":{"line":468,"column":29}},"44":{"start":{"line":469,"column":8},"end":{"line":469,"column":22}},"45":{"start":{"line":474,"column":8},"end":{"line":474,"column":9691}},"46":{"start":{"line":477,"column":12},"end":{"line":477,"column":48}},"47":{"start":{"line":478,"column":15},"end":{"line":478,"column":9807}},"48":{"start":{"line":481,"column":12},"end":{"line":481,"column":42}},"49":{"start":{"line":483,"column":12},"end":{"line":483,"column":9932}},"50":{"start":{"line":488,"column":12},"end":{"line":488,"column":53}},"51":{"start":{"line":489,"column":15},"end":{"line":489,"column":10104}},"52":{"start":{"line":491,"column":12},"end":{"line":491,"column":47}},"53":{"start":{"line":493,"column":12},"end":{"line":493,"column":10220}},"54":{"start":{"line":498,"column":12},"end":{"line":498,"column":26}},"55":{"start":{"line":507,"column":12},"end":{"line":507,"column":10602}},"56":{"start":{"line":512,"column":12},"end":{"line":512,"column":67}},"57":{"start":{"line":513,"column":15},"end":{"line":513,"column":10801}},"58":{"start":{"line":515,"column":12},"end":{"line":515,"column":43}},"59":{"start":{"line":517,"column":12},"end":{"line":517,"column":10912}},"60":{"start":{"line":522,"column":12},"end":{"line":522,"column":54}},"61":{"start":{"line":525,"column":12},"end":{"line":525,"column":48}},"62":{"start":{"line":527,"column":12},"end":{"line":527,"column":11179}},"63":{"start":{"line":532,"column":12},"end":{"line":532,"column":27}},"64":{"start":{"line":541,"column":12},"end":{"line":541,"column":11561}},"65":{"start":{"line":546,"column":12},"end":{"line":546,"column":69}},"66":{"start":{"line":568,"column":8},"end":{"line":568,"column":45}},"67":{"start":{"line":569,"column":8},"end":{"line":569,"column":12253}},"68":{"start":{"line":570,"column":12},"end":{"line":570,"column":22}},"69":{"start":{"line":573,"column":8},"end":{"line":573,"column":36}},"70":{"start":{"line":574,"column":8},"end":{"line":574,"column":20}},"71":{"start":{"line":580,"column":8},"end":{"line":580,"column":12497}},"72":{"start":{"line":585,"column":12},"end":{"line":585,"column":20}},"73":{"start":{"line":586,"column":12},"end":{"line":586,"column":21}},"74":{"start":{"line":590,"column":8},"end":{"line":590,"column":55}},"75":{"start":{"line":601,"column":8},"end":{"line":601,"column":18}},"76":{"start":{"line":618,"column":8},"end":{"line":618,"column":44}}},"branchMap":{"1":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"2":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":12},"end":{"line":100,"column":12}},{"start":{"line":100,"column":12},"end":{"line":100,"column":12}}]},"3":{"line":169,"type":"if","locations":[{"start":{"line":169,"column":8},"end":{"line":169,"column":8}},{"start":{"line":169,"column":8},"end":{"line":169,"column":8}}]},"4":{"line":246,"type":"if","locations":[{"start":{"line":246,"column":8},"end":{"line":246,"column":8}},{"start":{"line":246,"column":8},"end":{"line":246,"column":8}}]},"5":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":8},"end":{"line":257,"column":8}},{"start":{"line":257,"column":8},"end":{"line":257,"column":8}}]},"6":{"line":345,"type":"if","locations":[{"start":{"line":345,"column":8},"end":{"line":345,"column":8}},{"start":{"line":345,"column":8},"end":{"line":345,"column":8}}]},"7":{"line":392,"type":"if","locations":[{"start":{"line":392,"column":8},"end":{"line":392,"column":8}},{"start":{"line":392,"column":8},"end":{"line":392,"column":8}}]},"8":{"line":396,"type":"if","locations":[{"start":{"line":396,"column":8},"end":{"line":396,"column":8}},{"start":{"line":396,"column":8},"end":{"line":396,"column":8}}]},"9":{"line":463,"type":"if","locations":[{"start":{"line":463,"column":8},"end":{"line":463,"column":8}},{"start":{"line":463,"column":8},"end":{"line":463,"column":8}}]},"10":{"line":474,"type":"if","locations":[{"start":{"line":474,"column":8},"end":{"line":474,"column":8}},{"start":{"line":474,"column":8},"end":{"line":474,"column":8}}]},"11":{"line":478,"type":"if","locations":[{"start":{"line":478,"column":15},"end":{"line":478,"column":15}},{"start":{"line":478,"column":15},"end":{"line":478,"column":15}}]},"12":{"line":483,"type":"if","locations":[{"start":{"line":483,"column":12},"end":{"line":483,"column":12}},{"start":{"line":483,"column":12},"end":{"line":483,"column":12}}]},"13":{"line":489,"type":"if","locations":[{"start":{"line":489,"column":15},"end":{"line":489,"column":15}},{"start":{"line":489,"column":15},"end":{"line":489,"column":15}}]},"14":{"line":493,"type":"if","locations":[{"start":{"line":493,"column":12},"end":{"line":493,"column":12}},{"start":{"line":493,"column":12},"end":{"line":493,"column":12}}]},"15":{"line":507,"type":"if","locations":[{"start":{"line":507,"column":12},"end":{"line":507,"column":12}},{"start":{"line":507,"column":12},"end":{"line":507,"column":12}}]},"16":{"line":513,"type":"if","locations":[{"start":{"line":513,"column":15},"end":{"line":513,"column":15}},{"start":{"line":513,"column":15},"end":{"line":513,"column":15}}]},"17":{"line":517,"type":"if","locations":[{"start":{"line":517,"column":12},"end":{"line":517,"column":12}},{"start":{"line":517,"column":12},"end":{"line":517,"column":12}}]},"18":{"line":527,"type":"if","locations":[{"start":{"line":527,"column":12},"end":{"line":527,"column":12}},{"start":{"line":527,"column":12},"end":{"line":527,"column":12}}]},"19":{"line":541,"type":"if","locations":[{"start":{"line":541,"column":12},"end":{"line":541,"column":12}},{"start":{"line":541,"column":12},"end":{"line":541,"column":12}}]},"20":{"line":569,"type":"if","locations":[{"start":{"line":569,"column":8},"end":{"line":569,"column":8}},{"start":{"line":569,"column":8},"end":{"line":569,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol":{"l":{"32":324,"34":324,"35":16,"37":308,"40":324,"57":157,"58":157,"75":139,"92":30,"109":52,"126":0,"127":0,"128":0,"152":465,"154":465,"155":415,"156":415,"158":50,"159":50,"160":50,"161":72,"162":72,"165":50,"166":50,"167":50,"168":72,"172":465,"190":52,"192":52,"193":52,"194":1643,"195":24,"199":52,"200":52,"201":45,"204":52,"222":1030,"223":1030,"224":1030,"226":1030,"227":420,"230":420,"231":420,"234":1030,"235":1030,"257":157,"258":8,"261":149,"262":149,"263":149,"264":1030,"267":149,"268":149,"269":149,"271":149,"272":1030,"274":1030,"275":1030,"277":1030,"278":1030,"281":149},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol","s":{"1":324,"2":324,"3":16,"4":308,"5":324,"6":157,"7":157,"8":139,"9":30,"10":52,"11":0,"12":0,"13":0,"14":465,"15":465,"16":415,"17":415,"18":50,"19":50,"20":50,"21":72,"22":50,"23":50,"24":50,"25":72,"26":465,"27":52,"28":52,"29":52,"30":1643,"31":52,"32":52,"33":45,"34":52,"35":1030,"36":1030,"37":1030,"38":1030,"39":420,"40":420,"41":1030,"42":157,"43":8,"44":149,"45":149,"46":149,"47":1030,"48":149,"49":149,"50":149,"51":1030,"52":1030,"53":1030,"54":1030,"55":149},"b":{"1":[16,308],"2":[415,50],"3":[24,1619],"4":[8,149]},"f":{"1":324,"2":157,"3":139,"4":30,"5":52,"6":0,"7":465,"8":52,"9":1030,"10":157},"fnMap":{"1":{"name":"writeBytes","line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":41,"column":4}}},"2":{"name":"writeList","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":59,"column":4}}},"3":{"name":"writeString","line":66,"loc":{"start":{"line":66,"column":4},"end":{"line":76,"column":4}}},"4":{"name":"writeAddress","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":93,"column":4}}},"5":{"name":"writeUint","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":110,"column":4}}},"6":{"name":"writeBool","line":117,"loc":{"start":{"line":117,"column":4},"end":{"line":129,"column":4}}},"7":{"name":"_writeLength","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":173,"column":4}}},"8":{"name":"_toBinary","line":181,"loc":{"start":{"line":181,"column":4},"end":{"line":205,"column":4}}},"9":{"name":"_memcpy","line":214,"loc":{"start":{"line":214,"column":4},"end":{"line":240,"column":4}}},"10":{"name":"_flatten","line":248,"loc":{"start":{"line":248,"column":4},"end":{"line":282,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":28}},"2":{"start":{"line":34,"column":8},"end":{"line":34,"column":711}},"3":{"start":{"line":35,"column":12},"end":{"line":35,"column":24}},"4":{"start":{"line":37,"column":12},"end":{"line":37,"column":73}},"5":{"start":{"line":40,"column":8},"end":{"line":40,"column":22}},"6":{"start":{"line":57,"column":8},"end":{"line":57,"column":41}},"7":{"start":{"line":58,"column":8},"end":{"line":58,"column":69}},"8":{"start":{"line":75,"column":8},"end":{"line":75,"column":37}},"9":{"start":{"line":92,"column":8},"end":{"line":92,"column":48}},"10":{"start":{"line":109,"column":8},"end":{"line":109,"column":41}},"11":{"start":{"line":126,"column":8},"end":{"line":126,"column":43}},"12":{"start":{"line":127,"column":8},"end":{"line":127,"column":55}},"13":{"start":{"line":128,"column":8},"end":{"line":128,"column":22}},"14":{"start":{"line":152,"column":8},"end":{"line":152,"column":28}},"15":{"start":{"line":154,"column":8},"end":{"line":154,"column":3384}},"16":{"start":{"line":155,"column":12},"end":{"line":155,"column":33}},"17":{"start":{"line":156,"column":12},"end":{"line":156,"column":58}},"18":{"start":{"line":158,"column":12},"end":{"line":158,"column":26}},"19":{"start":{"line":159,"column":12},"end":{"line":159,"column":25}},"20":{"start":{"line":160,"column":12},"end":{"line":160,"column":3586}},"21":{"start":{"line":162,"column":16},"end":{"line":162,"column":23}},"22":{"start":{"line":165,"column":12},"end":{"line":165,"column":42}},"23":{"start":{"line":166,"column":12},"end":{"line":166,"column":65}},"24":{"start":{"line":167,"column":12},"end":{"line":167,"column":3802}},"25":{"start":{"line":168,"column":16},"end":{"line":168,"column":73}},"26":{"start":{"line":172,"column":8},"end":{"line":172,"column":22}},"27":{"start":{"line":190,"column":8},"end":{"line":190,"column":45}},"28":{"start":{"line":192,"column":8},"end":{"line":192,"column":21}},"29":{"start":{"line":193,"column":8},"end":{"line":193,"column":4434}},"30":{"start":{"line":194,"column":12},"end":{"line":194,"column":4472}},"31":{"start":{"line":199,"column":8},"end":{"line":199,"column":44}},"32":{"start":{"line":200,"column":8},"end":{"line":200,"column":4587}},"33":{"start":{"line":201,"column":12},"end":{"line":201,"column":26}},"34":{"start":{"line":204,"column":8},"end":{"line":204,"column":18}},"35":{"start":{"line":222,"column":8},"end":{"line":222,"column":28}},"36":{"start":{"line":223,"column":8},"end":{"line":223,"column":26}},"37":{"start":{"line":224,"column":8},"end":{"line":224,"column":26}},"38":{"start":{"line":226,"column":8},"end":{"line":226,"column":5212}},"39":{"start":{"line":230,"column":12},"end":{"line":230,"column":21}},"40":{"start":{"line":231,"column":12},"end":{"line":231,"column":20}},"41":{"start":{"line":234,"column":8},"end":{"line":234,"column":44}},"42":{"start":{"line":257,"column":8},"end":{"line":257,"column":6057}},"43":{"start":{"line":258,"column":12},"end":{"line":258,"column":31}},"44":{"start":{"line":261,"column":8},"end":{"line":261,"column":19}},"45":{"start":{"line":262,"column":8},"end":{"line":262,"column":21}},"46":{"start":{"line":263,"column":8},"end":{"line":263,"column":6178}},"47":{"start":{"line":264,"column":12},"end":{"line":264,"column":33}},"48":{"start":{"line":267,"column":8},"end":{"line":267,"column":47}},"49":{"start":{"line":268,"column":8},"end":{"line":268,"column":28}},"50":{"start":{"line":271,"column":8},"end":{"line":271,"column":6403}},"51":{"start":{"line":272,"column":12},"end":{"line":272,"column":40}},"52":{"start":{"line":274,"column":12},"end":{"line":274,"column":27}},"53":{"start":{"line":277,"column":12},"end":{"line":277,"column":54}},"54":{"start":{"line":278,"column":12},"end":{"line":278,"column":42}},"55":{"start":{"line":281,"column":8},"end":{"line":281,"column":24}}},"branchMap":{"1":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":8}},{"start":{"line":34,"column":8},"end":{"line":34,"column":8}}]},"2":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":8},"end":{"line":154,"column":8}},{"start":{"line":154,"column":8},"end":{"line":154,"column":8}}]},"3":{"line":194,"type":"if","locations":[{"start":{"line":194,"column":12},"end":{"line":194,"column":12}},{"start":{"line":194,"column":12},"end":{"line":194,"column":12}}]},"4":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":8},"end":{"line":257,"column":8}},{"start":{"line":257,"column":8},"end":{"line":257,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol":{"l":{},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol":{"l":{"8":6,"12":10,"16":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol","s":{"1":6,"2":10,"3":0},"b":{"1":[6,0],"2":[10,0],"3":[0,0]},"f":{"1":6,"2":10,"3":0},"fnMap":{"1":{"name":"add","line":7,"loc":{"start":{"line":7,"column":4},"end":{"line":9,"column":4}}},"2":{"name":"sub","line":11,"loc":{"start":{"line":11,"column":4},"end":{"line":13,"column":4}}},"3":{"name":"mul","line":15,"loc":{"start":{"line":15,"column":4},"end":{"line":17,"column":4}}}},"statementMap":{"1":{"start":{"line":8,"column":8},"end":{"line":8,"column":56}},"2":{"start":{"line":12,"column":8},"end":{"line":12,"column":57}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":70}}},"branchMap":{"1":{"line":8,"type":"if","locations":[{"start":{"line":8,"column":8},"end":{"line":8,"column":8}},{"start":{"line":8,"column":8},"end":{"line":8,"column":8}}]},"2":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":8},"end":{"line":12,"column":8}},{"start":{"line":12,"column":8},"end":{"line":12,"column":8}}]},"3":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":8},"end":{"line":16,"column":8}},{"start":{"line":16,"column":8},"end":{"line":16,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol":{"l":{"26":39,"27":39,"29":39,"30":39,"33":39,"45":1,"46":1,"47":1,"51":2,"52":2,"53":2,"57":2,"58":2,"62":4,"63":4,"64":4,"68":2,"69":2,"73":2,"74":2,"78":2,"79":2,"81":2,"82":2,"86":0,"87":0,"94":0,"95":0,"96":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol","s":{"1":39,"2":39,"3":39,"4":39,"5":1,"6":1,"7":1,"8":2,"9":2,"10":2,"11":2,"12":2,"13":4,"14":4,"15":4,"16":2,"17":2,"18":2,"19":2,"20":2,"21":2,"22":2,"23":2,"24":0,"25":0,"26":0,"27":0,"28":0},"b":{"1":[2,0],"2":[0,0],"3":[0,0]},"f":{"1":39,"2":1,"3":2,"4":2,"5":4,"6":2,"7":2,"8":2,"9":0},"fnMap":{"1":{"name":"constructor","line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":42,"column":4}}},"2":{"name":"_mint","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"_burn","line":50,"loc":{"start":{"line":50,"column":4},"end":{"line":54,"column":4}}},"4":{"name":"_approve","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":59,"column":4}}},"5":{"name":"_transfer","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":65,"column":4}}},"6":{"name":"approve","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":70,"column":4}}},"7":{"name":"transfer","line":72,"loc":{"start":{"line":72,"column":4},"end":{"line":75,"column":4}}},"8":{"name":"transferFrom","line":77,"loc":{"start":{"line":77,"column":4},"end":{"line":83,"column":4}}},"9":{"name":"permit","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":97,"column":4}}}},"statementMap":{"1":{"start":{"line":26,"column":8},"end":{"line":26,"column":19}},"2":{"start":{"line":27,"column":8},"end":{"line":27,"column":23}},"3":{"start":{"line":29,"column":8},"end":{"line":29,"column":20}},"4":{"start":{"line":33,"column":8},"end":{"line":33,"column":1051}},"5":{"start":{"line":45,"column":8},"end":{"line":45,"column":43}},"6":{"start":{"line":46,"column":8},"end":{"line":46,"column":47}},"7":{"start":{"line":47,"column":8},"end":{"line":47,"column":44}},"8":{"start":{"line":51,"column":8},"end":{"line":51,"column":51}},"9":{"start":{"line":52,"column":8},"end":{"line":52,"column":43}},"10":{"start":{"line":53,"column":8},"end":{"line":53,"column":46}},"11":{"start":{"line":57,"column":8},"end":{"line":57,"column":40}},"12":{"start":{"line":58,"column":8},"end":{"line":58,"column":44}},"13":{"start":{"line":62,"column":8},"end":{"line":62,"column":51}},"14":{"start":{"line":63,"column":8},"end":{"line":63,"column":47}},"15":{"start":{"line":64,"column":8},"end":{"line":64,"column":38}},"16":{"start":{"line":68,"column":8},"end":{"line":68,"column":43}},"17":{"start":{"line":69,"column":8},"end":{"line":69,"column":19}},"18":{"start":{"line":73,"column":8},"end":{"line":73,"column":39}},"19":{"start":{"line":74,"column":8},"end":{"line":74,"column":19}},"20":{"start":{"line":78,"column":8},"end":{"line":78,"column":2609}},"21":{"start":{"line":79,"column":12},"end":{"line":79,"column":79}},"22":{"start":{"line":81,"column":8},"end":{"line":81,"column":33}},"23":{"start":{"line":82,"column":8},"end":{"line":82,"column":19}},"24":{"start":{"line":86,"column":8},"end":{"line":86,"column":65}},"25":{"start":{"line":87,"column":8},"end":{"line":87,"column":3019}},"26":{"start":{"line":94,"column":8},"end":{"line":94,"column":61}},"27":{"start":{"line":95,"column":8},"end":{"line":95,"column":107}},"28":{"start":{"line":96,"column":8},"end":{"line":96,"column":38}}},"branchMap":{"1":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]},"2":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"3":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":8},"end":{"line":95,"column":8}},{"start":{"line":95,"column":8},"end":{"line":95,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol":{"l":{"85":25,"90":24,"116":0,"120":0,"147":22,"148":0,"151":22,"152":22,"153":22,"155":22,"178":77,"179":73,"181":58,"183":58,"188":58,"190":58,"212":0,"245":95,"246":95,"248":95,"249":95,"250":95,"251":95,"254":95,"255":243,"256":243,"260":243,"262":243,"264":95,"270":148,"276":0,"282":229,"283":147,"285":0,"289":147,"290":147,"291":147,"292":147,"293":147,"296":82,"297":82,"298":82,"299":82,"300":82,"301":82,"303":82,"304":80,"310":73,"314":80,"315":80,"317":1,"320":0,"321":0,"325":1,"326":1,"327":1,"330":1,"333":0,"338":80,"339":80,"366":22,"369":22,"370":22,"376":22,"377":22,"379":22,"382":22,"383":22,"385":0,"388":0,"389":0,"393":0,"394":0,"397":0,"398":0,"402":0,"403":0,"405":0,"408":0,"409":0,"410":0,"413":0,"414":0,"418":0,"420":0,"424":0,"428":0,"430":0,"432":0,"435":0,"436":0,"440":0,"441":0,"446":0,"450":0,"453":0,"455":0,"456":0,"461":0,"463":0,"464":0,"466":0,"467":0,"473":22,"492":22,"495":22,"496":22,"497":22,"500":22,"502":65,"503":65,"505":65,"508":22,"509":22,"512":1,"513":1,"517":1,"519":1,"524":42,"526":42,"527":42,"528":42,"533":65,"538":22,"555":99,"556":95,"558":95,"559":265,"560":265,"566":95,"585":148,"587":148,"589":0,"592":148,"595":148,"612":172,"630":45,"647":51,"665":65,"666":0,"668":65,"686":87,"687":42,"689":45,"690":45,"692":45,"693":44,"695":1,"699":0,"719":82,"720":82,"721":4991,"723":82,"740":65,"742":65,"762":42,"763":42,"764":714,"766":42,"785":1,"786":1,"787":1,"788":1,"789":1,"811":22,"812":22,"813":22,"814":22,"815":22,"829":0,"830":0,"831":0,"833":0,"852":0,"853":0,"854":0,"875":42,"876":42,"877":42,"896":23,"897":23,"898":23,"899":23,"900":23,"917":45,"918":26,"920":19,"946":22,"949":22,"950":43,"954":22,"955":22,"958":22},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol","s":{"1":25,"2":24,"3":0,"4":0,"5":22,"6":0,"7":22,"8":22,"9":22,"10":22,"11":77,"12":73,"13":58,"14":58,"15":58,"16":58,"17":0,"18":95,"19":95,"20":95,"21":95,"22":95,"23":95,"24":95,"25":243,"26":243,"27":243,"28":243,"29":95,"30":148,"31":148,"32":0,"33":229,"34":147,"35":147,"36":147,"37":147,"38":147,"39":82,"40":82,"41":82,"42":82,"43":82,"44":82,"45":82,"46":82,"47":80,"48":73,"49":80,"50":2,"51":1,"52":0,"53":1,"54":1,"55":1,"56":0,"57":80,"58":80,"59":22,"60":22,"61":22,"62":22,"63":22,"64":22,"65":22,"66":22,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":22,"105":22,"106":22,"107":22,"108":22,"109":22,"110":65,"111":65,"112":65,"113":22,"114":22,"115":43,"116":1,"117":1,"118":1,"119":1,"120":42,"121":42,"122":42,"123":42,"124":42,"125":65,"126":22,"127":99,"128":95,"129":95,"130":265,"131":265,"132":95,"133":148,"134":148,"135":0,"136":148,"137":148,"138":172,"139":45,"140":51,"141":65,"142":0,"143":65,"144":87,"145":42,"146":45,"147":45,"148":45,"149":45,"150":44,"151":1,"152":1,"153":0,"154":82,"155":82,"156":82,"157":65,"158":65,"159":42,"160":42,"161":714,"162":42,"163":1,"164":1,"165":1,"166":1,"167":1,"168":22,"169":22,"170":22,"171":22,"172":22,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":42,"181":42,"182":42,"183":23,"184":23,"185":23,"186":23,"187":23,"188":45,"189":26,"190":19,"191":22,"192":22,"193":43,"194":22,"195":22,"196":22},"b":{"1":[0,22],"2":[58,0],"3":[95,148],"4":[88,7],"5":[148,0],"6":[141,7],"7":[0,0],"8":[147,82],"9":[0,147],"10":[82,0],"11":[80,2],"12":[73,7],"13":[1,1],"14":[0,1],"15":[22,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[22,43],"24":[1,42],"25":[1,0],"26":[42,0],"27":[42,0],"28":[0,148],"29":[0,65],"30":[42,45],"31":[45,0],"32":[44,1],"33":[1,0],"34":[26,19]},"f":{"1":25,"2":0,"3":22,"4":77,"5":0,"6":95,"7":22,"8":22,"9":99,"10":148,"11":172,"12":45,"13":51,"14":65,"15":87,"16":82,"17":65,"18":42,"19":1,"20":22,"21":0,"22":0,"23":42,"24":23,"25":45,"26":22},"fnMap":{"1":{"name":"verifyInclusionProof","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":93,"column":4}}},"2":{"name":"verifyExclusionProof","line":105,"loc":{"start":{"line":105,"column":4},"end":{"line":121,"column":4}}},"3":{"name":"update","line":134,"loc":{"start":{"line":134,"column":4},"end":{"line":156,"column":4}}},"4":{"name":"get","line":166,"loc":{"start":{"line":166,"column":4},"end":{"line":194,"column":4}}},"5":{"name":"getSingleNodeRootHash","line":202,"loc":{"start":{"line":202,"column":4},"end":{"line":216,"column":4}}},"6":{"name":"_walkNodePath","line":232,"loc":{"start":{"line":232,"column":4},"end":{"line":340,"column":4}}},"7":{"name":"_getNewPath","line":354,"loc":{"start":{"line":354,"column":4},"end":{"line":474,"column":4}}},"8":{"name":"_getUpdatedTrieRoot","line":482,"loc":{"start":{"line":482,"column":4},"end":{"line":539,"column":4}}},"9":{"name":"_parseProof","line":546,"loc":{"start":{"line":546,"column":4},"end":{"line":567,"column":4}}},"10":{"name":"_getNodeID","line":576,"loc":{"start":{"line":576,"column":4},"end":{"line":596,"column":4}}},"11":{"name":"_getNodePath","line":603,"loc":{"start":{"line":603,"column":4},"end":{"line":613,"column":4}}},"12":{"name":"_getNodeKey","line":621,"loc":{"start":{"line":621,"column":4},"end":{"line":631,"column":4}}},"13":{"name":"_getNodeValue","line":638,"loc":{"start":{"line":638,"column":4},"end":{"line":648,"column":4}}},"14":{"name":"_getNodeHash","line":656,"loc":{"start":{"line":656,"column":4},"end":{"line":670,"column":4}}},"15":{"name":"_getNodeType","line":677,"loc":{"start":{"line":677,"column":4},"end":{"line":700,"column":4}}},"16":{"name":"_getSharedNibbleLength","line":709,"loc":{"start":{"line":709,"column":4},"end":{"line":724,"column":4}}},"17":{"name":"_makeNode","line":731,"loc":{"start":{"line":731,"column":4},"end":{"line":746,"column":4}}},"18":{"name":"_makeNode","line":753,"loc":{"start":{"line":753,"column":4},"end":{"line":767,"column":4}}},"19":{"name":"_makeExtensionNode","line":775,"loc":{"start":{"line":775,"column":4},"end":{"line":790,"column":4}}},"20":{"name":"_makeLeafNode","line":801,"loc":{"start":{"line":801,"column":4},"end":{"line":816,"column":4}}},"21":{"name":"_makeEmptyBranchNode","line":822,"loc":{"start":{"line":822,"column":4},"end":{"line":834,"column":4}}},"22":{"name":"_editBranchValue","line":842,"loc":{"start":{"line":842,"column":4},"end":{"line":855,"column":4}}},"23":{"name":"_editBranchIndex","line":864,"loc":{"start":{"line":864,"column":4},"end":{"line":878,"column":4}}},"24":{"name":"_addHexPrefix","line":886,"loc":{"start":{"line":886,"column":4},"end":{"line":901,"column":4}}},"25":{"name":"_removeHexPrefix","line":908,"loc":{"start":{"line":908,"column":4},"end":{"line":922,"column":4}}},"26":{"name":"_joinNodeArrays","line":934,"loc":{"start":{"line":934,"column":4},"end":{"line":959,"column":4}}}},"statementMap":{"1":{"start":{"line":85,"column":8},"end":{"line":85,"column":2923}},"2":{"start":{"line":90,"column":8},"end":{"line":90,"column":3001}},"3":{"start":{"line":116,"column":8},"end":{"line":116,"column":3811}},"4":{"start":{"line":120,"column":8},"end":{"line":120,"column":30}},"5":{"start":{"line":147,"column":8},"end":{"line":147,"column":4811}},"6":{"start":{"line":148,"column":12},"end":{"line":148,"column":54}},"7":{"start":{"line":151,"column":8},"end":{"line":151,"column":53}},"8":{"start":{"line":152,"column":8},"end":{"line":152,"column":93}},"9":{"start":{"line":153,"column":8},"end":{"line":153,"column":88}},"10":{"start":{"line":155,"column":8},"end":{"line":155,"column":49}},"11":{"start":{"line":178,"column":8},"end":{"line":178,"column":53}},"12":{"start":{"line":179,"column":8},"end":{"line":179,"column":109}},"13":{"start":{"line":181,"column":8},"end":{"line":181,"column":46}},"14":{"start":{"line":183,"column":8},"end":{"line":183,"column":6018}},"15":{"start":{"line":188,"column":8},"end":{"line":188,"column":86}},"16":{"start":{"line":190,"column":8},"end":{"line":190,"column":6213}},"17":{"start":{"line":212,"column":8},"end":{"line":212,"column":6704}},"18":{"start":{"line":245,"column":8},"end":{"line":245,"column":30}},"19":{"start":{"line":246,"column":8},"end":{"line":246,"column":57}},"20":{"start":{"line":248,"column":8},"end":{"line":248,"column":37}},"21":{"start":{"line":249,"column":8},"end":{"line":249,"column":35}},"22":{"start":{"line":250,"column":8},"end":{"line":250,"column":39}},"23":{"start":{"line":251,"column":8},"end":{"line":251,"column":35}},"24":{"start":{"line":254,"column":8},"end":{"line":254,"column":7917}},"25":{"start":{"line":255,"column":12},"end":{"line":255,"column":34}},"26":{"start":{"line":256,"column":12},"end":{"line":256,"column":49}},"27":{"start":{"line":260,"column":12},"end":{"line":260,"column":26}},"28":{"start":{"line":262,"column":12},"end":{"line":262,"column":8247}},"29":{"start":{"line":264,"column":16},"end":{"line":264,"column":8359}},"30":{"start":{"line":268,"column":19},"end":{"line":268,"column":8511}},"31":{"start":{"line":270,"column":16},"end":{"line":270,"column":8647}},"32":{"start":{"line":276,"column":16},"end":{"line":276,"column":8893}},"33":{"start":{"line":282,"column":12},"end":{"line":282,"column":9077}},"34":{"start":{"line":283,"column":16},"end":{"line":283,"column":9153}},"35":{"start":{"line":289,"column":20},"end":{"line":289,"column":65}},"36":{"start":{"line":290,"column":20},"end":{"line":290,"column":90}},"37":{"start":{"line":291,"column":20},"end":{"line":291,"column":55}},"38":{"start":{"line":292,"column":20},"end":{"line":292,"column":42}},"39":{"start":{"line":295,"column":19},"end":{"line":295,"column":9813}},"40":{"start":{"line":296,"column":16},"end":{"line":296,"column":61}},"41":{"start":{"line":297,"column":16},"end":{"line":297,"column":45}},"42":{"start":{"line":298,"column":16},"end":{"line":298,"column":45}},"43":{"start":{"line":299,"column":16},"end":{"line":299,"column":79}},"44":{"start":{"line":300,"column":16},"end":{"line":300,"column":86}},"45":{"start":{"line":301,"column":16},"end":{"line":301,"column":96}},"46":{"start":{"line":303,"column":16},"end":{"line":303,"column":10325}},"47":{"start":{"line":304,"column":20},"end":{"line":304,"column":10412}},"48":{"start":{"line":310,"column":24},"end":{"line":310,"column":60}},"49":{"start":{"line":314,"column":20},"end":{"line":314,"column":52}},"50":{"start":{"line":316,"column":23},"end":{"line":316,"column":11009}},"51":{"start":{"line":317,"column":20},"end":{"line":317,"column":11106}},"52":{"start":{"line":320,"column":24},"end":{"line":320,"column":56}},"53":{"start":{"line":325,"column":24},"end":{"line":325,"column":73}},"54":{"start":{"line":326,"column":24},"end":{"line":326,"column":63}},"55":{"start":{"line":330,"column":20},"end":{"line":330,"column":67}},"56":{"start":{"line":333,"column":16},"end":{"line":333,"column":54}},"57":{"start":{"line":338,"column":8},"end":{"line":338,"column":61}},"58":{"start":{"line":339,"column":8},"end":{"line":339,"column":84}},"59":{"start":{"line":366,"column":8},"end":{"line":366,"column":49}},"60":{"start":{"line":369,"column":8},"end":{"line":369,"column":57}},"61":{"start":{"line":370,"column":8},"end":{"line":370,"column":54}},"62":{"start":{"line":376,"column":8},"end":{"line":376,"column":54}},"63":{"start":{"line":377,"column":8},"end":{"line":377,"column":33}},"64":{"start":{"line":379,"column":8},"end":{"line":379,"column":13744}},"65":{"start":{"line":382,"column":12},"end":{"line":382,"column":81}},"66":{"start":{"line":383,"column":12},"end":{"line":383,"column":29}},"67":{"start":{"line":384,"column":15},"end":{"line":384,"column":14072}},"68":{"start":{"line":385,"column":12},"end":{"line":385,"column":14131}},"69":{"start":{"line":388,"column":16},"end":{"line":388,"column":75}},"70":{"start":{"line":389,"column":16},"end":{"line":389,"column":33}},"71":{"start":{"line":393,"column":16},"end":{"line":393,"column":49}},"72":{"start":{"line":394,"column":16},"end":{"line":394,"column":33}},"73":{"start":{"line":397,"column":16},"end":{"line":397,"column":101}},"74":{"start":{"line":398,"column":16},"end":{"line":398,"column":33}},"75":{"start":{"line":402,"column":12},"end":{"line":402,"column":60}},"76":{"start":{"line":403,"column":12},"end":{"line":403,"column":90}},"77":{"start":{"line":405,"column":12},"end":{"line":405,"column":15218}},"78":{"start":{"line":408,"column":16},"end":{"line":408,"column":99}},"79":{"start":{"line":409,"column":16},"end":{"line":409,"column":94}},"80":{"start":{"line":410,"column":16},"end":{"line":410,"column":33}},"81":{"start":{"line":413,"column":16},"end":{"line":413,"column":82}},"82":{"start":{"line":414,"column":16},"end":{"line":414,"column":84}},"83":{"start":{"line":418,"column":12},"end":{"line":418,"column":62}},"84":{"start":{"line":420,"column":12},"end":{"line":420,"column":16068}},"85":{"start":{"line":424,"column":16},"end":{"line":424,"column":79}},"86":{"start":{"line":428,"column":16},"end":{"line":428,"column":55}},"87":{"start":{"line":430,"column":16},"end":{"line":430,"column":65}},"88":{"start":{"line":432,"column":16},"end":{"line":432,"column":16734}},"89":{"start":{"line":435,"column":20},"end":{"line":435,"column":106}},"90":{"start":{"line":436,"column":20},"end":{"line":436,"column":109}},"91":{"start":{"line":437,"column":23},"end":{"line":437,"column":17169}},"92":{"start":{"line":440,"column":20},"end":{"line":440,"column":111}},"93":{"start":{"line":441,"column":20},"end":{"line":441,"column":109}},"94":{"start":{"line":446,"column":20},"end":{"line":446,"column":94}},"95":{"start":{"line":450,"column":12},"end":{"line":450,"column":17956}},"96":{"start":{"line":453,"column":16},"end":{"line":453,"column":62}},"97":{"start":{"line":455,"column":16},"end":{"line":455,"column":50}},"98":{"start":{"line":456,"column":16},"end":{"line":456,"column":33}},"99":{"start":{"line":461,"column":16},"end":{"line":461,"column":67}},"100":{"start":{"line":463,"column":16},"end":{"line":463,"column":50}},"101":{"start":{"line":464,"column":16},"end":{"line":464,"column":33}},"102":{"start":{"line":466,"column":16},"end":{"line":466,"column":76}},"103":{"start":{"line":467,"column":16},"end":{"line":467,"column":33}},"104":{"start":{"line":473,"column":8},"end":{"line":473,"column":79}},"105":{"start":{"line":492,"column":8},"end":{"line":492,"column":57}},"106":{"start":{"line":495,"column":8},"end":{"line":495,"column":35}},"107":{"start":{"line":496,"column":8},"end":{"line":496,"column":32}},"108":{"start":{"line":497,"column":8},"end":{"line":497,"column":37}},"109":{"start":{"line":500,"column":8},"end":{"line":500,"column":19924}},"110":{"start":{"line":502,"column":12},"end":{"line":502,"column":38}},"111":{"start":{"line":503,"column":12},"end":{"line":503,"column":54}},"112":{"start":{"line":505,"column":12},"end":{"line":505,"column":20127}},"113":{"start":{"line":508,"column":16},"end":{"line":508,"column":63}},"114":{"start":{"line":509,"column":16},"end":{"line":509,"column":78}},"115":{"start":{"line":510,"column":19},"end":{"line":510,"column":20465}},"116":{"start":{"line":512,"column":16},"end":{"line":512,"column":63}},"117":{"start":{"line":513,"column":16},"end":{"line":513,"column":78}},"118":{"start":{"line":517,"column":16},"end":{"line":517,"column":20887}},"119":{"start":{"line":519,"column":20},"end":{"line":519,"column":78}},"120":{"start":{"line":521,"column":19},"end":{"line":521,"column":21106}},"121":{"start":{"line":524,"column":16},"end":{"line":524,"column":21310}},"122":{"start":{"line":526,"column":20},"end":{"line":526,"column":64}},"123":{"start":{"line":527,"column":20},"end":{"line":527,"column":69}},"124":{"start":{"line":528,"column":20},"end":{"line":528,"column":91}},"125":{"start":{"line":533,"column":12},"end":{"line":533,"column":63}},"126":{"start":{"line":538,"column":8},"end":{"line":538,"column":45}},"127":{"start":{"line":555,"column":8},"end":{"line":555,"column":77}},"128":{"start":{"line":556,"column":8},"end":{"line":556,"column":62}},"129":{"start":{"line":558,"column":8},"end":{"line":558,"column":22490}},"130":{"start":{"line":559,"column":12},"end":{"line":559,"column":68}},"131":{"start":{"line":560,"column":12},"end":{"line":560,"column":22622}},"132":{"start":{"line":566,"column":8},"end":{"line":566,"column":20}},"133":{"start":{"line":585,"column":8},"end":{"line":585,"column":27}},"134":{"start":{"line":587,"column":8},"end":{"line":587,"column":23295}},"135":{"start":{"line":589,"column":12},"end":{"line":589,"column":53}},"136":{"start":{"line":592,"column":12},"end":{"line":592,"column":50}},"137":{"start":{"line":595,"column":8},"end":{"line":595,"column":47}},"138":{"start":{"line":612,"column":8},"end":{"line":612,"column":82}},"139":{"start":{"line":630,"column":8},"end":{"line":630,"column":52}},"140":{"start":{"line":647,"column":8},"end":{"line":647,"column":79}},"141":{"start":{"line":665,"column":8},"end":{"line":665,"column":25348}},"142":{"start":{"line":666,"column":12},"end":{"line":666,"column":27}},"143":{"start":{"line":668,"column":12},"end":{"line":668,"column":56}},"144":{"start":{"line":686,"column":8},"end":{"line":686,"column":25851}},"145":{"start":{"line":687,"column":12},"end":{"line":687,"column":38}},"146":{"start":{"line":688,"column":15},"end":{"line":688,"column":25956}},"147":{"start":{"line":689,"column":12},"end":{"line":689,"column":51}},"148":{"start":{"line":690,"column":12},"end":{"line":690,"column":41}},"149":{"start":{"line":692,"column":12},"end":{"line":692,"column":26130}},"150":{"start":{"line":693,"column":16},"end":{"line":693,"column":40}},"151":{"start":{"line":694,"column":19},"end":{"line":694,"column":26254}},"152":{"start":{"line":695,"column":16},"end":{"line":695,"column":45}},"153":{"start":{"line":699,"column":8},"end":{"line":699,"column":34}},"154":{"start":{"line":719,"column":8},"end":{"line":719,"column":21}},"155":{"start":{"line":720,"column":8},"end":{"line":720,"column":26891}},"156":{"start":{"line":723,"column":8},"end":{"line":723,"column":16}},"157":{"start":{"line":740,"column":8},"end":{"line":740,"column":60}},"158":{"start":{"line":742,"column":8},"end":{"line":742,"column":27417}},"159":{"start":{"line":762,"column":8},"end":{"line":762,"column":55}},"160":{"start":{"line":763,"column":8},"end":{"line":763,"column":27962}},"161":{"start":{"line":764,"column":12},"end":{"line":764,"column":57}},"162":{"start":{"line":766,"column":8},"end":{"line":766,"column":29}},"163":{"start":{"line":785,"column":8},"end":{"line":785,"column":43}},"164":{"start":{"line":786,"column":8},"end":{"line":786,"column":53}},"165":{"start":{"line":787,"column":8},"end":{"line":787,"column":73}},"166":{"start":{"line":788,"column":8},"end":{"line":788,"column":48}},"167":{"start":{"line":789,"column":8},"end":{"line":789,"column":29}},"168":{"start":{"line":811,"column":8},"end":{"line":811,"column":43}},"169":{"start":{"line":812,"column":8},"end":{"line":812,"column":52}},"170":{"start":{"line":813,"column":8},"end":{"line":813,"column":73}},"171":{"start":{"line":814,"column":8},"end":{"line":814,"column":48}},"172":{"start":{"line":815,"column":8},"end":{"line":815,"column":29}},"173":{"start":{"line":829,"column":8},"end":{"line":829,"column":60}},"174":{"start":{"line":830,"column":8},"end":{"line":830,"column":30021}},"175":{"start":{"line":831,"column":12},"end":{"line":831,"column":34}},"176":{"start":{"line":833,"column":8},"end":{"line":833,"column":29}},"177":{"start":{"line":852,"column":8},"end":{"line":852,"column":63}},"178":{"start":{"line":853,"column":8},"end":{"line":853,"column":85}},"179":{"start":{"line":854,"column":8},"end":{"line":854,"column":41}},"180":{"start":{"line":875,"column":8},"end":{"line":875,"column":93}},"181":{"start":{"line":876,"column":8},"end":{"line":876,"column":65}},"182":{"start":{"line":877,"column":8},"end":{"line":877,"column":41}},"183":{"start":{"line":896,"column":8},"end":{"line":896,"column":58}},"184":{"start":{"line":897,"column":8},"end":{"line":897,"column":45}},"185":{"start":{"line":898,"column":8},"end":{"line":898,"column":53}},"186":{"start":{"line":899,"column":8},"end":{"line":899,"column":44}},"187":{"start":{"line":900,"column":8},"end":{"line":900,"column":47}},"188":{"start":{"line":917,"column":8},"end":{"line":917,"column":32479}},"189":{"start":{"line":918,"column":12},"end":{"line":918,"column":49}},"190":{"start":{"line":920,"column":12},"end":{"line":920,"column":49}},"191":{"start":{"line":946,"column":8},"end":{"line":946,"column":67}},"192":{"start":{"line":949,"column":8},"end":{"line":949,"column":33473}},"193":{"start":{"line":950,"column":12},"end":{"line":950,"column":25}},"194":{"start":{"line":954,"column":8},"end":{"line":954,"column":33609}},"195":{"start":{"line":955,"column":12},"end":{"line":955,"column":36}},"196":{"start":{"line":958,"column":8},"end":{"line":958,"column":18}}},"branchMap":{"1":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":8},"end":{"line":147,"column":8}},{"start":{"line":147,"column":8},"end":{"line":147,"column":8}}]},"2":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":8},"end":{"line":183,"column":8}},{"start":{"line":183,"column":8},"end":{"line":183,"column":8}}]},"3":{"line":262,"type":"if","locations":[{"start":{"line":262,"column":12},"end":{"line":262,"column":12}},{"start":{"line":262,"column":12},"end":{"line":262,"column":12}}]},"4":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":16},"end":{"line":264,"column":16}},{"start":{"line":264,"column":16},"end":{"line":264,"column":16}}]},"5":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":19},"end":{"line":268,"column":19}},{"start":{"line":268,"column":19},"end":{"line":268,"column":19}}]},"6":{"line":270,"type":"if","locations":[{"start":{"line":270,"column":16},"end":{"line":270,"column":16}},{"start":{"line":270,"column":16},"end":{"line":270,"column":16}}]},"7":{"line":276,"type":"if","locations":[{"start":{"line":276,"column":16},"end":{"line":276,"column":16}},{"start":{"line":276,"column":16},"end":{"line":276,"column":16}}]},"8":{"line":282,"type":"if","locations":[{"start":{"line":282,"column":12},"end":{"line":282,"column":12}},{"start":{"line":282,"column":12},"end":{"line":282,"column":12}}]},"9":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":16},"end":{"line":283,"column":16}},{"start":{"line":283,"column":16},"end":{"line":283,"column":16}}]},"10":{"line":295,"type":"if","locations":[{"start":{"line":295,"column":19},"end":{"line":295,"column":19}},{"start":{"line":295,"column":19},"end":{"line":295,"column":19}}]},"11":{"line":303,"type":"if","locations":[{"start":{"line":303,"column":16},"end":{"line":303,"column":16}},{"start":{"line":303,"column":16},"end":{"line":303,"column":16}}]},"12":{"line":304,"type":"if","locations":[{"start":{"line":304,"column":20},"end":{"line":304,"column":20}},{"start":{"line":304,"column":20},"end":{"line":304,"column":20}}]},"13":{"line":316,"type":"if","locations":[{"start":{"line":316,"column":23},"end":{"line":316,"column":23}},{"start":{"line":316,"column":23},"end":{"line":316,"column":23}}]},"14":{"line":317,"type":"if","locations":[{"start":{"line":317,"column":20},"end":{"line":317,"column":20}},{"start":{"line":317,"column":20},"end":{"line":317,"column":20}}]},"15":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"16":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":15},"end":{"line":384,"column":15}},{"start":{"line":384,"column":15},"end":{"line":384,"column":15}}]},"17":{"line":385,"type":"if","locations":[{"start":{"line":385,"column":12},"end":{"line":385,"column":12}},{"start":{"line":385,"column":12},"end":{"line":385,"column":12}}]},"18":{"line":405,"type":"if","locations":[{"start":{"line":405,"column":12},"end":{"line":405,"column":12}},{"start":{"line":405,"column":12},"end":{"line":405,"column":12}}]},"19":{"line":420,"type":"if","locations":[{"start":{"line":420,"column":12},"end":{"line":420,"column":12}},{"start":{"line":420,"column":12},"end":{"line":420,"column":12}}]},"20":{"line":432,"type":"if","locations":[{"start":{"line":432,"column":16},"end":{"line":432,"column":16}},{"start":{"line":432,"column":16},"end":{"line":432,"column":16}}]},"21":{"line":437,"type":"if","locations":[{"start":{"line":437,"column":23},"end":{"line":437,"column":23}},{"start":{"line":437,"column":23},"end":{"line":437,"column":23}}]},"22":{"line":450,"type":"if","locations":[{"start":{"line":450,"column":12},"end":{"line":450,"column":12}},{"start":{"line":450,"column":12},"end":{"line":450,"column":12}}]},"23":{"line":505,"type":"if","locations":[{"start":{"line":505,"column":12},"end":{"line":505,"column":12}},{"start":{"line":505,"column":12},"end":{"line":505,"column":12}}]},"24":{"line":510,"type":"if","locations":[{"start":{"line":510,"column":19},"end":{"line":510,"column":19}},{"start":{"line":510,"column":19},"end":{"line":510,"column":19}}]},"25":{"line":517,"type":"if","locations":[{"start":{"line":517,"column":16},"end":{"line":517,"column":16}},{"start":{"line":517,"column":16},"end":{"line":517,"column":16}}]},"26":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":19},"end":{"line":521,"column":19}},{"start":{"line":521,"column":19},"end":{"line":521,"column":19}}]},"27":{"line":524,"type":"if","locations":[{"start":{"line":524,"column":16},"end":{"line":524,"column":16}},{"start":{"line":524,"column":16},"end":{"line":524,"column":16}}]},"28":{"line":587,"type":"if","locations":[{"start":{"line":587,"column":8},"end":{"line":587,"column":8}},{"start":{"line":587,"column":8},"end":{"line":587,"column":8}}]},"29":{"line":665,"type":"if","locations":[{"start":{"line":665,"column":8},"end":{"line":665,"column":8}},{"start":{"line":665,"column":8},"end":{"line":665,"column":8}}]},"30":{"line":686,"type":"if","locations":[{"start":{"line":686,"column":8},"end":{"line":686,"column":8}},{"start":{"line":686,"column":8},"end":{"line":686,"column":8}}]},"31":{"line":688,"type":"if","locations":[{"start":{"line":688,"column":15},"end":{"line":688,"column":15}},{"start":{"line":688,"column":15},"end":{"line":688,"column":15}}]},"32":{"line":692,"type":"if","locations":[{"start":{"line":692,"column":12},"end":{"line":692,"column":12}},{"start":{"line":692,"column":12},"end":{"line":692,"column":12}}]},"33":{"line":694,"type":"if","locations":[{"start":{"line":694,"column":19},"end":{"line":694,"column":19}},{"start":{"line":694,"column":19},"end":{"line":694,"column":19}}]},"34":{"line":917,"type":"if","locations":[{"start":{"line":917,"column":8},"end":{"line":917,"column":8}},{"start":{"line":917,"column":8},"end":{"line":917,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol":{"l":{"41":15,"42":15,"66":0,"67":0,"93":12,"94":12,"117":20,"118":20,"137":0,"138":0,"160":47},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol","s":{"1":15,"2":15,"3":0,"4":0,"5":12,"6":12,"7":20,"8":20,"9":0,"10":0,"11":47},"b":{},"f":{"1":15,"2":0,"3":12,"4":20,"5":0,"6":47},"fnMap":{"1":{"name":"verifyInclusionProof","line":29,"loc":{"start":{"line":29,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"verifyExclusionProof","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":68,"column":4}}},"3":{"name":"update","line":81,"loc":{"start":{"line":81,"column":4},"end":{"line":95,"column":4}}},"4":{"name":"get","line":105,"loc":{"start":{"line":105,"column":4},"end":{"line":119,"column":4}}},"5":{"name":"getSingleNodeRootHash","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":139,"column":4}}},"6":{"name":"_getSecureKey","line":151,"loc":{"start":{"line":151,"column":4},"end":{"line":161,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":46}},"2":{"start":{"line":42,"column":8},"end":{"line":42,"column":78}},"3":{"start":{"line":66,"column":8},"end":{"line":66,"column":46}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":70}},"5":{"start":{"line":93,"column":8},"end":{"line":93,"column":46}},"6":{"start":{"line":94,"column":8},"end":{"line":94,"column":64}},"7":{"start":{"line":117,"column":8},"end":{"line":117,"column":46}},"8":{"start":{"line":118,"column":8},"end":{"line":118,"column":53}},"9":{"start":{"line":137,"column":8},"end":{"line":137,"column":46}},"10":{"start":{"line":138,"column":8},"end":{"line":138,"column":64}},"11":{"start":{"line":160,"column":8},"end":{"line":160,"column":48}}},"branchMap":{}}, -"contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol":{"l":{"27":40,"44":2,"61":31,"78":19,"95":3,"97":3,"115":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol","s":{"1":40,"2":2,"3":31,"4":19,"5":3,"6":3},"b":{},"f":{"1":40,"2":2,"3":31,"4":19,"5":3},"fnMap":{"1":{"name":"toBool","line":18,"loc":{"start":{"line":18,"column":4},"end":{"line":28,"column":4}}},"2":{"name":"fromBool","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":45,"column":4}}},"3":{"name":"toAddress","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":62,"column":4}}},"4":{"name":"fromAddress","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":79,"column":4}}},"5":{"name":"removeLeadingZeros","line":86,"loc":{"start":{"line":86,"column":4},"end":{"line":116,"column":4}}}},"statementMap":{"1":{"start":{"line":27,"column":8},"end":{"line":27,"column":23}},"2":{"start":{"line":44,"column":8},"end":{"line":44,"column":44}},"3":{"start":{"line":61,"column":8},"end":{"line":61,"column":45}},"4":{"start":{"line":78,"column":8},"end":{"line":78,"column":36}},"5":{"start":{"line":95,"column":8},"end":{"line":95,"column":24}},"6":{"start":{"line":115,"column":8},"end":{"line":115,"column":18}}},"branchMap":{}}, -"contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol":{"l":{"22":311,"23":311,"24":311,"26":308,"28":308,"81":308,"92":299,"93":73,"96":226,"106":1,"107":1,"108":1,"111":1,"121":164,"122":2,"123":2,"126":2,"129":162,"139":3,"143":15,"144":15,"145":15,"147":15,"151":15,"155":12,"156":12,"157":12,"159":12,"163":12,"167":5,"168":5,"169":5,"171":5,"175":5,"185":292,"187":292,"188":9144,"189":9144,"192":292,"202":26,"204":26,"205":708,"208":26,"219":26},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol","s":{"1":311,"2":311,"3":311,"4":308,"5":308,"6":299,"7":73,"8":226,"9":1,"10":1,"11":1,"12":164,"13":2,"14":2,"15":162,"16":3,"17":15,"18":15,"19":15,"20":15,"21":12,"22":12,"23":12,"24":12,"25":5,"26":5,"27":5,"28":5,"29":292,"30":292,"31":9144,"32":9144,"33":292,"34":26,"35":26,"36":708,"37":26,"38":26},"b":{"1":[311,0],"2":[311,0],"3":[308,3],"4":[73,226],"5":[2,162],"6":[15,0],"7":[15,0],"8":[12,0],"9":[12,0],"10":[5,0],"11":[5,0]},"f":{"1":311,"2":299,"3":1,"4":164,"5":3,"6":15,"7":12,"8":5,"9":292,"10":26,"11":26},"fnMap":{"1":{"name":"slice","line":13,"loc":{"start":{"line":13,"column":4},"end":{"line":82,"column":4}}},"2":{"name":"slice","line":84,"loc":{"start":{"line":84,"column":4},"end":{"line":97,"column":4}}},"3":{"name":"toBytes32PadLeft","line":99,"loc":{"start":{"line":99,"column":4},"end":{"line":112,"column":4}}},"4":{"name":"toBytes32","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":130,"column":4}}},"5":{"name":"toUint256","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"6":{"name":"toUint24","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":152,"column":4}}},"7":{"name":"toUint8","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":164,"column":4}}},"8":{"name":"toAddress","line":166,"loc":{"start":{"line":166,"column":4},"end":{"line":176,"column":4}}},"9":{"name":"toNibbles","line":178,"loc":{"start":{"line":178,"column":4},"end":{"line":193,"column":4}}},"10":{"name":"fromNibbles","line":195,"loc":{"start":{"line":195,"column":4},"end":{"line":209,"column":4}}},"11":{"name":"equal","line":211,"loc":{"start":{"line":211,"column":4},"end":{"line":220,"column":4}}}},"statementMap":{"1":{"start":{"line":22,"column":8},"end":{"line":22,"column":57}},"2":{"start":{"line":23,"column":8},"end":{"line":23,"column":60}},"3":{"start":{"line":24,"column":8},"end":{"line":24,"column":70}},"4":{"start":{"line":26,"column":8},"end":{"line":26,"column":30}},"5":{"start":{"line":81,"column":8},"end":{"line":81,"column":24}},"6":{"start":{"line":92,"column":8},"end":{"line":92,"column":3245}},"7":{"start":{"line":93,"column":12},"end":{"line":93,"column":28}},"8":{"start":{"line":96,"column":8},"end":{"line":96,"column":60}},"9":{"start":{"line":106,"column":8},"end":{"line":106,"column":19}},"10":{"start":{"line":107,"column":8},"end":{"line":107,"column":62}},"11":{"start":{"line":111,"column":8},"end":{"line":111,"column":18}},"12":{"start":{"line":121,"column":8},"end":{"line":121,"column":3855}},"13":{"start":{"line":122,"column":12},"end":{"line":122,"column":23}},"14":{"start":{"line":126,"column":12},"end":{"line":126,"column":22}},"15":{"start":{"line":129,"column":8},"end":{"line":129,"column":43}},"16":{"start":{"line":139,"column":8},"end":{"line":139,"column":41}},"17":{"start":{"line":143,"column":8},"end":{"line":143,"column":57}},"18":{"start":{"line":144,"column":8},"end":{"line":144,"column":68}},"19":{"start":{"line":145,"column":8},"end":{"line":145,"column":23}},"20":{"start":{"line":151,"column":8},"end":{"line":151,"column":23}},"21":{"start":{"line":155,"column":8},"end":{"line":155,"column":56}},"22":{"start":{"line":156,"column":8},"end":{"line":156,"column":67}},"23":{"start":{"line":157,"column":8},"end":{"line":157,"column":22}},"24":{"start":{"line":163,"column":8},"end":{"line":163,"column":23}},"25":{"start":{"line":167,"column":8},"end":{"line":167,"column":59}},"26":{"start":{"line":168,"column":8},"end":{"line":168,"column":69}},"27":{"start":{"line":169,"column":8},"end":{"line":169,"column":27}},"28":{"start":{"line":175,"column":8},"end":{"line":175,"column":26}},"29":{"start":{"line":185,"column":8},"end":{"line":185,"column":59}},"30":{"start":{"line":187,"column":8},"end":{"line":187,"column":5646}},"31":{"start":{"line":188,"column":12},"end":{"line":188,"column":42}},"32":{"start":{"line":189,"column":12},"end":{"line":189,"column":61}},"33":{"start":{"line":192,"column":8},"end":{"line":192,"column":22}},"34":{"start":{"line":202,"column":8},"end":{"line":202,"column":55}},"35":{"start":{"line":204,"column":8},"end":{"line":204,"column":6036}},"36":{"start":{"line":205,"column":12},"end":{"line":205,"column":62}},"37":{"start":{"line":208,"column":8},"end":{"line":208,"column":18}},"38":{"start":{"line":219,"column":8},"end":{"line":219,"column":53}}},"branchMap":{"1":{"line":22,"type":"if","locations":[{"start":{"line":22,"column":8},"end":{"line":22,"column":8}},{"start":{"line":22,"column":8},"end":{"line":22,"column":8}}]},"2":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":8},"end":{"line":23,"column":8}},{"start":{"line":23,"column":8},"end":{"line":23,"column":8}}]},"3":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":8},"end":{"line":24,"column":8}},{"start":{"line":24,"column":8},"end":{"line":24,"column":8}}]},"4":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":8}},{"start":{"line":92,"column":8},"end":{"line":92,"column":8}}]},"5":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":8},"end":{"line":121,"column":8}},{"start":{"line":121,"column":8},"end":{"line":121,"column":8}}]},"6":{"line":143,"type":"if","locations":[{"start":{"line":143,"column":8},"end":{"line":143,"column":8}},{"start":{"line":143,"column":8},"end":{"line":143,"column":8}}]},"7":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"8":{"line":155,"type":"if","locations":[{"start":{"line":155,"column":8},"end":{"line":155,"column":8}},{"start":{"line":155,"column":8},"end":{"line":155,"column":8}}]},"9":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"10":{"line":167,"type":"if","locations":[{"start":{"line":167,"column":8},"end":{"line":167,"column":8}},{"start":{"line":167,"column":8},"end":{"line":167,"column":8}}]},"11":{"line":168,"type":"if","locations":[{"start":{"line":168,"column":8},"end":{"line":168,"column":8}},{"start":{"line":168,"column":8},"end":{"line":168,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol":{"l":{"35":22,"37":22,"52":24,"53":9,"55":15,"77":15,"94":9,"95":9,"96":9},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol","s":{"1":22,"2":22,"3":24,"4":9,"5":15,"6":15,"7":9,"8":9,"9":9},"b":{"1":[9,15]},"f":{"1":22,"2":24,"3":15,"4":9},"fnMap":{"1":{"name":"recover","line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"getMessageHash","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":56,"column":4}}},"3":{"name":"getNativeMessageHash","line":68,"loc":{"start":{"line":68,"column":4},"end":{"line":78,"column":4}}},"4":{"name":"getEthSignedMessageHash","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":97,"column":4}}}},"statementMap":{"1":{"start":{"line":35,"column":8},"end":{"line":35,"column":75}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1000}},"3":{"start":{"line":52,"column":8},"end":{"line":52,"column":1277}},"4":{"start":{"line":53,"column":12},"end":{"line":53,"column":52}},"5":{"start":{"line":55,"column":8},"end":{"line":55,"column":45}},"6":{"start":{"line":77,"column":8},"end":{"line":77,"column":34}},"7":{"start":{"line":94,"column":8},"end":{"line":94,"column":64}},"8":{"start":{"line":95,"column":8},"end":{"line":95,"column":49}},"9":{"start":{"line":96,"column":8},"end":{"line":96,"column":63}}},"branchMap":{"1":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol":{"l":{"30":10},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol","s":{"1":10},"b":{},"f":{"1":10},"fnMap":{"1":{"name":"encodeRevertString","line":21,"loc":{"start":{"line":21,"column":4},"end":{"line":34,"column":4}}}},"statementMap":{"1":{"start":{"line":30,"column":8},"end":{"line":30,"column":830}}},"branchMap":{}}, -"contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol":{"l":{"37":34,"44":34,"61":18,"82":212,"86":212,"103":19,"107":19,"128":27,"136":27,"155":27,"156":27,"157":27,"159":27,"160":27,"179":0,"186":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol","s":{"1":34,"2":18,"3":212,"4":19,"5":27,"6":27,"7":27,"8":27,"9":27,"10":27,"11":0,"12":0},"b":{},"f":{"1":34,"2":18,"3":212,"4":19,"5":27,"6":27,"7":0},"fnMap":{"1":{"name":"getCode","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":45,"column":4}}},"2":{"name":"getCode","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":66,"column":4}}},"3":{"name":"getCodeSize","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":87,"column":4}}},"4":{"name":"getCodeHash","line":94,"loc":{"start":{"line":94,"column":4},"end":{"line":108,"column":4}}},"5":{"name":"createContract","line":120,"loc":{"start":{"line":120,"column":4},"end":{"line":137,"column":4}}},"6":{"name":"getAddressForCREATE","line":145,"loc":{"start":{"line":145,"column":4},"end":{"line":161,"column":4}}},"7":{"name":"getAddressForCREATE2","line":170,"loc":{"start":{"line":170,"column":4},"end":{"line":187,"column":4}}}},"statementMap":{"1":{"start":{"line":44,"column":8},"end":{"line":44,"column":20}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":1471}},"3":{"start":{"line":86,"column":8},"end":{"line":86,"column":24}},"4":{"start":{"line":107,"column":8},"end":{"line":107,"column":24}},"5":{"start":{"line":136,"column":8},"end":{"line":136,"column":23}},"6":{"start":{"line":155,"column":8},"end":{"line":155,"column":47}},"7":{"start":{"line":156,"column":8},"end":{"line":156,"column":56}},"8":{"start":{"line":157,"column":8},"end":{"line":157,"column":51}},"9":{"start":{"line":159,"column":8},"end":{"line":159,"column":67}},"10":{"start":{"line":160,"column":8},"end":{"line":160,"column":65}},"11":{"start":{"line":179,"column":8},"end":{"line":179,"column":4349}},"12":{"start":{"line":186,"column":8},"end":{"line":186,"column":53}}},"branchMap":{}}, -"contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol":{"l":{"29":0,"30":0,"33":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol","s":{"1":0,"2":0,"3":0},"b":{"1":[0,0]},"f":{"1":0},"fnMap":{"1":{"name":"min","line":19,"loc":{"start":{"line":19,"column":4},"end":{"line":34,"column":4}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":550}},"2":{"start":{"line":30,"column":12},"end":{"line":30,"column":21}},"3":{"start":{"line":33,"column":8},"end":{"line":33,"column":17}}},"branchMap":{"1":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":8},"end":{"line":29,"column":8}},{"start":{"line":29,"column":8},"end":{"line":29,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol":{"l":{"32":118,"37":117,"38":0,"41":117,"61":117,"64":117,"65":117,"68":117,"71":117,"74":117,"75":117,"77":117,"78":273,"79":273,"81":273,"82":4620,"83":4620,"84":4620,"89":4620,"92":273,"93":27,"94":27,"95":27,"100":27,"103":273,"104":273,"107":117,"134":102,"139":101,"144":100,"149":99,"151":99,"152":653,"153":146,"160":507,"168":653,"171":99,"193":100,"198":100,"199":3,"204":97,"205":97,"206":97,"207":776,"208":206,"209":206,"214":97,"215":70,"218":97},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol","s":{"1":118,"2":117,"3":0,"4":117,"5":117,"6":117,"7":117,"8":117,"9":117,"10":117,"11":117,"12":117,"13":273,"14":273,"15":273,"16":4620,"17":4620,"18":4620,"19":273,"20":27,"21":27,"22":27,"23":273,"24":117,"25":102,"26":101,"27":100,"28":99,"29":99,"30":653,"31":146,"32":507,"33":653,"34":99,"35":100,"36":100,"37":3,"38":97,"39":97,"40":97,"41":776,"42":206,"43":206,"44":97,"45":70,"46":97},"b":{"1":[117,1],"2":[0,117],"3":[27,246],"4":[101,1],"5":[100,1],"6":[99,1],"7":[146,507],"8":[100,0],"9":[3,97],"10":[206,570],"11":[70,27]},"f":{"1":118,"2":102,"3":100},"fnMap":{"1":{"name":"getMerkleRoot","line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":108,"column":4}}},"2":{"name":"verify","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":172,"column":4}}},"3":{"name":"_ceilLog2","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":219,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":1067}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1197}},"3":{"start":{"line":38,"column":12},"end":{"line":38,"column":31}},"4":{"start":{"line":41,"column":8},"end":{"line":41,"column":1279}},"5":{"start":{"line":61,"column":8},"end":{"line":61,"column":40}},"6":{"start":{"line":64,"column":8},"end":{"line":64,"column":27}},"7":{"start":{"line":65,"column":8},"end":{"line":65,"column":28}},"8":{"start":{"line":68,"column":8},"end":{"line":68,"column":42}},"9":{"start":{"line":71,"column":8},"end":{"line":71,"column":25}},"10":{"start":{"line":74,"column":8},"end":{"line":74,"column":27}},"11":{"start":{"line":75,"column":8},"end":{"line":75,"column":25}},"12":{"start":{"line":77,"column":8},"end":{"line":77,"column":3156}},"13":{"start":{"line":78,"column":12},"end":{"line":78,"column":36}},"14":{"start":{"line":79,"column":12},"end":{"line":79,"column":42}},"15":{"start":{"line":81,"column":12},"end":{"line":81,"column":3279}},"16":{"start":{"line":82,"column":16},"end":{"line":82,"column":52}},"17":{"start":{"line":83,"column":16},"end":{"line":83,"column":52}},"18":{"start":{"line":89,"column":16},"end":{"line":89,"column":44}},"19":{"start":{"line":92,"column":12},"end":{"line":92,"column":3663}},"20":{"start":{"line":93,"column":16},"end":{"line":93,"column":52}},"21":{"start":{"line":94,"column":16},"end":{"line":94,"column":54}},"22":{"start":{"line":100,"column":16},"end":{"line":100,"column":54}},"23":{"start":{"line":103,"column":12},"end":{"line":103,"column":57}},"24":{"start":{"line":107,"column":8},"end":{"line":107,"column":27}},"25":{"start":{"line":134,"column":8},"end":{"line":134,"column":5110}},"26":{"start":{"line":139,"column":8},"end":{"line":139,"column":5239}},"27":{"start":{"line":144,"column":8},"end":{"line":144,"column":5354}},"28":{"start":{"line":149,"column":8},"end":{"line":149,"column":36}},"29":{"start":{"line":151,"column":8},"end":{"line":151,"column":5571}},"30":{"start":{"line":152,"column":12},"end":{"line":152,"column":5636}},"31":{"start":{"line":153,"column":16},"end":{"line":153,"column":5681}},"32":{"start":{"line":160,"column":16},"end":{"line":160,"column":5898}},"33":{"start":{"line":168,"column":12},"end":{"line":168,"column":23}},"34":{"start":{"line":171,"column":8},"end":{"line":171,"column":36}},"35":{"start":{"line":193,"column":8},"end":{"line":193,"column":6569}},"36":{"start":{"line":198,"column":8},"end":{"line":198,"column":6682}},"37":{"start":{"line":199,"column":12},"end":{"line":199,"column":20}},"38":{"start":{"line":204,"column":8},"end":{"line":204,"column":25}},"39":{"start":{"line":205,"column":8},"end":{"line":205,"column":27}},"40":{"start":{"line":206,"column":8},"end":{"line":206,"column":6934}},"41":{"start":{"line":207,"column":12},"end":{"line":207,"column":6989}},"42":{"start":{"line":208,"column":16},"end":{"line":208,"column":27}},"43":{"start":{"line":209,"column":16},"end":{"line":209,"column":24}},"44":{"start":{"line":214,"column":8},"end":{"line":214,"column":7181}},"45":{"start":{"line":215,"column":12},"end":{"line":215,"column":23}},"46":{"start":{"line":218,"column":8},"end":{"line":218,"column":22}}},"branchMap":{"1":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":8},"end":{"line":32,"column":8}},{"start":{"line":32,"column":8},"end":{"line":32,"column":8}}]},"2":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"3":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":12},"end":{"line":92,"column":12}},{"start":{"line":92,"column":12},"end":{"line":92,"column":12}}]},"4":{"line":134,"type":"if","locations":[{"start":{"line":134,"column":8},"end":{"line":134,"column":8}},{"start":{"line":134,"column":8},"end":{"line":134,"column":8}}]},"5":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"6":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"7":{"line":152,"type":"if","locations":[{"start":{"line":152,"column":12},"end":{"line":152,"column":12}},{"start":{"line":152,"column":12},"end":{"line":152,"column":12}}]},"8":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"9":{"line":198,"type":"if","locations":[{"start":{"line":198,"column":8},"end":{"line":198,"column":8}},{"start":{"line":198,"column":8},"end":{"line":198,"column":8}}]},"10":{"line":207,"type":"if","locations":[{"start":{"line":207,"column":12},"end":{"line":207,"column":12}},{"start":{"line":207,"column":12},"end":{"line":207,"column":12}}]},"11":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol":{"l":{"38":54,"50":14,"53":14,"55":14,"59":6},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol","s":{"1":54,"2":14,"3":14,"4":6},"b":{"1":[14,0]},"f":{"1":54,"2":14},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":39,"column":4}}},"2":{"name":"nonReentrant","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":60,"column":4}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":29}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":70}},"3":{"start":{"line":53,"column":8},"end":{"line":53,"column":25}},"4":{"start":{"line":59,"column":8},"end":{"line":59,"column":29}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol":{"l":{"60":572,"61":572,"64":572,"65":134,"69":572,"70":11,"73":0,"74":0,"75":0,"78":0,"81":11,"86":572,"87":572,"90":572,"91":572,"92":572,"106":470,"108":470,"130":538,"132":538,"137":535,"138":535,"140":535,"143":535,"146":535,"151":535,"155":0,"158":0,"164":0,"169":0,"186":1,"188":1,"193":1,"197":0,"198":0,"202":1,"203":1,"204":1,"218":0,"219":0,"239":441,"240":441,"254":0,"255":0,"256":0,"273":550,"274":550,"288":573,"289":573,"291":573,"292":573,"293":573,"298":573,"299":573,"300":573,"301":573,"307":573,"308":573,"311":573,"312":0,"330":2572,"331":2572,"333":2572,"334":2572,"335":2572,"340":2572,"341":2572,"342":2572,"343":2572,"349":2572,"374":1642},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol","s":{"1":572,"2":572,"3":572,"4":134,"5":572,"6":11,"7":0,"8":0,"9":0,"10":11,"11":572,"12":572,"13":572,"14":572,"15":470,"16":470,"17":538,"18":538,"19":535,"20":535,"21":535,"22":535,"23":535,"24":535,"25":0,"26":0,"27":0,"28":0,"29":1,"30":1,"31":1,"32":0,"33":1,"34":1,"35":1,"36":0,"37":0,"38":441,"39":441,"40":0,"41":0,"42":0,"43":550,"44":550,"45":573,"46":573,"47":573,"48":573,"49":573,"50":573,"51":573,"52":573,"53":573,"54":573,"55":0,"56":2572,"57":2572,"58":2572,"59":2572,"60":2572,"61":2572,"62":2572,"63":2572,"64":1642},"b":{"1":[134,438],"2":[11,561],"3":[0,11],"4":[535,3],"5":[535,0],"6":[535,0],"7":[0,0],"8":[0,0],"9":[1,0],"10":[0,1],"11":[573,0],"12":[0,573]},"f":{"1":572,"2":470,"3":538,"4":1,"5":0,"6":441,"7":0,"8":550,"9":573,"10":2572,"11":1642},"fnMap":{"1":{"name":"push","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":93,"column":4}}},"2":{"name":"push","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":112,"column":4}}},"3":{"name":"get","line":120,"loc":{"start":{"line":120,"column":4},"end":{"line":171,"column":4}}},"4":{"name":"deleteElementsAfterInclusive","line":179,"loc":{"start":{"line":179,"column":4},"end":{"line":205,"column":4}}},"5":{"name":"deleteElementsAfterInclusive","line":212,"loc":{"start":{"line":212,"column":4},"end":{"line":223,"column":4}}},"6":{"name":"getLength","line":230,"loc":{"start":{"line":230,"column":4},"end":{"line":241,"column":4}}},"7":{"name":"setExtraData","line":248,"loc":{"start":{"line":248,"column":4},"end":{"line":257,"column":4}}},"8":{"name":"getExtraData","line":264,"loc":{"start":{"line":264,"column":4},"end":{"line":275,"column":4}}},"9":{"name":"setContext","line":282,"loc":{"start":{"line":282,"column":4},"end":{"line":314,"column":4}}},"10":{"name":"getContext","line":321,"loc":{"start":{"line":321,"column":4},"end":{"line":356,"column":4}}},"11":{"name":"getBuffer","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":375,"column":4}}}},"statementMap":{"1":{"start":{"line":60,"column":8},"end":{"line":60,"column":57}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":72}},"3":{"start":{"line":64,"column":8},"end":{"line":64,"column":1385}},"4":{"start":{"line":65,"column":12},"end":{"line":65,"column":43}},"5":{"start":{"line":69,"column":8},"end":{"line":69,"column":1530}},"6":{"start":{"line":70,"column":12},"end":{"line":70,"column":1611}},"7":{"start":{"line":74,"column":16},"end":{"line":74,"column":54}},"8":{"start":{"line":75,"column":16},"end":{"line":75,"column":51}},"9":{"start":{"line":78,"column":16},"end":{"line":78,"column":64}},"10":{"start":{"line":81,"column":16},"end":{"line":81,"column":37}},"11":{"start":{"line":86,"column":8},"end":{"line":86,"column":64}},"12":{"start":{"line":87,"column":8},"end":{"line":87,"column":41}},"13":{"start":{"line":91,"column":8},"end":{"line":91,"column":33}},"14":{"start":{"line":92,"column":8},"end":{"line":92,"column":28}},"15":{"start":{"line":106,"column":8},"end":{"line":106,"column":57}},"16":{"start":{"line":108,"column":8},"end":{"line":108,"column":2968}},"17":{"start":{"line":130,"column":8},"end":{"line":130,"column":57}},"18":{"start":{"line":132,"column":8},"end":{"line":132,"column":3484}},"19":{"start":{"line":137,"column":8},"end":{"line":137,"column":72}},"20":{"start":{"line":138,"column":8},"end":{"line":138,"column":76}},"21":{"start":{"line":140,"column":8},"end":{"line":140,"column":3739}},"22":{"start":{"line":143,"column":12},"end":{"line":143,"column":63}},"23":{"start":{"line":146,"column":12},"end":{"line":146,"column":4055}},"24":{"start":{"line":151,"column":12},"end":{"line":151,"column":48}},"25":{"start":{"line":155,"column":12},"end":{"line":155,"column":63}},"26":{"start":{"line":158,"column":12},"end":{"line":158,"column":4566}},"27":{"start":{"line":164,"column":12},"end":{"line":164,"column":4767}},"28":{"start":{"line":169,"column":12},"end":{"line":169,"column":68}},"29":{"start":{"line":186,"column":8},"end":{"line":186,"column":57}},"30":{"start":{"line":188,"column":8},"end":{"line":188,"column":5432}},"31":{"start":{"line":193,"column":8},"end":{"line":193,"column":5566}},"32":{"start":{"line":198,"column":12},"end":{"line":198,"column":50}},"33":{"start":{"line":202,"column":8},"end":{"line":202,"column":31}},"34":{"start":{"line":203,"column":8},"end":{"line":203,"column":33}},"35":{"start":{"line":204,"column":8},"end":{"line":204,"column":28}},"36":{"start":{"line":218,"column":8},"end":{"line":218,"column":57}},"37":{"start":{"line":219,"column":8},"end":{"line":219,"column":6512}},"38":{"start":{"line":239,"column":8},"end":{"line":239,"column":57}},"39":{"start":{"line":240,"column":8},"end":{"line":240,"column":30}},"40":{"start":{"line":254,"column":8},"end":{"line":254,"column":57}},"41":{"start":{"line":255,"column":8},"end":{"line":255,"column":33}},"42":{"start":{"line":256,"column":8},"end":{"line":256,"column":28}},"43":{"start":{"line":273,"column":8},"end":{"line":273,"column":57}},"44":{"start":{"line":274,"column":8},"end":{"line":274,"column":28}},"45":{"start":{"line":288,"column":8},"end":{"line":288,"column":24}},"46":{"start":{"line":289,"column":8},"end":{"line":289,"column":24}},"47":{"start":{"line":291,"column":8},"end":{"line":291,"column":45}},"48":{"start":{"line":292,"column":8},"end":{"line":292,"column":42}},"49":{"start":{"line":298,"column":8},"end":{"line":298,"column":53}},"50":{"start":{"line":299,"column":8},"end":{"line":299,"column":51}},"51":{"start":{"line":300,"column":8},"end":{"line":300,"column":51}},"52":{"start":{"line":307,"column":8},"end":{"line":307,"column":8669}},"53":{"start":{"line":308,"column":12},"end":{"line":308,"column":36}},"54":{"start":{"line":311,"column":8},"end":{"line":311,"column":8761}},"55":{"start":{"line":312,"column":12},"end":{"line":312,"column":36}},"56":{"start":{"line":330,"column":8},"end":{"line":330,"column":41}},"57":{"start":{"line":331,"column":8},"end":{"line":331,"column":41}},"58":{"start":{"line":333,"column":8},"end":{"line":333,"column":26}},"59":{"start":{"line":334,"column":8},"end":{"line":334,"column":25}},"60":{"start":{"line":340,"column":8},"end":{"line":340,"column":30}},"61":{"start":{"line":341,"column":8},"end":{"line":341,"column":29}},"62":{"start":{"line":342,"column":8},"end":{"line":342,"column":29}},"63":{"start":{"line":349,"column":8},"end":{"line":349,"column":10056}},"64":{"start":{"line":374,"column":8},"end":{"line":374,"column":62}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"2":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":8}},{"start":{"line":69,"column":8},"end":{"line":69,"column":8}}]},"3":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":12},"end":{"line":70,"column":12}},{"start":{"line":70,"column":12},"end":{"line":70,"column":12}}]},"4":{"line":132,"type":"if","locations":[{"start":{"line":132,"column":8},"end":{"line":132,"column":8}},{"start":{"line":132,"column":8},"end":{"line":132,"column":8}}]},"5":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":8},"end":{"line":140,"column":8}},{"start":{"line":140,"column":8},"end":{"line":140,"column":8}}]},"6":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":12},"end":{"line":146,"column":12}},{"start":{"line":146,"column":12},"end":{"line":146,"column":12}}]},"7":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":12},"end":{"line":158,"column":12}},{"start":{"line":158,"column":12},"end":{"line":158,"column":12}}]},"8":{"line":164,"type":"if","locations":[{"start":{"line":164,"column":12},"end":{"line":164,"column":12}},{"start":{"line":164,"column":12},"end":{"line":164,"column":12}}]},"9":{"line":188,"type":"if","locations":[{"start":{"line":188,"column":8},"end":{"line":188,"column":8}},{"start":{"line":188,"column":8},"end":{"line":188,"column":8}}]},"10":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"11":{"line":307,"type":"if","locations":[{"start":{"line":307,"column":8},"end":{"line":307,"column":8}},{"start":{"line":307,"column":8},"end":{"line":307,"column":8}}]},"12":{"line":311,"type":"if","locations":[{"start":{"line":311,"column":8},"end":{"line":311,"column":8}},{"start":{"line":311,"column":8},"end":{"line":311,"column":8}}]}}}, -"contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol":{"l":{"41":18,"50":18,"72":2,"81":2,"100":1,"108":1,"124":5,"131":5,"144":12,"150":12,"163":11,"169":11,"182":9,"188":9,"201":7,"207":7,"219":6,"242":2,"262":9,"283":41,"284":7,"301":43,"308":43,"320":21,"348":146,"349":146,"354":146,"355":2,"359":0,"363":144,"375":145},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol","s":{"1":18,"2":18,"3":2,"4":2,"5":1,"6":1,"7":5,"8":5,"9":12,"10":12,"11":11,"12":11,"13":9,"14":9,"15":7,"16":7,"17":6,"18":2,"19":9,"20":41,"21":7,"22":43,"23":43,"24":21,"25":146,"26":146,"27":146,"28":144,"29":144,"30":145},"b":{"1":[7,34],"2":[2,144],"3":[0,144]},"f":{"1":18,"2":2,"3":1,"4":5,"5":12,"6":11,"7":9,"8":7,"9":6,"10":2,"11":9,"12":41,"13":43,"14":21,"15":146,"16":145},"fnMap":{"1":{"name":"safeCALL","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":51,"column":4}}},"2":{"name":"safeDELEGATECALL","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":82,"column":4}}},"3":{"name":"safeCREATE","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":109,"column":4}}},"4":{"name":"safeEXTCODESIZE","line":116,"loc":{"start":{"line":116,"column":4},"end":{"line":132,"column":4}}},"5":{"name":"safeCHAINID","line":138,"loc":{"start":{"line":138,"column":4},"end":{"line":151,"column":4}}},"6":{"name":"safeCALLER","line":157,"loc":{"start":{"line":157,"column":4},"end":{"line":170,"column":4}}},"7":{"name":"safeADDRESS","line":176,"loc":{"start":{"line":176,"column":4},"end":{"line":189,"column":4}}},"8":{"name":"safeGETNONCE","line":195,"loc":{"start":{"line":195,"column":4},"end":{"line":208,"column":4}}},"9":{"name":"safeSETNONCE","line":214,"loc":{"start":{"line":214,"column":4},"end":{"line":225,"column":4}}},"10":{"name":"safeCREATEEOA","line":234,"loc":{"start":{"line":234,"column":4},"end":{"line":251,"column":4}}},"11":{"name":"safeREVERT","line":257,"loc":{"start":{"line":257,"column":4},"end":{"line":270,"column":4}}},"12":{"name":"safeREQUIRE","line":277,"loc":{"start":{"line":277,"column":4},"end":{"line":288,"column":4}}},"13":{"name":"safeSLOAD","line":293,"loc":{"start":{"line":293,"column":4},"end":{"line":309,"column":4}}},"14":{"name":"safeSSTORE","line":314,"loc":{"start":{"line":314,"column":4},"end":{"line":327,"column":4}}},"15":{"name":"_safeExecutionManagerInteraction","line":339,"loc":{"start":{"line":339,"column":4},"end":{"line":365,"column":4}}},"16":{"name":"_safeExecutionManagerInteraction","line":367,"loc":{"start":{"line":367,"column":4},"end":{"line":379,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":1128}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":52}},"3":{"start":{"line":72,"column":8},"end":{"line":72,"column":1988}},"4":{"start":{"line":81,"column":8},"end":{"line":81,"column":52}},"5":{"start":{"line":100,"column":8},"end":{"line":100,"column":2718}},"6":{"start":{"line":108,"column":8},"end":{"line":108,"column":55}},"7":{"start":{"line":124,"column":8},"end":{"line":124,"column":3343}},"8":{"start":{"line":131,"column":8},"end":{"line":131,"column":48}},"9":{"start":{"line":144,"column":8},"end":{"line":144,"column":3817}},"10":{"start":{"line":150,"column":8},"end":{"line":150,"column":48}},"11":{"start":{"line":163,"column":8},"end":{"line":163,"column":4248}},"12":{"start":{"line":169,"column":8},"end":{"line":169,"column":48}},"13":{"start":{"line":182,"column":8},"end":{"line":182,"column":4683}},"14":{"start":{"line":188,"column":8},"end":{"line":188,"column":48}},"15":{"start":{"line":201,"column":8},"end":{"line":201,"column":5118}},"16":{"start":{"line":207,"column":8},"end":{"line":207,"column":48}},"17":{"start":{"line":219,"column":8},"end":{"line":219,"column":5513}},"18":{"start":{"line":242,"column":8},"end":{"line":242,"column":6076}},"19":{"start":{"line":262,"column":8},"end":{"line":262,"column":6544}},"20":{"start":{"line":283,"column":8},"end":{"line":283,"column":7099}},"21":{"start":{"line":284,"column":12},"end":{"line":284,"column":7134}},"22":{"start":{"line":301,"column":8},"end":{"line":301,"column":7383}},"23":{"start":{"line":308,"column":8},"end":{"line":308,"column":48}},"24":{"start":{"line":320,"column":8},"end":{"line":320,"column":7782}},"25":{"start":{"line":348,"column":8},"end":{"line":348,"column":48}},"26":{"start":{"line":349,"column":8},"end":{"line":349,"column":8669}},"27":{"start":{"line":354,"column":8},"end":{"line":354,"column":8752}},"28":{"start":{"line":358,"column":15},"end":{"line":358,"column":8893}},"29":{"start":{"line":363,"column":12},"end":{"line":363,"column":29}},"30":{"start":{"line":375,"column":8},"end":{"line":375,"column":9234}}},"branchMap":{"1":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":8},"end":{"line":283,"column":8}},{"start":{"line":283,"column":8},"end":{"line":283,"column":8}}]},"2":{"line":354,"type":"if","locations":[{"start":{"line":354,"column":8},"end":{"line":354,"column":8}},{"start":{"line":354,"column":8},"end":{"line":354,"column":8}}]},"3":{"line":358,"type":"if","locations":[{"start":{"line":358,"column":15},"end":{"line":358,"column":15}},{"start":{"line":358,"column":15},"end":{"line":358,"column":15}}]}}}, -"contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol":{"l":{"39":0,"40":0,"42":0,"56":0,"70":0,"71":0,"73":0,"90":7,"91":0,"94":7,"95":7,"97":7,"113":0,"129":0,"130":0,"133":0,"149":0,"165":0,"166":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":7,"9":0,"10":7,"11":7,"12":7,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"b":{"1":[0,7]},"f":{"1":0,"2":0,"3":0,"4":7,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"add","line":38,"loc":{"start":{"line":38,"column":4},"end":{"line":43,"column":4}}},"2":{"name":"sub","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":57,"column":4}}},"3":{"name":"sub","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":74,"column":4}}},"4":{"name":"mul","line":86,"loc":{"start":{"line":86,"column":4},"end":{"line":98,"column":4}}},"5":{"name":"div","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":114,"column":4}}},"6":{"name":"div","line":128,"loc":{"start":{"line":128,"column":4},"end":{"line":134,"column":4}}},"7":{"name":"mod","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":150,"column":4}}},"8":{"name":"mod","line":164,"loc":{"start":{"line":164,"column":4},"end":{"line":167,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":25}},"2":{"start":{"line":40,"column":8},"end":{"line":40,"column":100}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":16}},"4":{"start":{"line":56,"column":8},"end":{"line":56,"column":69}},"5":{"start":{"line":70,"column":8},"end":{"line":70,"column":72}},"6":{"start":{"line":71,"column":8},"end":{"line":71,"column":25}},"7":{"start":{"line":73,"column":8},"end":{"line":73,"column":16}},"8":{"start":{"line":90,"column":8},"end":{"line":90,"column":2816}},"9":{"start":{"line":91,"column":12},"end":{"line":91,"column":20}},"10":{"start":{"line":94,"column":8},"end":{"line":94,"column":25}},"11":{"start":{"line":95,"column":8},"end":{"line":95,"column":110}},"12":{"start":{"line":97,"column":8},"end":{"line":97,"column":16}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":65}},"14":{"start":{"line":129,"column":8},"end":{"line":129,"column":71}},"15":{"start":{"line":130,"column":8},"end":{"line":130,"column":25}},"16":{"start":{"line":133,"column":8},"end":{"line":133,"column":16}},"17":{"start":{"line":149,"column":8},"end":{"line":149,"column":63}},"18":{"start":{"line":165,"column":8},"end":{"line":165,"column":72}},"19":{"start":{"line":166,"column":8},"end":{"line":166,"column":20}}},"branchMap":{"1":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol":{"l":{"63":7,"69":7,"80":7,"83":7,"89":7,"102":7,"103":7,"104":7,"109":7,"115":7,"116":1,"122":1,"123":1,"125":0,"131":6,"133":6},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol","s":{"1":7,"2":7,"3":7,"4":7,"5":7,"6":7,"7":7,"8":7,"9":7,"10":7,"11":1,"12":1,"13":1,"14":0,"15":6,"16":6},"b":{"1":[1,6],"2":[1,0]},"f":{"1":7},"fnMap":{"1":{"name":"execute","line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":139,"column":4}}}},"statementMap":{"1":{"start":{"line":63,"column":8},"end":{"line":63,"column":91}},"2":{"start":{"line":69,"column":8},"end":{"line":69,"column":2653}},"3":{"start":{"line":80,"column":8},"end":{"line":80,"column":119}},"4":{"start":{"line":83,"column":8},"end":{"line":83,"column":3201}},"5":{"start":{"line":89,"column":8},"end":{"line":89,"column":3483}},"6":{"start":{"line":102,"column":8},"end":{"line":102,"column":70}},"7":{"start":{"line":103,"column":8},"end":{"line":103,"column":85}},"8":{"start":{"line":104,"column":8},"end":{"line":104,"column":4275}},"9":{"start":{"line":109,"column":8},"end":{"line":109,"column":4487}},"10":{"start":{"line":115,"column":8},"end":{"line":115,"column":4721}},"11":{"start":{"line":116,"column":12},"end":{"line":116,"column":4772}},"12":{"start":{"line":122,"column":12},"end":{"line":122,"column":5049}},"13":{"start":{"line":123,"column":16},"end":{"line":123,"column":50}},"14":{"start":{"line":125,"column":16},"end":{"line":125,"column":42}},"15":{"start":{"line":131,"column":12},"end":{"line":131,"column":76}},"16":{"start":{"line":133,"column":12},"end":{"line":133,"column":5602}}},"branchMap":{"1":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":8},"end":{"line":115,"column":8}},{"start":{"line":115,"column":8},"end":{"line":115,"column":8}}]},"2":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":12},"end":{"line":122,"column":12}},{"start":{"line":122,"column":12},"end":{"line":122,"column":12}}]}}}, -"contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol":{"l":{"39":13,"50":1,"56":1,"57":1,"61":0,"81":2,"86":2,"99":2,"116":15},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol","s":{"1":13,"2":1,"3":1,"4":0,"5":2,"6":2,"7":2,"8":15},"b":{"1":[1,0]},"f":{"1":13,"2":1,"3":2,"4":2,"5":15},"fnMap":{"1":{"name":"constructor","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":40,"column":4}}},"2":{"name":null,"line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":65,"column":4}}},"3":{"name":"upgrade","line":76,"loc":{"start":{"line":76,"column":4},"end":{"line":87,"column":4}}},"4":{"name":"getImplementation","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":104,"column":4}}},"5":{"name":"_setImplementation","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":120,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":42}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":1366}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":1554}},"4":{"start":{"line":61,"column":12},"end":{"line":61,"column":1704}},"5":{"start":{"line":81,"column":8},"end":{"line":81,"column":2100}},"6":{"start":{"line":86,"column":8},"end":{"line":86,"column":42}},"7":{"start":{"line":99,"column":8},"end":{"line":99,"column":2610}},"8":{"start":{"line":116,"column":8},"end":{"line":116,"column":2955}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol":{"l":{"47":4,"48":0,"65":7,"72":7,"73":7,"75":7,"76":7,"103":21,"124":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol","s":{"1":4,"2":0,"3":7,"4":7,"5":7,"6":7,"7":7,"8":21,"9":0},"b":{"1":[0,4]},"f":{"1":54,"2":4,"3":7,"4":21,"5":0},"fnMap":{"1":{"name":"constructor","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":41}}},"2":{"name":"xDomainMessageSender","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"sendMessage","line":57,"loc":{"start":{"line":57,"column":4},"end":{"line":77,"column":4}}},"4":{"name":"_getXDomainCalldata","line":91,"loc":{"start":{"line":91,"column":4},"end":{"line":110,"column":4}}},"5":{"name":"_sendXDomainMessage","line":117,"loc":{"start":{"line":117,"column":4},"end":{"line":125,"column":4}}}},"statementMap":{"1":{"start":{"line":47,"column":8},"end":{"line":47,"column":93}},"2":{"start":{"line":48,"column":8},"end":{"line":48,"column":31}},"3":{"start":{"line":65,"column":8},"end":{"line":65,"column":2352}},"4":{"start":{"line":72,"column":8},"end":{"line":72,"column":24}},"5":{"start":{"line":73,"column":8},"end":{"line":73,"column":54}},"6":{"start":{"line":75,"column":8},"end":{"line":75,"column":54}},"7":{"start":{"line":76,"column":8},"end":{"line":76,"column":41}},"8":{"start":{"line":103,"column":8},"end":{"line":103,"column":3373}},"9":{"start":{"line":124,"column":8},"end":{"line":124,"column":49}}},"branchMap":{"1":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":8}},{"start":{"line":47,"column":8},"end":{"line":47,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol":{"l":{"50":12,"51":12,"52":12,"64":9,"65":9,"66":1,"71":8,"95":8,"102":8,"110":4,"112":4,"117":3,"118":3,"119":3,"123":3,"124":3,"125":3,"130":3,"137":3,"154":2,"161":2,"166":1,"190":8,"210":8,"212":8,"238":6,"250":6,"259":5,"264":5,"268":5,"288":5},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol","s":{"1":12,"2":12,"3":12,"4":9,"5":9,"6":1,"7":8,"8":8,"9":4,"10":4,"11":3,"12":3,"13":3,"14":3,"15":3,"16":3,"17":3,"18":3,"19":2,"20":2,"21":1,"22":8,"23":8,"24":8,"25":6,"26":6,"27":5,"28":5,"29":5,"30":5},"b":{"1":[12,0],"2":[1,8],"3":[0,1],"4":[4,4],"5":[3,1],"6":[3,0],"7":[1,1],"8":[5,0]},"f":{"1":36,"2":12,"3":9,"4":8,"5":2,"6":8,"7":8,"8":6,"9":5},"fnMap":{"1":{"name":"constructor","line":39,"loc":{"start":{"line":38,"column":4},"end":{"line":40,"column":5}}},"2":{"name":"initialize","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":53,"column":4}}},"3":{"name":"onlyRelayer","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":72,"column":4}}},"4":{"name":"relayMessage","line":93,"loc":{"start":{"line":83,"column":4},"end":{"line":138,"column":4}}},"5":{"name":"replayMessage","line":144,"loc":{"start":{"line":144,"column":4},"end":{"line":167,"column":4}}},"6":{"name":"_verifyXDomainMessage","line":180,"loc":{"start":{"line":180,"column":4},"end":{"line":194,"column":4}}},"7":{"name":"_verifyStateRootProof","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":220,"column":4}}},"8":{"name":"_verifyStorageProof","line":228,"loc":{"start":{"line":228,"column":4},"end":{"line":274,"column":4}}},"9":{"name":"_sendXDomainMessage","line":281,"loc":{"start":{"line":281,"column":4},"end":{"line":293,"column":4}}}},"statementMap":{"1":{"start":{"line":50,"column":8},"end":{"line":50,"column":102}},"2":{"start":{"line":51,"column":8},"end":{"line":51,"column":65}},"3":{"start":{"line":52,"column":8},"end":{"line":52,"column":48}},"4":{"start":{"line":64,"column":8},"end":{"line":64,"column":57}},"5":{"start":{"line":65,"column":8},"end":{"line":65,"column":2460}},"6":{"start":{"line":66,"column":12},"end":{"line":66,"column":2505}},"7":{"start":{"line":95,"column":8},"end":{"line":95,"column":3142}},"8":{"start":{"line":102,"column":8},"end":{"line":102,"column":3303}},"9":{"start":{"line":110,"column":8},"end":{"line":110,"column":64}},"10":{"start":{"line":112,"column":8},"end":{"line":112,"column":3567}},"11":{"start":{"line":117,"column":8},"end":{"line":117,"column":33}},"12":{"start":{"line":118,"column":8},"end":{"line":118,"column":49}},"13":{"start":{"line":119,"column":8},"end":{"line":119,"column":48}},"14":{"start":{"line":123,"column":8},"end":{"line":123,"column":4023}},"15":{"start":{"line":124,"column":12},"end":{"line":124,"column":57}},"16":{"start":{"line":125,"column":12},"end":{"line":125,"column":52}},"17":{"start":{"line":130,"column":8},"end":{"line":130,"column":4350}},"18":{"start":{"line":137,"column":8},"end":{"line":137,"column":38}},"19":{"start":{"line":154,"column":8},"end":{"line":154,"column":4915}},"20":{"start":{"line":161,"column":8},"end":{"line":161,"column":5076}},"21":{"start":{"line":166,"column":8},"end":{"line":166,"column":54}},"22":{"start":{"line":190,"column":8},"end":{"line":190,"column":5816}},"23":{"start":{"line":210,"column":8},"end":{"line":210,"column":122}},"24":{"start":{"line":212,"column":8},"end":{"line":212,"column":6441}},"25":{"start":{"line":238,"column":8},"end":{"line":238,"column":7225}},"26":{"start":{"line":250,"column":8},"end":{"line":250,"column":7558}},"27":{"start":{"line":259,"column":8},"end":{"line":259,"column":7836}},"28":{"start":{"line":264,"column":8},"end":{"line":264,"column":7986}},"29":{"start":{"line":268,"column":8},"end":{"line":268,"column":8119}},"30":{"start":{"line":288,"column":8},"end":{"line":288,"column":8632}}},"branchMap":{"1":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]},"2":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]},"3":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":12},"end":{"line":66,"column":12}},{"start":{"line":66,"column":12},"end":{"line":66,"column":12}}]},"4":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"5":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":8},"end":{"line":112,"column":8}},{"start":{"line":112,"column":8},"end":{"line":112,"column":8}}]},"6":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"7":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":8}},{"start":{"line":161,"column":8},"end":{"line":161,"column":8}}]},"8":{"line":259,"type":"if","locations":[{"start":{"line":259,"column":8},"end":{"line":259,"column":8}},{"start":{"line":259,"column":8},"end":{"line":259,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol":{"l":{"38":2,"42":1,"58":1,"59":1,"60":3,"61":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol","s":{"1":2,"2":1,"3":1,"4":3,"5":3},"b":{"1":[1,1]},"f":{"1":6,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":30,"loc":{"start":{"line":27,"column":4},"end":{"line":31,"column":5}}},"2":{"name":"onlyBatchRelayer","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"batchRelayMessages","line":56,"loc":{"start":{"line":53,"column":4},"end":{"line":69,"column":4}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":1192}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":121}},"3":{"start":{"line":59,"column":8},"end":{"line":59,"column":1913}},"4":{"start":{"line":60,"column":12},"end":{"line":60,"column":55}},"5":{"start":{"line":61,"column":12},"end":{"line":61,"column":2035}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":8}},{"start":{"line":38,"column":8},"end":{"line":38,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol":{"l":{"59":5,"64":4,"71":4,"73":4,"78":3,"79":3,"80":3,"84":3,"85":3,"86":3,"91":3,"98":3,"117":5,"134":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol","s":{"1":5,"2":4,"3":4,"4":4,"5":3,"6":3,"7":3,"8":3,"9":3,"10":3,"11":3,"12":3,"13":5,"14":3},"b":{"1":[4,1],"2":[3,1],"3":[3,0]},"f":{"1":18,"2":5,"3":5,"4":3},"fnMap":{"1":{"name":"constructor","line":37,"loc":{"start":{"line":34,"column":4},"end":{"line":38,"column":5}}},"2":{"name":"relayMessage","line":56,"loc":{"start":{"line":49,"column":4},"end":{"line":99,"column":4}}},"3":{"name":"_verifyXDomainMessage","line":110,"loc":{"start":{"line":110,"column":4},"end":{"line":120,"column":4}}},"4":{"name":"_sendXDomainMessage","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":135,"column":4}}}},"statementMap":{"1":{"start":{"line":59,"column":8},"end":{"line":59,"column":1793}},"2":{"start":{"line":64,"column":8},"end":{"line":64,"column":1922}},"3":{"start":{"line":71,"column":8},"end":{"line":71,"column":64}},"4":{"start":{"line":73,"column":8},"end":{"line":73,"column":2150}},"5":{"start":{"line":78,"column":8},"end":{"line":78,"column":33}},"6":{"start":{"line":79,"column":8},"end":{"line":79,"column":49}},"7":{"start":{"line":80,"column":8},"end":{"line":80,"column":48}},"8":{"start":{"line":84,"column":8},"end":{"line":84,"column":2606}},"9":{"start":{"line":85,"column":12},"end":{"line":85,"column":57}},"10":{"start":{"line":86,"column":12},"end":{"line":86,"column":52}},"11":{"start":{"line":91,"column":8},"end":{"line":91,"column":2933}},"12":{"start":{"line":98,"column":8},"end":{"line":98,"column":38}},"13":{"start":{"line":117,"column":8},"end":{"line":117,"column":3513}},"14":{"start":{"line":134,"column":8},"end":{"line":134,"column":93}}},"branchMap":{"1":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":8},"end":{"line":59,"column":8}},{"start":{"line":59,"column":8},"end":{"line":59,"column":8}}]},"2":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":8},"end":{"line":73,"column":8}},{"start":{"line":73,"column":8},"end":{"line":73,"column":8}}]},"3":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":8},"end":{"line":84,"column":8}},{"start":{"line":84,"column":8},"end":{"line":84,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol":{"l":{"48":24,"72":0,"91":0,"107":2,"124":1,"139":1,"158":2,"165":2,"172":2,"178":2,"202":1,"207":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol","s":{"1":24,"2":0,"3":0,"4":2,"5":1,"6":1,"7":2,"8":2,"9":2,"10":2,"11":1,"12":1},"b":{},"f":{"1":24,"2":0,"3":0,"4":2,"5":1,"6":1,"7":2,"8":1},"fnMap":{"1":{"name":"constructor","line":46,"loc":{"start":{"line":42,"column":4},"end":{"line":49,"column":4}}},"2":{"name":"_handleFinalizeWithdrawal","line":65,"loc":{"start":{"line":65,"column":4},"end":{"line":73,"column":4}}},"3":{"name":"_handleInitiateDeposit","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":92,"column":4}}},"4":{"name":"getFinalizeDepositL2Gas","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":108,"column":4}}},"5":{"name":"deposit","line":118,"loc":{"start":{"line":118,"column":4},"end":{"line":125,"column":4}}},"6":{"name":"depositTo","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"7":{"name":"_initiateDeposit","line":150,"loc":{"start":{"line":150,"column":4},"end":{"line":179,"column":4}}},"8":{"name":"finalizeWithdrawal","line":199,"loc":{"start":{"line":193,"column":4},"end":{"line":208,"column":4}}}},"statementMap":{"1":{"start":{"line":48,"column":8},"end":{"line":48,"column":43}},"2":{"start":{"line":72,"column":8},"end":{"line":72,"column":48}},"3":{"start":{"line":91,"column":8},"end":{"line":91,"column":48}},"4":{"start":{"line":107,"column":8},"end":{"line":107,"column":46}},"5":{"start":{"line":124,"column":8},"end":{"line":124,"column":56}},"6":{"start":{"line":139,"column":8},"end":{"line":139,"column":49}},"7":{"start":{"line":158,"column":8},"end":{"line":158,"column":4675}},"8":{"start":{"line":165,"column":8},"end":{"line":165,"column":4857}},"9":{"start":{"line":172,"column":8},"end":{"line":172,"column":5050}},"10":{"start":{"line":178,"column":8},"end":{"line":178,"column":50}},"11":{"start":{"line":202,"column":8},"end":{"line":202,"column":5940}},"12":{"start":{"line":207,"column":8},"end":{"line":207,"column":46}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol":{"l":{"64":8,"66":8,"68":8,"76":5,"77":5,"102":0,"119":0,"136":9,"155":1,"171":1,"187":2,"190":2,"197":2,"203":2,"227":1,"228":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol","s":{"1":8,"2":8,"3":8,"4":5,"5":0,"6":0,"7":9,"8":1,"9":1,"10":2,"11":2,"12":2,"13":2,"14":1,"15":1},"b":{"1":[8,0],"2":[5,0]},"f":{"1":30,"2":8,"3":5,"4":0,"5":0,"6":9,"7":1,"8":1,"9":2,"10":1},"fnMap":{"1":{"name":"constructor","line":48,"loc":{"start":{"line":45,"column":4},"end":{"line":49,"column":5}}},"2":{"name":"init","line":59,"loc":{"start":{"line":59,"column":4},"end":{"line":69,"column":4}}},"3":{"name":"onlyInitialized","line":75,"loc":{"start":{"line":75,"column":4},"end":{"line":78,"column":4}}},"4":{"name":"_handleInitiateWithdrawal","line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":103,"column":4}}},"5":{"name":"_handleFinalizeDeposit","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":120,"column":4}}},"6":{"name":"getFinalizeWithdrawalL1Gas","line":128,"loc":{"start":{"line":128,"column":4},"end":{"line":137,"column":4}}},"7":{"name":"withdraw","line":153,"loc":{"start":{"line":148,"column":4},"end":{"line":156,"column":4}}},"8":{"name":"withdrawTo","line":169,"loc":{"start":{"line":163,"column":4},"end":{"line":172,"column":4}}},"9":{"name":"_initiateWithdrawal","line":180,"loc":{"start":{"line":180,"column":4},"end":{"line":204,"column":4}}},"10":{"name":"finalizeDeposit","line":225,"loc":{"start":{"line":218,"column":4},"end":{"line":229,"column":4}}}},"statementMap":{"1":{"start":{"line":64,"column":8},"end":{"line":64,"column":94}},"2":{"start":{"line":66,"column":8},"end":{"line":66,"column":39}},"3":{"start":{"line":68,"column":8},"end":{"line":68,"column":40}},"4":{"start":{"line":76,"column":8},"end":{"line":76,"column":94}},"5":{"start":{"line":102,"column":8},"end":{"line":102,"column":66}},"6":{"start":{"line":119,"column":8},"end":{"line":119,"column":66}},"7":{"start":{"line":136,"column":8},"end":{"line":136,"column":49}},"8":{"start":{"line":155,"column":8},"end":{"line":155,"column":47}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":40}},"10":{"start":{"line":187,"column":8},"end":{"line":187,"column":46}},"11":{"start":{"line":190,"column":8},"end":{"line":190,"column":5686}},"12":{"start":{"line":197,"column":8},"end":{"line":197,"column":5888}},"13":{"start":{"line":203,"column":8},"end":{"line":203,"column":58}},"14":{"start":{"line":227,"column":8},"end":{"line":227,"column":43}},"15":{"start":{"line":228,"column":8},"end":{"line":228,"column":43}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"2":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol":{"l":{"51":24,"76":2,"98":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol","s":{"1":24,"2":2,"3":1},"b":{},"f":{"1":24,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":49,"loc":{"start":{"line":41,"column":4},"end":{"line":52,"column":4}}},"2":{"name":"_handleInitiateDeposit","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":81,"column":4}}},"3":{"name":"_handleFinalizeWithdrawal","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":99,"column":4}}}},"statementMap":{"1":{"start":{"line":51,"column":8},"end":{"line":51,"column":25}},"2":{"start":{"line":76,"column":8},"end":{"line":76,"column":2273}},"3":{"start":{"line":98,"column":8},"end":{"line":98,"column":37}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol":{"l":{"50":24,"51":24,"62":0,"73":2,"87":1,"103":3,"111":3,"117":3,"140":1,"142":1,"161":1,"162":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol","s":{"1":24,"2":24,"3":2,"4":1,"5":3,"6":3,"7":3,"8":1,"9":1,"10":1,"11":1},"b":{"1":[1,0]},"f":{"1":24,"2":2,"3":1,"4":3,"5":1,"6":1},"fnMap":{"1":{"name":"constructor","line":48,"loc":{"start":{"line":43,"column":4},"end":{"line":52,"column":4}}},"2":{"name":"deposit","line":68,"loc":{"start":{"line":68,"column":4},"end":{"line":74,"column":4}}},"3":{"name":"depositTo","line":80,"loc":{"start":{"line":80,"column":4},"end":{"line":88,"column":4}}},"4":{"name":"_initiateDeposit","line":96,"loc":{"start":{"line":96,"column":4},"end":{"line":118,"column":4}}},"5":{"name":"finalizeWithdrawal","line":138,"loc":{"start":{"line":132,"column":4},"end":{"line":143,"column":4}}},"6":{"name":"_safeTransferETH","line":155,"loc":{"start":{"line":155,"column":4},"end":{"line":163,"column":4}}}},"statementMap":{"1":{"start":{"line":50,"column":8},"end":{"line":50,"column":23}},"2":{"start":{"line":51,"column":8},"end":{"line":51,"column":63}},"3":{"start":{"line":73,"column":8},"end":{"line":73,"column":47}},"4":{"start":{"line":87,"column":8},"end":{"line":87,"column":40}},"5":{"start":{"line":103,"column":8},"end":{"line":103,"column":2878}},"6":{"start":{"line":111,"column":8},"end":{"line":111,"column":3097}},"7":{"start":{"line":117,"column":8},"end":{"line":117,"column":52}},"8":{"start":{"line":140,"column":8},"end":{"line":140,"column":37}},"9":{"start":{"line":142,"column":8},"end":{"line":142,"column":46}},"10":{"start":{"line":161,"column":8},"end":{"line":161,"column":64}},"11":{"start":{"line":162,"column":8},"end":{"line":162,"column":79}}},"branchMap":{"1":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol":{"l":{"54":2,"65":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol","s":{"1":2,"2":1},"b":{},"f":{"1":30,"2":2,"3":1},"fnMap":{"1":{"name":"constructor","line":43,"loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":5}}},"2":{"name":"_handleInitiateWithdrawal","line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":55,"column":4}}},"3":{"name":"_handleFinalizeDeposit","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":66,"column":4}}}},"statementMap":{"1":{"start":{"line":54,"column":8},"end":{"line":54,"column":33}},"2":{"start":{"line":65,"column":8},"end":{"line":65,"column":26}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol":{"l":{"73":222,"74":222,"75":222,"95":559,"112":382,"129":291,"130":291,"145":0,"160":100,"161":100,"176":0,"177":0,"192":0,"193":0,"211":47,"229":0,"245":0,"264":239,"269":238,"274":237,"282":236,"283":236,"287":236,"294":235,"295":235,"296":37600,"299":235,"308":235,"309":235,"314":235,"316":235,"317":235,"322":235,"323":235,"345":1,"397":104,"398":104,"399":104,"400":104,"406":104,"411":103,"416":102,"421":101,"426":100,"428":100,"436":100,"437":100,"442":100,"445":100,"448":100,"451":100,"455":100,"457":100,"458":100,"459":232,"461":232,"463":100,"467":226,"475":221,"478":221,"479":439,"480":439,"484":439,"491":439,"492":439,"493":439,"497":221,"498":179,"503":178,"504":178,"505":178,"509":88,"516":82,"521":81,"527":81,"528":81,"529":81,"530":81,"532":39,"533":39,"539":42,"544":42,"545":42,"551":81,"559":81,"587":2,"588":1,"595":1,"623":232,"624":232,"625":232,"626":232,"627":232,"629":232,"636":232,"659":476,"661":476,"662":476,"663":476,"664":476,"665":476,"673":476,"701":81,"702":81,"710":81,"727":179,"756":267,"757":267,"758":265,"760":265,"761":265,"762":265,"767":265,"790":100,"813":439,"814":419,"817":439,"818":439,"820":439,"821":439,"838":439,"855":1,"856":1,"858":1,"859":1,"860":1,"862":1,"863":1,"880":1,"900":81,"901":81,"903":81,"911":81,"919":81,"920":81,"927":81,"942":100,"943":4,"945":4,"950":2,"957":96,"962":95,"982":178,"988":177,"995":176,"1000":174,"1023":226,"1028":225,"1034":224,"1035":175,"1060":88,"1061":3,"1068":85,"1069":83,"1086":179,"1117":1,"1118":1,"1119":1,"1121":1,"1130":1,"1141":1,"1164":1,"1166":1,"1175":1,"1184":1,"1185":1,"1192":1,"1212":2,"1217":2,"1228":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol","s":{"1":222,"2":222,"3":222,"4":559,"5":382,"6":291,"7":291,"8":0,"9":100,"10":100,"11":0,"12":0,"13":0,"14":0,"15":47,"16":0,"17":0,"18":239,"19":238,"20":237,"21":236,"22":236,"23":236,"24":235,"25":235,"26":235,"27":235,"28":235,"29":235,"30":235,"31":235,"32":235,"33":1,"34":104,"35":104,"36":104,"37":104,"38":103,"39":102,"40":101,"41":100,"42":100,"43":100,"44":100,"45":100,"46":100,"47":100,"48":100,"49":100,"50":100,"51":100,"52":232,"53":232,"54":100,"55":226,"56":221,"57":221,"58":439,"59":439,"60":439,"61":221,"62":179,"63":178,"64":88,"65":82,"66":81,"67":81,"68":81,"69":81,"70":81,"71":39,"72":39,"73":42,"74":42,"75":42,"76":81,"77":81,"78":2,"79":1,"80":1,"81":232,"82":232,"83":232,"84":232,"85":232,"86":232,"87":476,"88":476,"89":476,"90":476,"91":476,"92":476,"93":81,"94":81,"95":179,"96":267,"97":267,"98":265,"99":265,"100":265,"101":265,"102":100,"103":439,"104":419,"105":439,"106":439,"107":439,"108":439,"109":1,"110":1,"111":1,"112":1,"113":1,"114":1,"115":1,"116":81,"117":81,"118":81,"119":81,"120":81,"121":81,"122":81,"123":100,"124":4,"125":4,"126":2,"127":96,"128":95,"129":178,"130":177,"131":176,"132":174,"133":226,"134":225,"135":224,"136":175,"137":88,"138":3,"139":85,"140":83,"141":179,"142":1,"143":1,"144":1,"145":1,"146":1,"147":1,"148":1,"149":1,"150":1,"151":1,"152":1,"153":1,"154":2,"155":2,"156":2},"b":{"1":[238,1],"2":[237,1],"3":[236,1],"4":[235,1],"5":[103,1],"6":[102,1],"7":[101,1],"8":[100,1],"9":[100,0],"10":[100,132],"11":[178,1],"12":[81,1],"13":[81,0],"14":[39,42],"15":[1,1],"16":[419,20],"17":[4,96],"18":[2,2],"19":[0,2],"20":[95,1],"21":[94,1],"22":[176,1],"23":[174,2],"24":[172,2],"25":[225,1],"26":[224,1],"27":[175,49],"28":[3,85],"29":[83,2],"30":[82,1],"31":[1,0],"32":[1,0],"33":[1,0],"34":[1,0],"35":[2,0],"36":[2,0]},"f":{"1":222,"2":559,"3":382,"4":291,"5":0,"6":100,"7":0,"8":0,"9":47,"10":0,"11":0,"12":239,"13":1,"14":104,"15":2,"16":232,"17":476,"18":81,"19":179,"20":267,"21":100,"22":439,"23":1,"24":81,"25":100,"26":178,"27":226,"28":88,"29":179,"30":1,"31":1,"32":2},"fnMap":{"1":{"name":"constructor","line":71,"loc":{"start":{"line":65,"column":4},"end":{"line":76,"column":4}}},"2":{"name":"batches","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":98,"column":4}}},"3":{"name":"queue","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":115,"column":4}}},"4":{"name":"getTotalElements","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":131,"column":4}}},"5":{"name":"getTotalBatches","line":137,"loc":{"start":{"line":137,"column":4},"end":{"line":146,"column":4}}},"6":{"name":"getNextQueueIndex","line":152,"loc":{"start":{"line":152,"column":4},"end":{"line":162,"column":4}}},"7":{"name":"getLastTimestamp","line":168,"loc":{"start":{"line":168,"column":4},"end":{"line":178,"column":4}}},"8":{"name":"getLastBlockNumber","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":194,"column":4}}},"9":{"name":"getQueueElement","line":201,"loc":{"start":{"line":201,"column":4},"end":{"line":215,"column":4}}},"10":{"name":"getNumPendingQueueElements","line":221,"loc":{"start":{"line":221,"column":4},"end":{"line":230,"column":4}}},"11":{"name":"getQueueLength","line":237,"loc":{"start":{"line":237,"column":4},"end":{"line":248,"column":4}}},"12":{"name":"enqueue","line":256,"loc":{"start":{"line":256,"column":4},"end":{"line":331,"column":4}}},"13":{"name":"appendQueueBatch","line":337,"loc":{"start":{"line":337,"column":4},"end":{"line":383,"column":4}}},"14":{"name":"appendSequencerBatch","line":393,"loc":{"start":{"line":393,"column":4},"end":{"line":564,"column":4}}},"15":{"name":"verifyTransaction","line":574,"loc":{"start":{"line":574,"column":4},"end":{"line":602,"column":4}}},"16":{"name":"_getBatchContext","line":614,"loc":{"start":{"line":614,"column":4},"end":{"line":642,"column":4}}},"17":{"name":"_getBatchExtraData","line":649,"loc":{"start":{"line":649,"column":4},"end":{"line":679,"column":4}}},"18":{"name":"_makeBatchExtraData","line":689,"loc":{"start":{"line":689,"column":4},"end":{"line":711,"column":4}}},"19":{"name":"_getQueueLeafHash","line":718,"loc":{"start":{"line":718,"column":4},"end":{"line":736,"column":4}}},"20":{"name":"_getQueueElement","line":743,"loc":{"start":{"line":743,"column":4},"end":{"line":772,"column":4}}},"21":{"name":"_getQueueLength","line":778,"loc":{"start":{"line":778,"column":4},"end":{"line":791,"column":4}}},"22":{"name":"_getSequencerLeafHash","line":800,"loc":{"start":{"line":800,"column":4},"end":{"line":839,"column":4}}},"23":{"name":"_getSequencerLeafHash","line":846,"loc":{"start":{"line":846,"column":4},"end":{"line":881,"column":4}}},"24":{"name":"_appendBatch","line":891,"loc":{"start":{"line":891,"column":4},"end":{"line":928,"column":4}}},"25":{"name":"_validateFirstBatchContext","line":934,"loc":{"start":{"line":934,"column":4},"end":{"line":966,"column":4}}},"26":{"name":"_validateContextBeforeEnqueue","line":974,"loc":{"start":{"line":974,"column":4},"end":{"line":1004,"column":4}}},"27":{"name":"_validateNextBatchContext","line":1013,"loc":{"start":{"line":1013,"column":4},"end":{"line":1041,"column":4}}},"28":{"name":"_validateFinalBatchContext","line":1050,"loc":{"start":{"line":1050,"column":4},"end":{"line":1070,"column":4}}},"29":{"name":"_hashTransactionChainElement","line":1077,"loc":{"start":{"line":1077,"column":4},"end":{"line":1095,"column":4}}},"30":{"name":"_verifySequencerTransaction","line":1105,"loc":{"start":{"line":1105,"column":4},"end":{"line":1142,"column":4}}},"31":{"name":"_verifyQueueTransaction","line":1152,"loc":{"start":{"line":1152,"column":4},"end":{"line":1193,"column":4}}},"32":{"name":"_verifyElement","line":1201,"loc":{"start":{"line":1201,"column":4},"end":{"line":1229,"column":4}}}},"statementMap":{"1":{"start":{"line":73,"column":8},"end":{"line":73,"column":65}},"2":{"start":{"line":74,"column":8},"end":{"line":74,"column":63}},"3":{"start":{"line":75,"column":8},"end":{"line":75,"column":55}},"4":{"start":{"line":95,"column":8},"end":{"line":95,"column":3203}},"5":{"start":{"line":112,"column":8},"end":{"line":112,"column":3582}},"6":{"start":{"line":129,"column":8},"end":{"line":129,"column":56}},"7":{"start":{"line":130,"column":8},"end":{"line":130,"column":37}},"8":{"start":{"line":145,"column":8},"end":{"line":145,"column":33}},"9":{"start":{"line":160,"column":8},"end":{"line":160,"column":57}},"10":{"start":{"line":161,"column":8},"end":{"line":161,"column":29}},"11":{"start":{"line":176,"column":8},"end":{"line":176,"column":56}},"12":{"start":{"line":177,"column":8},"end":{"line":177,"column":28}},"13":{"start":{"line":192,"column":8},"end":{"line":192,"column":58}},"14":{"start":{"line":193,"column":8},"end":{"line":193,"column":30}},"15":{"start":{"line":211,"column":8},"end":{"line":211,"column":5827}},"16":{"start":{"line":229,"column":8},"end":{"line":229,"column":53}},"17":{"start":{"line":245,"column":8},"end":{"line":245,"column":6538}},"18":{"start":{"line":264,"column":8},"end":{"line":264,"column":6982}},"19":{"start":{"line":269,"column":8},"end":{"line":269,"column":7135}},"20":{"start":{"line":274,"column":8},"end":{"line":274,"column":7289}},"21":{"start":{"line":282,"column":8},"end":{"line":282,"column":64}},"22":{"start":{"line":283,"column":8},"end":{"line":283,"column":39}},"23":{"start":{"line":287,"column":8},"end":{"line":287,"column":7932}},"24":{"start":{"line":294,"column":8},"end":{"line":294,"column":17}},"25":{"start":{"line":295,"column":8},"end":{"line":295,"column":8239}},"26":{"start":{"line":299,"column":8},"end":{"line":299,"column":8324}},"27":{"start":{"line":308,"column":8},"end":{"line":308,"column":39}},"28":{"start":{"line":314,"column":8},"end":{"line":314,"column":53}},"29":{"start":{"line":316,"column":8},"end":{"line":316,"column":37}},"30":{"start":{"line":317,"column":8},"end":{"line":317,"column":45}},"31":{"start":{"line":322,"column":8},"end":{"line":322,"column":54}},"32":{"start":{"line":323,"column":8},"end":{"line":323,"column":9103}},"33":{"start":{"line":345,"column":8},"end":{"line":345,"column":56}},"34":{"start":{"line":397,"column":8},"end":{"line":397,"column":35}},"35":{"start":{"line":398,"column":8},"end":{"line":398,"column":36}},"36":{"start":{"line":399,"column":8},"end":{"line":399,"column":26}},"37":{"start":{"line":406,"column":8},"end":{"line":406,"column":12031}},"38":{"start":{"line":411,"column":8},"end":{"line":411,"column":12192}},"39":{"start":{"line":416,"column":8},"end":{"line":416,"column":12333}},"40":{"start":{"line":421,"column":8},"end":{"line":421,"column":12446}},"41":{"start":{"line":426,"column":8},"end":{"line":426,"column":102}},"42":{"start":{"line":428,"column":8},"end":{"line":428,"column":12667}},"43":{"start":{"line":436,"column":8},"end":{"line":436,"column":53}},"44":{"start":{"line":437,"column":8},"end":{"line":437,"column":54}},"45":{"start":{"line":442,"column":8},"end":{"line":442,"column":90}},"46":{"start":{"line":445,"column":8},"end":{"line":445,"column":70}},"47":{"start":{"line":448,"column":8},"end":{"line":448,"column":28}},"48":{"start":{"line":451,"column":8},"end":{"line":451,"column":43}},"49":{"start":{"line":455,"column":8},"end":{"line":455,"column":51}},"50":{"start":{"line":457,"column":8},"end":{"line":457,"column":38}},"51":{"start":{"line":458,"column":8},"end":{"line":458,"column":14097}},"52":{"start":{"line":459,"column":12},"end":{"line":459,"column":65}},"53":{"start":{"line":461,"column":12},"end":{"line":461,"column":14224}},"54":{"start":{"line":463,"column":16},"end":{"line":463,"column":54}},"55":{"start":{"line":467,"column":12},"end":{"line":467,"column":14468}},"56":{"start":{"line":475,"column":12},"end":{"line":475,"column":35}},"57":{"start":{"line":478,"column":12},"end":{"line":478,"column":14783}},"58":{"start":{"line":479,"column":16},"end":{"line":479,"column":36}},"59":{"start":{"line":484,"column":16},"end":{"line":484,"column":15033}},"60":{"start":{"line":491,"column":16},"end":{"line":491,"column":79}},"61":{"start":{"line":497,"column":12},"end":{"line":497,"column":15473}},"62":{"start":{"line":498,"column":16},"end":{"line":498,"column":15566}},"63":{"start":{"line":503,"column":16},"end":{"line":503,"column":68}},"64":{"start":{"line":509,"column":8},"end":{"line":509,"column":15868}},"65":{"start":{"line":516,"column":8},"end":{"line":516,"column":16014}},"66":{"start":{"line":521,"column":8},"end":{"line":521,"column":16155}},"67":{"start":{"line":527,"column":8},"end":{"line":527,"column":87}},"68":{"start":{"line":528,"column":8},"end":{"line":528,"column":29}},"69":{"start":{"line":529,"column":8},"end":{"line":529,"column":26}},"70":{"start":{"line":530,"column":8},"end":{"line":530,"column":16545}},"71":{"start":{"line":532,"column":12},"end":{"line":532,"column":56}},"72":{"start":{"line":533,"column":12},"end":{"line":533,"column":55}},"73":{"start":{"line":539,"column":12},"end":{"line":539,"column":17265}},"74":{"start":{"line":544,"column":12},"end":{"line":544,"column":49}},"75":{"start":{"line":545,"column":12},"end":{"line":545,"column":48}},"76":{"start":{"line":551,"column":8},"end":{"line":551,"column":17737}},"77":{"start":{"line":559,"column":8},"end":{"line":559,"column":17944}},"78":{"start":{"line":587,"column":8},"end":{"line":587,"column":18958}},"79":{"start":{"line":588,"column":12},"end":{"line":588,"column":19018}},"80":{"start":{"line":595,"column":12},"end":{"line":595,"column":19223}},"81":{"start":{"line":623,"column":8},"end":{"line":623,"column":61}},"82":{"start":{"line":624,"column":8},"end":{"line":624,"column":40}},"83":{"start":{"line":625,"column":8},"end":{"line":625,"column":46}},"84":{"start":{"line":626,"column":8},"end":{"line":626,"column":28}},"85":{"start":{"line":627,"column":8},"end":{"line":627,"column":30}},"86":{"start":{"line":636,"column":8},"end":{"line":636,"column":20452}},"87":{"start":{"line":659,"column":8},"end":{"line":659,"column":57}},"88":{"start":{"line":661,"column":8},"end":{"line":661,"column":28}},"89":{"start":{"line":662,"column":8},"end":{"line":662,"column":29}},"90":{"start":{"line":663,"column":8},"end":{"line":663,"column":28}},"91":{"start":{"line":664,"column":8},"end":{"line":664,"column":30}},"92":{"start":{"line":673,"column":8},"end":{"line":673,"column":21814}},"93":{"start":{"line":701,"column":8},"end":{"line":701,"column":25}},"94":{"start":{"line":710,"column":8},"end":{"line":710,"column":24}},"95":{"start":{"line":727,"column":8},"end":{"line":727,"column":23233}},"96":{"start":{"line":756,"column":8},"end":{"line":756,"column":45}},"97":{"start":{"line":757,"column":8},"end":{"line":757,"column":58}},"98":{"start":{"line":758,"column":8},"end":{"line":758,"column":70}},"99":{"start":{"line":760,"column":8},"end":{"line":760,"column":31}},"100":{"start":{"line":761,"column":8},"end":{"line":761,"column":33}},"101":{"start":{"line":767,"column":8},"end":{"line":767,"column":24663}},"102":{"start":{"line":790,"column":8},"end":{"line":790,"column":45}},"103":{"start":{"line":813,"column":8},"end":{"line":813,"column":25984}},"104":{"start":{"line":814,"column":12},"end":{"line":814,"column":70}},"105":{"start":{"line":817,"column":8},"end":{"line":817,"column":49}},"106":{"start":{"line":818,"column":8},"end":{"line":818,"column":53}},"107":{"start":{"line":820,"column":8},"end":{"line":820,"column":24}},"108":{"start":{"line":838,"column":8},"end":{"line":838,"column":23}},"109":{"start":{"line":855,"column":8},"end":{"line":855,"column":52}},"110":{"start":{"line":856,"column":8},"end":{"line":856,"column":60}},"111":{"start":{"line":858,"column":8},"end":{"line":858,"column":80}},"112":{"start":{"line":859,"column":8},"end":{"line":859,"column":56}},"113":{"start":{"line":860,"column":8},"end":{"line":860,"column":60}},"114":{"start":{"line":862,"column":8},"end":{"line":862,"column":24}},"115":{"start":{"line":880,"column":8},"end":{"line":880,"column":23}},"116":{"start":{"line":900,"column":8},"end":{"line":900,"column":57}},"117":{"start":{"line":901,"column":8},"end":{"line":901,"column":78}},"118":{"start":{"line":903,"column":8},"end":{"line":903,"column":29394}},"119":{"start":{"line":911,"column":8},"end":{"line":911,"column":29688}},"120":{"start":{"line":919,"column":8},"end":{"line":919,"column":70}},"121":{"start":{"line":920,"column":8},"end":{"line":920,"column":29969}},"122":{"start":{"line":927,"column":8},"end":{"line":927,"column":59}},"123":{"start":{"line":942,"column":8},"end":{"line":942,"column":30681}},"124":{"start":{"line":943,"column":12},"end":{"line":943,"column":84}},"125":{"start":{"line":945,"column":12},"end":{"line":945,"column":30814}},"126":{"start":{"line":950,"column":12},"end":{"line":950,"column":30982}},"127":{"start":{"line":957,"column":8},"end":{"line":957,"column":31241}},"128":{"start":{"line":962,"column":8},"end":{"line":962,"column":31409}},"129":{"start":{"line":982,"column":12},"end":{"line":982,"column":32133}},"130":{"start":{"line":988,"column":12},"end":{"line":988,"column":32405}},"131":{"start":{"line":995,"column":12},"end":{"line":995,"column":32840}},"132":{"start":{"line":1000,"column":12},"end":{"line":1000,"column":33029}},"133":{"start":{"line":1023,"column":8},"end":{"line":1023,"column":34010}},"134":{"start":{"line":1028,"column":8},"end":{"line":1028,"column":34169}},"135":{"start":{"line":1034,"column":8},"end":{"line":1034,"column":34414}},"136":{"start":{"line":1035,"column":12},"end":{"line":1035,"column":34485}},"137":{"start":{"line":1060,"column":8},"end":{"line":1060,"column":35385}},"138":{"start":{"line":1061,"column":12},"end":{"line":1061,"column":35496}},"139":{"start":{"line":1068,"column":8},"end":{"line":1068,"column":99}},"140":{"start":{"line":1069,"column":8},"end":{"line":1069,"column":101}},"141":{"start":{"line":1086,"column":8},"end":{"line":1086,"column":36314}},"142":{"start":{"line":1117,"column":8},"end":{"line":1117,"column":104}},"143":{"start":{"line":1118,"column":8},"end":{"line":1118,"column":74}},"144":{"start":{"line":1119,"column":8},"end":{"line":1119,"column":65}},"145":{"start":{"line":1121,"column":8},"end":{"line":1121,"column":37737}},"146":{"start":{"line":1130,"column":8},"end":{"line":1130,"column":37958}},"147":{"start":{"line":1141,"column":8},"end":{"line":1141,"column":19}},"148":{"start":{"line":1164,"column":8},"end":{"line":1164,"column":57}},"149":{"start":{"line":1166,"column":8},"end":{"line":1166,"column":39506}},"150":{"start":{"line":1175,"column":8},"end":{"line":1175,"column":39724}},"151":{"start":{"line":1184,"column":8},"end":{"line":1184,"column":74}},"152":{"start":{"line":1185,"column":8},"end":{"line":1185,"column":40049}},"153":{"start":{"line":1192,"column":8},"end":{"line":1192,"column":19}},"154":{"start":{"line":1212,"column":8},"end":{"line":1212,"column":40839}},"155":{"start":{"line":1217,"column":8},"end":{"line":1217,"column":41010}},"156":{"start":{"line":1228,"column":8},"end":{"line":1228,"column":19}}},"branchMap":{"1":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":8},"end":{"line":264,"column":8}},{"start":{"line":264,"column":8},"end":{"line":264,"column":8}}]},"2":{"line":269,"type":"if","locations":[{"start":{"line":269,"column":8},"end":{"line":269,"column":8}},{"start":{"line":269,"column":8},"end":{"line":269,"column":8}}]},"3":{"line":274,"type":"if","locations":[{"start":{"line":274,"column":8},"end":{"line":274,"column":8}},{"start":{"line":274,"column":8},"end":{"line":274,"column":8}}]},"4":{"line":287,"type":"if","locations":[{"start":{"line":287,"column":8},"end":{"line":287,"column":8}},{"start":{"line":287,"column":8},"end":{"line":287,"column":8}}]},"5":{"line":406,"type":"if","locations":[{"start":{"line":406,"column":8},"end":{"line":406,"column":8}},{"start":{"line":406,"column":8},"end":{"line":406,"column":8}}]},"6":{"line":411,"type":"if","locations":[{"start":{"line":411,"column":8},"end":{"line":411,"column":8}},{"start":{"line":411,"column":8},"end":{"line":411,"column":8}}]},"7":{"line":416,"type":"if","locations":[{"start":{"line":416,"column":8},"end":{"line":416,"column":8}},{"start":{"line":416,"column":8},"end":{"line":416,"column":8}}]},"8":{"line":421,"type":"if","locations":[{"start":{"line":421,"column":8},"end":{"line":421,"column":8}},{"start":{"line":421,"column":8},"end":{"line":421,"column":8}}]},"9":{"line":428,"type":"if","locations":[{"start":{"line":428,"column":8},"end":{"line":428,"column":8}},{"start":{"line":428,"column":8},"end":{"line":428,"column":8}}]},"10":{"line":461,"type":"if","locations":[{"start":{"line":461,"column":12},"end":{"line":461,"column":12}},{"start":{"line":461,"column":12},"end":{"line":461,"column":12}}]},"11":{"line":498,"type":"if","locations":[{"start":{"line":498,"column":16},"end":{"line":498,"column":16}},{"start":{"line":498,"column":16},"end":{"line":498,"column":16}}]},"12":{"line":516,"type":"if","locations":[{"start":{"line":516,"column":8},"end":{"line":516,"column":8}},{"start":{"line":516,"column":8},"end":{"line":516,"column":8}}]},"13":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":8},"end":{"line":521,"column":8}},{"start":{"line":521,"column":8},"end":{"line":521,"column":8}}]},"14":{"line":530,"type":"if","locations":[{"start":{"line":530,"column":8},"end":{"line":530,"column":8}},{"start":{"line":530,"column":8},"end":{"line":530,"column":8}}]},"15":{"line":587,"type":"if","locations":[{"start":{"line":587,"column":8},"end":{"line":587,"column":8}},{"start":{"line":587,"column":8},"end":{"line":587,"column":8}}]},"16":{"line":813,"type":"if","locations":[{"start":{"line":813,"column":8},"end":{"line":813,"column":8}},{"start":{"line":813,"column":8},"end":{"line":813,"column":8}}]},"17":{"line":942,"type":"if","locations":[{"start":{"line":942,"column":8},"end":{"line":942,"column":8}},{"start":{"line":942,"column":8},"end":{"line":942,"column":8}}]},"18":{"line":945,"type":"if","locations":[{"start":{"line":945,"column":12},"end":{"line":945,"column":12}},{"start":{"line":945,"column":12},"end":{"line":945,"column":12}}]},"19":{"line":950,"type":"if","locations":[{"start":{"line":950,"column":12},"end":{"line":950,"column":12}},{"start":{"line":950,"column":12},"end":{"line":950,"column":12}}]},"20":{"line":957,"type":"if","locations":[{"start":{"line":957,"column":8},"end":{"line":957,"column":8}},{"start":{"line":957,"column":8},"end":{"line":957,"column":8}}]},"21":{"line":962,"type":"if","locations":[{"start":{"line":962,"column":8},"end":{"line":962,"column":8}},{"start":{"line":962,"column":8},"end":{"line":962,"column":8}}]},"22":{"line":988,"type":"if","locations":[{"start":{"line":988,"column":12},"end":{"line":988,"column":12}},{"start":{"line":988,"column":12},"end":{"line":988,"column":12}}]},"23":{"line":995,"type":"if","locations":[{"start":{"line":995,"column":12},"end":{"line":995,"column":12}},{"start":{"line":995,"column":12},"end":{"line":995,"column":12}}]},"24":{"line":1000,"type":"if","locations":[{"start":{"line":1000,"column":12},"end":{"line":1000,"column":12}},{"start":{"line":1000,"column":12},"end":{"line":1000,"column":12}}]},"25":{"line":1023,"type":"if","locations":[{"start":{"line":1023,"column":8},"end":{"line":1023,"column":8}},{"start":{"line":1023,"column":8},"end":{"line":1023,"column":8}}]},"26":{"line":1028,"type":"if","locations":[{"start":{"line":1028,"column":8},"end":{"line":1028,"column":8}},{"start":{"line":1028,"column":8},"end":{"line":1028,"column":8}}]},"27":{"line":1034,"type":"if","locations":[{"start":{"line":1034,"column":8},"end":{"line":1034,"column":8}},{"start":{"line":1034,"column":8},"end":{"line":1034,"column":8}}]},"28":{"line":1060,"type":"if","locations":[{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}},{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}}]},"29":{"line":1068,"type":"if","locations":[{"start":{"line":1068,"column":8},"end":{"line":1068,"column":8}},{"start":{"line":1068,"column":8},"end":{"line":1068,"column":8}}]},"30":{"line":1069,"type":"if","locations":[{"start":{"line":1069,"column":8},"end":{"line":1069,"column":8}},{"start":{"line":1069,"column":8},"end":{"line":1069,"column":8}}]},"31":{"line":1121,"type":"if","locations":[{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}},{"start":{"line":1121,"column":8},"end":{"line":1121,"column":8}}]},"32":{"line":1130,"type":"if","locations":[{"start":{"line":1130,"column":8},"end":{"line":1130,"column":8}},{"start":{"line":1130,"column":8},"end":{"line":1130,"column":8}}]},"33":{"line":1166,"type":"if","locations":[{"start":{"line":1166,"column":8},"end":{"line":1166,"column":8}},{"start":{"line":1166,"column":8},"end":{"line":1166,"column":8}}]},"34":{"line":1185,"type":"if","locations":[{"start":{"line":1185,"column":8},"end":{"line":1185,"column":8}},{"start":{"line":1185,"column":8},"end":{"line":1185,"column":8}}]},"35":{"line":1212,"type":"if","locations":[{"start":{"line":1212,"column":8},"end":{"line":1212,"column":8}},{"start":{"line":1212,"column":8},"end":{"line":1212,"column":8}}]},"36":{"line":1217,"type":"if","locations":[{"start":{"line":1217,"column":8},"end":{"line":1217,"column":8}},{"start":{"line":1217,"column":8},"end":{"line":1217,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol":{"l":{"56":504,"65":573,"69":573,"87":0,"101":550,"115":441,"128":470,"142":102,"158":538,"171":0,"187":1,"203":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol","s":{"1":504,"2":573,"3":0,"4":550,"5":441,"6":470,"7":102,"8":538,"9":0,"10":1,"11":0},"b":{"1":[573,0]},"f":{"1":504,"2":573,"3":0,"4":550,"5":441,"6":470,"7":102,"8":538,"9":0,"10":1,"11":0},"fnMap":{"1":{"name":"constructor","line":54,"loc":{"start":{"line":50,"column":4},"end":{"line":57,"column":4}}},"2":{"name":"onlyOwner","line":64,"loc":{"start":{"line":64,"column":4},"end":{"line":70,"column":4}}},"3":{"name":"setGlobalMetadata","line":85,"loc":{"start":{"line":80,"column":4},"end":{"line":88,"column":4}}},"4":{"name":"getGlobalMetadata","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":102,"column":4}}},"5":{"name":"length","line":107,"loc":{"start":{"line":107,"column":4},"end":{"line":116,"column":4}}},"6":{"name":"push","line":126,"loc":{"start":{"line":121,"column":4},"end":{"line":129,"column":4}}},"7":{"name":"push","line":140,"loc":{"start":{"line":134,"column":4},"end":{"line":143,"column":4}}},"8":{"name":"get","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":159,"column":4}}},"9":{"name":"deleteElementsAfterInclusive","line":169,"loc":{"start":{"line":164,"column":4},"end":{"line":174,"column":4}}},"10":{"name":"deleteElementsAfterInclusive","line":185,"loc":{"start":{"line":179,"column":4},"end":{"line":191,"column":4}}},"11":{"name":"setNextOverwritableIndex","line":201,"loc":{"start":{"line":196,"column":4},"end":{"line":204,"column":4}}}},"statementMap":{"1":{"start":{"line":56,"column":8},"end":{"line":56,"column":21}},"2":{"start":{"line":65,"column":8},"end":{"line":65,"column":1959}},"3":{"start":{"line":87,"column":8},"end":{"line":87,"column":51}},"4":{"start":{"line":101,"column":8},"end":{"line":101,"column":36}},"5":{"start":{"line":115,"column":8},"end":{"line":115,"column":42}},"6":{"start":{"line":128,"column":8},"end":{"line":128,"column":27}},"7":{"start":{"line":142,"column":8},"end":{"line":142,"column":44}},"8":{"start":{"line":158,"column":8},"end":{"line":158,"column":41}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":3842}},"10":{"start":{"line":187,"column":8},"end":{"line":187,"column":4155}},"11":{"start":{"line":203,"column":8},"end":{"line":203,"column":44}}},"branchMap":{"1":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol":{"l":{"54":60,"55":60,"74":125,"90":52,"91":52,"105":24,"119":0,"120":0,"135":25,"141":24,"146":24,"151":23,"158":22,"173":4,"178":3,"183":1,"188":1,"206":0,"211":0,"222":0,"238":1,"243":1,"247":1,"268":74,"270":74,"271":74,"272":74,"278":74,"300":22,"301":22,"307":22,"321":22,"322":22,"324":22,"325":20,"331":2,"340":21,"348":21,"356":21,"374":1,"379":1,"384":1,"392":1,"412":4},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol","s":{"1":60,"2":60,"3":125,"4":52,"5":52,"6":24,"7":0,"8":0,"9":25,"10":24,"11":24,"12":23,"13":22,"14":4,"15":3,"16":1,"17":1,"18":0,"19":0,"20":0,"21":1,"22":1,"23":1,"24":74,"25":74,"26":74,"27":74,"28":22,"29":22,"30":22,"31":22,"32":22,"33":20,"34":2,"35":21,"36":21,"37":21,"38":1,"39":1,"40":1,"41":1,"42":4},"b":{"1":[24,1],"2":[24,0],"3":[23,1],"4":[22,1],"5":[3,1],"6":[1,2],"7":[1,0],"8":[0,0],"9":[0,0],"10":[1,0],"11":[20,2],"12":[1,1],"13":[1,0],"14":[1,0]},"f":{"1":60,"2":125,"3":52,"4":24,"5":0,"6":25,"7":4,"8":0,"9":1,"10":74,"11":22,"12":22,"13":1,"14":4},"fnMap":{"1":{"name":"constructor","line":52,"loc":{"start":{"line":47,"column":4},"end":{"line":56,"column":4}}},"2":{"name":"batches","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":77,"column":4}}},"3":{"name":"getTotalElements","line":82,"loc":{"start":{"line":82,"column":4},"end":{"line":92,"column":4}}},"4":{"name":"getTotalBatches","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":106,"column":4}}},"5":{"name":"getLastSequencerTimestamp","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":121,"column":4}}},"6":{"name":"appendStateBatch","line":126,"loc":{"start":{"line":126,"column":4},"end":{"line":162,"column":4}}},"7":{"name":"deleteStateBatch","line":167,"loc":{"start":{"line":167,"column":4},"end":{"line":189,"column":4}}},"8":{"name":"verifyStateCommitment","line":194,"loc":{"start":{"line":194,"column":4},"end":{"line":223,"column":4}}},"9":{"name":"insideFraudProofWindow","line":228,"loc":{"start":{"line":228,"column":4},"end":{"line":248,"column":4}}},"10":{"name":"_getBatchExtraData","line":260,"loc":{"start":{"line":260,"column":4},"end":{"line":282,"column":4}}},"11":{"name":"_makeBatchExtraData","line":290,"loc":{"start":{"line":290,"column":4},"end":{"line":308,"column":4}}},"12":{"name":"_appendBatch","line":315,"loc":{"start":{"line":315,"column":4},"end":{"line":363,"column":4}}},"13":{"name":"_deleteBatch","line":369,"loc":{"start":{"line":369,"column":4},"end":{"line":396,"column":4}}},"14":{"name":"_isValidBatchHeader","line":403,"loc":{"start":{"line":403,"column":4},"end":{"line":413,"column":4}}}},"statementMap":{"1":{"start":{"line":54,"column":8},"end":{"line":54,"column":45}},"2":{"start":{"line":55,"column":8},"end":{"line":55,"column":57}},"3":{"start":{"line":74,"column":8},"end":{"line":74,"column":2401}},"4":{"start":{"line":90,"column":8},"end":{"line":90,"column":55}},"5":{"start":{"line":91,"column":8},"end":{"line":91,"column":37}},"6":{"start":{"line":105,"column":8},"end":{"line":105,"column":33}},"7":{"start":{"line":119,"column":8},"end":{"line":119,"column":64}},"8":{"start":{"line":120,"column":8},"end":{"line":120,"column":46}},"9":{"start":{"line":135,"column":8},"end":{"line":135,"column":3782}},"10":{"start":{"line":141,"column":8},"end":{"line":141,"column":4012}},"11":{"start":{"line":146,"column":8},"end":{"line":146,"column":4190}},"12":{"start":{"line":151,"column":8},"end":{"line":151,"column":4300}},"13":{"start":{"line":158,"column":8},"end":{"line":158,"column":4670}},"14":{"start":{"line":173,"column":8},"end":{"line":173,"column":4976}},"15":{"start":{"line":178,"column":8},"end":{"line":178,"column":5135}},"16":{"start":{"line":183,"column":8},"end":{"line":183,"column":5247}},"17":{"start":{"line":188,"column":8},"end":{"line":188,"column":33}},"18":{"start":{"line":206,"column":8},"end":{"line":206,"column":5787}},"19":{"start":{"line":211,"column":8},"end":{"line":211,"column":5899}},"20":{"start":{"line":222,"column":8},"end":{"line":222,"column":19}},"21":{"start":{"line":238,"column":8},"end":{"line":238,"column":6480}},"22":{"start":{"line":243,"column":8},"end":{"line":243,"column":6601}},"23":{"start":{"line":247,"column":8},"end":{"line":247,"column":76}},"24":{"start":{"line":268,"column":8},"end":{"line":268,"column":57}},"25":{"start":{"line":270,"column":8},"end":{"line":270,"column":28}},"26":{"start":{"line":271,"column":8},"end":{"line":271,"column":37}},"27":{"start":{"line":278,"column":8},"end":{"line":278,"column":7685}},"28":{"start":{"line":300,"column":8},"end":{"line":300,"column":25}},"29":{"start":{"line":307,"column":8},"end":{"line":307,"column":24}},"30":{"start":{"line":321,"column":8},"end":{"line":321,"column":51}},"31":{"start":{"line":322,"column":8},"end":{"line":322,"column":84}},"32":{"start":{"line":324,"column":8},"end":{"line":324,"column":8914}},"33":{"start":{"line":325,"column":12},"end":{"line":325,"column":59}},"34":{"start":{"line":331,"column":12},"end":{"line":331,"column":9429}},"35":{"start":{"line":340,"column":8},"end":{"line":340,"column":9854}},"36":{"start":{"line":348,"column":8},"end":{"line":348,"column":10179}},"37":{"start":{"line":356,"column":8},"end":{"line":356,"column":10406}},"38":{"start":{"line":374,"column":8},"end":{"line":374,"column":10922}},"39":{"start":{"line":379,"column":8},"end":{"line":379,"column":11044}},"40":{"start":{"line":384,"column":8},"end":{"line":384,"column":11156}},"41":{"start":{"line":392,"column":8},"end":{"line":392,"column":11375}},"42":{"start":{"line":412,"column":8},"end":{"line":412,"column":99}}},"branchMap":{"1":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]},"2":{"line":141,"type":"if","locations":[{"start":{"line":141,"column":8},"end":{"line":141,"column":8}},{"start":{"line":141,"column":8},"end":{"line":141,"column":8}}]},"3":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"4":{"line":151,"type":"if","locations":[{"start":{"line":151,"column":8},"end":{"line":151,"column":8}},{"start":{"line":151,"column":8},"end":{"line":151,"column":8}}]},"5":{"line":173,"type":"if","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":8}},{"start":{"line":173,"column":8},"end":{"line":173,"column":8}}]},"6":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":8},"end":{"line":178,"column":8}},{"start":{"line":178,"column":8},"end":{"line":178,"column":8}}]},"7":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":8},"end":{"line":183,"column":8}},{"start":{"line":183,"column":8},"end":{"line":183,"column":8}}]},"8":{"line":206,"type":"if","locations":[{"start":{"line":206,"column":8},"end":{"line":206,"column":8}},{"start":{"line":206,"column":8},"end":{"line":206,"column":8}}]},"9":{"line":211,"type":"if","locations":[{"start":{"line":211,"column":8},"end":{"line":211,"column":8}},{"start":{"line":211,"column":8},"end":{"line":211,"column":8}}]},"10":{"line":243,"type":"if","locations":[{"start":{"line":243,"column":8},"end":{"line":243,"column":8}},{"start":{"line":243,"column":8},"end":{"line":243,"column":8}}]},"11":{"line":324,"type":"if","locations":[{"start":{"line":324,"column":8},"end":{"line":324,"column":8}},{"start":{"line":324,"column":8},"end":{"line":324,"column":8}}]},"12":{"line":331,"type":"if","locations":[{"start":{"line":331,"column":12},"end":{"line":331,"column":12}},{"start":{"line":331,"column":12},"end":{"line":331,"column":12}}]},"13":{"line":374,"type":"if","locations":[{"start":{"line":374,"column":8},"end":{"line":374,"column":8}},{"start":{"line":374,"column":8},"end":{"line":374,"column":8}}]},"14":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol":{"l":{"85":27,"86":27,"87":27,"88":27,"104":55,"105":55,"106":55,"109":55,"110":46,"122":201,"123":201,"124":192,"127":192,"128":165,"131":27,"139":42,"140":4,"142":38,"162":0,"165":0,"170":0,"178":0,"186":0,"187":0,"188":0,"196":0,"208":0,"211":0,"231":4,"246":150,"261":1,"276":1,"291":1,"306":1,"325":1,"340":1,"357":6,"384":28,"388":28,"391":27,"396":27,"423":1,"427":1,"430":0,"436":0,"458":3,"472":1,"501":1,"510":1,"511":0,"515":1,"516":0,"520":1,"523":1,"524":1,"528":1,"531":1,"534":1,"540":1,"570":154,"571":154,"572":154,"574":154,"604":8,"605":8,"606":8,"607":8,"609":8,"639":10,"641":10,"670":48,"672":48,"693":7,"695":7,"730":2,"732":2,"753":3,"772":2,"789":0,"807":29,"812":29,"814":29,"815":2,"841":27,"845":27,"846":27,"847":27,"851":27,"860":24,"889":172,"894":1,"898":171,"903":169,"938":196,"939":196,"945":196,"946":196,"947":196,"955":196,"961":196,"965":196,"969":196,"970":23,"980":23,"981":5,"987":18,"993":14,"998":18,"1002":10,"1004":8,"1012":18,"1016":191,"1018":191,"1047":27,"1050":0,"1060":27,"1061":0,"1071":27,"1074":27,"1076":27,"1079":10,"1080":10,"1081":10,"1082":10,"1090":10,"1095":17,"1096":17,"1097":1,"1108":16,"1115":16,"1135":0,"1136":0,"1152":28,"1153":28,"1167":29,"1168":29,"1184":57,"1185":57,"1201":369,"1202":367,"1217":28,"1218":28,"1236":17,"1237":17,"1259":55,"1260":55,"1281":7,"1282":0,"1285":7,"1286":7,"1300":535,"1301":0,"1305":535,"1306":2,"1311":533,"1317":533,"1318":144,"1336":53,"1340":53,"1346":53,"1347":47,"1348":47,"1372":62,"1373":0,"1379":62,"1380":0,"1385":62,"1391":62,"1392":46,"1410":7,"1414":7,"1420":7,"1423":7,"1425":7,"1426":7,"1452":20,"1455":0,"1459":20,"1460":7,"1469":13,"1498":23,"1499":3,"1508":20,"1523":19,"1528":19,"1542":13,"1567":196,"1581":244,"1582":0,"1585":244,"1602":0,"1608":0,"1613":0,"1620":0,"1646":0,"1647":0,"1651":0,"1652":0,"1656":0,"1687":0,"1688":0,"1689":0,"1691":0,"1694":0,"1718":0,"1735":0,"1759":392,"1760":202,"1764":392,"1765":308,"1769":392,"1770":16,"1783":0,"1784":0,"1785":0,"1786":0,"1787":0,"1788":0,"1790":0,"1799":27,"1800":27,"1801":27,"1802":27,"1803":27,"1804":27,"1806":27,"1808":27,"1809":27,"1810":27,"1812":27,"1837":0,"1839":0,"1840":0,"1841":0,"1843":0,"1845":0,"1846":0,"1847":0,"1848":0,"1849":0,"1853":0,"1856":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol","s":{"1":27,"2":27,"3":27,"4":27,"5":55,"6":55,"7":55,"8":46,"9":201,"10":192,"11":192,"12":165,"13":27,"14":42,"15":4,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":4,"27":150,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":6,"35":28,"36":28,"37":27,"38":27,"39":1,"40":1,"41":0,"42":0,"43":3,"44":1,"45":1,"46":1,"47":0,"48":1,"49":0,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":154,"58":154,"59":154,"60":154,"61":8,"62":8,"63":8,"64":8,"65":8,"66":10,"67":10,"68":48,"69":48,"70":7,"71":7,"72":2,"73":2,"74":3,"75":2,"76":0,"77":29,"78":29,"79":29,"80":2,"81":27,"82":27,"83":27,"84":27,"85":27,"86":24,"87":172,"88":1,"89":171,"90":169,"91":196,"92":196,"93":196,"94":196,"95":196,"96":196,"97":196,"98":196,"99":196,"100":23,"101":23,"102":5,"103":18,"104":14,"105":18,"106":10,"107":8,"108":18,"109":191,"110":191,"111":27,"112":0,"113":27,"114":0,"115":27,"116":27,"117":27,"118":10,"119":10,"120":10,"121":17,"122":17,"123":1,"124":16,"125":16,"126":0,"127":0,"128":28,"129":28,"130":29,"131":29,"132":57,"133":57,"134":369,"135":367,"136":28,"137":28,"138":17,"139":17,"140":55,"141":55,"142":7,"143":0,"144":7,"145":7,"146":535,"147":0,"148":535,"149":2,"150":533,"151":533,"152":144,"153":53,"154":53,"155":53,"156":47,"157":47,"158":62,"159":0,"160":62,"161":0,"162":62,"163":62,"164":46,"165":7,"166":7,"167":7,"168":7,"169":7,"170":7,"171":20,"172":0,"173":20,"174":7,"175":13,"176":23,"177":3,"178":20,"179":19,"180":13,"181":196,"182":244,"183":0,"184":244,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":392,"202":202,"203":392,"204":308,"205":392,"206":16,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":27,"215":27,"216":27,"217":27,"218":27,"219":27,"220":27,"221":27,"222":27,"223":27,"224":27,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0},"b":{"1":[46,9],"2":[165,27],"3":[4,38],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,1],"8":[0,1],"9":[2,27],"10":[1,171],"11":[23,173],"12":[5,18],"13":[14,4],"14":[10,8],"15":[0,27],"16":[0,27],"17":[10,17],"18":[1,16],"19":[0,7],"20":[0,535],"21":[2,533],"22":[144,389],"23":[47,6],"24":[0,62],"25":[0,62],"26":[46,16],"27":[7,0],"28":[0,20],"29":[7,13],"30":[3,20],"31":[0,244],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[202,190],"37":[308,84],"38":[16,376],"39":[0,0],"40":[0,0],"41":[0,0]},"f":{"1":27,"2":55,"3":201,"4":42,"5":0,"6":4,"7":150,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":6,"15":28,"16":1,"17":3,"18":1,"19":1,"20":154,"21":8,"22":10,"23":48,"24":7,"25":2,"26":3,"27":2,"28":0,"29":29,"30":27,"31":172,"32":196,"33":27,"34":0,"35":28,"36":29,"37":57,"38":369,"39":28,"40":17,"41":55,"42":7,"43":535,"44":53,"45":62,"46":7,"47":20,"48":23,"49":19,"50":13,"51":196,"52":244,"53":0,"54":0,"55":0,"56":0,"57":0,"58":392,"59":0,"60":27,"61":0},"fnMap":{"1":{"name":"constructor","line":83,"loc":{"start":{"line":78,"column":4},"end":{"line":89,"column":4}}},"2":{"name":"netGasCost","line":101,"loc":{"start":{"line":101,"column":4},"end":{"line":112,"column":4}}},"3":{"name":"fixedGasDiscount","line":119,"loc":{"start":{"line":119,"column":4},"end":{"line":133,"column":4}}},"4":{"name":"notStatic","line":138,"loc":{"start":{"line":138,"column":4},"end":{"line":143,"column":4}}},"5":{"name":"run","line":155,"loc":{"start":{"line":155,"column":4},"end":{"line":212,"column":4}}},"6":{"name":"ovmCALLER","line":223,"loc":{"start":{"line":223,"column":4},"end":{"line":232,"column":4}}},"7":{"name":"ovmADDRESS","line":238,"loc":{"start":{"line":238,"column":4},"end":{"line":247,"column":4}}},"8":{"name":"ovmTIMESTAMP","line":253,"loc":{"start":{"line":253,"column":4},"end":{"line":262,"column":4}}},"9":{"name":"ovmNUMBER","line":268,"loc":{"start":{"line":268,"column":4},"end":{"line":277,"column":4}}},"10":{"name":"ovmGASLIMIT","line":283,"loc":{"start":{"line":283,"column":4},"end":{"line":292,"column":4}}},"11":{"name":"ovmCHAINID","line":298,"loc":{"start":{"line":298,"column":4},"end":{"line":307,"column":4}}},"12":{"name":"ovmL1QUEUEORIGIN","line":317,"loc":{"start":{"line":317,"column":4},"end":{"line":326,"column":4}}},"13":{"name":"ovmL1TXORIGIN","line":332,"loc":{"start":{"line":332,"column":4},"end":{"line":341,"column":4}}},"14":{"name":"ovmREVERT","line":351,"loc":{"start":{"line":351,"column":4},"end":{"line":358,"column":4}}},"15":{"name":"ovmCREATE","line":377,"loc":{"start":{"line":371,"column":4},"end":{"line":400,"column":4}}},"16":{"name":"ovmCREATE2","line":416,"loc":{"start":{"line":409,"column":4},"end":{"line":440,"column":4}}},"17":{"name":"ovmGETNONCE","line":451,"loc":{"start":{"line":451,"column":4},"end":{"line":459,"column":4}}},"18":{"name":"ovmSETNONCE","line":470,"loc":{"start":{"line":465,"column":4},"end":{"line":473,"column":4}}},"19":{"name":"ovmCREATEEOA","line":494,"loc":{"start":{"line":486,"column":4},"end":{"line":541,"column":4}}},"20":{"name":"ovmCALL","line":563,"loc":{"start":{"line":556,"column":4},"end":{"line":580,"column":4}}},"21":{"name":"ovmSTATICCALL","line":597,"loc":{"start":{"line":590,"column":4},"end":{"line":615,"column":4}}},"22":{"name":"ovmDELEGATECALL","line":632,"loc":{"start":{"line":625,"column":4},"end":{"line":647,"column":4}}},"23":{"name":"ovmSLOAD","line":664,"loc":{"start":{"line":659,"column":4},"end":{"line":676,"column":4}}},"24":{"name":"ovmSSTORE","line":690,"loc":{"start":{"line":683,"column":4},"end":{"line":700,"column":4}}},"25":{"name":"ovmEXTCODECOPY","line":714,"loc":{"start":{"line":714,"column":4},"end":{"line":737,"column":4}}},"26":{"name":"ovmEXTCODESIZE","line":744,"loc":{"start":{"line":744,"column":4},"end":{"line":756,"column":4}}},"27":{"name":"ovmEXTCODEHASH","line":763,"loc":{"start":{"line":763,"column":4},"end":{"line":775,"column":4}}},"28":{"name":"getMaxTransactionGasLimit","line":781,"loc":{"start":{"line":781,"column":4},"end":{"line":790,"column":4}}},"29":{"name":"_checkDeployerAllowed","line":800,"loc":{"start":{"line":800,"column":4},"end":{"line":817,"column":4}}},"30":{"name":"_createContract","line":830,"loc":{"start":{"line":830,"column":4},"end":{"line":864,"column":4}}},"31":{"name":"_callContract","line":875,"loc":{"start":{"line":875,"column":4},"end":{"line":910,"column":4}}},"32":{"name":"_handleExternalMessage","line":924,"loc":{"start":{"line":924,"column":4},"end":{"line":1022,"column":4}}},"33":{"name":"_handleContractCreation","line":1035,"loc":{"start":{"line":1035,"column":4},"end":{"line":1116,"column":4}}},"34":{"name":"_hasAccount","line":1127,"loc":{"start":{"line":1127,"column":4},"end":{"line":1137,"column":4}}},"35":{"name":"_hasEmptyAccount","line":1144,"loc":{"start":{"line":1144,"column":4},"end":{"line":1154,"column":4}}},"36":{"name":"_setAccountNonce","line":1161,"loc":{"start":{"line":1161,"column":4},"end":{"line":1169,"column":4}}},"37":{"name":"_getAccountNonce","line":1176,"loc":{"start":{"line":1176,"column":4},"end":{"line":1186,"column":4}}},"38":{"name":"_getAccountEthAddress","line":1193,"loc":{"start":{"line":1193,"column":4},"end":{"line":1203,"column":4}}},"39":{"name":"_initPendingAccount","line":1209,"loc":{"start":{"line":1209,"column":4},"end":{"line":1219,"column":4}}},"40":{"name":"_commitPendingAccount","line":1229,"loc":{"start":{"line":1229,"column":4},"end":{"line":1242,"column":4}}},"41":{"name":"_getContractStorage","line":1250,"loc":{"start":{"line":1250,"column":4},"end":{"line":1261,"column":4}}},"42":{"name":"_putContractStorage","line":1269,"loc":{"start":{"line":1269,"column":4},"end":{"line":1287,"column":4}}},"43":{"name":"_checkAccountLoad","line":1294,"loc":{"start":{"line":1294,"column":4},"end":{"line":1322,"column":4}}},"44":{"name":"_checkAccountChange","line":1329,"loc":{"start":{"line":1329,"column":4},"end":{"line":1352,"column":4}}},"45":{"name":"_checkContractStorageLoad","line":1360,"loc":{"start":{"line":1360,"column":4},"end":{"line":1394,"column":4}}},"46":{"name":"_checkContractStorageChange","line":1402,"loc":{"start":{"line":1402,"column":4},"end":{"line":1428,"column":4}}},"47":{"name":"_encodeRevertData","line":1441,"loc":{"start":{"line":1441,"column":4},"end":{"line":1475,"column":4}}},"48":{"name":"_decodeRevertData","line":1485,"loc":{"start":{"line":1485,"column":4},"end":{"line":1509,"column":4}}},"49":{"name":"_revertWithFlag","line":1516,"loc":{"start":{"line":1516,"column":4},"end":{"line":1531,"column":4}}},"50":{"name":"_revertWithFlag","line":1537,"loc":{"start":{"line":1537,"column":4},"end":{"line":1543,"column":4}}},"51":{"name":"_getNuisanceGasLimit","line":1558,"loc":{"start":{"line":1558,"column":4},"end":{"line":1568,"column":4}}},"52":{"name":"_useNuisanceGas","line":1574,"loc":{"start":{"line":1574,"column":4},"end":{"line":1586,"column":4}}},"53":{"name":"_checkNeedsNewEpoch","line":1597,"loc":{"start":{"line":1597,"column":4},"end":{"line":1627,"column":4}}},"54":{"name":"_isValidGasLimit","line":1635,"loc":{"start":{"line":1635,"column":4},"end":{"line":1674,"column":4}}},"55":{"name":"_updateCumulativeGas","line":1681,"loc":{"start":{"line":1681,"column":4},"end":{"line":1703,"column":4}}},"56":{"name":"_getGasMetadata","line":1710,"loc":{"start":{"line":1710,"column":4},"end":{"line":1722,"column":4}}},"57":{"name":"_putGasMetadata","line":1729,"loc":{"start":{"line":1729,"column":4},"end":{"line":1740,"column":4}}},"58":{"name":"_switchMessageContext","line":1752,"loc":{"start":{"line":1752,"column":4},"end":{"line":1772,"column":4}}},"59":{"name":"_initContext","line":1778,"loc":{"start":{"line":1778,"column":4},"end":{"line":1791,"column":4}}},"60":{"name":"_resetContext","line":1796,"loc":{"start":{"line":1796,"column":4},"end":{"line":1813,"column":4}}},"61":{"name":"simulateMessage","line":1825,"loc":{"start":{"line":1825,"column":4},"end":{"line":1862,"column":4}}}},"statementMap":{"1":{"start":{"line":85,"column":8},"end":{"line":85,"column":74}},"2":{"start":{"line":86,"column":8},"end":{"line":86,"column":39}},"3":{"start":{"line":87,"column":8},"end":{"line":87,"column":37}},"4":{"start":{"line":88,"column":8},"end":{"line":88,"column":22}},"5":{"start":{"line":104,"column":8},"end":{"line":104,"column":39}},"6":{"start":{"line":106,"column":8},"end":{"line":106,"column":49}},"7":{"start":{"line":109,"column":8},"end":{"line":109,"column":3969}},"8":{"start":{"line":110,"column":12},"end":{"line":110,"column":60}},"9":{"start":{"line":122,"column":8},"end":{"line":122,"column":39}},"10":{"start":{"line":124,"column":8},"end":{"line":124,"column":49}},"11":{"start":{"line":127,"column":8},"end":{"line":127,"column":4602}},"12":{"start":{"line":128,"column":12},"end":{"line":128,"column":54}},"13":{"start":{"line":131,"column":12},"end":{"line":131,"column":52}},"14":{"start":{"line":139,"column":8},"end":{"line":139,"column":4939}},"15":{"start":{"line":140,"column":12},"end":{"line":140,"column":55}},"16":{"start":{"line":162,"column":8},"end":{"line":162,"column":99}},"17":{"start":{"line":165,"column":8},"end":{"line":165,"column":60}},"18":{"start":{"line":170,"column":8},"end":{"line":170,"column":6129}},"19":{"start":{"line":178,"column":8},"end":{"line":178,"column":33}},"20":{"start":{"line":186,"column":8},"end":{"line":186,"column":6951}},"21":{"start":{"line":187,"column":12},"end":{"line":187,"column":26}},"22":{"start":{"line":188,"column":12},"end":{"line":188,"column":18}},"23":{"start":{"line":196,"column":8},"end":{"line":196,"column":7365}},"24":{"start":{"line":208,"column":8},"end":{"line":208,"column":22}},"25":{"start":{"line":211,"column":8},"end":{"line":211,"column":54}},"26":{"start":{"line":231,"column":8},"end":{"line":231,"column":39}},"27":{"start":{"line":246,"column":8},"end":{"line":246,"column":40}},"28":{"start":{"line":261,"column":8},"end":{"line":261,"column":46}},"29":{"start":{"line":276,"column":8},"end":{"line":276,"column":43}},"30":{"start":{"line":291,"column":8},"end":{"line":291,"column":45}},"31":{"start":{"line":306,"column":8},"end":{"line":306,"column":39}},"32":{"start":{"line":325,"column":8},"end":{"line":325,"column":50}},"33":{"start":{"line":340,"column":8},"end":{"line":340,"column":47}},"34":{"start":{"line":357,"column":8},"end":{"line":357,"column":60}},"35":{"start":{"line":384,"column":8},"end":{"line":384,"column":38}},"36":{"start":{"line":388,"column":8},"end":{"line":388,"column":37}},"37":{"start":{"line":391,"column":8},"end":{"line":391,"column":12120}},"38":{"start":{"line":396,"column":8},"end":{"line":396,"column":12259}},"39":{"start":{"line":423,"column":8},"end":{"line":423,"column":38}},"40":{"start":{"line":427,"column":8},"end":{"line":427,"column":37}},"41":{"start":{"line":430,"column":8},"end":{"line":430,"column":13215}},"42":{"start":{"line":436,"column":8},"end":{"line":436,"column":13358}},"43":{"start":{"line":458,"column":8},"end":{"line":458,"column":45}},"44":{"start":{"line":472,"column":8},"end":{"line":472,"column":45}},"45":{"start":{"line":501,"column":8},"end":{"line":501,"column":15412}},"46":{"start":{"line":510,"column":8},"end":{"line":510,"column":15716}},"47":{"start":{"line":511,"column":12},"end":{"line":511,"column":87}},"48":{"start":{"line":515,"column":8},"end":{"line":515,"column":15949}},"49":{"start":{"line":516,"column":12},"end":{"line":516,"column":18}},"50":{"start":{"line":520,"column":8},"end":{"line":520,"column":31}},"51":{"start":{"line":523,"column":8},"end":{"line":523,"column":55}},"52":{"start":{"line":524,"column":8},"end":{"line":524,"column":38}},"53":{"start":{"line":528,"column":8},"end":{"line":528,"column":92}},"54":{"start":{"line":531,"column":8},"end":{"line":531,"column":46}},"55":{"start":{"line":534,"column":8},"end":{"line":534,"column":16780}},"56":{"start":{"line":540,"column":8},"end":{"line":540,"column":31}},"57":{"start":{"line":570,"column":8},"end":{"line":570,"column":65}},"58":{"start":{"line":571,"column":8},"end":{"line":571,"column":67}},"59":{"start":{"line":572,"column":8},"end":{"line":572,"column":47}},"60":{"start":{"line":574,"column":8},"end":{"line":574,"column":17970}},"61":{"start":{"line":604,"column":8},"end":{"line":604,"column":65}},"62":{"start":{"line":605,"column":8},"end":{"line":605,"column":67}},"63":{"start":{"line":606,"column":8},"end":{"line":606,"column":47}},"64":{"start":{"line":607,"column":8},"end":{"line":607,"column":41}},"65":{"start":{"line":609,"column":8},"end":{"line":609,"column":19091}},"66":{"start":{"line":639,"column":8},"end":{"line":639,"column":65}},"67":{"start":{"line":641,"column":8},"end":{"line":641,"column":20043}},"68":{"start":{"line":670,"column":8},"end":{"line":670,"column":46}},"69":{"start":{"line":672,"column":8},"end":{"line":672,"column":20768}},"70":{"start":{"line":693,"column":8},"end":{"line":693,"column":46}},"71":{"start":{"line":695,"column":8},"end":{"line":695,"column":21293}},"72":{"start":{"line":730,"column":8},"end":{"line":730,"column":51}},"73":{"start":{"line":732,"column":8},"end":{"line":732,"column":22625}},"74":{"start":{"line":753,"column":8},"end":{"line":753,"column":23119}},"75":{"start":{"line":772,"column":8},"end":{"line":772,"column":23567}},"76":{"start":{"line":789,"column":8},"end":{"line":789,"column":52}},"77":{"start":{"line":807,"column":8},"end":{"line":807,"column":24656}},"78":{"start":{"line":812,"column":8},"end":{"line":812,"column":49}},"79":{"start":{"line":814,"column":8},"end":{"line":814,"column":24934}},"80":{"start":{"line":815,"column":12},"end":{"line":815,"column":58}},"81":{"start":{"line":841,"column":8},"end":{"line":841,"column":73}},"82":{"start":{"line":845,"column":8},"end":{"line":845,"column":65}},"83":{"start":{"line":846,"column":8},"end":{"line":846,"column":63}},"84":{"start":{"line":847,"column":8},"end":{"line":847,"column":55}},"85":{"start":{"line":851,"column":8},"end":{"line":851,"column":26479}},"86":{"start":{"line":860,"column":8},"end":{"line":860,"column":26781}},"87":{"start":{"line":889,"column":8},"end":{"line":889,"column":27852}},"88":{"start":{"line":894,"column":12},"end":{"line":894,"column":32}},"89":{"start":{"line":898,"column":8},"end":{"line":898,"column":28436}},"90":{"start":{"line":903,"column":8},"end":{"line":903,"column":28544}},"91":{"start":{"line":938,"column":8},"end":{"line":938,"column":65}},"92":{"start":{"line":939,"column":8},"end":{"line":939,"column":69}},"93":{"start":{"line":945,"column":8},"end":{"line":945,"column":67}},"94":{"start":{"line":946,"column":8},"end":{"line":946,"column":66}},"95":{"start":{"line":947,"column":8},"end":{"line":947,"column":55}},"96":{"start":{"line":955,"column":8},"end":{"line":955,"column":30971}},"97":{"start":{"line":961,"column":8},"end":{"line":961,"column":69}},"98":{"start":{"line":965,"column":8},"end":{"line":965,"column":63}},"99":{"start":{"line":969,"column":8},"end":{"line":969,"column":31643}},"100":{"start":{"line":970,"column":12},"end":{"line":970,"column":31716}},"101":{"start":{"line":980,"column":12},"end":{"line":980,"column":32198}},"102":{"start":{"line":981,"column":16},"end":{"line":981,"column":36}},"103":{"start":{"line":987,"column":12},"end":{"line":987,"column":32623}},"104":{"start":{"line":993,"column":16},"end":{"line":993,"column":60}},"105":{"start":{"line":998,"column":12},"end":{"line":998,"column":33142}},"106":{"start":{"line":1002,"column":16},"end":{"line":1002,"column":46}},"107":{"start":{"line":1004,"column":16},"end":{"line":1004,"column":33}},"108":{"start":{"line":1012,"column":12},"end":{"line":1012,"column":54}},"109":{"start":{"line":1016,"column":8},"end":{"line":1016,"column":97}},"110":{"start":{"line":1018,"column":8},"end":{"line":1018,"column":34093}},"111":{"start":{"line":1047,"column":8},"end":{"line":1047,"column":35080}},"112":{"start":{"line":1050,"column":12},"end":{"line":1050,"column":35291}},"113":{"start":{"line":1060,"column":8},"end":{"line":1060,"column":35634}},"114":{"start":{"line":1061,"column":12},"end":{"line":1061,"column":35714}},"115":{"start":{"line":1071,"column":8},"end":{"line":1071,"column":36}},"116":{"start":{"line":1074,"column":8},"end":{"line":1074,"column":71}},"117":{"start":{"line":1076,"column":8},"end":{"line":1076,"column":36312}},"118":{"start":{"line":1079,"column":12},"end":{"line":1079,"column":34}},"119":{"start":{"line":1081,"column":12},"end":{"line":1081,"column":63}},"120":{"start":{"line":1090,"column":12},"end":{"line":1090,"column":38}},"121":{"start":{"line":1095,"column":8},"end":{"line":1095,"column":68}},"122":{"start":{"line":1096,"column":8},"end":{"line":1096,"column":37248}},"123":{"start":{"line":1097,"column":12},"end":{"line":1097,"column":37327}},"124":{"start":{"line":1108,"column":8},"end":{"line":1108,"column":37793}},"125":{"start":{"line":1115,"column":8},"end":{"line":1115,"column":28}},"126":{"start":{"line":1135,"column":8},"end":{"line":1135,"column":34}},"127":{"start":{"line":1136,"column":8},"end":{"line":1136,"column":51}},"128":{"start":{"line":1152,"column":8},"end":{"line":1152,"column":34}},"129":{"start":{"line":1153,"column":8},"end":{"line":1153,"column":56}},"130":{"start":{"line":1167,"column":8},"end":{"line":1167,"column":36}},"131":{"start":{"line":1168,"column":8},"end":{"line":1168,"column":56}},"132":{"start":{"line":1184,"column":8},"end":{"line":1184,"column":34}},"133":{"start":{"line":1185,"column":8},"end":{"line":1185,"column":56}},"134":{"start":{"line":1201,"column":8},"end":{"line":1201,"column":34}},"135":{"start":{"line":1202,"column":8},"end":{"line":1202,"column":61}},"136":{"start":{"line":1217,"column":8},"end":{"line":1217,"column":34}},"137":{"start":{"line":1218,"column":8},"end":{"line":1218,"column":51}},"138":{"start":{"line":1236,"column":8},"end":{"line":1236,"column":36}},"139":{"start":{"line":1237,"column":8},"end":{"line":1237,"column":41463}},"140":{"start":{"line":1259,"column":8},"end":{"line":1259,"column":49}},"141":{"start":{"line":1260,"column":8},"end":{"line":1260,"column":66}},"142":{"start":{"line":1281,"column":8},"end":{"line":1281,"column":42888}},"143":{"start":{"line":1282,"column":12},"end":{"line":1282,"column":18}},"144":{"start":{"line":1285,"column":8},"end":{"line":1285,"column":51}},"145":{"start":{"line":1286,"column":8},"end":{"line":1286,"column":66}},"146":{"start":{"line":1300,"column":8},"end":{"line":1300,"column":43493}},"147":{"start":{"line":1301,"column":12},"end":{"line":1301,"column":49}},"148":{"start":{"line":1305,"column":8},"end":{"line":1305,"column":43681}},"149":{"start":{"line":1306,"column":12},"end":{"line":1306,"column":59}},"150":{"start":{"line":1311,"column":8},"end":{"line":1311,"column":44063}},"151":{"start":{"line":1317,"column":8},"end":{"line":1317,"column":44270}},"152":{"start":{"line":1318,"column":12},"end":{"line":1318,"column":44327}},"153":{"start":{"line":1336,"column":8},"end":{"line":1336,"column":34}},"154":{"start":{"line":1340,"column":8},"end":{"line":1340,"column":45260}},"155":{"start":{"line":1346,"column":8},"end":{"line":1346,"column":45468}},"156":{"start":{"line":1347,"column":12},"end":{"line":1347,"column":62}},"157":{"start":{"line":1348,"column":12},"end":{"line":1348,"column":45591}},"158":{"start":{"line":1372,"column":8},"end":{"line":1372,"column":46695}},"159":{"start":{"line":1373,"column":12},"end":{"line":1373,"column":49}},"160":{"start":{"line":1379,"column":8},"end":{"line":1379,"column":47096}},"161":{"start":{"line":1380,"column":12},"end":{"line":1380,"column":59}},"162":{"start":{"line":1385,"column":8},"end":{"line":1385,"column":47501}},"163":{"start":{"line":1391,"column":8},"end":{"line":1391,"column":47698}},"164":{"start":{"line":1392,"column":12},"end":{"line":1392,"column":46}},"165":{"start":{"line":1410,"column":8},"end":{"line":1410,"column":49}},"166":{"start":{"line":1414,"column":8},"end":{"line":1414,"column":48692}},"167":{"start":{"line":1420,"column":8},"end":{"line":1420,"column":48891}},"168":{"start":{"line":1423,"column":12},"end":{"line":1423,"column":41}},"169":{"start":{"line":1425,"column":12},"end":{"line":1425,"column":69}},"170":{"start":{"line":1426,"column":12},"end":{"line":1426,"column":47}},"171":{"start":{"line":1452,"column":8},"end":{"line":1452,"column":49929}},"172":{"start":{"line":1455,"column":12},"end":{"line":1455,"column":28}},"173":{"start":{"line":1459,"column":8},"end":{"line":1459,"column":50123}},"174":{"start":{"line":1460,"column":12},"end":{"line":1460,"column":50188}},"175":{"start":{"line":1469,"column":8},"end":{"line":1469,"column":50379}},"176":{"start":{"line":1498,"column":8},"end":{"line":1498,"column":51255}},"177":{"start":{"line":1499,"column":12},"end":{"line":1499,"column":51303}},"178":{"start":{"line":1508,"column":8},"end":{"line":1508,"column":77}},"179":{"start":{"line":1523,"column":8},"end":{"line":1523,"column":51849}},"180":{"start":{"line":1542,"column":8},"end":{"line":1542,"column":40}},"181":{"start":{"line":1567,"column":8},"end":{"line":1567,"column":60}},"182":{"start":{"line":1581,"column":8},"end":{"line":1581,"column":53501}},"183":{"start":{"line":1582,"column":12},"end":{"line":1582,"column":59}},"184":{"start":{"line":1585,"column":8},"end":{"line":1585,"column":47}},"185":{"start":{"line":1602,"column":8},"end":{"line":1602,"column":54058}},"186":{"start":{"line":1608,"column":12},"end":{"line":1608,"column":54260}},"187":{"start":{"line":1613,"column":12},"end":{"line":1613,"column":54394}},"188":{"start":{"line":1620,"column":12},"end":{"line":1620,"column":54619}},"189":{"start":{"line":1646,"column":8},"end":{"line":1646,"column":55372}},"190":{"start":{"line":1647,"column":12},"end":{"line":1647,"column":24}},"191":{"start":{"line":1651,"column":8},"end":{"line":1651,"column":55532}},"192":{"start":{"line":1652,"column":12},"end":{"line":1652,"column":24}},"193":{"start":{"line":1656,"column":8},"end":{"line":1656,"column":19}},"194":{"start":{"line":1687,"column":8},"end":{"line":1687,"column":39}},"195":{"start":{"line":1688,"column":8},"end":{"line":1688,"column":56851}},"196":{"start":{"line":1689,"column":12},"end":{"line":1689,"column":75}},"197":{"start":{"line":1691,"column":12},"end":{"line":1691,"column":72}},"198":{"start":{"line":1694,"column":8},"end":{"line":1694,"column":57104}},"199":{"start":{"line":1718,"column":8},"end":{"line":1718,"column":57699}},"200":{"start":{"line":1735,"column":8},"end":{"line":1735,"column":58099}},"201":{"start":{"line":1759,"column":8},"end":{"line":1759,"column":58790}},"202":{"start":{"line":1760,"column":12},"end":{"line":1760,"column":67}},"203":{"start":{"line":1764,"column":8},"end":{"line":1764,"column":58990}},"204":{"start":{"line":1765,"column":12},"end":{"line":1765,"column":69}},"205":{"start":{"line":1769,"column":8},"end":{"line":1769,"column":59194}},"206":{"start":{"line":1770,"column":12},"end":{"line":1770,"column":65}},"207":{"start":{"line":1783,"column":8},"end":{"line":1783,"column":63}},"208":{"start":{"line":1784,"column":8},"end":{"line":1784,"column":62}},"209":{"start":{"line":1785,"column":8},"end":{"line":1785,"column":63}},"210":{"start":{"line":1786,"column":8},"end":{"line":1786,"column":71}},"211":{"start":{"line":1787,"column":8},"end":{"line":1787,"column":65}},"212":{"start":{"line":1788,"column":8},"end":{"line":1788,"column":77}},"213":{"start":{"line":1790,"column":8},"end":{"line":1790,"column":82}},"214":{"start":{"line":1799,"column":8},"end":{"line":1799,"column":52}},"215":{"start":{"line":1800,"column":8},"end":{"line":1800,"column":42}},"216":{"start":{"line":1801,"column":8},"end":{"line":1801,"column":39}},"217":{"start":{"line":1802,"column":8},"end":{"line":1802,"column":41}},"218":{"start":{"line":1803,"column":8},"end":{"line":1803,"column":43}},"219":{"start":{"line":1804,"column":8},"end":{"line":1804,"column":85}},"220":{"start":{"line":1806,"column":8},"end":{"line":1806,"column":41}},"221":{"start":{"line":1808,"column":8},"end":{"line":1808,"column":44}},"222":{"start":{"line":1809,"column":8},"end":{"line":1809,"column":45}},"223":{"start":{"line":1810,"column":8},"end":{"line":1810,"column":38}},"224":{"start":{"line":1812,"column":8},"end":{"line":1812,"column":40}},"225":{"start":{"line":1837,"column":8},"end":{"line":1837,"column":40}},"226":{"start":{"line":1839,"column":8},"end":{"line":1839,"column":41}},"227":{"start":{"line":1840,"column":8},"end":{"line":1840,"column":33}},"228":{"start":{"line":1841,"column":8},"end":{"line":1841,"column":47}},"229":{"start":{"line":1843,"column":8},"end":{"line":1843,"column":40}},"230":{"start":{"line":1845,"column":8},"end":{"line":1845,"column":61}},"231":{"start":{"line":1846,"column":8},"end":{"line":1846,"column":61862}},"232":{"start":{"line":1847,"column":12},"end":{"line":1847,"column":85}},"233":{"start":{"line":1848,"column":12},"end":{"line":1848,"column":61981}},"234":{"start":{"line":1849,"column":16},"end":{"line":1849,"column":42}},"235":{"start":{"line":1853,"column":16},"end":{"line":1853,"column":60}},"236":{"start":{"line":1856,"column":12},"end":{"line":1856,"column":62361}}},"branchMap":{"1":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":8},"end":{"line":109,"column":8}},{"start":{"line":109,"column":8},"end":{"line":109,"column":8}}]},"2":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":8},"end":{"line":127,"column":8}},{"start":{"line":127,"column":8},"end":{"line":127,"column":8}}]},"3":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"4":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]},"5":{"line":170,"type":"if","locations":[{"start":{"line":170,"column":8},"end":{"line":170,"column":8}},{"start":{"line":170,"column":8},"end":{"line":170,"column":8}}]},"6":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"7":{"line":510,"type":"if","locations":[{"start":{"line":510,"column":8},"end":{"line":510,"column":8}},{"start":{"line":510,"column":8},"end":{"line":510,"column":8}}]},"8":{"line":515,"type":"if","locations":[{"start":{"line":515,"column":8},"end":{"line":515,"column":8}},{"start":{"line":515,"column":8},"end":{"line":515,"column":8}}]},"9":{"line":814,"type":"if","locations":[{"start":{"line":814,"column":8},"end":{"line":814,"column":8}},{"start":{"line":814,"column":8},"end":{"line":814,"column":8}}]},"10":{"line":889,"type":"if","locations":[{"start":{"line":889,"column":8},"end":{"line":889,"column":8}},{"start":{"line":889,"column":8},"end":{"line":889,"column":8}}]},"11":{"line":969,"type":"if","locations":[{"start":{"line":969,"column":8},"end":{"line":969,"column":8}},{"start":{"line":969,"column":8},"end":{"line":969,"column":8}}]},"12":{"line":980,"type":"if","locations":[{"start":{"line":980,"column":12},"end":{"line":980,"column":12}},{"start":{"line":980,"column":12},"end":{"line":980,"column":12}}]},"13":{"line":987,"type":"if","locations":[{"start":{"line":987,"column":12},"end":{"line":987,"column":12}},{"start":{"line":987,"column":12},"end":{"line":987,"column":12}}]},"14":{"line":998,"type":"if","locations":[{"start":{"line":998,"column":12},"end":{"line":998,"column":12}},{"start":{"line":998,"column":12},"end":{"line":998,"column":12}}]},"15":{"line":1047,"type":"if","locations":[{"start":{"line":1047,"column":8},"end":{"line":1047,"column":8}},{"start":{"line":1047,"column":8},"end":{"line":1047,"column":8}}]},"16":{"line":1060,"type":"if","locations":[{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}},{"start":{"line":1060,"column":8},"end":{"line":1060,"column":8}}]},"17":{"line":1076,"type":"if","locations":[{"start":{"line":1076,"column":8},"end":{"line":1076,"column":8}},{"start":{"line":1076,"column":8},"end":{"line":1076,"column":8}}]},"18":{"line":1096,"type":"if","locations":[{"start":{"line":1096,"column":8},"end":{"line":1096,"column":8}},{"start":{"line":1096,"column":8},"end":{"line":1096,"column":8}}]},"19":{"line":1281,"type":"if","locations":[{"start":{"line":1281,"column":8},"end":{"line":1281,"column":8}},{"start":{"line":1281,"column":8},"end":{"line":1281,"column":8}}]},"20":{"line":1300,"type":"if","locations":[{"start":{"line":1300,"column":8},"end":{"line":1300,"column":8}},{"start":{"line":1300,"column":8},"end":{"line":1300,"column":8}}]},"21":{"line":1305,"type":"if","locations":[{"start":{"line":1305,"column":8},"end":{"line":1305,"column":8}},{"start":{"line":1305,"column":8},"end":{"line":1305,"column":8}}]},"22":{"line":1317,"type":"if","locations":[{"start":{"line":1317,"column":8},"end":{"line":1317,"column":8}},{"start":{"line":1317,"column":8},"end":{"line":1317,"column":8}}]},"23":{"line":1346,"type":"if","locations":[{"start":{"line":1346,"column":8},"end":{"line":1346,"column":8}},{"start":{"line":1346,"column":8},"end":{"line":1346,"column":8}}]},"24":{"line":1372,"type":"if","locations":[{"start":{"line":1372,"column":8},"end":{"line":1372,"column":8}},{"start":{"line":1372,"column":8},"end":{"line":1372,"column":8}}]},"25":{"line":1379,"type":"if","locations":[{"start":{"line":1379,"column":8},"end":{"line":1379,"column":8}},{"start":{"line":1379,"column":8},"end":{"line":1379,"column":8}}]},"26":{"line":1391,"type":"if","locations":[{"start":{"line":1391,"column":8},"end":{"line":1391,"column":8}},{"start":{"line":1391,"column":8},"end":{"line":1391,"column":8}}]},"27":{"line":1420,"type":"if","locations":[{"start":{"line":1420,"column":8},"end":{"line":1420,"column":8}},{"start":{"line":1420,"column":8},"end":{"line":1420,"column":8}}]},"28":{"line":1452,"type":"if","locations":[{"start":{"line":1452,"column":8},"end":{"line":1452,"column":8}},{"start":{"line":1452,"column":8},"end":{"line":1452,"column":8}}]},"29":{"line":1459,"type":"if","locations":[{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}},{"start":{"line":1459,"column":8},"end":{"line":1459,"column":8}}]},"30":{"line":1498,"type":"if","locations":[{"start":{"line":1498,"column":8},"end":{"line":1498,"column":8}},{"start":{"line":1498,"column":8},"end":{"line":1498,"column":8}}]},"31":{"line":1581,"type":"if","locations":[{"start":{"line":1581,"column":8},"end":{"line":1581,"column":8}},{"start":{"line":1581,"column":8},"end":{"line":1581,"column":8}}]},"32":{"line":1602,"type":"if","locations":[{"start":{"line":1602,"column":8},"end":{"line":1602,"column":8}},{"start":{"line":1602,"column":8},"end":{"line":1602,"column":8}}]},"33":{"line":1646,"type":"if","locations":[{"start":{"line":1646,"column":8},"end":{"line":1646,"column":8}},{"start":{"line":1646,"column":8},"end":{"line":1646,"column":8}}]},"34":{"line":1651,"type":"if","locations":[{"start":{"line":1651,"column":8},"end":{"line":1651,"column":8}},{"start":{"line":1651,"column":8},"end":{"line":1651,"column":8}}]},"35":{"line":1688,"type":"if","locations":[{"start":{"line":1688,"column":8},"end":{"line":1688,"column":8}},{"start":{"line":1688,"column":8},"end":{"line":1688,"column":8}}]},"36":{"line":1759,"type":"if","locations":[{"start":{"line":1759,"column":8},"end":{"line":1759,"column":8}},{"start":{"line":1759,"column":8},"end":{"line":1759,"column":8}}]},"37":{"line":1764,"type":"if","locations":[{"start":{"line":1764,"column":8},"end":{"line":1764,"column":8}},{"start":{"line":1764,"column":8},"end":{"line":1764,"column":8}}]},"38":{"line":1769,"type":"if","locations":[{"start":{"line":1769,"column":8},"end":{"line":1769,"column":8}},{"start":{"line":1769,"column":8},"end":{"line":1769,"column":8}}]},"39":{"line":1837,"type":"if","locations":[{"start":{"line":1837,"column":8},"end":{"line":1837,"column":8}},{"start":{"line":1837,"column":8},"end":{"line":1837,"column":8}}]},"40":{"line":1846,"type":"if","locations":[{"start":{"line":1846,"column":8},"end":{"line":1846,"column":8}},{"start":{"line":1846,"column":8},"end":{"line":1846,"column":8}}]},"41":{"line":1848,"type":"if","locations":[{"start":{"line":1848,"column":12},"end":{"line":1848,"column":12}},{"start":{"line":1848,"column":12},"end":{"line":1848,"column":12}}]}}}, -"contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol":{"l":{"43":277,"54":277,"56":277,"58":277,"60":277,"61":277,"62":277,"65":277,"66":277,"146":152},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol","s":{"1":277,"2":277,"3":277,"4":277,"5":277,"6":277,"7":277,"8":152},"b":{},"f":{"1":277},"fnMap":{"1":{"name":"isBytecodeSafe","line":31,"loc":{"start":{"line":31,"column":4},"end":{"line":147,"column":4}}}},"statementMap":{"1":{"start":{"line":43,"column":8},"end":{"line":43,"column":1492}},"2":{"start":{"line":54,"column":8},"end":{"line":54,"column":109}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":112}},"4":{"start":{"line":58,"column":8},"end":{"line":58,"column":77}},"5":{"start":{"line":60,"column":8},"end":{"line":60,"column":26}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":19}},"7":{"start":{"line":65,"column":8},"end":{"line":65,"column":42}},"8":{"start":{"line":146,"column":8},"end":{"line":146,"column":19}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol":{"l":{"57":207,"71":921,"75":920,"97":0,"111":12,"127":12,"141":0,"142":0,"143":0,"161":4,"179":537,"197":31,"216":31,"234":60,"252":369,"270":0,"284":30,"285":30,"286":30,"287":30,"288":30,"306":18,"307":18,"308":18,"326":538,"347":61,"368":7,"369":7,"370":3,"373":4,"374":4,"376":4,"387":70,"402":5,"420":0,"421":0,"439":0,"440":0,"466":14,"473":14,"474":8,"497":57,"501":6,"505":51,"525":74,"545":69,"568":19,"591":9,"592":9,"593":3,"596":6,"597":6,"599":6,"610":30,"625":5,"645":0,"646":0,"666":0,"667":0,"689":606,"708":97,"730":687,"732":687,"733":268,"736":687},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol","s":{"1":207,"2":921,"3":0,"4":12,"5":12,"6":0,"7":0,"8":0,"9":4,"10":537,"11":31,"12":31,"13":60,"14":369,"15":0,"16":30,"17":30,"18":30,"19":30,"20":30,"21":18,"22":18,"23":18,"24":538,"25":61,"26":7,"27":7,"28":3,"29":4,"30":4,"31":4,"32":70,"33":5,"34":0,"35":0,"36":0,"37":0,"38":14,"39":14,"40":8,"41":57,"42":6,"43":51,"44":74,"45":69,"46":19,"47":9,"48":9,"49":3,"50":6,"51":6,"52":6,"53":30,"54":5,"55":0,"56":0,"57":0,"58":0,"59":606,"60":97,"61":687,"62":687,"63":268,"64":687},"b":{"1":[920,1],"2":[3,4],"3":[8,6],"4":[6,51],"5":[3,6],"6":[268,419]},"f":{"1":207,"2":921,"3":0,"4":12,"5":12,"6":0,"7":4,"8":537,"9":31,"10":31,"11":60,"12":369,"13":0,"14":30,"15":18,"16":538,"17":61,"18":7,"19":70,"20":5,"21":0,"22":0,"23":14,"24":57,"25":74,"26":69,"27":19,"28":9,"29":30,"30":5,"31":0,"32":0,"33":606,"34":97,"35":687},"fnMap":{"1":{"name":"constructor","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":58,"column":4}}},"2":{"name":"authenticated","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":76,"column":4}}},"3":{"name":"isAuthenticated","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":98,"column":4}}},"4":{"name":"setExecutionManager","line":109,"loc":{"start":{"line":104,"column":4},"end":{"line":112,"column":4}}},"5":{"name":"putAccount","line":125,"loc":{"start":{"line":119,"column":4},"end":{"line":128,"column":4}}},"6":{"name":"putEmptyAccount","line":139,"loc":{"start":{"line":134,"column":4},"end":{"line":144,"column":4}}},"7":{"name":"getAccount","line":151,"loc":{"start":{"line":151,"column":4},"end":{"line":162,"column":4}}},"8":{"name":"hasAccount","line":169,"loc":{"start":{"line":169,"column":4},"end":{"line":180,"column":4}}},"9":{"name":"hasEmptyAccount","line":187,"loc":{"start":{"line":187,"column":4},"end":{"line":201,"column":4}}},"10":{"name":"setAccountNonce","line":214,"loc":{"start":{"line":208,"column":4},"end":{"line":217,"column":4}}},"11":{"name":"getAccountNonce","line":224,"loc":{"start":{"line":224,"column":4},"end":{"line":235,"column":4}}},"12":{"name":"getAccountEthAddress","line":242,"loc":{"start":{"line":242,"column":4},"end":{"line":253,"column":4}}},"13":{"name":"getAccountStorageRoot","line":260,"loc":{"start":{"line":260,"column":4},"end":{"line":271,"column":4}}},"14":{"name":"initPendingAccount","line":282,"loc":{"start":{"line":277,"column":4},"end":{"line":289,"column":4}}},"15":{"name":"commitPendingAccount","line":304,"loc":{"start":{"line":297,"column":4},"end":{"line":309,"column":4}}},"16":{"name":"testAndSetAccountLoaded","line":321,"loc":{"start":{"line":316,"column":4},"end":{"line":330,"column":4}}},"17":{"name":"testAndSetAccountChanged","line":342,"loc":{"start":{"line":337,"column":4},"end":{"line":351,"column":4}}},"18":{"name":"commitAccount","line":363,"loc":{"start":{"line":358,"column":4},"end":{"line":377,"column":4}}},"19":{"name":"incrementTotalUncommittedAccounts","line":385,"loc":{"start":{"line":382,"column":4},"end":{"line":388,"column":4}}},"20":{"name":"getTotalUncommittedAccounts","line":394,"loc":{"start":{"line":394,"column":4},"end":{"line":403,"column":4}}},"21":{"name":"wasAccountChanged","line":410,"loc":{"start":{"line":410,"column":4},"end":{"line":422,"column":4}}},"22":{"name":"wasAccountCommitted","line":429,"loc":{"start":{"line":429,"column":4},"end":{"line":441,"column":4}}},"23":{"name":"putContractStorage","line":461,"loc":{"start":{"line":454,"column":4},"end":{"line":476,"column":4}}},"24":{"name":"getContractStorage","line":484,"loc":{"start":{"line":484,"column":4},"end":{"line":506,"column":4}}},"25":{"name":"hasContractStorage","line":514,"loc":{"start":{"line":514,"column":4},"end":{"line":526,"column":4}}},"26":{"name":"testAndSetContractStorageLoaded","line":540,"loc":{"start":{"line":534,"column":4},"end":{"line":549,"column":4}}},"27":{"name":"testAndSetContractStorageChanged","line":563,"loc":{"start":{"line":557,"column":4},"end":{"line":572,"column":4}}},"28":{"name":"commitContractStorage","line":586,"loc":{"start":{"line":580,"column":4},"end":{"line":600,"column":4}}},"29":{"name":"incrementTotalUncommittedContractStorage","line":608,"loc":{"start":{"line":605,"column":4},"end":{"line":611,"column":4}}},"30":{"name":"getTotalUncommittedContractStorage","line":617,"loc":{"start":{"line":617,"column":4},"end":{"line":626,"column":4}}},"31":{"name":"wasContractStorageChanged","line":634,"loc":{"start":{"line":634,"column":4},"end":{"line":647,"column":4}}},"32":{"name":"wasContractStorageCommitted","line":655,"loc":{"start":{"line":655,"column":4},"end":{"line":668,"column":4}}},"33":{"name":"_getItemHash","line":680,"loc":{"start":{"line":680,"column":4},"end":{"line":690,"column":4}}},"34":{"name":"_getItemHash","line":698,"loc":{"start":{"line":698,"column":4},"end":{"line":712,"column":4}}},"35":{"name":"_testAndSetItemState","line":721,"loc":{"start":{"line":721,"column":4},"end":{"line":737,"column":4}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":21}},"2":{"start":{"line":71,"column":8},"end":{"line":71,"column":2475}},"3":{"start":{"line":97,"column":8},"end":{"line":97,"column":69}},"4":{"start":{"line":111,"column":8},"end":{"line":111,"column":49}},"5":{"start":{"line":127,"column":8},"end":{"line":127,"column":36}},"6":{"start":{"line":141,"column":8},"end":{"line":141,"column":65}},"7":{"start":{"line":142,"column":8},"end":{"line":142,"column":55}},"8":{"start":{"line":143,"column":8},"end":{"line":143,"column":49}},"9":{"start":{"line":161,"column":8},"end":{"line":161,"column":33}},"10":{"start":{"line":179,"column":8},"end":{"line":179,"column":56}},"11":{"start":{"line":197,"column":8},"end":{"line":197,"column":5447}},"12":{"start":{"line":216,"column":8},"end":{"line":216,"column":40}},"13":{"start":{"line":234,"column":8},"end":{"line":234,"column":39}},"14":{"start":{"line":252,"column":8},"end":{"line":252,"column":44}},"15":{"start":{"line":270,"column":8},"end":{"line":270,"column":45}},"16":{"start":{"line":284,"column":8},"end":{"line":284,"column":65}},"17":{"start":{"line":285,"column":8},"end":{"line":285,"column":24}},"18":{"start":{"line":286,"column":8},"end":{"line":286,"column":55}},"19":{"start":{"line":287,"column":8},"end":{"line":287,"column":49}},"20":{"start":{"line":288,"column":8},"end":{"line":288,"column":29}},"21":{"start":{"line":306,"column":8},"end":{"line":306,"column":65}},"22":{"start":{"line":307,"column":8},"end":{"line":307,"column":39}},"23":{"start":{"line":308,"column":8},"end":{"line":308,"column":35}},"24":{"start":{"line":326,"column":8},"end":{"line":326,"column":8632}},"25":{"start":{"line":347,"column":8},"end":{"line":347,"column":9161}},"26":{"start":{"line":368,"column":8},"end":{"line":368,"column":45}},"27":{"start":{"line":369,"column":8},"end":{"line":369,"column":9676}},"28":{"start":{"line":370,"column":12},"end":{"line":370,"column":24}},"29":{"start":{"line":373,"column":8},"end":{"line":373,"column":50}},"30":{"start":{"line":374,"column":8},"end":{"line":374,"column":36}},"31":{"start":{"line":376,"column":8},"end":{"line":376,"column":19}},"32":{"start":{"line":387,"column":8},"end":{"line":387,"column":36}},"33":{"start":{"line":402,"column":8},"end":{"line":402,"column":39}},"34":{"start":{"line":420,"column":8},"end":{"line":420,"column":45}},"35":{"start":{"line":421,"column":8},"end":{"line":421,"column":57}},"36":{"start":{"line":439,"column":8},"end":{"line":439,"column":45}},"37":{"start":{"line":440,"column":8},"end":{"line":440,"column":59}},"38":{"start":{"line":466,"column":8},"end":{"line":466,"column":68}},"39":{"start":{"line":473,"column":8},"end":{"line":473,"column":12609}},"40":{"start":{"line":474,"column":12},"end":{"line":474,"column":58}},"41":{"start":{"line":497,"column":8},"end":{"line":497,"column":13277}},"42":{"start":{"line":501,"column":12},"end":{"line":501,"column":29}},"43":{"start":{"line":505,"column":8},"end":{"line":505,"column":67}},"44":{"start":{"line":525,"column":8},"end":{"line":525,"column":86}},"45":{"start":{"line":545,"column":8},"end":{"line":545,"column":14610}},"46":{"start":{"line":568,"column":8},"end":{"line":568,"column":15225}},"47":{"start":{"line":591,"column":8},"end":{"line":591,"column":52}},"48":{"start":{"line":592,"column":8},"end":{"line":592,"column":15834}},"49":{"start":{"line":593,"column":12},"end":{"line":593,"column":24}},"50":{"start":{"line":596,"column":8},"end":{"line":596,"column":50}},"51":{"start":{"line":597,"column":8},"end":{"line":597,"column":43}},"52":{"start":{"line":599,"column":8},"end":{"line":599,"column":19}},"53":{"start":{"line":610,"column":8},"end":{"line":610,"column":43}},"54":{"start":{"line":625,"column":8},"end":{"line":625,"column":46}},"55":{"start":{"line":645,"column":8},"end":{"line":645,"column":52}},"56":{"start":{"line":646,"column":8},"end":{"line":646,"column":57}},"57":{"start":{"line":666,"column":8},"end":{"line":666,"column":52}},"58":{"start":{"line":667,"column":8},"end":{"line":667,"column":59}},"59":{"start":{"line":689,"column":8},"end":{"line":689,"column":52}},"60":{"start":{"line":708,"column":8},"end":{"line":708,"column":18596}},"61":{"start":{"line":730,"column":8},"end":{"line":730,"column":62}},"62":{"start":{"line":732,"column":8},"end":{"line":732,"column":19270}},"63":{"start":{"line":733,"column":12},"end":{"line":733,"column":44}},"64":{"start":{"line":736,"column":8},"end":{"line":736,"column":27}}},"branchMap":{"1":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":8}},{"start":{"line":71,"column":8},"end":{"line":71,"column":8}}]},"2":{"line":369,"type":"if","locations":[{"start":{"line":369,"column":8},"end":{"line":369,"column":8}},{"start":{"line":369,"column":8},"end":{"line":369,"column":8}}]},"3":{"line":473,"type":"if","locations":[{"start":{"line":473,"column":8},"end":{"line":473,"column":8}},{"start":{"line":473,"column":8},"end":{"line":473,"column":8}}]},"4":{"line":497,"type":"if","locations":[{"start":{"line":497,"column":8},"end":{"line":497,"column":8}},{"start":{"line":497,"column":8},"end":{"line":497,"column":8}}]},"5":{"line":592,"type":"if","locations":[{"start":{"line":592,"column":8},"end":{"line":592,"column":8}},{"start":{"line":592,"column":8},"end":{"line":592,"column":8}}]},"6":{"line":732,"type":"if","locations":[{"start":{"line":732,"column":8},"end":{"line":732,"column":8}},{"start":{"line":732,"column":8},"end":{"line":732,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol":{"l":{"39":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol","s":{"1":0},"b":{},"f":{"1":0},"fnMap":{"1":{"name":"create","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":40,"column":4}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":43}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol":{"l":{"57":0,"58":0,"59":0,"60":0,"62":0,"74":0,"75":0,"77":0,"78":0,"79":0,"85":0,"86":0,"94":0,"95":0,"96":0,"104":0,"105":0,"107":0,"115":0,"125":0,"127":0,"138":0,"139":0,"141":0,"149":0,"150":0,"152":0,"153":0,"154":0,"157":0,"158":0,"159":0,"162":0,"163":0,"164":0,"166":0,"173":0,"180":0,"182":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0},"fnMap":{"1":{"name":"getInterfaceImplementer","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":63,"column":4}}},"2":{"name":"setInterfaceImplementer","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":87,"column":4}}},"3":{"name":"setManager","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":97,"column":4}}},"4":{"name":"getManager","line":102,"loc":{"start":{"line":102,"column":4},"end":{"line":109,"column":4}}},"5":{"name":"interfaceHash","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":116,"column":4}}},"6":{"name":"updateERC165Cache","line":124,"loc":{"start":{"line":124,"column":4},"end":{"line":128,"column":4}}},"7":{"name":"implementsERC165Interface","line":137,"loc":{"start":{"line":137,"column":4},"end":{"line":142,"column":4}}},"8":{"name":"implementsERC165InterfaceNoCache","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":167,"column":4}}},"9":{"name":"isERC165Interface","line":172,"loc":{"start":{"line":172,"column":4},"end":{"line":174,"column":4}}},"10":{"name":"noThrowCall","line":177,"loc":{"start":{"line":177,"column":4},"end":{"line":198,"column":4}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":63}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":3386}},"3":{"start":{"line":59,"column":12},"end":{"line":59,"column":63}},"4":{"start":{"line":60,"column":12},"end":{"line":60,"column":91}},"5":{"start":{"line":62,"column":8},"end":{"line":62,"column":47}},"6":{"start":{"line":74,"column":8},"end":{"line":74,"column":63}},"7":{"start":{"line":75,"column":8},"end":{"line":75,"column":65}},"8":{"start":{"line":77,"column":8},"end":{"line":77,"column":80}},"9":{"start":{"line":78,"column":8},"end":{"line":78,"column":4625}},"10":{"start":{"line":79,"column":12},"end":{"line":79,"column":4705}},"11":{"start":{"line":85,"column":8},"end":{"line":85,"column":54}},"12":{"start":{"line":86,"column":8},"end":{"line":86,"column":72}},"13":{"start":{"line":94,"column":8},"end":{"line":94,"column":66}},"14":{"start":{"line":95,"column":8},"end":{"line":95,"column":72}},"15":{"start":{"line":96,"column":8},"end":{"line":96,"column":47}},"16":{"start":{"line":104,"column":8},"end":{"line":104,"column":5986}},"17":{"start":{"line":105,"column":12},"end":{"line":105,"column":24}},"18":{"start":{"line":107,"column":12},"end":{"line":107,"column":34}},"19":{"start":{"line":115,"column":8},"end":{"line":115,"column":58}},"20":{"start":{"line":125,"column":8},"end":{"line":125,"column":6972}},"21":{"start":{"line":127,"column":8},"end":{"line":127,"column":51}},"22":{"start":{"line":138,"column":8},"end":{"line":138,"column":7770}},"23":{"start":{"line":139,"column":12},"end":{"line":139,"column":76}},"24":{"start":{"line":141,"column":8},"end":{"line":141,"column":63}},"25":{"start":{"line":149,"column":8},"end":{"line":149,"column":23}},"26":{"start":{"line":150,"column":8},"end":{"line":150,"column":22}},"27":{"start":{"line":152,"column":8},"end":{"line":152,"column":59}},"28":{"start":{"line":153,"column":8},"end":{"line":153,"column":8523}},"29":{"start":{"line":154,"column":12},"end":{"line":154,"column":24}},"30":{"start":{"line":157,"column":8},"end":{"line":157,"column":61}},"31":{"start":{"line":158,"column":8},"end":{"line":158,"column":8667}},"32":{"start":{"line":159,"column":12},"end":{"line":159,"column":24}},"33":{"start":{"line":162,"column":8},"end":{"line":162,"column":63}},"34":{"start":{"line":163,"column":8},"end":{"line":163,"column":8813}},"35":{"start":{"line":164,"column":12},"end":{"line":164,"column":23}},"36":{"start":{"line":166,"column":8},"end":{"line":166,"column":20}},"37":{"start":{"line":173,"column":8},"end":{"line":173,"column":103}},"38":{"start":{"line":180,"column":8},"end":{"line":180,"column":34}}},"branchMap":{"1":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":8},"end":{"line":58,"column":8}},{"start":{"line":58,"column":8},"end":{"line":58,"column":8}}]},"2":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":8},"end":{"line":75,"column":8}},{"start":{"line":75,"column":8},"end":{"line":75,"column":8}}]},"3":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":77,"column":8}},{"start":{"line":77,"column":8},"end":{"line":77,"column":8}}]},"4":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]},"5":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":12},"end":{"line":79,"column":12}},{"start":{"line":79,"column":12},"end":{"line":79,"column":12}}]},"6":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":8},"end":{"line":94,"column":8}},{"start":{"line":94,"column":8},"end":{"line":94,"column":8}}]},"7":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":8},"end":{"line":104,"column":8}},{"start":{"line":104,"column":8},"end":{"line":104,"column":8}}]},"8":{"line":138,"type":"if","locations":[{"start":{"line":138,"column":8},"end":{"line":138,"column":8}},{"start":{"line":138,"column":8},"end":{"line":138,"column":8}}]},"9":{"line":153,"type":"if","locations":[{"start":{"line":153,"column":8},"end":{"line":153,"column":8}},{"start":{"line":153,"column":8},"end":{"line":153,"column":8}}]},"10":{"line":158,"type":"if","locations":[{"start":{"line":158,"column":8},"end":{"line":158,"column":8}},{"start":{"line":158,"column":8},"end":{"line":158,"column":8}}]},"11":{"line":163,"type":"if","locations":[{"start":{"line":163,"column":8},"end":{"line":163,"column":8}},{"start":{"line":163,"column":8},"end":{"line":163,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol":{"l":{"40":0,"46":0,"50":0,"70":0,"74":0,"75":0,"78":0,"82":0,"86":0,"102":0,"122":0,"139":0,"156":0,"170":0,"171":0,"188":29,"192":29,"193":25,"196":4,"200":4,"201":1,"204":3,"210":3},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":29,"16":29,"17":25,"18":4,"19":4,"20":1,"21":3,"22":3},"b":{"1":[0,0],"2":[25,4],"3":[1,3]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":29},"fnMap":{"1":{"name":"onlyOwner","line":39,"loc":{"start":{"line":39,"column":4},"end":{"line":51,"column":4}}},"2":{"name":"initialize","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":90,"column":4}}},"3":{"name":"getOwner","line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":107,"column":4}}},"4":{"name":"setWhitelistedDeployer","line":120,"loc":{"start":{"line":114,"column":4},"end":{"line":126,"column":4}}},"5":{"name":"setOwner","line":137,"loc":{"start":{"line":132,"column":4},"end":{"line":143,"column":4}}},"6":{"name":"setAllowArbitraryDeployment","line":154,"loc":{"start":{"line":149,"column":4},"end":{"line":160,"column":4}}},"7":{"name":"enableArbitraryContractDeployment","line":168,"loc":{"start":{"line":165,"column":4},"end":{"line":172,"column":4}}},"8":{"name":"isDeployerAllowed","line":179,"loc":{"start":{"line":179,"column":4},"end":{"line":211,"column":4}}}},"statementMap":{"1":{"start":{"line":40,"column":8},"end":{"line":40,"column":1617}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":1775}},"3":{"start":{"line":70,"column":8},"end":{"line":70,"column":2421}},"4":{"start":{"line":74,"column":8},"end":{"line":74,"column":2555}},"5":{"start":{"line":75,"column":12},"end":{"line":75,"column":18}},"6":{"start":{"line":78,"column":8},"end":{"line":78,"column":2621}},"7":{"start":{"line":82,"column":8},"end":{"line":82,"column":2757}},"8":{"start":{"line":86,"column":8},"end":{"line":86,"column":2892}},"9":{"start":{"line":102,"column":8},"end":{"line":102,"column":3237}},"10":{"start":{"line":122,"column":8},"end":{"line":122,"column":3758}},"11":{"start":{"line":139,"column":8},"end":{"line":139,"column":4149}},"12":{"start":{"line":156,"column":8},"end":{"line":156,"column":4591}},"13":{"start":{"line":170,"column":8},"end":{"line":170,"column":40}},"14":{"start":{"line":171,"column":8},"end":{"line":171,"column":27}},"15":{"start":{"line":188,"column":8},"end":{"line":188,"column":5404}},"16":{"start":{"line":192,"column":8},"end":{"line":192,"column":5538}},"17":{"start":{"line":193,"column":12},"end":{"line":193,"column":23}},"18":{"start":{"line":196,"column":8},"end":{"line":196,"column":5611}},"19":{"start":{"line":200,"column":8},"end":{"line":200,"column":5773}},"20":{"start":{"line":201,"column":12},"end":{"line":201,"column":23}},"21":{"start":{"line":204,"column":8},"end":{"line":204,"column":5858}},"22":{"start":{"line":210,"column":8},"end":{"line":210,"column":28}}},"branchMap":{"1":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":8},"end":{"line":74,"column":8}},{"start":{"line":74,"column":8},"end":{"line":74,"column":8}}]},"2":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":8},"end":{"line":192,"column":8}},{"start":{"line":192,"column":8},"end":{"line":192,"column":8}}]},"3":{"line":200,"type":"if","locations":[{"start":{"line":200,"column":8},"end":{"line":200,"column":8}},{"start":{"line":200,"column":8},"end":{"line":200,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol":{"l":{"32":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol","s":{"1":0},"b":{},"f":{"1":0},"fnMap":{"1":{"name":"constructor","line":30,"loc":{"start":{"line":22,"column":4},"end":{"line":33,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":47}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol":{"l":{"41":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol","s":{"1":1},"b":{},"f":{"1":1},"fnMap":{"1":{"name":"getL1MessageSender","line":32,"loc":{"start":{"line":32,"column":4},"end":{"line":42,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":64}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol":{"l":{"43":31},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol","s":{"1":31},"b":{},"f":{"1":31},"fnMap":{"1":{"name":"passMessageToL1","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":49,"column":4}}}},"statementMap":{"1":{"start":{"line":43,"column":8},"end":{"line":43,"column":1351}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol":{"l":{"25":1,"43":2,"47":2,"48":2,"56":2,"61":2,"74":4,"86":1,"98":2,"110":4},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol","s":{"1":1,"2":2,"3":2,"4":2,"5":2,"6":2,"7":4,"8":1,"9":2,"10":4},"b":{},"f":{"1":1,"2":2,"3":2,"4":4,"5":1,"6":2,"7":4},"fnMap":{"1":{"name":null,"line":22,"loc":{"start":{"line":22,"column":4},"end":{"line":30,"column":4}}},"2":{"name":"init","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"upgrade","line":51,"loc":{"start":{"line":51,"column":4},"end":{"line":62,"column":4}}},"4":{"name":"_setImplementation","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":78,"column":4}}},"5":{"name":"_getImplementation","line":80,"loc":{"start":{"line":80,"column":4},"end":{"line":91,"column":4}}},"6":{"name":"_setOwner","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":102,"column":4}}},"7":{"name":"_getOwner","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":115,"column":4}}}},"statementMap":{"1":{"start":{"line":25,"column":8},"end":{"line":25,"column":678}},"2":{"start":{"line":43,"column":8},"end":{"line":43,"column":1017}},"3":{"start":{"line":47,"column":8},"end":{"line":47,"column":24}},"4":{"start":{"line":48,"column":8},"end":{"line":48,"column":42}},"5":{"start":{"line":56,"column":8},"end":{"line":56,"column":1345}},"6":{"start":{"line":61,"column":8},"end":{"line":61,"column":42}},"7":{"start":{"line":74,"column":8},"end":{"line":74,"column":1768}},"8":{"start":{"line":86,"column":8},"end":{"line":86,"column":2050}},"9":{"start":{"line":98,"column":8},"end":{"line":98,"column":2288}},"10":{"start":{"line":110,"column":8},"end":{"line":110,"column":2543}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol":{"l":{"52":7,"54":5,"55":5,"56":5,"59":5,"60":5,"63":5,"68":5,"76":5,"78":2,"79":2,"83":5,"92":5,"117":7,"118":3,"120":2,"122":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol","s":{"1":7,"2":5,"3":5,"4":5,"5":5,"6":5,"7":5,"8":5,"9":5,"10":2,"11":2,"12":5,"13":5,"14":7,"15":3,"16":4,"17":2,"18":2},"b":{"1":[2,3],"2":[3,4],"3":[2,2]},"f":{"1":7,"2":7},"fnMap":{"1":{"name":null,"line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":97,"column":4}}},"2":{"name":"_getTransactionType","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":126,"column":4}}}},"statementMap":{"1":{"start":{"line":52,"column":8},"end":{"line":52,"column":98}},"2":{"start":{"line":54,"column":8},"end":{"line":54,"column":83}},"3":{"start":{"line":55,"column":8},"end":{"line":55,"column":84}},"4":{"start":{"line":56,"column":8},"end":{"line":56,"column":54}},"5":{"start":{"line":59,"column":8},"end":{"line":59,"column":70}},"6":{"start":{"line":60,"column":8},"end":{"line":60,"column":87}},"7":{"start":{"line":63,"column":8},"end":{"line":63,"column":2436}},"8":{"start":{"line":68,"column":8},"end":{"line":68,"column":2618}},"9":{"start":{"line":76,"column":8},"end":{"line":76,"column":2784}},"10":{"start":{"line":78,"column":12},"end":{"line":78,"column":94}},"11":{"start":{"line":79,"column":12},"end":{"line":79,"column":85}},"12":{"start":{"line":83,"column":8},"end":{"line":83,"column":3190}},"13":{"start":{"line":92,"column":8},"end":{"line":92,"column":3423}},"14":{"start":{"line":117,"column":8},"end":{"line":117,"column":3983}},"15":{"start":{"line":118,"column":12},"end":{"line":118,"column":57}},"16":{"start":{"line":119,"column":10},"end":{"line":119,"column":4081}},"17":{"start":{"line":120,"column":12},"end":{"line":120,"column":53}},"18":{"start":{"line":122,"column":12},"end":{"line":122,"column":4198}}},"branchMap":{"1":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"2":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":8},"end":{"line":117,"column":8}},{"start":{"line":117,"column":8},"end":{"line":117,"column":8}}]},"3":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":10},"end":{"line":119,"column":10}},{"start":{"line":119,"column":10},"end":{"line":119,"column":10}}]}}}, -"contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol":{"l":{"13":28,"14":28,"15":14,"16":14},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol","s":{"1":28,"2":14,"3":14},"b":{},"f":{"1":28},"fnMap":{"1":{"name":"contributesToFraudProof","line":12,"loc":{"start":{"line":12,"column":4},"end":{"line":17,"column":4}}}},"statementMap":{"1":{"start":{"line":13,"column":8},"end":{"line":13,"column":36}},"2":{"start":{"line":15,"column":8},"end":{"line":15,"column":47}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":110}}},"branchMap":{}}, -"contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol":{"l":{"69":63,"80":46,"81":46,"83":45,"84":45,"90":13,"91":12,"95":11,"97":11,"98":11,"99":8,"100":8,"101":8,"108":1,"109":1,"118":11,"123":1,"127":10,"133":18,"139":18,"144":7,"145":7,"146":7,"148":6,"149":6,"154":5,"156":5,"160":4,"163":3,"164":3,"166":3,"175":6,"176":6,"182":5,"183":5,"186":5,"190":4,"193":4,"196":4,"201":3,"206":2},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol","s":{"1":63,"2":46,"3":46,"4":45,"5":45,"6":13,"7":12,"8":11,"9":11,"10":11,"11":8,"12":8,"13":8,"14":3,"15":1,"16":1,"17":11,"18":1,"19":10,"20":18,"21":18,"22":7,"23":7,"24":7,"25":6,"26":6,"27":5,"28":5,"29":4,"30":3,"31":3,"32":3,"33":6,"34":6,"35":5,"36":5,"37":5,"38":4,"39":4,"40":4,"41":3,"42":2},"b":{"1":[45,1],"2":[12,1],"3":[11,1],"4":[8,3],"5":[1,2],"6":[1,10],"7":[18,0],"8":[7,0],"9":[6,1],"10":[4,1],"11":[3,1],"12":[3,0],"13":[5,1],"14":[4,1],"15":[4,0]},"f":{"1":63,"2":46,"3":13,"4":18,"5":7,"6":5,"7":6,"8":3,"9":2},"fnMap":{"1":{"name":"constructor","line":67,"loc":{"start":{"line":63,"column":4},"end":{"line":70,"column":4}}},"2":{"name":"recordGasSpent","line":78,"loc":{"start":{"line":78,"column":4},"end":{"line":85,"column":4}}},"3":{"name":"finalize","line":89,"loc":{"start":{"line":89,"column":4},"end":{"line":128,"column":4}}},"4":{"name":"deposit","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":140,"column":4}}},"5":{"name":"startWithdrawal","line":143,"loc":{"start":{"line":143,"column":4},"end":{"line":150,"column":4}}},"6":{"name":"finalizeWithdrawal","line":153,"loc":{"start":{"line":153,"column":4},"end":{"line":170,"column":4}}},"7":{"name":"claim","line":174,"loc":{"start":{"line":174,"column":4},"end":{"line":197,"column":4}}},"8":{"name":"isCollateralized","line":200,"loc":{"start":{"line":200,"column":4},"end":{"line":202,"column":4}}},"9":{"name":"getGasSpent","line":205,"loc":{"start":{"line":205,"column":4},"end":{"line":207,"column":4}}}},"statementMap":{"1":{"start":{"line":69,"column":8},"end":{"line":69,"column":21}},"2":{"start":{"line":80,"column":8},"end":{"line":80,"column":133}},"3":{"start":{"line":81,"column":8},"end":{"line":81,"column":68}},"4":{"start":{"line":83,"column":8},"end":{"line":83,"column":56}},"5":{"start":{"line":84,"column":8},"end":{"line":84,"column":64}},"6":{"start":{"line":90,"column":8},"end":{"line":90,"column":86}},"7":{"start":{"line":91,"column":8},"end":{"line":91,"column":91}},"8":{"start":{"line":95,"column":8},"end":{"line":95,"column":54}},"9":{"start":{"line":97,"column":8},"end":{"line":97,"column":44}},"10":{"start":{"line":98,"column":8},"end":{"line":98,"column":3657}},"11":{"start":{"line":99,"column":12},"end":{"line":99,"column":48}},"12":{"start":{"line":100,"column":12},"end":{"line":100,"column":57}},"13":{"start":{"line":101,"column":12},"end":{"line":101,"column":45}},"14":{"start":{"line":102,"column":15},"end":{"line":102,"column":3863}},"15":{"start":{"line":108,"column":12},"end":{"line":108,"column":57}},"16":{"start":{"line":109,"column":12},"end":{"line":109,"column":45}},"17":{"start":{"line":118,"column":8},"end":{"line":118,"column":4758}},"18":{"start":{"line":123,"column":12},"end":{"line":123,"column":18}},"19":{"start":{"line":127,"column":8},"end":{"line":127,"column":44}},"20":{"start":{"line":133,"column":8},"end":{"line":133,"column":5212}},"21":{"start":{"line":139,"column":8},"end":{"line":139,"column":53}},"22":{"start":{"line":144,"column":8},"end":{"line":144,"column":45}},"23":{"start":{"line":145,"column":8},"end":{"line":145,"column":72}},"24":{"start":{"line":146,"column":8},"end":{"line":146,"column":70}},"25":{"start":{"line":148,"column":8},"end":{"line":148,"column":37}},"26":{"start":{"line":149,"column":8},"end":{"line":149,"column":57}},"27":{"start":{"line":154,"column":8},"end":{"line":154,"column":45}},"28":{"start":{"line":156,"column":8},"end":{"line":156,"column":5998}},"29":{"start":{"line":160,"column":8},"end":{"line":160,"column":63}},"30":{"start":{"line":163,"column":8},"end":{"line":163,"column":44}},"31":{"start":{"line":164,"column":8},"end":{"line":164,"column":35}},"32":{"start":{"line":166,"column":8},"end":{"line":166,"column":6334}},"33":{"start":{"line":175,"column":8},"end":{"line":175,"column":38}},"34":{"start":{"line":176,"column":8},"end":{"line":176,"column":6686}},"35":{"start":{"line":182,"column":8},"end":{"line":182,"column":62}},"36":{"start":{"line":183,"column":8},"end":{"line":183,"column":65}},"37":{"start":{"line":186,"column":8},"end":{"line":186,"column":53}},"38":{"start":{"line":190,"column":8},"end":{"line":190,"column":98}},"39":{"start":{"line":193,"column":8},"end":{"line":193,"column":39}},"40":{"start":{"line":196,"column":8},"end":{"line":196,"column":68}},"41":{"start":{"line":201,"column":8},"end":{"line":201,"column":55}},"42":{"start":{"line":206,"column":8},"end":{"line":206,"column":59}}},"branchMap":{"1":{"line":81,"type":"if","locations":[{"start":{"line":81,"column":8},"end":{"line":81,"column":8}},{"start":{"line":81,"column":8},"end":{"line":81,"column":8}}]},"2":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]},"3":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"4":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"5":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":15},"end":{"line":102,"column":15}},{"start":{"line":102,"column":15},"end":{"line":102,"column":15}}]},"6":{"line":118,"type":"if","locations":[{"start":{"line":118,"column":8},"end":{"line":118,"column":8}},{"start":{"line":118,"column":8},"end":{"line":118,"column":8}}]},"7":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":8}},{"start":{"line":133,"column":8},"end":{"line":133,"column":8}}]},"8":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":145,"column":8}},{"start":{"line":145,"column":8},"end":{"line":145,"column":8}}]},"9":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"10":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"11":{"line":160,"type":"if","locations":[{"start":{"line":160,"column":8},"end":{"line":160,"column":8}},{"start":{"line":160,"column":8},"end":{"line":160,"column":8}}]},"12":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":8},"end":{"line":166,"column":8}},{"start":{"line":166,"column":8},"end":{"line":166,"column":8}}]},"13":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":8},"end":{"line":176,"column":8}},{"start":{"line":176,"column":8},"end":{"line":176,"column":8}}]},"14":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":8},"end":{"line":186,"column":8}},{"start":{"line":186,"column":8},"end":{"line":186,"column":8}}]},"15":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol":{"l":{"74":21,"105":12,"107":12,"108":0,"111":12,"112":12,"114":12,"123":11,"133":10,"138":9,"140":9,"171":6,"172":6,"174":6,"179":5,"184":4,"193":3,"203":2,"208":1,"211":1,"213":1,"241":12,"257":9,"278":1,"279":1,"282":1,"287":1,"290":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol","s":{"1":21,"2":12,"3":12,"4":0,"5":12,"6":12,"7":12,"8":11,"9":10,"10":9,"11":9,"12":6,"13":6,"14":6,"15":5,"16":4,"17":3,"18":2,"19":1,"20":1,"21":1,"22":12,"23":9,"24":1,"25":1,"26":1,"27":1,"28":1},"b":{"1":[0,12],"2":[11,1],"3":[10,1],"4":[9,1],"5":[5,1],"6":[4,1],"7":[3,1],"8":[2,1],"9":[1,1]},"f":{"1":33,"2":21,"3":12,"4":6,"5":12,"6":9,"7":1},"fnMap":{"1":{"name":"constructor","line":50,"loc":{"start":{"line":47,"column":4},"end":{"line":51,"column":5}}},"2":{"name":"getStateTransitioner","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":75,"column":4}}},"3":{"name":"initializeFraudVerification","line":103,"loc":{"start":{"line":92,"column":4},"end":{"line":146,"column":4}}},"4":{"name":"finalizeFraudVerification","line":169,"loc":{"start":{"line":158,"column":4},"end":{"line":219,"column":4}}},"5":{"name":"_hasStateTransitioner","line":231,"loc":{"start":{"line":231,"column":4},"end":{"line":242,"column":4}}},"6":{"name":"_deployTransitioner","line":250,"loc":{"start":{"line":250,"column":4},"end":{"line":265,"column":4}}},"7":{"name":"_cancelStateTransition","line":272,"loc":{"start":{"line":272,"column":4},"end":{"line":295,"column":4}}}},"statementMap":{"1":{"start":{"line":74,"column":8},"end":{"line":74,"column":81}},"2":{"start":{"line":105,"column":8},"end":{"line":105,"column":68}},"3":{"start":{"line":107,"column":8},"end":{"line":107,"column":3959}},"4":{"start":{"line":108,"column":12},"end":{"line":108,"column":18}},"5":{"start":{"line":111,"column":8},"end":{"line":111,"column":122}},"6":{"start":{"line":112,"column":8},"end":{"line":112,"column":142}},"7":{"start":{"line":114,"column":8},"end":{"line":114,"column":4320}},"8":{"start":{"line":123,"column":8},"end":{"line":123,"column":4585}},"9":{"start":{"line":133,"column":8},"end":{"line":133,"column":4878}},"10":{"start":{"line":138,"column":8},"end":{"line":138,"column":76}},"11":{"start":{"line":140,"column":8},"end":{"line":140,"column":5238}},"12":{"start":{"line":171,"column":8},"end":{"line":171,"column":90}},"13":{"start":{"line":172,"column":8},"end":{"line":172,"column":122}},"14":{"start":{"line":174,"column":8},"end":{"line":174,"column":6732}},"15":{"start":{"line":179,"column":8},"end":{"line":179,"column":6888}},"16":{"start":{"line":184,"column":8},"end":{"line":184,"column":7179}},"17":{"start":{"line":193,"column":8},"end":{"line":193,"column":7444}},"18":{"start":{"line":203,"column":8},"end":{"line":203,"column":7814}},"19":{"start":{"line":208,"column":8},"end":{"line":208,"column":71}},"20":{"start":{"line":211,"column":8},"end":{"line":211,"column":142}},"21":{"start":{"line":213,"column":8},"end":{"line":213,"column":8258}},"22":{"start":{"line":241,"column":8},"end":{"line":241,"column":82}},"23":{"start":{"line":257,"column":8},"end":{"line":257,"column":9503}},"24":{"start":{"line":278,"column":8},"end":{"line":278,"column":122}},"25":{"start":{"line":279,"column":8},"end":{"line":279,"column":86}},"26":{"start":{"line":282,"column":8},"end":{"line":282,"column":10441}},"27":{"start":{"line":287,"column":8},"end":{"line":287,"column":116}},"28":{"start":{"line":290,"column":8},"end":{"line":290,"column":10767}}},"branchMap":{"1":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"2":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":8},"end":{"line":114,"column":8}},{"start":{"line":114,"column":8},"end":{"line":114,"column":8}}]},"3":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"4":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":8}},{"start":{"line":133,"column":8},"end":{"line":133,"column":8}}]},"5":{"line":174,"type":"if","locations":[{"start":{"line":174,"column":8},"end":{"line":174,"column":8}},{"start":{"line":174,"column":8},"end":{"line":174,"column":8}}]},"6":{"line":179,"type":"if","locations":[{"start":{"line":179,"column":8},"end":{"line":179,"column":8}},{"start":{"line":179,"column":8},"end":{"line":179,"column":8}}]},"7":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":8},"end":{"line":184,"column":8}},{"start":{"line":184,"column":8},"end":{"line":184,"column":8}}]},"8":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"9":{"line":203,"type":"if","locations":[{"start":{"line":203,"column":8},"end":{"line":203,"column":8}},{"start":{"line":203,"column":8},"end":{"line":203,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol":{"l":{"97":42,"98":42,"99":42,"100":42,"102":42,"117":13,"121":13,"141":0,"156":1,"171":1,"196":2,"205":2,"214":1,"216":1,"220":1,"221":1,"224":0,"228":1,"234":1,"247":0,"268":3,"273":3,"278":2,"279":2,"281":2,"283":0,"286":2,"295":1,"298":1,"303":0,"307":1,"331":1,"340":0,"345":0,"350":0,"355":0,"357":0,"379":2,"384":2,"389":1,"391":1,"401":1,"422":2,"427":1,"428":1,"430":1,"439":1,"442":1,"461":3,"466":2,"471":1},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol","s":{"1":42,"2":42,"3":42,"4":42,"5":42,"6":13,"7":0,"8":1,"9":1,"10":2,"11":2,"12":1,"13":1,"14":1,"15":1,"16":0,"17":1,"18":1,"19":0,"20":3,"21":3,"22":2,"23":2,"24":2,"25":0,"26":2,"27":1,"28":1,"29":0,"30":1,"31":1,"32":0,"33":0,"34":0,"35":0,"36":0,"37":2,"38":2,"39":1,"40":1,"41":1,"42":2,"43":1,"44":1,"45":1,"46":1,"47":1,"48":3,"49":2,"50":1},"b":{"1":[13,0],"2":[2,0],"3":[1,0],"4":[0,1],"5":[1,0],"6":[3,0],"7":[2,1],"8":[0,2],"9":[1,0],"10":[0,1],"11":[0,0],"12":[2,0],"13":[1,1],"14":[1,1],"15":[2,1],"16":[1,1]},"f":{"1":42,"2":13,"3":0,"4":1,"5":1,"6":2,"7":3,"8":1,"9":2,"10":2,"11":3},"fnMap":{"1":{"name":"constructor","line":95,"loc":{"start":{"line":89,"column":4},"end":{"line":103,"column":4}}},"2":{"name":"onlyDuringPhase","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":122,"column":4}}},"3":{"name":"getPreStateRoot","line":133,"loc":{"start":{"line":133,"column":4},"end":{"line":142,"column":4}}},"4":{"name":"getPostStateRoot","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":157,"column":4}}},"5":{"name":"isComplete","line":163,"loc":{"start":{"line":163,"column":4},"end":{"line":172,"column":4}}},"6":{"name":"proveContractState","line":193,"loc":{"start":{"line":185,"column":4},"end":{"line":249,"column":4}}},"7":{"name":"proveStorageSlot","line":265,"loc":{"start":{"line":257,"column":4},"end":{"line":312,"column":4}}},"8":{"name":"applyTransaction","line":329,"loc":{"start":{"line":323,"column":4},"end":{"line":358,"column":4}}},"9":{"name":"commitContractState","line":377,"loc":{"start":{"line":370,"column":4},"end":{"line":404,"column":4}}},"10":{"name":"commitStorageSlot","line":420,"loc":{"start":{"line":412,"column":4},"end":{"line":446,"column":4}}},"11":{"name":"completeTransition","line":459,"loc":{"start":{"line":456,"column":4},"end":{"line":472,"column":4}}}},"statementMap":{"1":{"start":{"line":97,"column":8},"end":{"line":97,"column":51}},"2":{"start":{"line":98,"column":8},"end":{"line":98,"column":35}},"3":{"start":{"line":99,"column":8},"end":{"line":99,"column":36}},"4":{"start":{"line":100,"column":8},"end":{"line":100,"column":41}},"5":{"start":{"line":102,"column":8},"end":{"line":102,"column":107}},"6":{"start":{"line":117,"column":8},"end":{"line":117,"column":4442}},"7":{"start":{"line":141,"column":8},"end":{"line":141,"column":27}},"8":{"start":{"line":156,"column":8},"end":{"line":156,"column":28}},"9":{"start":{"line":171,"column":8},"end":{"line":171,"column":48}},"10":{"start":{"line":196,"column":8},"end":{"line":196,"column":6424}},"11":{"start":{"line":205,"column":8},"end":{"line":205,"column":6778}},"12":{"start":{"line":214,"column":8},"end":{"line":214,"column":7009}},"13":{"start":{"line":216,"column":12},"end":{"line":216,"column":7108}},"14":{"start":{"line":220,"column":12},"end":{"line":220,"column":60}},"15":{"start":{"line":221,"column":12},"end":{"line":221,"column":7300}},"16":{"start":{"line":224,"column":16},"end":{"line":224,"column":78}},"17":{"start":{"line":228,"column":16},"end":{"line":228,"column":7787}},"18":{"start":{"line":234,"column":12},"end":{"line":234,"column":8038}},"19":{"start":{"line":247,"column":12},"end":{"line":247,"column":63}},"20":{"start":{"line":268,"column":8},"end":{"line":268,"column":9237}},"21":{"start":{"line":273,"column":8},"end":{"line":273,"column":9402}},"22":{"start":{"line":278,"column":8},"end":{"line":278,"column":88}},"23":{"start":{"line":279,"column":8},"end":{"line":279,"column":21}},"24":{"start":{"line":281,"column":8},"end":{"line":281,"column":9685}},"25":{"start":{"line":283,"column":12},"end":{"line":283,"column":29}},"26":{"start":{"line":286,"column":12},"end":{"line":286,"column":9989}},"27":{"start":{"line":295,"column":12},"end":{"line":295,"column":10236}},"28":{"start":{"line":298,"column":16},"end":{"line":298,"column":10392}},"29":{"start":{"line":303,"column":16},"end":{"line":303,"column":33}},"30":{"start":{"line":307,"column":8},"end":{"line":307,"column":10652}},"31":{"start":{"line":331,"column":8},"end":{"line":331,"column":11252}},"32":{"start":{"line":340,"column":8},"end":{"line":340,"column":11732}},"33":{"start":{"line":345,"column":8},"end":{"line":345,"column":106}},"34":{"start":{"line":350,"column":8},"end":{"line":350,"column":72}},"35":{"start":{"line":355,"column":8},"end":{"line":355,"column":70}},"36":{"start":{"line":357,"column":8},"end":{"line":357,"column":45}},"37":{"start":{"line":379,"column":8},"end":{"line":379,"column":13348}},"38":{"start":{"line":384,"column":8},"end":{"line":384,"column":13526}},"39":{"start":{"line":389,"column":8},"end":{"line":389,"column":93}},"40":{"start":{"line":391,"column":8},"end":{"line":391,"column":13798}},"41":{"start":{"line":401,"column":8},"end":{"line":401,"column":14153}},"42":{"start":{"line":422,"column":8},"end":{"line":422,"column":14795}},"43":{"start":{"line":427,"column":8},"end":{"line":427,"column":93}},"44":{"start":{"line":428,"column":8},"end":{"line":428,"column":85}},"45":{"start":{"line":430,"column":8},"end":{"line":430,"column":15172}},"46":{"start":{"line":439,"column":8},"end":{"line":439,"column":63}},"47":{"start":{"line":442,"column":8},"end":{"line":442,"column":15596}},"48":{"start":{"line":461,"column":8},"end":{"line":461,"column":16010}},"49":{"start":{"line":466,"column":8},"end":{"line":466,"column":16180}},"50":{"start":{"line":471,"column":8},"end":{"line":471,"column":39}}},"branchMap":{"1":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":8},"end":{"line":117,"column":8}},{"start":{"line":117,"column":8},"end":{"line":117,"column":8}}]},"2":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]},"3":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]},"4":{"line":221,"type":"if","locations":[{"start":{"line":221,"column":12},"end":{"line":221,"column":12}},{"start":{"line":221,"column":12},"end":{"line":221,"column":12}}]},"5":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":16},"end":{"line":228,"column":16}},{"start":{"line":228,"column":16},"end":{"line":228,"column":16}}]},"6":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":8},"end":{"line":268,"column":8}},{"start":{"line":268,"column":8},"end":{"line":268,"column":8}}]},"7":{"line":273,"type":"if","locations":[{"start":{"line":273,"column":8},"end":{"line":273,"column":8}},{"start":{"line":273,"column":8},"end":{"line":273,"column":8}}]},"8":{"line":281,"type":"if","locations":[{"start":{"line":281,"column":8},"end":{"line":281,"column":8}},{"start":{"line":281,"column":8},"end":{"line":281,"column":8}}]},"9":{"line":295,"type":"if","locations":[{"start":{"line":295,"column":12},"end":{"line":295,"column":12}},{"start":{"line":295,"column":12},"end":{"line":295,"column":12}}]},"10":{"line":331,"type":"if","locations":[{"start":{"line":331,"column":8},"end":{"line":331,"column":8}},{"start":{"line":331,"column":8},"end":{"line":331,"column":8}}]},"11":{"line":340,"type":"if","locations":[{"start":{"line":340,"column":8},"end":{"line":340,"column":8}},{"start":{"line":340,"column":8},"end":{"line":340,"column":8}}]},"12":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"13":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":8},"end":{"line":384,"column":8}},{"start":{"line":384,"column":8},"end":{"line":384,"column":8}}]},"14":{"line":422,"type":"if","locations":[{"start":{"line":422,"column":8},"end":{"line":422,"column":8}},{"start":{"line":422,"column":8},"end":{"line":422,"column":8}}]},"15":{"line":461,"type":"if","locations":[{"start":{"line":461,"column":8},"end":{"line":461,"column":8}},{"start":{"line":461,"column":8},"end":{"line":461,"column":8}}]},"16":{"line":466,"type":"if","locations":[{"start":{"line":466,"column":8},"end":{"line":466,"column":8}},{"start":{"line":466,"column":8},"end":{"line":466,"column":8}}]}}}, -"contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol":{"l":{"56":1,"60":0},"path":"/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol","s":{"1":1,"2":0},"b":{"1":[0,1]},"f":{"1":3,"2":1},"fnMap":{"1":{"name":"constructor","line":29,"loc":{"start":{"line":26,"column":4},"end":{"line":30,"column":5}}},"2":{"name":"create","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":66,"column":4}}}},"statementMap":{"1":{"start":{"line":56,"column":8},"end":{"line":56,"column":1919}},"2":{"start":{"line":60,"column":8},"end":{"line":60,"column":2068}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]}}}} diff --git a/coverage/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html b/coverage/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html deleted file mode 100644 index 5fa3e67a7..000000000 --- a/coverage/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - Code coverage report for iOVM/accounts/iOVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / iOVM/accounts/ iOVM_ECDSAContractAccount.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_ECDSAContractAccount
- */
-interface iOVM_ECDSAContractAccount {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    ) external returns (bool _success, bytes memory _returndata);
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/accounts/index.html b/coverage/iOVM/accounts/index.html deleted file mode 100644 index 62cb35f7b..000000000 --- a/coverage/iOVM/accounts/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for iOVM/accounts/ - - - - - - - -
-
-

- all files iOVM/accounts/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_ECDSAContractAccount.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html b/coverage/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html deleted file mode 100644 index 4426f72ea..000000000 --- a/coverage/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / iOVM/bridge/messaging/ iAbs_BaseCrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iAbs_BaseCrossDomainMessenger
- */
-interface iAbs_BaseCrossDomainMessenger {
- 
-    /**********
-     * Events *
-     **********/
-    event SentMessage(bytes message);
-    event RelayedMessage(bytes32 msgHash);
- 
-    /**********************
-     * Contract Variables *
-     **********************/
-    function xDomainMessageSender() external view returns (address);
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sends a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _message Message to send to the target.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function sendMessage(
-        address _target,
-        bytes calldata _message,
-        uint32 _gasLimit
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html b/coverage/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html deleted file mode 100644 index 7e00c950c..000000000 --- a/coverage/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / iOVM/bridge/messaging/ iOVM_L1CrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title iOVM_L1CrossDomainMessenger
- */
-interface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    struct L2MessageInclusionProof {
-        bytes32 stateRoot;
-        Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;
-        Lib_OVMCodec.ChainInclusionProof stateRootProof;
-        bytes stateTrieWitness;
-        bytes storageTrieWitness;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @param _proof Inclusion proof for the given message.
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        L2MessageInclusionProof memory _proof
-    ) external;
- 
-    /**
-     * Replays a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _sender Original sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function replayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        uint32 _gasLimit
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html b/coverage/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html deleted file mode 100644 index b32e59d35..000000000 --- a/coverage/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol - - - - - - - -
-
-

- all files / iOVM/bridge/messaging/ iOVM_L1MultiMessageRelayer.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-interface iOVM_L1MultiMessageRelayer {
- 
-    struct L2ToL1Message {
-        address target;
-        address sender;
-        bytes message;
-        uint256 messageNonce;
-        iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;
-    }
- 
-    function batchRelayMessages(L2ToL1Message[] calldata _messages) external; 
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html b/coverage/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html deleted file mode 100644 index cf02333cc..000000000 --- a/coverage/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / iOVM/bridge/messaging/ iOVM_L2CrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title iOVM_L2CrossDomainMessenger
- */
-interface iOVM_L2CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/bridge/messaging/index.html b/coverage/iOVM/bridge/messaging/index.html deleted file mode 100644 index 58a002500..000000000 --- a/coverage/iOVM/bridge/messaging/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/ - - - - - - - -
-
-

- all files iOVM/bridge/messaging/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iAbs_BaseCrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MultiMessageRelayer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html b/coverage/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html deleted file mode 100644 index 84ad6f409..000000000 --- a/coverage/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - Code coverage report for iOVM/bridge/tokens/iOVM_L1ETHGateway.sol - - - - - - - -
-
-

- all files / iOVM/bridge/tokens/ iOVM_L1ETHGateway.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L1ETHGateway
- */
-interface iOVM_L1ETHGateway {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event DepositInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
- 
-    event WithdrawalFinalized(
-        address indexed _to,
-        uint256 _amount
-    );
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function deposit()
-        external
-        payable;
- 
-    function depositTo(
-        address _to
-    )
-        external
-        payable;
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external;
- 
-    function getFinalizeDepositL2Gas()
-        external
-        view
-        returns(
-            uint32
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html b/coverage/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html deleted file mode 100644 index 1a088713e..000000000 --- a/coverage/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Code coverage report for iOVM/bridge/tokens/iOVM_L1TokenGateway.sol - - - - - - - -
-
-

- all files / iOVM/bridge/tokens/ iOVM_L1TokenGateway.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L1TokenGateway
- */
-interface iOVM_L1TokenGateway {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event DepositInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
-  
-    event WithdrawalFinalized(
-        address indexed _to,
-        uint256 _amount
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function deposit(
-        uint _amount
-    )
-        external;
- 
-    function depositTo(
-        address _to,
-        uint _amount
-    )
-        external;
- 
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html b/coverage/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html deleted file mode 100644 index 8c248edb0..000000000 --- a/coverage/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Code coverage report for iOVM/bridge/tokens/iOVM_L2DepositedToken.sol - - - - - - - -
-
-

- all files / iOVM/bridge/tokens/ iOVM_L2DepositedToken.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L2DepositedToken
- */
-interface iOVM_L2DepositedToken {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event WithdrawalInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
- 
-    event DepositFinalized(
-        address indexed _to,
-        uint256 _amount
-    );    
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function withdraw(
-        uint _amount
-    )
-        external;
- 
-    function withdrawTo(
-        address _to,
-        uint _amount
-    )
-        external;
- 
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/bridge/tokens/index.html b/coverage/iOVM/bridge/tokens/index.html deleted file mode 100644 index 1ad5e98f3..000000000 --- a/coverage/iOVM/bridge/tokens/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for iOVM/bridge/tokens/ - - - - - - - -
-
-

- all files iOVM/bridge/tokens/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_L1ETHGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1TokenGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2DepositedToken.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html b/coverage/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html deleted file mode 100644 index 03738305b..000000000 --- a/coverage/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html +++ /dev/null @@ -1,782 +0,0 @@ - - - - Code coverage report for iOVM/chain/iOVM_CanonicalTransactionChain.sol - - - - - - - -
-
-

- all files / iOVM/chain/ iOVM_CanonicalTransactionChain.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_ChainStorageContainer } from "./iOVM_ChainStorageContainer.sol";
- 
-/**
- * @title iOVM_CanonicalTransactionChain
- */
-interface iOVM_CanonicalTransactionChain {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event TransactionEnqueued(
-        address _l1TxOrigin,
-        address _target,
-        uint256 _gasLimit,
-        bytes _data,
-        uint256 _queueIndex,
-        uint256 _timestamp
-    );
- 
-    event QueueBatchAppended(
-        uint256 _startingQueueIndex,
-        uint256 _numQueueElements,
-        uint256 _totalElements
-    );
- 
-    event SequencerBatchAppended(
-        uint256 _startingQueueIndex,
-        uint256 _numQueueElements,
-        uint256 _totalElements
-    );
- 
-    event TransactionBatchAppended(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot,
-        uint256 _batchSize,
-        uint256 _prevTotalElements,
-        bytes _extraData
-    );
- 
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct BatchContext {
-        uint256 numSequencedTransactions;
-        uint256 numSubsequentQueueTransactions;
-        uint256 timestamp;
-        uint256 blockNumber;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        external
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        );
- 
-    /**
-     * Accesses the queue storage container.
-     * @return Reference to the queue storage container.
-     */
-    function queue()
-        external
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        );
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        external
-        view
-        returns (
-            uint256 _totalElements
-        );
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        external
-        view
-        returns (
-            uint256 _totalBatches
-        );
- 
-    /**
-     * Returns the index of the next element to be enqueued.
-     * @return Index for the next queue element.
-     */
-    function getNextQueueIndex()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function getQueueElement(
-        uint256 _index
-    )
-        external
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        );
- 
-    /**
-     * Returns the timestamp of the last transaction.
-     * @return Timestamp for the last transaction.
-     */
-    function getLastTimestamp()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Returns the blocknumber of the last transaction.
-     * @return Blocknumber for the last transaction.
-     */
-    function getLastBlockNumber()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Get the number of queue elements which have not yet been included.
-     * @return Number of pending queue elements.
-     */
-    function getNumPendingQueueElements()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Retrieves the length of the queue, including
-     * both pending and canonical transactions.
-     * @return Length of the queue.
-     */
-    function getQueueLength()
-        external
-        view
-        returns (
-            uint40
-        );
- 
- 
-    /**
-     * Adds a transaction to the queue.
-     * @param _target Target contract to send the transaction to.
-     * @param _gasLimit Gas limit for the given transaction.
-     * @param _data Transaction data.
-     */
-    function enqueue(
-        address _target,
-        uint256 _gasLimit,
-        bytes memory _data
-    )
-        external;
- 
-    /**
-     * Appends a given number of queued transactions as a single batch.
-     * @param _numQueuedTransactions Number of transactions to append.
-     */
-    function appendQueueBatch(
-        uint256 _numQueuedTransactions
-    )
-        external;
- 
-    /**
-     * Allows the sequencer to append a batch of transactions.
-     * @dev This function uses a custom encoding scheme for efficiency reasons.
-     * .param _shouldStartAtElement Specific batch we expect to start appending to.
-     * .param _totalElementsToAppend Total number of batch elements we expect to append.
-     * .param _contexts Array of batch contexts.
-     * .param _transactionDataFields Array of raw transaction data.
-     */
-    function appendSequencerBatch(
-        // uint40 _shouldStartAtElement,
-        // uint24 _totalElementsToAppend,
-        // BatchContext[] _contexts,
-        // bytes[] _transactionDataFields
-    )
-        external;
- 
-    /**
-     * Verifies whether a transaction is included in the chain.
-     * @param _transaction Transaction to verify.
-     * @param _txChainElement Transaction chain element corresponding to the transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
-     * @return True if the transaction exists in the CTC, false if not.
-     */
-    function verifyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        external
-        view
-        returns (
-            bool
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/chain/iOVM_ChainStorageContainer.sol.html b/coverage/iOVM/chain/iOVM_ChainStorageContainer.sol.html deleted file mode 100644 index 382c309c4..000000000 --- a/coverage/iOVM/chain/iOVM_ChainStorageContainer.sol.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - Code coverage report for iOVM/chain/iOVM_ChainStorageContainer.sol - - - - - - - -
-
-

- all files / iOVM/chain/ iOVM_ChainStorageContainer.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_ChainStorageContainer
- */
-interface iOVM_ChainStorageContainer {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sets the container's global metadata field. We're using `bytes27` here because we use five
-     * bytes to maintain the length of the underlying data structure, meaning we have an extra
-     * 27 bytes to store arbitrary data.
-     * @param _globalMetadata New global metadata to set.
-     */
-    function setGlobalMetadata(
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Retrieves the container's global metadata field.
-     * @return Container global metadata field.
-     */
-    function getGlobalMetadata()
-        external
-        view
-        returns (
-            bytes27
-        );
- 
-    /**
-     * Retrieves the number of objects stored in the container.
-     * @return Number of objects in the container.
-     */
-    function length()
-        external
-        view
-        returns (
-            uint256
-        );
- 
-    /**
-     * Pushes an object into the container.
-     * @param _object A 32 byte value to insert into the container.
-     */
-    function push(
-        bytes32 _object
-    )
-        external;
- 
-    /**
-     * Pushes an object into the container. Function allows setting the global metadata since
-     * we'll need to touch the "length" storage slot anyway, which also contains the global
-     * metadata (it's an optimization).
-     * @param _object A 32 byte value to insert into the container.
-     * @param _globalMetadata New global metadata for the container.
-     */
-    function push(
-        bytes32 _object,
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Retrieves an object from the container.
-     * @param _index Index of the particular object to access.
-     * @return 32 byte object value.
-     */
-    function get(
-        uint256 _index
-    )
-        external
-        view
-        returns (
-            bytes32
-        );
- 
-    /**
-     * Removes all objects after and including a given index.
-     * @param _index Object index to delete from.
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index
-    )
-        external;
- 
-    /**
-     * Removes all objects after and including a given index. Also allows setting the global
-     * metadata field.
-     * @param _index Object index to delete from.
-     * @param _globalMetadata New global metadata for the container.
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index,
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Marks an index as overwritable, meaing the underlying buffer can start to write values over
-     * any objects before and including the given index.
-     */
-    function setNextOverwritableIndex(
-        uint256 _index
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/chain/iOVM_StateCommitmentChain.sol.html b/coverage/iOVM/chain/iOVM_StateCommitmentChain.sol.html deleted file mode 100644 index 713fcd358..000000000 --- a/coverage/iOVM/chain/iOVM_StateCommitmentChain.sol.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - Code coverage report for iOVM/chain/iOVM_StateCommitmentChain.sol - - - - - - - -
-
-

- all files / iOVM/chain/ iOVM_StateCommitmentChain.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateCommitmentChain
- */
-interface iOVM_StateCommitmentChain {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event StateBatchAppended(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot,
-        uint256 _batchSize,
-        uint256 _prevTotalElements,
-        bytes _extraData
-    );
- 
-    event StateBatchDeleted(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        external
-        view
-        returns (
-            uint256 _totalElements
-        );
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        external
-        view
-        returns (
-            uint256 _totalBatches
-        );
- 
-    /**
-     * Retrieves the timestamp of the last batch submitted by the sequencer.
-     * @return _lastSequencerTimestamp Last sequencer batch timestamp.
-     */
-    function getLastSequencerTimestamp()
-        external
-        view
-        returns (
-            uint256 _lastSequencerTimestamp
-        );
- 
-    /**
-     * Appends a batch of state roots to the chain.
-     * @param _batch Batch of state roots.
-     * @param _shouldStartAtElement Index of the element at which this batch should start.
-     */
-    function appendStateBatch(
-        bytes32[] calldata _batch,
-        uint256 _shouldStartAtElement
-    )
-        external;
- 
-    /**
-     * Deletes all state roots after (and including) a given batch.
-     * @param _batchHeader Header of the batch to start deleting from.
-     */
-    function deleteStateBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        external;
- 
-    /**
-     * Verifies a batch inclusion proof.
-     * @param _element Hash of the element to verify a proof for.
-     * @param _batchHeader Header of the batch in which the element was included.
-     * @param _proof Merkle inclusion proof for the element.
-     */
-    function verifyStateCommitment(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        external
-        view
-        returns (
-            bool _verified
-        );
- 
-    /**
-     * Checks whether a given batch is still inside its fraud proof window.
-     * @param _batchHeader Header of the batch to check.
-     * @return _inside Whether or not the batch is inside the fraud proof window.
-     */
-    function insideFraudProofWindow(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        external
-        view
-        returns (
-            bool _inside
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/chain/index.html b/coverage/iOVM/chain/index.html deleted file mode 100644 index bba16e950..000000000 --- a/coverage/iOVM/chain/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for iOVM/chain/ - - - - - - - -
-
-

- all files iOVM/chain/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_CanonicalTransactionChain.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ChainStorageContainer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateCommitmentChain.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/iOVM/execution/iOVM_ExecutionManager.sol.html b/coverage/iOVM/execution/iOVM_ExecutionManager.sol.html deleted file mode 100644 index 18c089ea7..000000000 --- a/coverage/iOVM/execution/iOVM_ExecutionManager.sol.html +++ /dev/null @@ -1,533 +0,0 @@ - - - - Code coverage report for iOVM/execution/iOVM_ExecutionManager.sol - - - - - - - -
-
-

- all files / iOVM/execution/ iOVM_ExecutionManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-interface iOVM_ExecutionManager {
-    /**********
-     * Enums *
-     *********/
- 
-    enum RevertFlag {
-        OUT_OF_GAS,
-        INTENTIONAL_REVERT,
-        EXCEEDS_NUISANCE_GAS,
-        INVALID_STATE_ACCESS,
-        UNSAFE_BYTECODE,
-        CREATE_COLLISION,
-        STATIC_VIOLATION,
-        CREATOR_NOT_ALLOWED
-    }
- 
-    enum GasMetadataKey {
-        CURRENT_EPOCH_START_TIMESTAMP,
-        CUMULATIVE_SEQUENCER_QUEUE_GAS,
-        CUMULATIVE_L1TOL2_QUEUE_GAS,
-        PREV_EPOCH_SEQUENCER_QUEUE_GAS,
-        PREV_EPOCH_L1TOL2_QUEUE_GAS
-    }
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct GasMeterConfig {
-        uint256 minTransactionGasLimit;
-        uint256 maxTransactionGasLimit;
-        uint256 maxGasPerQueuePerEpoch;
-        uint256 secondsPerEpoch;
-    }
- 
-    struct GlobalContext {
-        uint256 ovmCHAINID;
-    }
- 
-    struct TransactionContext {
-        Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;
-        uint256 ovmTIMESTAMP;
-        uint256 ovmNUMBER;
-        uint256 ovmGASLIMIT;
-        uint256 ovmTXGASLIMIT;
-        address ovmL1TXORIGIN;
-    }
- 
-    struct TransactionRecord {
-        uint256 ovmGasRefund;
-    }
- 
-    struct MessageContext {
-        address ovmCALLER;
-        address ovmADDRESS;
-        bool isStatic;
-    }
- 
-    struct MessageRecord {
-        uint256 nuisanceGasLeft;
-    }
- 
- 
-    /************************************
-     * Transaction Execution Entrypoint *
-     ************************************/
- 
-    function run(
-        Lib_OVMCodec.Transaction calldata _transaction,
-        address _txStateManager
-    ) external;
- 
- 
-    /*******************
-     * Context Opcodes *
-     *******************/
- 
-    function ovmCALLER() external view returns (address _caller);
-    function ovmADDRESS() external view returns (address _address);
-    function ovmTIMESTAMP() external view returns (uint256 _timestamp);
-    function ovmNUMBER() external view returns (uint256 _number);
-    function ovmGASLIMIT() external view returns (uint256 _gasLimit);
-    function ovmCHAINID() external view returns (uint256 _chainId);
- 
- 
-    /**********************
-     * L2 Context Opcodes *
-     **********************/
- 
-    function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
-    function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
- 
- 
-    /*******************
-     * Halting Opcodes *
-     *******************/
- 
-    function ovmREVERT(bytes memory _data) external;
- 
- 
-    /*****************************
-     * Contract Creation Opcodes *
-     *****************************/
- 
-    function ovmCREATE(bytes memory _bytecode) external returns (address _contract, bytes memory _revertdata);
-    function ovmCREATE2(bytes memory _bytecode, bytes32 _salt) external returns (address _contract, bytes memory _revertdata);
- 
- 
-    /*******************************
-     * Account Abstraction Opcodes *
-     ******************************/
- 
-    function ovmGETNONCE() external returns (uint256 _nonce);
-    function ovmSETNONCE(uint256 _nonce) external;
-    function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
- 
- 
-    /****************************
-     * Contract Calling Opcodes *
-     ****************************/
- 
-    function ovmCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
-    function ovmSTATICCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
-    function ovmDELEGATECALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
- 
- 
-    /****************************
-     * Contract Storage Opcodes *
-     ****************************/
- 
-    function ovmSLOAD(bytes32 _key) external returns (bytes32 _value);
-    function ovmSSTORE(bytes32 _key, bytes32 _value) external;
- 
- 
-    /*************************
-     * Contract Code Opcodes *
-     *************************/
- 
-    function ovmEXTCODECOPY(address _contract, uint256 _offset, uint256 _length) external returns (bytes memory _code);
-    function ovmEXTCODESIZE(address _contract) external returns (uint256 _size);
-    function ovmEXTCODEHASH(address _contract) external returns (bytes32 _hash);
- 
- 
-    /***************************************
-     * Public Functions: Execution Context *
-     ***************************************/
- 
-    function getMaxTransactionGasLimit() external view returns (uint _maxTransactionGasLimit);
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/execution/iOVM_SafetyChecker.sol.html b/coverage/iOVM/execution/iOVM_SafetyChecker.sol.html deleted file mode 100644 index 32921e244..000000000 --- a/coverage/iOVM/execution/iOVM_SafetyChecker.sol.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Code coverage report for iOVM/execution/iOVM_SafetyChecker.sol - - - - - - - -
-
-

- all files / iOVM/execution/ iOVM_SafetyChecker.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_SafetyChecker
- */
-interface iOVM_SafetyChecker {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/execution/iOVM_StateManager.sol.html b/coverage/iOVM/execution/iOVM_StateManager.sol.html deleted file mode 100644 index 10e5b015f..000000000 --- a/coverage/iOVM/execution/iOVM_StateManager.sol.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - Code coverage report for iOVM/execution/iOVM_StateManager.sol - - - - - - - -
-
-

- all files / iOVM/execution/ iOVM_StateManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateManager
- */
-interface iOVM_StateManager {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum ItemState {
-        ITEM_UNTOUCHED,
-        ITEM_LOADED,
-        ITEM_CHANGED,
-        ITEM_COMMITTED
-    }
- 
-    /***************************
-     * Public Functions: Misc *
-     ***************************/
- 
-    function isAuthenticated(address _address) external view returns (bool);
- 
-    /***************************
-     * Public Functions: Setup *
-     ***************************/
- 
-    function owner() external view returns (address _owner);
-    function ovmExecutionManager() external view returns (address _ovmExecutionManager);
-    function setExecutionManager(address _ovmExecutionManager) external;
- 
- 
-    /************************************
-     * Public Functions: Account Access *
-     ************************************/
- 
-    function putAccount(address _address, Lib_OVMCodec.Account memory _account) external;
-    function putEmptyAccount(address _address) external;
-    function getAccount(address _address) external view returns (Lib_OVMCodec.Account memory _account);
-    function hasAccount(address _address) external view returns (bool _exists);
-    function hasEmptyAccount(address _address) external view returns (bool _exists);
-    function setAccountNonce(address _address, uint256 _nonce) external;
-    function getAccountNonce(address _address) external view returns (uint256 _nonce);
-    function getAccountEthAddress(address _address) external view returns (address _ethAddress);
-    function getAccountStorageRoot(address _address) external view returns (bytes32 _storageRoot);
-    function initPendingAccount(address _address) external;
-    function commitPendingAccount(address _address, address _ethAddress, bytes32 _codeHash) external;
-    function testAndSetAccountLoaded(address _address) external returns (bool _wasAccountAlreadyLoaded);
-    function testAndSetAccountChanged(address _address) external returns (bool _wasAccountAlreadyChanged);
-    function commitAccount(address _address) external returns (bool _wasAccountCommitted);
-    function incrementTotalUncommittedAccounts() external;
-    function getTotalUncommittedAccounts() external view returns (uint256 _total);
-    function wasAccountChanged(address _address) external view returns (bool);
-    function wasAccountCommitted(address _address) external view returns (bool);
- 
- 
-    /************************************
-     * Public Functions: Storage Access *
-     ************************************/
- 
-    function putContractStorage(address _contract, bytes32 _key, bytes32 _value) external;
-    function getContractStorage(address _contract, bytes32 _key) external view returns (bytes32 _value);
-    function hasContractStorage(address _contract, bytes32 _key) external view returns (bool _exists);
-    function testAndSetContractStorageLoaded(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyLoaded);
-    function testAndSetContractStorageChanged(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyChanged);
-    function commitContractStorage(address _contract, bytes32 _key) external returns (bool _wasContractStorageCommitted);
-    function incrementTotalUncommittedContractStorage() external;
-    function getTotalUncommittedContractStorage() external view returns (uint256 _total);
-    function wasContractStorageChanged(address _contract, bytes32 _key) external view returns (bool);
-    function wasContractStorageCommitted(address _contract, bytes32 _key) external view returns (bool);
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/execution/iOVM_StateManagerFactory.sol.html b/coverage/iOVM/execution/iOVM_StateManagerFactory.sol.html deleted file mode 100644 index ccc0b1d51..000000000 --- a/coverage/iOVM/execution/iOVM_StateManagerFactory.sol.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - Code coverage report for iOVM/execution/iOVM_StateManagerFactory.sol - - - - - - - -
-
-

- all files / iOVM/execution/ iOVM_StateManagerFactory.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { iOVM_StateManager } from "./iOVM_StateManager.sol";
- 
-/**
- * @title iOVM_StateManagerFactory
- */
-interface iOVM_StateManagerFactory {
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    function create(
-        address _owner
-    )
-        external
-        returns (
-            iOVM_StateManager _ovmStateManager
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/execution/index.html b/coverage/iOVM/execution/index.html deleted file mode 100644 index 920d0dec2..000000000 --- a/coverage/iOVM/execution/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for iOVM/execution/ - - - - - - - -
-
-

- all files iOVM/execution/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_ExecutionManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_SafetyChecker.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManagerFactory.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html b/coverage/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html deleted file mode 100644 index 32c1ad98b..000000000 --- a/coverage/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/iOVM_DeployerWhitelist.sol - - - - - - - -
-
-

- all files / iOVM/predeploys/ iOVM_DeployerWhitelist.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_DeployerWhitelist
- */
-interface iOVM_DeployerWhitelist {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function initialize(address _owner, bool _allowArbitraryDeployment) external;
-    function getOwner() external returns (address _owner);
-    function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;
-    function setOwner(address _newOwner) external;
-    function setAllowArbitraryDeployment(bool _allowArbitraryDeployment) external;
-    function enableArbitraryContractDeployment() external;
-    function isDeployerAllowed(address _deployer) external returns (bool _allowed);
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/predeploys/iOVM_ERC20.sol.html b/coverage/iOVM/predeploys/iOVM_ERC20.sol.html deleted file mode 100644 index b9619f473..000000000 --- a/coverage/iOVM/predeploys/iOVM_ERC20.sol.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/iOVM_ERC20.sol - - - - - - - -
-
-

- all files / iOVM/predeploys/ iOVM_ERC20.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_ERC20
- */
-interface iOVM_ERC20 {
-    /* This is a slight change to the ERC20 base standard.
-    function totalSupply() constant returns (uint256 supply);
-    is replaced with:
-    uint256 public totalSupply;
-    This automatically creates a getter function for the totalSupply.
-    This is moved to the base contract since public getter functions are not
-    currently recognised as an implementation of the matching abstract
-    function by the compiler.
-    */
-    /// total amount of tokens
-    function totalSupply() external view returns (uint256);
- 
-    /// @param _owner The address from which the balance will be retrieved
-    /// @return balance The balance
-    function balanceOf(address _owner) external view returns (uint256 balance);
- 
-    /// @notice send `_value` token to `_to` from `msg.sender`
-    /// @param _to The address of the recipient
-    /// @param _value The amount of token to be transferred
-    /// @return success Whether the transfer was successful or not
-    function transfer(address _to, uint256 _value) external returns (bool success);
- 
-    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
-    /// @param _from The address of the sender
-    /// @param _to The address of the recipient
-    /// @param _value The amount of token to be transferred
-    /// @return success Whether the transfer was successful or not
-    function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
- 
-    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
-    /// @param _spender The address of the account able to transfer the tokens
-    /// @param _value The amount of tokens to be approved for transfer
-    /// @return success Whether the approval was successful or not
-    function approve(address _spender, uint256 _value) external returns (bool success);
- 
-    /// @param _owner The address of the account owning tokens
-    /// @param _spender The address of the account able to transfer the tokens
-    /// @return remaining Amount of remaining tokens allowed to spent
-    function allowance(address _owner, address _spender) external view returns (uint256 remaining);
- 
-    // solhint-disable-next-line no-simple-event-func-name
-    event Transfer(address indexed _from, address indexed _to, uint256 _value);
-    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
-    event Mint(address indexed _account, uint256 _amount);
-    event Burn(address indexed _account, uint256 _amount);
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/predeploys/iOVM_L1MessageSender.sol.html b/coverage/iOVM/predeploys/iOVM_L1MessageSender.sol.html deleted file mode 100644 index 1fb36e2dd..000000000 --- a/coverage/iOVM/predeploys/iOVM_L1MessageSender.sol.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/iOVM_L1MessageSender.sol - - - - - - - -
-
-

- all files / iOVM/predeploys/ iOVM_L1MessageSender.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_L1MessageSender
- */
-interface iOVM_L1MessageSender {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function getL1MessageSender() external view returns (address _l1MessageSender);
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html b/coverage/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html deleted file mode 100644 index d43cbd99b..000000000 --- a/coverage/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol - - - - - - - -
-
-

- all files / iOVM/predeploys/ iOVM_L2ToL1MessagePasser.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_L2ToL1MessagePasser
- */
-interface iOVM_L2ToL1MessagePasser {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event L2ToL1Message(
-        uint256 _nonce,
-        address _sender,
-        bytes _data
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function passMessageToL1(bytes calldata _message) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/predeploys/index.html b/coverage/iOVM/predeploys/index.html deleted file mode 100644 index d766508c8..000000000 --- a/coverage/iOVM/predeploys/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/ - - - - - - - -
-
-

- all files iOVM/predeploys/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_DeployerWhitelist.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ERC20.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MessageSender.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2ToL1MessagePasser.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/iOVM/verification/iOVM_BondManager.sol.html b/coverage/iOVM/verification/iOVM_BondManager.sol.html deleted file mode 100644 index 8d7748deb..000000000 --- a/coverage/iOVM/verification/iOVM_BondManager.sol.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - Code coverage report for iOVM/verification/iOVM_BondManager.sol - - - - - - - -
-
-

- all files / iOVM/verification/ iOVM_BondManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-interface ERC20 {
-    function transfer(address, uint256) external returns (bool);
-    function transferFrom(address, address, uint256) external returns (bool);
-}
- 
-/// All the errors which may be encountered on the bond manager
-library Errors {
-    string constant ERC20_ERR = "BondManager: Could not post bond";
-    string constant ALREADY_FINALIZED = "BondManager: Fraud proof for this pre-state root has already been finalized";
-    string constant SLASHED = "BondManager: Cannot finalize withdrawal, you probably got slashed";
-    string constant WRONG_STATE = "BondManager: Wrong bond state for proposer";
-    string constant CANNOT_CLAIM = "BondManager: Cannot claim yet. Dispute must be finalized first";
- 
-    string constant WITHDRAWAL_PENDING = "BondManager: Withdrawal already pending";
-    string constant TOO_EARLY = "BondManager: Too early to finalize your withdrawal";
- 
-    string constant ONLY_TRANSITIONER = "BondManager: Only the transitioner for this pre-state root may call this function";
-    string constant ONLY_FRAUD_VERIFIER = "BondManager: Only the fraud verifier may call this function";
-    string constant ONLY_STATE_COMMITMENT_CHAIN = "BondManager: Only the state commitment chain may call this function";
-    string constant WAIT_FOR_DISPUTES = "BondManager: Wait for other potential disputes";
-}
- 
-/**
- * @title iOVM_BondManager
- */
-interface iOVM_BondManager {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    /// The lifecycle of a proposer's bond
-    enum State {
-        // Before depositing or after getting slashed, a user is uncollateralized
-        NOT_COLLATERALIZED,
-        // After depositing, a user is collateralized
-        COLLATERALIZED,
-        // After a user has initiated a withdrawal
-        WITHDRAWING
-    }
- 
-    /// A bond posted by a proposer
-    struct Bond {
-        // The user's state
-        State state;
-        // The timestamp at which a proposer issued their withdrawal request
-        uint32 withdrawalTimestamp;
-        // The time when the first disputed was initiated for this bond
-        uint256 firstDisputeAt;
-        // The earliest observed state root for this bond which has had fraud
-        bytes32 earliestDisputedStateRoot;
-        // The state root's timestamp
-        uint256 earliestTimestamp;
-    }
- 
-    // Per pre-state root, store the number of state provisions that were made
-    // and how many of these calls were made by each user. Payouts will then be
-    // claimed by users proportionally for that dispute.
-    struct Rewards {
-        // Flag to check if rewards for a fraud proof are claimable
-        bool canClaim;
-        // Total number of `recordGasSpent` calls made
-        uint256 total;
-        // The gas spent by each user to provide witness data. The sum of all
-        // values inside this map MUST be equal to the value of `total`
-        mapping(address => uint256) gasSpent;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function recordGasSpent(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        address _who,
-        uint256 _gasSpent
-    ) external;
- 
-    function finalize(
-        bytes32 _preStateRoot,
-        address _publisher,
-        uint256 _timestamp
-    ) external;
- 
-    function deposit() external;
- 
-    function startWithdrawal() external;
- 
-    function finalizeWithdrawal() external;
- 
-    function claim(
-        address _who
-    ) external;
- 
-    function isCollateralized(
-        address _who
-    ) external view returns (bool);
- 
-    function getGasSpent(
-        bytes32 _preStateRoot,
-        address _who
-    ) external view returns (uint256);
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/verification/iOVM_FraudVerifier.sol.html b/coverage/iOVM/verification/iOVM_FraudVerifier.sol.html deleted file mode 100644 index a3b2ed104..000000000 --- a/coverage/iOVM/verification/iOVM_FraudVerifier.sol.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - Code coverage report for iOVM/verification/iOVM_FraudVerifier.sol - - - - - - - -
-
-

- all files / iOVM/verification/ iOVM_FraudVerifier.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
- 
-/**
- * @title iOVM_FraudVerifier
- */
-interface iOVM_FraudVerifier {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event FraudProofInitialized(
-        bytes32 _preStateRoot,
-        uint256 _preStateRootIndex,
-        bytes32 _transactionHash,
-        address _who
-    );
- 
-    event FraudProofFinalized(
-        bytes32 _preStateRoot,
-        uint256 _preStateRootIndex,
-        bytes32 _transactionHash,
-        address _who
-    );
- 
- 
-    /***************************************
-     * Public Functions: Transition Status *
-     ***************************************/
- 
-    function getStateTransitioner(bytes32 _preStateRoot, bytes32 _txHash) external view returns (iOVM_StateTransitioner _transitioner);
- 
- 
-    /****************************************
-     * Public Functions: Fraud Verification *
-     ****************************************/
- 
-    function initializeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
-        Lib_OVMCodec.Transaction calldata _transaction,
-        Lib_OVMCodec.TransactionChainElement calldata _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader calldata _transactionBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _transactionProof
-    ) external;
- 
-    function finalizeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
-        bytes32 _txHash,
-        bytes32 _postStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _postStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _postStateRootProof
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/verification/iOVM_StateTransitioner.sol.html b/coverage/iOVM/verification/iOVM_StateTransitioner.sol.html deleted file mode 100644 index 3a0d781b4..000000000 --- a/coverage/iOVM/verification/iOVM_StateTransitioner.sol.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - Code coverage report for iOVM/verification/iOVM_StateTransitioner.sol - - - - - - - -
-
-

- all files / iOVM/verification/ iOVM_StateTransitioner.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateTransitioner
- */
-interface iOVM_StateTransitioner {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event AccountCommitted(
-        address _address
-    );
- 
-    event ContractStorageCommitted(
-        address _address,
-        bytes32 _key
-    );
- 
- 
-    /**********************************
-     * Public Functions: State Access *
-     **********************************/
- 
-    function getPreStateRoot() external view returns (bytes32 _preStateRoot);
-    function getPostStateRoot() external view returns (bytes32 _postStateRoot);
-    function isComplete() external view returns (bool _complete);
- 
- 
-    /***********************************
-     * Public Functions: Pre-Execution *
-     ***********************************/
- 
-    function proveContractState(
-        address _ovmContractAddress,
-        address _ethContractAddress,
-        bytes calldata _stateTrieWitness
-    ) external;
- 
-    function proveStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes calldata _storageTrieWitness
-    ) external;
- 
- 
-    /*******************************
-     * Public Functions: Execution *
-     *******************************/
- 
-    function applyTransaction(
-        Lib_OVMCodec.Transaction calldata _transaction
-    ) external;
- 
- 
-    /************************************
-     * Public Functions: Post-Execution *
-     ************************************/
- 
-    function commitContractState(
-        address _ovmContractAddress,
-        bytes calldata _stateTrieWitness
-    ) external;
- 
-    function commitStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes calldata _storageTrieWitness
-    ) external;
- 
- 
-    /**********************************
-     * Public Functions: Finalization *
-     **********************************/
- 
-    function completeTransition() external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/verification/iOVM_StateTransitionerFactory.sol.html b/coverage/iOVM/verification/iOVM_StateTransitionerFactory.sol.html deleted file mode 100644 index a4498df98..000000000 --- a/coverage/iOVM/verification/iOVM_StateTransitionerFactory.sol.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - Code coverage report for iOVM/verification/iOVM_StateTransitionerFactory.sol - - - - - - - -
-
-

- all files / iOVM/verification/ iOVM_StateTransitionerFactory.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
- 
-/**
- * @title iOVM_StateTransitionerFactory
- */
-interface iOVM_StateTransitionerFactory {
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    function create(
-        address _proxyManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        external
-        returns (
-            iOVM_StateTransitioner _ovmStateTransitioner
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/iOVM/verification/index.html b/coverage/iOVM/verification/index.html deleted file mode 100644 index bc1507a4f..000000000 --- a/coverage/iOVM/verification/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for iOVM/verification/ - - - - - - - -
-
-

- all files iOVM/verification/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_BondManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_FraudVerifier.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitioner.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitionerFactory.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/index.html b/coverage/index.html deleted file mode 100644 index ea6ba8e13..000000000 --- a/coverage/index.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - Code coverage report for All files - - - - - - - -
-
-

- / -

-
-
- 82.21% - Statements - 1248/1518 -
-
- 67.99% - Branches - 393/578 -
-
- 82.88% - Functions - 363/438 -
-
- 82.63% - Lines - 1313/1589 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM/accounts/
91.67%22/2466.67%4/6100%6/692%23/25
OVM/bridge/messaging/
96.55%56/5876.92%20/2695.24%20/2196.67%58/60
OVM/bridge/tokens/
90.7%39/4350%3/686.67%26/3088.89%40/45
OVM/chain/
92.82%194/20981.37%83/10282.46%47/5793.36%211/226
OVM/execution/
76.05%235/30967.02%63/9481.63%80/9876.73%244/318
OVM/predeploys/
41.76%38/9129.41%10/3440%12/3040.22%37/92
OVM/verification/
90.4%113/12578.05%64/8296.67%29/3090.48%114/126
iOVM/accounts/
100%0/0100%0/0100%0/0100%0/0
iOVM/bridge/messaging/
100%0/0100%0/0100%0/0100%0/0
iOVM/bridge/tokens/
100%0/0100%0/0100%0/0100%0/0
iOVM/chain/
100%0/0100%0/0100%0/0100%0/0
iOVM/execution/
100%0/0100%0/0100%0/0100%0/0
iOVM/predeploys/
100%0/0100%0/0100%0/0100%0/0
iOVM/verification/
100%0/0100%0/0100%0/0100%0/0
libraries/bridge/
100%5/5100%4/4100%4/4100%6/6
libraries/codec/
100%33/33100%6/6100%9/9100%33/33
libraries/resolver/
75%15/2050%4/881.82%9/1178.26%18/23
libraries/rlp/
96.95%127/13172.92%35/4893.1%27/2997.22%140/144
libraries/standards/
80.65%25/3125%3/1283.33%10/1281.25%26/32
libraries/trie/
71.98%149/20755.88%38/6881.25%26/3271.57%146/204
libraries/utils/
89.07%163/18367.57%50/7491.11%41/4589.27%183/205
libraries/wrappers/
69.39%34/4975%6/870.83%17/2468%34/50
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/accounts/OVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/OVM/accounts/OVM_ECDSAContractAccount.sol.html deleted file mode 100644 index f86195d44..000000000 --- a/coverage/lcov-report/OVM/accounts/OVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - Code coverage report for OVM/accounts/OVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / OVM/accounts/ OVM_ECDSAContractAccount.sol -

-
-
- 93.75% - Statements - 15/16 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 1/1 -
-
- 93.75% - Lines - 15/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  -  - -  -  -  -  -  - - -  -  -  -  -  - - -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
-import { Lib_SafeMathWrapper } from "../../libraries/wrappers/Lib_SafeMathWrapper.sol";
- 
-/**
- * @title OVM_ECDSAContractAccount
- * @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the
- * ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by 
- * providing eth_sign and EIP155 formatted transaction encodings.
- *
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    // TODO: should be the amount sufficient to cover the gas costs of all of the transactions up
-    // to and including the CALL/CREATE which forms the entrypoint of the transaction.
-    uint256 constant EXECUTION_VALIDATION_GAS_OVERHEAD = 25000;
-    address constant ETH_ERC20_ADDRESS = 0x4200000000000000000000000000000000000006;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Executes a signed transaction.
-     * @param _transaction Signed EOA transaction.
-     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     * @return Whether or not the call returned (rather than reverted).
-     * @return Data returned by the call.
-     */
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        override
-        public
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
- 
-        // Address of this contract within the ovm (ovmADDRESS) should be the same as the
-        // recovered address of the user who signed this message. This is how we manage to shim
-        // account abstraction even though the user isn't a contract.
-        // Need to make sure that the transaction nonce is right and bump it if so.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_ECDSAUtils.recover(
-                _transaction,
-                isEthSign,
-                _v,
-                _r,
-                _s
-            ) == Lib_SafeExecutionManagerWrapper.safeADDRESS(),
-            "Signature provided for EOA transaction execution is invalid."
-        );
- 
-        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
- 
-        // Need to make sure that the transaction chainId is correct.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.chainId == Lib_SafeExecutionManagerWrapper.safeCHAINID(),
-            "Transaction chainId does not match expected OVM chainId."
-        );
- 
-        // Need to make sure that the transaction nonce is right.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
-            "Transaction nonce does not match the expected nonce."
-        );
- 
-        // TEMPORARY: Disable gas checks for mainnet.
-        // // Need to make sure that the gas is sufficient to execute the transaction.
-        // Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-        //    gasleft() >= Lib_SafeMathWrapper.add(decodedTx.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD),
-        //    "Gas is not sufficient to execute the transaction."
-        // );
- 
-        // Transfer fee to relayer.
-        address relayer = Lib_SafeExecutionManagerWrapper.safeCALLER();
-        uint256 fee = Lib_SafeMathWrapper.mul(decodedTx.gasLimit, decodedTx.gasPrice);
-        (bool success, ) = Lib_SafeExecutionManagerWrapper.safeCALL(
-            gasleft(),
-            ETH_ERC20_ADDRESS,
-            abi.encodeWithSignature("transfer(address,uint256)", relayer, fee)
-        );
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            success == true,
-            "Fee was not transferred to relayer."
-        );
- 
-        // Contract creations are signalled by sending a transaction to the zero address.
-        if (decodedTx.to == address(0)) {
-            (address created, bytes memory revertData) = Lib_SafeExecutionManagerWrapper.safeCREATE(
-                decodedTx.gasLimit,
-                decodedTx.data
-            );
- 
-            // Return true if the contract creation succeeded, false w/ revertData otherwise.
-            Eif (created != address(0)) {
-                return (true, abi.encode(created));
-            } else {
-                return (false, revertData);
-            }
-        } else {
-            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
-            // the nonce of the calling account. Normally an EOA would bump the nonce for both
-            // cases, but since this is a contract we'd end up bumping the nonce twice.
-            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
- 
-            return Lib_SafeExecutionManagerWrapper.safeCALL(
-                decodedTx.gasLimit,
-                decodedTx.to,
-                decodedTx.data
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/accounts/OVM_ProxyEOA.sol.html b/coverage/lcov-report/OVM/accounts/OVM_ProxyEOA.sol.html deleted file mode 100644 index d8de28f6d..000000000 --- a/coverage/lcov-report/OVM/accounts/OVM_ProxyEOA.sol.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - Code coverage report for OVM/accounts/OVM_ProxyEOA.sol - - - - - - - -
-
-

- all files / OVM/accounts/ OVM_ProxyEOA.sol -

-
-
- 87.5% - Statements - 7/8 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 5/5 -
-
- 88.89% - Lines - 8/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_ProxyEOA
- * @dev The Proxy EOA contract uses a delegate call to execute the logic in an implementation contract.
- * In combination with the logic implemented in the ECDSA Contract Account, this enables a form of upgradable 
- * 'account abstraction' on layer 2. 
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ProxyEOA {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _implementation Address of the initial implementation contract.
-     */
-    constructor(
-        address _implementation
-    )
-    {
-        _setImplementation(_implementation);
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        (bool success, bytes memory returndata) = Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
-            gasleft(),
-            getImplementation(),
-            msg.data
-        );
- 
-        Eif (success) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            Lib_SafeExecutionManagerWrapper.safeREVERT(
-                string(returndata)
-            );
-        }
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Changes the implementation address.
-     * @param _implementation New implementation address.
-     */
-    function upgrade(
-        address _implementation
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_SafeExecutionManagerWrapper.safeADDRESS() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
-            "EOAs can only upgrade their own EOA implementation"
-        );
- 
-        _setImplementation(_implementation);
-    }
- 
-    /**
-     * Gets the address of the current implementation.
-     * @return Current implementation address.
-     */
-    function getImplementation()
-        public
-        returns (
-            address
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                IMPLEMENTATION_KEY
-            )
-        );
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _setImplementation(
-        address _implementation
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            IMPLEMENTATION_KEY,
-            Lib_Bytes32Utils.fromAddress(_implementation)
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/accounts/index.html b/coverage/lcov-report/OVM/accounts/index.html deleted file mode 100644 index a286f49e4..000000000 --- a/coverage/lcov-report/OVM/accounts/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for OVM/accounts/ - - - - - - - -
-
-

- all files OVM/accounts/ -

-
-
- 91.67% - Statements - 22/24 -
-
- 66.67% - Branches - 4/6 -
-
- 100% - Functions - 6/6 -
-
- 92% - Lines - 23/25 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_ECDSAContractAccount.sol
93.75%15/1675%3/4100%1/193.75%15/16
OVM_ProxyEOA.sol
87.5%7/850%1/2100%5/588.89%8/9
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html b/coverage/lcov-report/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html deleted file mode 100644 index 6457a4c5d..000000000 --- a/coverage/lcov-report/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / OVM/bridge/messaging/ Abs_BaseCrossDomainMessenger.sol -

-
-
- 77.78% - Statements - 7/9 -
-
- 50% - Branches - 1/2 -
-
- 80% - Functions - 4/5 -
-
- 77.78% - Lines - 7/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/* Library Imports */
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/**
- * @title Abs_BaseCrossDomainMessenger
- * @dev The Base Cross Domain Messenger is an abstract contract providing the interface and common functionality used in the
- * L1 and L2 Cross Domain Messengers. It can also serve as a template for developers wishing to implement a custom bridge 
- * contract to suit their needs.
- *
- * Compiler used: defined by child contract
- * Runtime target: defined by child contract
- */
-abstract contract Abs_BaseCrossDomainMessenger is iAbs_BaseCrossDomainMessenger, Lib_ReentrancyGuard {
-    /**************
-     *  Constants *
-     **************/
- 
-    // The default x-domain message sender being set to a non-zero value makes
-    // deployment a bit more expensive, but in exchange the refund on every call to
-    // `relayMessage` by the L1 and L2 messengers will be higher.
-    address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    mapping (bytes32 => bool) public relayedMessages;
-    mapping (bytes32 => bool) public successfulMessages;
-    mapping (bytes32 => bool) public sentMessages;
-    uint256 public messageNonce;
-    address internal xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    constructor() Lib_ReentrancyGuard() {}
- 
-    function xDomainMessageSender() public override view returns (address) {
-        Irequire(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set");
-        return xDomainMsgSender;
-    }
- 
-    /**
-     * Sends a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _message Message to send to the target.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function sendMessage(
-        address _target,
-        bytes memory _message,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            msg.sender,
-            _message,
-            messageNonce
-        );
- 
-        messageNonce += 1;
-        sentMessages[keccak256(xDomainCalldata)] = true;
- 
-        _sendXDomainMessage(xDomainCalldata, _gasLimit);
-        emit SentMessage(xDomainCalldata);
-    }
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Generates the correct cross domain calldata for a message.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @return ABI encoded cross domain calldata.
-     */
-    function _getXDomainCalldata(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodeWithSignature(
-            "relayMessage(address,address,bytes,uint256)",
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * param // Message to send.
-     * param // Gas limit for the provided message.
-     */
-    function _sendXDomainMessage(
-        bytes memory, // _message,
-        uint256 // _gasLimit
-    )
-        virtual
-        internal
-    {
-        revert("Implement me in child contracts!");
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html b/coverage/lcov-report/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html deleted file mode 100644 index 07a375b6a..000000000 --- a/coverage/lcov-report/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html +++ /dev/null @@ -1,947 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / OVM/bridge/messaging/ OVM_L1CrossDomainMessenger.sol -

-
-
- 100% - Statements - 30/30 -
-
- 75% - Branches - 12/16 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 31/31 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -12× -12× -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  - -  -  -  -  - - - -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_AddressManager } from "../../../libraries/resolver/Lib_AddressManager.sol";
-import { Lib_SecureMerkleTrie } from "../../../libraries/trie/Lib_SecureMerkleTrie.sol";
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-import { iOVM_CanonicalTransactionChain } from "../../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_StateCommitmentChain } from "../../../iOVM/chain/iOVM_StateCommitmentChain.sol";
- 
-/* Contract Imports */
-import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_L1CrossDomainMessenger
- * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. 
- * In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted 
- * via this contract's replay function. 
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * Pass a default zero address to the address resolver. This will be updated when initialized.
-     */
-    constructor()
-        Lib_AddressResolver(address(0))
-    {}
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    function initialize(
-        address _libAddressManager
-    )
-        public
-    {
-        Erequire(address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized.");
-        libAddressManager = Lib_AddressManager(_libAddressManager);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may successfully call a method.
-     */
-    modifier onlyRelayer() {
-        address relayer = resolve("OVM_L2MessageRelayer");
-        if (relayer != address(0)) {
-            Irequire(
-                msg.sender == relayer,
-                "Only OVM_L2MessageRelayer can relay L2-to-L1 messages."
-            );
-        }
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @inheritdoc iOVM_L1CrossDomainMessenger
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        L2MessageInclusionProof memory _proof
-    )
-        override
-        public
-        nonReentrant
-        onlyRelayer()
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        require(
-            _verifyXDomainMessage(
-                xDomainCalldata,
-                _proof
-            ) == true,
-            "Provided message could not be verified."
-        );
- 
-        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
- 
-        require(
-            successfulMessages[xDomainCalldataHash] == false,
-            "Provided message has already been received."
-        );
- 
-        xDomainMsgSender = _sender;
-        (bool success, ) = _target.call(_message);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-        // Mark the message as received if the call was successful. Ensures that a message can be
-        // relayed multiple times in the case that the call reverted.
-        Eif (success == true) {
-            successfulMessages[xDomainCalldataHash] = true;
-            emit RelayedMessage(xDomainCalldataHash);
-        }
- 
-        // Store an identifier that can be used to prove that the given message was relayed by some
-        // user. Gives us an easy way to pay relayers for their work.
-        bytes32 relayId = keccak256(
-            abi.encodePacked(
-                xDomainCalldata,
-                msg.sender,
-                block.number
-            )
-        );
-        relayedMessages[relayId] = true;
-    }
- 
-    /**
-     * Replays a cross domain message to the target messenger.
-     * @inheritdoc iOVM_L1CrossDomainMessenger
-     */
-    function replayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        require(
-            sentMessages[keccak256(xDomainCalldata)] == true,
-            "Provided message has not already been sent."
-        );
- 
-        _sendXDomainMessage(xDomainCalldata, _gasLimit);
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Verifies that the given message is valid.
-     * @param _xDomainCalldata Calldata to verify.
-     * @param _proof Inclusion proof for the message.
-     * @return Whether or not the provided message is valid.
-     */
-    function _verifyXDomainMessage(
-        bytes memory _xDomainCalldata,
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        return (
-            _verifyStateRootProof(_proof)
-            && _verifyStorageProof(_xDomainCalldata, _proof)
-        );
-    }
- 
-    /**
-     * Verifies that the state root within an inclusion proof is valid.
-     * @param _proof Message inclusion proof.
-     * @return Whether or not the provided proof is valid.
-     */
-    function _verifyStateRootProof(
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
- 
-        return (
-            ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) == false
-            && ovmStateCommitmentChain.verifyStateCommitment(
-                _proof.stateRoot,
-                _proof.stateRootBatchHeader,
-                _proof.stateRootProof
-            )
-        );
-    }
- 
-    /**
-     * Verifies that the storage proof within an inclusion proof is valid.
-     * @param _xDomainCalldata Encoded message calldata.
-     * @param _proof Message inclusion proof.
-     * @return Whether or not the provided proof is valid.
-     */
-    function _verifyStorageProof(
-        bytes memory _xDomainCalldata,
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 storageKey = keccak256(
-            abi.encodePacked(
-                keccak256(
-                    abi.encodePacked(
-                        _xDomainCalldata,
-                        resolve("OVM_L2CrossDomainMessenger")
-                    )
-                ),
-                uint256(0)
-            )
-        );
- 
-        (
-            bool exists,
-            bytes memory encodedMessagePassingAccount
-        ) = Lib_SecureMerkleTrie.get(
-            abi.encodePacked(0x4200000000000000000000000000000000000000),
-            _proof.stateTrieWitness,
-            _proof.stateRoot
-        );
- 
-        Erequire(
-            exists == true,
-            "Message passing predeploy has not been initialized or invalid proof provided."
-        );
- 
-        Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
-            encodedMessagePassingAccount
-        );
- 
-        return Lib_SecureMerkleTrie.verifyInclusionProof(
-            abi.encodePacked(storageKey),
-            abi.encodePacked(uint8(1)),
-            _proof.storageTrieWitness,
-            account.storageRoot
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * @param _message Message to send.
-     * @param _gasLimit OVM gas limit for the message.
-     */
-    function _sendXDomainMessage(
-        bytes memory _message,
-        uint256 _gasLimit
-    )
-        override
-        internal
-    {
-        iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).enqueue(
-            resolve("OVM_L2CrossDomainMessenger"),
-            _gasLimit,
-            _message
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html b/coverage/lcov-report/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html deleted file mode 100644 index 421554d4f..000000000 --- a/coverage/lcov-report/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol - - - - - - - -
-
-

- all files / OVM/bridge/messaging/ OVM_L1MultiMessageRelayer.sol -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 6/6 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-import { iOVM_L1MultiMessageRelayer } from "../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol";
- 
-/* Contract Imports */
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
- 
- 
-/**
- * @title OVM_L1MultiMessageRelayer
- * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the 
- * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain
- * Message Sender.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
-    constructor(
-        address _libAddressManager
-    ) 
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyBatchRelayer() {
-        require(
-            msg.sender == resolve("OVM_L2BatchMessageRelayer"),
-            "OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer"
-        );
-        _;
-    }
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying
-     * @param _messages An array of L2 to L1 messages
-     */
-    function batchRelayMessages(L2ToL1Message[] calldata _messages) 
-        override
-        external
-        onlyBatchRelayer 
-    {
-        iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(resolve("Proxy__OVM_L1CrossDomainMessenger"));
-        for (uint256 i = 0; i < _messages.length; i++) {
-            L2ToL1Message memory message = _messages[i];
-            messenger.relayMessage(
-                message.target,
-                message.sender,
-                message.message,
-                message.messageNonce,
-                message.proof
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html b/coverage/lcov-report/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html deleted file mode 100644 index 16a8bd88d..000000000 --- a/coverage/lcov-report/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / OVM/bridge/messaging/ OVM_L2CrossDomainMessenger.sol -

-
-
- 100% - Statements - 14/14 -
-
- 83.33% - Branches - 5/6 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 14/14 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  - -  - -  -  -  -  - - - -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/* Interface Imports */
-import { iOVM_L2CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol";
-import { iOVM_L1MessageSender } from "../../../iOVM/predeploys/iOVM_L1MessageSender.sol";
-import { iOVM_L2ToL1MessagePasser } from "../../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
- 
-/* Contract Imports */
-import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_L2CrossDomainMessenger
- * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point
- * for L2 messages sent via the L1 Cross Domain Messenger.
- * 
- * Compiler used: optimistic-solc
- * Runtime target: OVM
-  */
-contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @inheritdoc iOVM_L2CrossDomainMessenger
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    )
-        override
-        nonReentrant
-        public
-    {
-        require(
-            _verifyXDomainMessage() == true,
-            "Provided message could not be verified."
-        );
- 
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
- 
-        require(
-            successfulMessages[xDomainCalldataHash] == false,
-            "Provided message has already been received."
-        );
- 
-        xDomainMsgSender = _sender;
-        (bool success, ) = _target.call(_message);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-        // Mark the message as received if the call was successful. Ensures that a message can be
-        // relayed multiple times in the case that the call reverted.
-        Eif (success == true) {
-            successfulMessages[xDomainCalldataHash] = true;
-            emit RelayedMessage(xDomainCalldataHash);
-        }
- 
-        // Store an identifier that can be used to prove that the given message was relayed by some
-        // user. Gives us an easy way to pay relayers for their work.
-        bytes32 relayId = keccak256(
-            abi.encodePacked(
-                xDomainCalldata,
-                msg.sender,
-                block.number
-            )
-        );
-        relayedMessages[relayId] = true;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Verifies that a received cross domain message is valid.
-     * @return _valid Whether or not the message is valid.
-     */
-    function _verifyXDomainMessage()
-        view
-        internal
-        returns (
-            bool _valid
-        )
-    {
-        return (
-            iOVM_L1MessageSender(resolve("OVM_L1MessageSender")).getL1MessageSender() == resolve("OVM_L1CrossDomainMessenger")
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * @param _message Message to send.
-     * param _gasLimit Gas limit for the provided message.
-     */
-    function _sendXDomainMessage(
-        bytes memory _message,
-        uint256 // _gasLimit
-    )
-        override
-        internal
-    {
-        iOVM_L2ToL1MessagePasser(resolve("OVM_L2ToL1MessagePasser")).passMessageToL1(_message);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/messaging/index.html b/coverage/lcov-report/OVM/bridge/messaging/index.html deleted file mode 100644 index d1b88f421..000000000 --- a/coverage/lcov-report/OVM/bridge/messaging/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for OVM/bridge/messaging/ - - - - - - - -
-
-

- all files OVM/bridge/messaging/ -

-
-
- 96.55% - Statements - 56/58 -
-
- 76.92% - Branches - 20/26 -
-
- 95.24% - Functions - 20/21 -
-
- 96.67% - Lines - 58/60 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_BaseCrossDomainMessenger.sol
77.78%7/950%1/280%4/577.78%7/9
OVM_L1CrossDomainMessenger.sol
100%30/3075%12/16100%9/9100%31/31
OVM_L1MultiMessageRelayer.sol
100%5/5100%2/2100%3/3100%6/6
OVM_L2CrossDomainMessenger.sol
100%14/1483.33%5/6100%4/4100%14/14
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html b/coverage/lcov-report/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html deleted file mode 100644 index d4b0621e5..000000000 --- a/coverage/lcov-report/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html +++ /dev/null @@ -1,692 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/Abs_L1TokenGateway.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ Abs_L1TokenGateway.sol -

-
-
- 83.33% - Statements - 10/12 -
-
- 100% - Branches - 0/0 -
-
- 75% - Functions - 6/8 -
-
- 83.33% - Lines - 10/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm 
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
- 
-/**
- * @title Abs_L1TokenGateway
- * @dev An L1 Token Gateway is a contract which stores deposited L1 funds that are in use on L2.
- * It synchronizes a corresponding L2 representation of the "deposited token", informing it
- * of new deposits and releasing L1 funds when there are newly finalized withdrawals.
- *
- * NOTE: This abstract contract gives all the core functionality of an L1 token gateway, 
- * but provides easy hooks in case developers need extensions in child contracts.
- * In many cases, the default OVM_L1ERC20Gateway will suffice.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-abstract contract Abs_L1TokenGateway is iOVM_L1TokenGateway, OVM_CrossDomainEnabled {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    address public l2DepositedToken;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l2DepositedToken iOVM_L2DepositedToken-compatible address on the chain being deposited into.
-     * @param _l1messenger L1 Messenger address being used for cross-chain communications.
-     */
-    constructor(
-        address _l2DepositedToken,
-        address _l1messenger 
-    )
-        OVM_CrossDomainEnabled(_l1messenger)
-    {
-        l2DepositedToken = _l2DepositedToken;
-    }
- 
-    /********************************
-     * Overridable Accounting logic *
-     ********************************/
- 
-    // Default gas value which can be overridden if more complex logic runs on L2.
-    uint32 public DEFAULT_FINALIZE_DEPOSIT_L2_GAS = 1200000;
- 
-    /**
-     * @dev Core logic to be performed when a withdrawal is finalized on L1.
-     * In most cases, this will simply send locked funds to the withdrawer.
-     *
-     * param _to Address being withdrawn to.
-     * param _amount Amount being withdrawn.
-     */
-    function _handleFinalizeWithdrawal(
-        address, // _to,
-        uint256 // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Implement me in child contracts");
-    }
- 
-    /**
-     * @dev Core logic to be performed when a deposit is initiated on L1.
-     * In most cases, this will simply send locked funds to the withdrawer.
-     *
-     * param _from Address being deposited from on L1.
-     * param _to Address being deposited into on L2.
-     * param _amount Amount being deposited.
-     */
-    function _handleInitiateDeposit(
-        address, // _from,
-        address, // _to,
-        uint256 // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Implement me in child contracts");
-    }
- 
-    /**
-     * @dev Overridable getter for the L2 gas limit, in the case it may be
-     * dynamic, and the above public constant does not suffice.
-     *
-     */
- 
-    function getFinalizeDepositL2Gas()
-        public
-        view
-        returns(
-            uint32
-        )
-    {
-        return DEFAULT_FINALIZE_DEPOSIT_L2_GAS;
-    }
- 
-    /**************
-     * Depositing *
-     **************/
- 
-    /**
-     * @dev deposit an amount of the ERC20 to the caller's balance on L2
-     * @param _amount Amount of the ERC20 to deposit
-     */
-    function deposit(
-        uint _amount
-    )
-        public
-        override
-    {
-        _initiateDeposit(msg.sender, msg.sender, _amount);
-    }
- 
-    /**
-     * @dev deposit an amount of ERC20 to a recipients's balance on L2
-     * @param _to L2 address to credit the withdrawal to
-     * @param _amount Amount of the ERC20 to deposit
-     */
-    function depositTo(
-        address _to,
-        uint _amount
-    )
-        public
-        override
-    {
-        _initiateDeposit(msg.sender, _to, _amount);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by informing the L2 Deposited Token
-     * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)
-     *
-     * @param _from Account to pull the deposit from on L1
-     * @param _to Account to give the deposit to on L2
-     * @param _amount Amount of the ERC20 to deposit.
-     */
-    function _initiateDeposit(
-        address _from,
-        address _to,
-        uint _amount
-    )
-        internal
-    {
-        // Call our deposit accounting handler implemented by child contracts.
-        _handleInitiateDeposit(
-            _from,
-            _to,
-            _amount
-        );
- 
-        // Construct calldata for l2DepositedToken.finalizeDeposit(_to, _amount)
-        bytes memory data = abi.encodeWithSelector(
-            iOVM_L2DepositedToken.finalizeDeposit.selector,
-            _to,
-            _amount
-        );
- 
-        // Send calldata into L2
-        sendCrossDomainMessage(
-            l2DepositedToken,
-            data,
-            getFinalizeDepositL2Gas()
-        );
- 
-        emit DepositInitiated(_from, _to, _amount);
-    }
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    /**
-     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the 
-     * L1 ERC20 token. 
-     * This call will fail if the initialized withdrawal from L2 has not been finalized. 
-     *
-     * @param _to L1 address to credit the withdrawal to
-     * @param _amount Amount of the ERC20 to withdraw
-     */
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external
-        override 
-        onlyFromCrossDomainAccount(l2DepositedToken)
-    {
-        // Call our withdrawal accounting handler implemented by child contracts.
-        _handleFinalizeWithdrawal(
-            _to,
-            _amount
-        );
- 
-        emit WithdrawalFinalized(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html b/coverage/lcov-report/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html deleted file mode 100644 index ba6d6780c..000000000 --- a/coverage/lcov-report/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html +++ /dev/null @@ -1,755 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/Abs_L2DepositedToken.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ Abs_L2DepositedToken.sol -

-
-
- 86.67% - Statements - 13/15 -
-
- 50% - Branches - 2/4 -
-
- 80% - Functions - 8/10 -
-
- 87.5% - Lines - 14/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  - -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
- 
-/**
- * @title Abs_L2DepositedToken
- * @dev An L2 Deposited Token is an L2 representation of funds which were deposited from L1.
- * Usually contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
- * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
- *
- * NOTE: This abstract contract gives all the core functionality of a deposited token implementation except for the
- * token's internal accounting itself.  This gives developers an easy way to implement children with their own token code.
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-abstract contract Abs_L2DepositedToken is iOVM_L2DepositedToken, OVM_CrossDomainEnabled {
- 
-    /*******************
-     * Contract Events *
-     *******************/
- 
-    event Initialized(iOVM_L1TokenGateway _l1TokenGateway);
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    iOVM_L1TokenGateway public l1TokenGateway;
- 
-    /********************************
-     * Constructor & Initialization *
-     ********************************/
- 
-    /**
-     * @param _l2CrossDomainMessenger L1 Messenger address being used for cross-chain communications.
-     */
-    constructor(
-        address _l2CrossDomainMessenger
-    )
-        OVM_CrossDomainEnabled(_l2CrossDomainMessenger)
-    {}
- 
-    /**
-     * @dev Initialize this contract with the L1 token gateway address.
-     * The flow: 1) this contract gets deployed on L2, 2) the L1
-     * gateway is deployed with addr from (1), 3) L1 gateway address passed here.
-     *
-     * @param _l1TokenGateway Address of the corresponding L1 gateway deployed to the main chain
-     */
- 
-    function init(
-        iOVM_L1TokenGateway _l1TokenGateway
-    )
-        public
-    {
-        Erequire(address(l1TokenGateway) == address(0), "Contract has already been initialized");
- 
-        l1TokenGateway = _l1TokenGateway;
-        
-        emit Initialized(l1TokenGateway);
-    }
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyInitialized() {
-        Erequire(address(l1TokenGateway) != address(0), "Contract has not yet been initialized");
-        _;
-    }
- 
-    /********************************
-     * Overridable Accounting logic *
-     ********************************/
- 
-    // Default gas value which can be overridden if more complex logic runs on L2.
-    uint32 constant DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS = 100000;
- 
-    /**
-     * @dev Core logic to be performed when a withdrawal from L2 is initialized.
-     * In most cases, this will simply burn the withdrawn L2 funds.
-     *
-     * param _to Address being withdrawn to
-     * param _amount Amount being withdrawn
-     */
- 
-    function _handleInitiateWithdrawal(
-        address, // _to,
-        uint // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Accounting must be implemented by child contract.");
-    }
- 
-    /**
-     * @dev Core logic to be performed when a deposit from L2 is finalized on L2.
-     * In most cases, this will simply _mint() to credit L2 funds to the recipient.
-     *
-     * param _to Address being deposited to on L2
-     * param _amount Amount which was deposited on L1
-     */
-    function _handleFinalizeDeposit(
-        address, // _to
-        uint // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Accounting must be implemented by child contract.");
-    }
- 
-    /**
-     * @dev Overridable getter for the *L1* gas limit of settling the withdrawal, in the case it may be
-     * dynamic, and the above public constant does not suffice.
-     *
-     */
- 
-    function getFinalizeWithdrawalL1Gas()
-        public
-        view
-        virtual
-        returns(
-            uint32
-        )
-    {
-        return DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS;
-    }
- 
- 
-    /***************
-     * Withdrawing *
-     ***************/
- 
-    /**
-     * @dev initiate a withdraw of some tokens to the caller's account on L1
-     * @param _amount Amount of the token to withdraw
-     */
-    function withdraw(
-        uint _amount
-    )
-        external
-        override
-        onlyInitialized()
-    {
-        _initiateWithdrawal(msg.sender, _amount);
-    }
- 
-    /**
-     * @dev initiate a withdraw of some token to a recipient's account on L1
-     * @param _to L1 adress to credit the withdrawal to
-     * @param _amount Amount of the token to withdraw
-     */
-    function withdrawTo(
-        address _to,
-        uint _amount
-    )
-        external
-        override
-        onlyInitialized()
-    {
-        _initiateWithdrawal(_to, _amount);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by storing the token and informing the L2 token Gateway of the deposit.
-     *
-     * @param _to Account to give the withdrawal to on L1
-     * @param _amount Amount of the token to withdraw
-     */
-    function _initiateWithdrawal(
-        address _to,
-        uint _amount
-    )
-        internal
-    {
-        // Call our withdrawal accounting handler implemented by child contracts (usually a _burn)
-        _handleInitiateWithdrawal(_to, _amount);
- 
-        // Construct calldata for l1TokenGateway.finalizeWithdrawal(_to, _amount)
-        bytes memory data = abi.encodeWithSelector(
-            iOVM_L1TokenGateway.finalizeWithdrawal.selector,
-            _to,
-            _amount
-        );
- 
-        // Send message up to L1 gateway
-        sendCrossDomainMessage(
-            address(l1TokenGateway),
-            data,
-            getFinalizeWithdrawalL1Gas()
-        );
- 
-        emit WithdrawalInitiated(msg.sender, _to, _amount);
-    }
- 
-    /************************************
-     * Cross-chain Function: Depositing *
-     ************************************/
- 
-    /**
-     * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this 
-     * L2 token. 
-     * This call will fail if it did not originate from a corresponding deposit in OVM_l1TokenGateway. 
-     *
-     * @param _to Address to receive the withdrawal at
-     * @param _amount Amount of the token to withdraw
-     */
-    function finalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        external
-        override 
-        onlyInitialized()
-        onlyFromCrossDomainAccount(address(l1TokenGateway))
-    {
-        _handleFinalizeDeposit(_to, _amount);
-        emit DepositFinalized(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html b/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html deleted file mode 100644 index ca0c061f1..000000000 --- a/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/OVM_L1ERC20Gateway.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ OVM_L1ERC20Gateway.sol -

-
-
- 100% - Statements - 3/3 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 3/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm 
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
-import { Abs_L1TokenGateway } from "./Abs_L1TokenGateway.sol";
-import { iOVM_ERC20 } from "../../../iOVM/predeploys/iOVM_ERC20.sol";
- 
-/**
- * @title OVM_L1ERC20Gateway
- * @dev The L1 ERC20 Gateway is a contract which stores deposited L1 funds that are in use on L2.
- * It synchronizes a corresponding L2 ERC20 Gateway, informing it of deposits, and listening to it
- * for newly finalized withdrawals.
- *
- * NOTE: This contract extends Abs_L1TokenGateway, which is where we
- * takes care of most of the initialization and the cross-chain logic.
- * If you are looking to implement your own deposit/withdrawal contracts, you
- * may also want to extend the abstract contract in a similar manner.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1ERC20Gateway is Abs_L1TokenGateway {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
-    
-    iOVM_ERC20 public l1ERC20;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l1ERC20 L1 ERC20 address this contract stores deposits for
-     * @param _l2DepositedERC20 L2 Gateway address on the chain being deposited into
-     */
-    constructor(
-        iOVM_ERC20 _l1ERC20,
-        address _l2DepositedERC20,
-        address _l1messenger 
-    )
-        Abs_L1TokenGateway(
-            _l2DepositedERC20,
-            _l1messenger
-        )
-    {
-        l1ERC20 = _l1ERC20;
-    }
- 
- 
-    /**************
-     * Accounting *
-     **************/
- 
-    /**
-     * @dev When a deposit is initiated on L1, the L1 Gateway
-     * transfers the funds to itself for future withdrawals
-     *
-     * @param _from L1 address ETH is being deposited from
-     * param _to L2 address that the ETH is being deposited to
-     * @param _amount Amount of ERC20 to send
-     */
-    function _handleInitiateDeposit(
-        address _from,
-        address, // _to,
-        uint256 _amount
-    )
-        internal
-        override
-    {
-         // Hold on to the newly deposited funds
-        l1ERC20.transferFrom(
-            _from,
-            address(this),
-            _amount
-        );
-    }
- 
-    /**
-     * @dev When a withdrawal is finalized on L1, the L1 Gateway
-     * transfers the funds to the withdrawer
-     *
-     * @param _to L1 address that the ERC20 is being withdrawn to
-     * @param _amount Amount of ERC20 to send
-     */
-    function _handleFinalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        // Transfer withdrawn funds out to withdrawer
-        l1ERC20.transfer(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html b/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html deleted file mode 100644 index af1be607b..000000000 --- a/coverage/lcov-report/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html +++ /dev/null @@ -1,557 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/OVM_L1ETHGateway.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ OVM_L1ETHGateway.sol -

-
-
- 100% - Statements - 11/11 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 6/6 -
-
- 91.67% - Lines - 11/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1ETHGateway } from "../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol";
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/**
- * @title OVM_L1ETHGateway
- * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {
- 
-    /********************
-     * Public Constants *
-     ********************/
- 
-    uint32 public constant override getFinalizeDepositL2Gas = 1200000;
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    address public ovmEth;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address manager for this OE deployment
-     * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken
-     */
-    constructor(
-        address _libAddressManager,
-        address _ovmEth
-    )
-        OVM_CrossDomainEnabled(address(0)) // overridden in constructor code
-        Lib_AddressResolver(_libAddressManager)
-    {
-        ovmEth = _ovmEth;
-        messenger = resolve("Proxy__OVM_L1CrossDomainMessenger"); // overrides OVM_CrossDomainEnabled constructor setting because resolve() is not yet accessible
-    }
- 
-    /**************
-     * Depositing *
-     **************/
- 
-    receive()
-        external
-        payable
-    {
-        _initiateDeposit(msg.sender, msg.sender);
-    }
- 
-    /**
-     * @dev deposit an amount of the ETH to the caller's balance on L2
-     */
-    function deposit() 
-        external
-        override
-        payable
-    {
-        _initiateDeposit(msg.sender, msg.sender);
-    }
- 
-    /**
-     * @dev deposit an amount of ETH to a recipients's balance on L2
-     * @param _to L2 address to credit the withdrawal to
-     */
-    function depositTo(
-        address _to
-    )
-        external
-        override
-        payable
-    {
-        _initiateDeposit(msg.sender, _to);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.
-     *
-     * @param _from Account to pull the deposit from on L1
-     * @param _to Account to give the deposit to on L2
-     */
-    function _initiateDeposit(
-        address _from,
-        address _to
-    )
-        internal
-    {
-        // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)
-        bytes memory data =
-            abi.encodeWithSelector(
-                iOVM_L2DepositedToken.finalizeDeposit.selector,
-                _to,
-                msg.value
-            );
- 
-        // Send calldata into L2
-        sendCrossDomainMessage(
-            ovmEth,
-            data,
-            getFinalizeDepositL2Gas
-        );
- 
-        emit DepositInitiated(_from, _to, msg.value);
-    }
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    /**
-     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the
-     * L1 ETH token.
-     * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized. 
-     *
-     * @param _to L1 address to credit the withdrawal to
-     * @param _amount Amount of the ETH to withdraw
-     */
-    function finalizeWithdrawal(
-        address _to,
-        uint256 _amount
-    )
-        external
-        override
-        onlyFromCrossDomainAccount(ovmEth)
-    {
-        _safeTransferETH(_to, _amount);
- 
-        emit WithdrawalFinalized(_to, _amount);
-    }
- 
-    /**********************************
-     * Internal Functions: Accounting *
-     **********************************/
- 
-    /**
-     * @dev Internal accounting function for moving around L1 ETH.
-     *
-     * @param _to L1 address to transfer ETH to
-     * @param _value Amount of ETH to send to
-     */
-    function _safeTransferETH(
-        address _to,
-        uint256 _value
-    )
-        internal
-    {
-        (bool success, ) = _to.call{value: _value}(new bytes(0));
-        Erequire(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html b/coverage/lcov-report/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html deleted file mode 100644 index 74ff02ea8..000000000 --- a/coverage/lcov-report/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/OVM_L2DepositedERC20.sol - - - - - - - -
-
-

- all files / OVM/bridge/tokens/ OVM_L2DepositedERC20.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Contract Imports */
-import { UniswapV2ERC20 } from "../../../libraries/standards/UniswapV2ERC20.sol";
- 
-/* Library Imports */
-import { Abs_L2DepositedToken } from "./Abs_L2DepositedToken.sol";
- 
-/**
- * @title OVM_L2DepositedERC20
- * @dev The L2 Deposited ERC20 is an ERC20 implementation which represents L1 assets deposited into L2.
- * This contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
- * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
- *
- * NOTE: This contract implements the Abs_L2DepositedToken contract using Uniswap's ERC20 as the implementation.
- * Alternative implementations can be used in this similar manner.
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract OVM_L2DepositedERC20 is Abs_L2DepositedToken, UniswapV2ERC20 {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.
-     * @param _name ERC20 name
-     * @param _symbol ERC20 symbol
-     */
-    constructor(
-        address _l2CrossDomainMessenger,
-        string memory _name,
-        string memory _symbol
-    )
-        Abs_L2DepositedToken(_l2CrossDomainMessenger)
-        UniswapV2ERC20(_name, _symbol)
-    {}
- 
-    // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2 usage.
-    function _handleInitiateWithdrawal(
-        address, // _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        _burn(msg.sender, _amount);
-    }
- 
-    // When a deposit is finalized, we credit the account on L2 with the same amount of tokens.
-    function _handleFinalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        _mint(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/bridge/tokens/index.html b/coverage/lcov-report/OVM/bridge/tokens/index.html deleted file mode 100644 index 81e37f18b..000000000 --- a/coverage/lcov-report/OVM/bridge/tokens/index.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - Code coverage report for OVM/bridge/tokens/ - - - - - - - -
-
-

- all files OVM/bridge/tokens/ -

-
-
- 90.7% - Statements - 39/43 -
-
- 50% - Branches - 3/6 -
-
- 86.67% - Functions - 26/30 -
-
- 88.89% - Lines - 40/45 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_L1TokenGateway.sol
83.33%10/12100%0/075%6/883.33%10/12
Abs_L2DepositedToken.sol
86.67%13/1550%2/480%8/1087.5%14/16
OVM_L1ERC20Gateway.sol
100%3/3100%0/0100%3/3100%3/3
OVM_L1ETHGateway.sol
100%11/1150%1/2100%6/691.67%11/12
OVM_L2DepositedERC20.sol
100%2/2100%0/0100%3/3100%2/2
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/chain/OVM_CanonicalTransactionChain.sol.html b/coverage/lcov-report/OVM/chain/OVM_CanonicalTransactionChain.sol.html deleted file mode 100644 index c0026a36e..000000000 --- a/coverage/lcov-report/OVM/chain/OVM_CanonicalTransactionChain.sol.html +++ /dev/null @@ -1,3755 +0,0 @@ - - - - Code coverage report for OVM/chain/OVM_CanonicalTransactionChain.sol - - - - - - - -
-
-

- all files / OVM/chain/ OVM_CanonicalTransactionChain.sol -

-
-
- 95.51% - Statements - 149/156 -
-
- 87.5% - Branches - 63/72 -
-
- 84.38% - Functions - 27/32 -
-
- 95.88% - Lines - 163/170 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -222× -222× -222× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -559× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -382× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -291× -291× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -100× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -47× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -239× -  -  -  -  -238× -  -  -  -  -237× -  -  -  -  -  -  -  -236× -236× -  -  -  -236× -  -  -  -  -  -  -235× -235× -37600× -  -  -235× -  -  -  -  -  -  -  -  -235× -235× -  -  -  -  -235× -  -235× -235× -  -  -  -  -235× -235× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -104× -104× -104× -104× -  -  -  -  -  -104× -  -  -  -  -103× -  -  -  -  -102× -  -  -  -  -101× -  -  -  -  -100× -  -100× -  -  -  -  -  -  -  -100× -100× -  -  -  -  -100× -  -  -100× -  -  -100× -  -  -100× -  -  -  -100× -  -100× -100× -232× -  -232× -  -100× -  -  -  -226× -  -  -  -  -  -  -  -221× -  -  -221× -439× -439× -  -  -  -439× -  -  -  -  -  -  -439× -439× -439× -  -  -  -221× -179× -  -  -  -  -178× -178× -178× -  -  -  -88× -  -  -  -  -  -  -82× -  -  -  -  -81× -  -  -  -  -  -81× -81× -81× -81× -  -39× -39× -  -  -  -  -  -42× -  -  -  -  -42× -42× -  -  -  -  -  -81× -  -  -  -  -  -  -  -81× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -232× -232× -232× -232× -232× -  -232× -  -  -  -  -  -  -232× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -476× -  -476× -476× -476× -476× -476× -  -  -  -  -  -  -  -476× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -81× -81× -  -  -  -  -  -  -  -81× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -179× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -267× -267× -265× -  -265× -265× -265× -  -  -  -  -265× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -439× -419× -  -  -439× -439× -  -439× -439× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -439× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -81× -81× -  -81× -  -  -  -  -  -  -  -81× -  -  -  -  -  -  -  -81× -81× -  -  -  -  -  -  -81× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× - -  - -  -  -  -  - -  -  -  -  -  -  -96× -  -  -  -  -95× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -178× -  -  -  -  -  -177× -  -  -  -  -  -  -176× -  -  -  -  -174× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -226× -  -  -  -  -225× -  -  -  -  -  -224× -175× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -88× - -  -  -  -  -  -  -85× -83× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -179× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
-import { Lib_Math } from "../../libraries/utils/Lib_Math.sol";
- 
-/* Interface Imports */
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/* Contract Imports */
-import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
- 
- 
-/**
- * @title OVM_CanonicalTransactionChain
- * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions
- * which must be applied to the rollup state. It defines the ordering of rollup transactions by
- * writing them to the 'CTC:batches' instance of the Chain Storage Container.
- * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer
- * will eventually append it to the rollup state.
- * If the Sequencer does not include an enqueued transaction within the 'force inclusion period',
- * then any account may force it to be included by calling appendQueueBatch().
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_AddressResolver {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    // L2 tx gas-related
-    uint256 constant public MIN_ROLLUP_TX_GAS = 100000;
-    uint256 constant public MAX_ROLLUP_TX_SIZE = 10000;
-    uint256 constant public L2_GAS_DISCOUNT_DIVISOR = 32;
- 
-    // Encoding-related (all in bytes)
-    uint256 constant internal BATCH_CONTEXT_SIZE = 16;
-    uint256 constant internal BATCH_CONTEXT_LENGTH_POS = 12;
-    uint256 constant internal BATCH_CONTEXT_START_POS = 15;
-    uint256 constant internal TX_DATA_HEADER_SIZE = 3;
-    uint256 constant internal BYTES_TILL_TX_DATA = 65;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    uint256 public forceInclusionPeriodSeconds;
-    uint256 public forceInclusionPeriodBlocks;
-    uint256 public maxTransactionGasLimit;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    constructor(
-        address _libAddressManager,
-        uint256 _forceInclusionPeriodSeconds,
-        uint256 _forceInclusionPeriodBlocks,
-        uint256 _maxTransactionGasLimit
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        forceInclusionPeriodSeconds = _forceInclusionPeriodSeconds;
-        forceInclusionPeriodBlocks = _forceInclusionPeriodBlocks;
-        maxTransactionGasLimit = _maxTransactionGasLimit;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        override
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:CTC:batches")
-        );
-    }
- 
-    /**
-     * Accesses the queue storage container.
-     * @return Reference to the queue storage container.
-     */
-    function queue()
-        override
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:CTC:queue")
-        );
-    }
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        override
-        public
-        view
-        returns (
-            uint256 _totalElements
-        )
-    {
-        (uint40 totalElements,,,) = _getBatchExtraData();
-        return uint256(totalElements);
-    }
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        override
-        public
-        view
-        returns (
-            uint256 _totalBatches
-        )
-    {
-        return batches().length();
-    }
- 
-    /**
-     * Returns the index of the next element to be enqueued.
-     * @return Index for the next queue element.
-     */
-    function getNextQueueIndex()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,uint40 nextQueueIndex,,) = _getBatchExtraData();
-        return nextQueueIndex;
-    }
- 
-    /**
-     * Returns the timestamp of the last transaction.
-     * @return Timestamp for the last transaction.
-     */
-    function getLastTimestamp()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,,uint40 lastTimestamp,) = _getBatchExtraData();
-        return lastTimestamp;
-    }
- 
-    /**
-     * Returns the blocknumber of the last transaction.
-     * @return Blocknumber for the last transaction.
-     */
-    function getLastBlockNumber()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,,,uint40 lastBlockNumber) = _getBatchExtraData();
-        return lastBlockNumber;
-    }
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function getQueueElement(
-        uint256 _index
-    )
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        )
-    {
-        return _getQueueElement(
-            _index,
-            queue()
-        );
-    }
- 
-    /**
-     * Get the number of queue elements which have not yet been included.
-     * @return Number of pending queue elements.
-     */
-    function getNumPendingQueueElements()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        return getQueueLength() - getNextQueueIndex();
-    }
- 
-   /**
-     * Retrieves the length of the queue, including
-     * both pending and canonical transactions.
-     * @return Length of the queue.
-     */
-    function getQueueLength()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        return _getQueueLength(
-            queue()
-        );
-    }
- 
-    /**
-     * Adds a transaction to the queue.
-     * @param _target Target L2 contract to send the transaction to.
-     * @param _gasLimit Gas limit for the enqueued L2 transaction.
-     * @param _data Transaction data.
-     */
-    function enqueue(
-        address _target,
-        uint256 _gasLimit,
-        bytes memory _data
-    )
-        override
-        public
-    {
-        require(
-            _data.length <= MAX_ROLLUP_TX_SIZE,
-            "Transaction data size exceeds maximum for rollup transaction."
-        );
- 
-        require(
-            _gasLimit <= maxTransactionGasLimit,
-            "Transaction gas limit exceeds maximum for rollup transaction."
-        );
- 
-        require(
-            _gasLimit >= MIN_ROLLUP_TX_GAS,
-            "Transaction gas limit too low to enqueue."
-        );
- 
-        // We need to consume some amount of L1 gas in order to rate limit transactions going into
-        // L2. However, L2 is cheaper than L1 so we only need to burn some small proportion of the
-        // provided L1 gas.
-        uint256 gasToConsume = _gasLimit/L2_GAS_DISCOUNT_DIVISOR;
-        uint256 startingGas = gasleft();
- 
-        // Although this check is not necessary (burn below will run out of gas if not true), it
-        // gives the user an explicit reason as to why the enqueue attempt failed.
-        require(
-            startingGas > gasToConsume,
-            "Insufficient gas for L2 rate limiting burn."
-        );
- 
-        // Here we do some "dumb" work in order to burn gas, although we should probably replace
-        // this with something like minting gas token later on.
-        uint256 i;
-        while(startingGas - gasleft() < gasToConsume) {
-            i++;
-        }
- 
-        bytes32 transactionHash = keccak256(
-            abi.encode(
-                msg.sender,
-                _target,
-                _gasLimit,
-                _data
-            )
-        );
- 
-        bytes32 timestampAndBlockNumber;
-        assembly {
-            timestampAndBlockNumber := timestamp()
-            timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
-        }
- 
-        iOVM_ChainStorageContainer queueRef = queue();
- 
-        queueRef.push(transactionHash);
-        queueRef.push(timestampAndBlockNumber);
- 
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the real queue length we need
-        // to divide by 2 and subtract 1.
-        uint256 queueIndex = queueRef.length() / 2 - 1;
-        emit TransactionEnqueued(
-            msg.sender,
-            _target,
-            _gasLimit,
-            _data,
-            queueIndex,
-            block.timestamp
-        );
-    }
- 
-    /**
-     * Appends a given number of queued transactions as a single batch.
-     * param _numQueuedTransactions Number of transactions to append.
-     */
-    function appendQueueBatch(
-        uint256 // _numQueuedTransactions
-    )
-        override
-        public
-        pure
-    {
-        // TEMPORARY: Disable `appendQueueBatch` for minnet
-        revert("appendQueueBatch is currently disabled.");
- 
-        // _numQueuedTransactions = Lib_Math.min(_numQueuedTransactions, getNumPendingQueueElements());
-        // require(
-        //     _numQueuedTransactions > 0,
-        //     "Must append more than zero transactions."
-        // );
- 
-        // bytes32[] memory leaves = new bytes32[](_numQueuedTransactions);
-        // uint40 nextQueueIndex = getNextQueueIndex();
- 
-        // for (uint256 i = 0; i < _numQueuedTransactions; i++) {
-        //     if (msg.sender != resolve("OVM_Sequencer")) {
-        //         Lib_OVMCodec.QueueElement memory el = getQueueElement(nextQueueIndex);
-        //         require(
-        //             el.timestamp + forceInclusionPeriodSeconds < block.timestamp,
-        //             "Queue transactions cannot be submitted during the sequencer inclusion period."
-        //         );
-        //     }
-        //     leaves[i] = _getQueueLeafHash(nextQueueIndex);
-        //     nextQueueIndex++;
-        // }
- 
-        // Lib_OVMCodec.QueueElement memory lastElement = getQueueElement(nextQueueIndex - 1);
- 
-        // _appendBatch(
-        //     Lib_MerkleTree.getMerkleRoot(leaves),
-        //     _numQueuedTransactions,
-        //     _numQueuedTransactions,
-        //     lastElement.timestamp,
-        //     lastElement.blockNumber
-        // );
- 
-        // emit QueueBatchAppended(
-        //     nextQueueIndex - _numQueuedTransactions,
-        //     _numQueuedTransactions,
-        //     getTotalElements()
-        // );
-    }
- 
-    /**
-     * Allows the sequencer to append a batch of transactions.
-     * @dev This function uses a custom encoding scheme for efficiency reasons.
-     * .param _shouldStartAtElement Specific batch we expect to start appending to.
-     * .param _totalElementsToAppend Total number of batch elements we expect to append.
-     * .param _contexts Array of batch contexts.
-     * .param _transactionDataFields Array of raw transaction data.
-     */
-    function appendSequencerBatch()
-        override
-        public
-    {
-        uint40 shouldStartAtElement;
-        uint24 totalElementsToAppend;
-        uint24 numContexts;
-        assembly {
-            shouldStartAtElement  := shr(216, calldataload(4))
-            totalElementsToAppend := shr(232, calldataload(9))
-            numContexts           := shr(232, calldataload(12))
-        }
- 
-        require(
-            shouldStartAtElement == getTotalElements(),
-            "Actual batch start index does not match expected start index."
-        );
- 
-        require(
-            msg.sender == resolve("OVM_Sequencer"),
-            "Function can only be called by the Sequencer."
-        );
- 
-        require(
-            numContexts > 0,
-            "Must provide at least one batch context."
-        );
- 
-        require(
-            totalElementsToAppend > 0,
-            "Must append at least one element."
-        );
- 
-        uint40 nextTransactionPtr = uint40(BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts);
- 
-        Erequire(
-            msg.data.length >= nextTransactionPtr,
-            "Not enough BatchContexts provided."
-        );
- 
-        // Take a reference to the queue and its length so we don't have to keep resolving it.
-        // Length isn't going to change during the course of execution, so it's fine to simply
-        // resolve this once at the start. Saves gas.
-        iOVM_ChainStorageContainer queueRef = queue();
-        uint40 queueLength = _getQueueLength(queueRef);
- 
-        // Reserve some memory to save gas on hashing later on. This is a relatively safe estimate
-        // for the average transaction size that will prevent having to resize this chunk of memory
-        // later on. Saves gas.
-        bytes memory hashMemory = new bytes((msg.data.length / totalElementsToAppend) * 2);
- 
-        // Initialize the array of canonical chain leaves that we will append.
-        bytes32[] memory leaves = new bytes32[](totalElementsToAppend);
- 
-        // Each leaf index corresponds to a tx, either sequenced or enqueued.
-        uint32 leafIndex = 0;
- 
-        // Counter for number of sequencer transactions appended so far.
-        uint32 numSequencerTransactions = 0;
- 
-        // We will sequentially append leaves which are pointers to the queue.
-        // The initial queue index is what is currently in storage.
-        uint40 nextQueueIndex = getNextQueueIndex();
- 
-        BatchContext memory curContext;
-        for (uint32 i = 0; i < numContexts; i++) {
-            BatchContext memory nextContext = _getBatchContext(i);
- 
-            if (i == 0) {
-                // Execute a special check for the first batch.
-                _validateFirstBatchContext(nextContext);
-            }
- 
-            // Execute this check on every single batch, including the first one.
-            _validateNextBatchContext(
-                curContext,
-                nextContext,
-                nextQueueIndex,
-                queueRef
-            );
- 
-            // Now we can update our current context.
-            curContext = nextContext;
- 
-            // Process sequencer transactions first.
-            for (uint32 j = 0; j < curContext.numSequencedTransactions; j++) {
-                uint256 txDataLength;
-                assembly {
-                    txDataLength := shr(232, calldataload(nextTransactionPtr))
-                }
- 
-                leaves[leafIndex] = _getSequencerLeafHash(
-                    curContext,
-                    nextTransactionPtr,
-                    txDataLength,
-                    hashMemory
-                );
- 
-                nextTransactionPtr += uint40(TX_DATA_HEADER_SIZE + txDataLength);
-                numSequencerTransactions++;
-                leafIndex++;
-            }
- 
-            // Now process any subsequent queue transactions.
-            for (uint32 j = 0; j < curContext.numSubsequentQueueTransactions; j++) {
-                require(
-                    nextQueueIndex < queueLength,
-                    "Not enough queued transactions to append."
-                );
- 
-                leaves[leafIndex] = _getQueueLeafHash(nextQueueIndex);
-                nextQueueIndex++;
-                leafIndex++;
-            }
-        }
- 
-        _validateFinalBatchContext(
-            curContext,
-            nextQueueIndex,
-            queueLength,
-            queueRef
-        );
- 
-        require(
-            msg.data.length == nextTransactionPtr,
-            "Not all sequencer transactions were processed."
-        );
- 
-        Erequire(
-            leafIndex == totalElementsToAppend,
-            "Actual transaction index does not match expected total elements to append."
-        );
- 
-        // Generate the required metadata that we need to append this batch
-        uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
-        uint40 blockTimestamp;
-        uint40 blockNumber;
-        if (curContext.numSubsequentQueueTransactions == 0) {
-            // The last element is a sequencer tx, therefore pull timestamp and block number from the last context.
-            blockTimestamp = uint40(curContext.timestamp);
-            blockNumber = uint40(curContext.blockNumber);
-        } else {
-            // The last element is a queue tx, therefore pull timestamp and block number from the queue element.
-            // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at least one queue element.
-            // We increment nextQueueIndex after processing each queue element,
-            // so the index of the last element we processed is nextQueueIndex - 1.
-            Lib_OVMCodec.QueueElement memory lastElement = _getQueueElement(
-                nextQueueIndex - 1,
-                queueRef
-            );
- 
-            blockTimestamp = lastElement.timestamp;
-            blockNumber = lastElement.blockNumber;
-        }
- 
-        // For efficiency reasons getMerkleRoot modifies the `leaves` argument in place
-        // while calculating the root hash therefore any arguments passed to it must not
-        // be used again afterwards
-        _appendBatch(
-            Lib_MerkleTree.getMerkleRoot(leaves),
-            totalElementsToAppend,
-            numQueuedTransactions,
-            blockTimestamp,
-            blockNumber
-        );
- 
-        emit SequencerBatchAppended(
-            nextQueueIndex - numQueuedTransactions,
-            numQueuedTransactions,
-            getTotalElements()
-        );
-    }
- 
-    /**
-     * Verifies whether a transaction is included in the chain.
-     * @param _transaction Transaction to verify.
-     * @param _txChainElement Transaction chain element corresponding to the transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
-     * @return True if the transaction exists in the CTC, false if not.
-     */
-    function verifyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        if (_txChainElement.isSequenced == true) {
-            return _verifySequencerTransaction(
-                _transaction,
-                _txChainElement,
-                _batchHeader,
-                _inclusionProof
-            );
-        } else {
-            return _verifyQueueTransaction(
-                _transaction,
-                _txChainElement.queueIndex,
-                _batchHeader,
-                _inclusionProof
-            );
-        }
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Returns the BatchContext located at a particular index.
-     * @param _index The index of the BatchContext
-     * @return The BatchContext at the specified index.
-     */
-    function _getBatchContext(
-        uint256 _index
-    )
-        internal
-        pure
-        returns (
-            BatchContext memory
-        )
-    {
-        uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;
-        uint256 numSequencedTransactions;
-        uint256 numSubsequentQueueTransactions;
-        uint256 ctxTimestamp;
-        uint256 ctxBlockNumber;
- 
-        assembly {
-            numSequencedTransactions       := shr(232, calldataload(contextPtr))
-            numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))
-            ctxTimestamp                   := shr(216, calldataload(add(contextPtr, 6)))
-            ctxBlockNumber                 := shr(216, calldataload(add(contextPtr, 11)))
-        }
- 
-        return BatchContext({
-            numSequencedTransactions: numSequencedTransactions,
-            numSubsequentQueueTransactions: numSubsequentQueueTransactions,
-            timestamp: ctxTimestamp,
-            blockNumber: ctxBlockNumber
-        });
-    }
- 
-    /**
-     * Parses the batch context from the extra data.
-     * @return Total number of elements submitted.
-     * @return Index of the next queue element.
-     */
-    function _getBatchExtraData()
-        internal
-        view
-        returns (
-            uint40,
-            uint40,
-            uint40,
-            uint40
-        )
-    {
-        bytes27 extraData = batches().getGlobalMetadata();
- 
-        uint40 totalElements;
-        uint40 nextQueueIndex;
-        uint40 lastTimestamp;
-        uint40 lastBlockNumber;
-        assembly {
-            extraData       :=  shr(40, extraData)
-            totalElements   :=  and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            nextQueueIndex  :=  shr(40, and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000))
-            lastTimestamp   :=  shr(80, and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000))
-            lastBlockNumber :=  shr(120, and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000))
-        }
- 
-        return (
-            totalElements,
-            nextQueueIndex,
-            lastTimestamp,
-            lastBlockNumber
-        );
-    }
- 
-    /**
-     * Encodes the batch context for the extra data.
-     * @param _totalElements Total number of elements submitted.
-     * @param _nextQueueIndex Index of the next queue element.
-     * @param _timestamp Timestamp for the last batch.
-     * @param _blockNumber Block number of the last batch.
-     * @return Encoded batch context.
-     */
-    function _makeBatchExtraData(
-        uint40 _totalElements,
-        uint40 _nextQueueIndex,
-        uint40 _timestamp,
-        uint40 _blockNumber
-    )
-        internal
-        pure
-        returns (
-            bytes27
-        )
-    {
-        bytes27 extraData;
-        assembly {
-            extraData := _totalElements
-            extraData := or(extraData, shl(40, _nextQueueIndex))
-            extraData := or(extraData, shl(80, _timestamp))
-            extraData := or(extraData, shl(120, _blockNumber))
-            extraData := shl(40, extraData)
-        }
- 
-        return extraData;
-    }
- 
-    /**
-     * Retrieves the hash of a queue element.
-     * @param _index Index of the queue element to retrieve a hash for.
-     * @return Hash of the queue element.
-     */
-    function _getQueueLeafHash(
-        uint256 _index
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return _hashTransactionChainElement(
-            Lib_OVMCodec.TransactionChainElement({
-                isSequenced: false,
-                queueIndex: _index,
-                timestamp: 0,
-                blockNumber: 0,
-                txData: hex""
-            })
-        );
-    }
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function _getQueueElement(
-        uint256 _index,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        )
-    {
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the actual desired queue index
-        // we need to multiply by 2.
-        uint40 trueIndex = uint40(_index * 2);
-        bytes32 transactionHash = _queueRef.get(trueIndex);
-        bytes32 timestampAndBlockNumber = _queueRef.get(trueIndex + 1);
- 
-        uint40 elementTimestamp;
-        uint40 elementBlockNumber;
-        assembly {
-            elementTimestamp   :=         and(timestampAndBlockNumber, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            elementBlockNumber := shr(40, and(timestampAndBlockNumber, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
-        }
- 
-        return Lib_OVMCodec.QueueElement({
-            transactionHash: transactionHash,
-            timestamp: elementTimestamp,
-            blockNumber: elementBlockNumber
-        });
-    }
- 
-    /**
-     * Retrieves the length of the queue.
-     * @return Length of the queue.
-     */
-    function _getQueueLength(
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the real queue length we need
-        // to divide by 2.
-        return uint40(_queueRef.length() / 2);
-    }
- 
-    /**
-     * Retrieves the hash of a sequencer element.
-     * @param _context Batch context for the given element.
-     * @param _nextTransactionPtr Pointer to the next transaction in the calldata.
-     * @param _txDataLength Length of the transaction item.
-     * @return Hash of the sequencer element.
-     */
-    function _getSequencerLeafHash(
-        BatchContext memory _context,
-        uint256 _nextTransactionPtr,
-        uint256 _txDataLength,
-        bytes memory _hashMemory
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        // Only allocate more memory if we didn't reserve enough to begin with.
-        if (BYTES_TILL_TX_DATA + _txDataLength > _hashMemory.length) {
-            _hashMemory = new bytes(BYTES_TILL_TX_DATA + _txDataLength);
-        }
- 
-        uint256 ctxTimestamp = _context.timestamp;
-        uint256 ctxBlockNumber = _context.blockNumber;
- 
-        bytes32 leafHash;
-        assembly {
-            let chainElementStart := add(_hashMemory, 0x20)
- 
-            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
-            // This distinguishes sequencer ChainElements from queue ChainElements because
-            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
-            // elements is always zero
-            mstore8(chainElementStart, 1)
- 
-            mstore(add(chainElementStart, 1), ctxTimestamp)
-            mstore(add(chainElementStart, 33), ctxBlockNumber)
- 
-            calldatacopy(add(chainElementStart, BYTES_TILL_TX_DATA), add(_nextTransactionPtr, 3), _txDataLength)
- 
-            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, _txDataLength))
-        }
- 
-        return leafHash;
-    }
- 
-    /**
-     * Retrieves the hash of a sequencer element.
-     * @param _txChainElement The chain element which is hashed to calculate the leaf.
-     * @return Hash of the sequencer element.
-     */
-    function _getSequencerLeafHash(
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement
-    )
-        internal
-        view
-        returns(
-            bytes32
-        )
-    {
-        bytes memory txData = _txChainElement.txData;
-        uint256 txDataLength = _txChainElement.txData.length;
- 
-        bytes memory chainElement = new bytes(BYTES_TILL_TX_DATA + txDataLength);
-        uint256 ctxTimestamp = _txChainElement.timestamp;
-        uint256 ctxBlockNumber = _txChainElement.blockNumber;
- 
-        bytes32 leafHash;
-        assembly {
-            let chainElementStart := add(chainElement, 0x20)
- 
-            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
-            // This distinguishes sequencer ChainElements from queue ChainElements because
-            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
-            // elements is always zero
-            mstore8(chainElementStart, 1)
- 
-            mstore(add(chainElementStart, 1), ctxTimestamp)
-            mstore(add(chainElementStart, 33), ctxBlockNumber)
- 
-            pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart, BYTES_TILL_TX_DATA), txDataLength))
- 
-            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, txDataLength))
-        }
- 
-        return leafHash;
-    }
- 
-    /**
-     * Inserts a batch into the chain of batches.
-     * @param _transactionRoot Root of the transaction tree for this batch.
-     * @param _batchSize Number of elements in the batch.
-     * @param _numQueuedTransactions Number of queue transactions in the batch.
-     * @param _timestamp The latest batch timestamp.
-     * @param _blockNumber The latest batch blockNumber.
-     */
-    function _appendBatch(
-        bytes32 _transactionRoot,
-        uint256 _batchSize,
-        uint256 _numQueuedTransactions,
-        uint40 _timestamp,
-        uint40 _blockNumber
-    )
-        internal
-    {
-        iOVM_ChainStorageContainer batchesRef = batches();
-        (uint40 totalElements, uint40 nextQueueIndex,,) = _getBatchExtraData();
- 
-        Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({
-            batchIndex: batchesRef.length(),
-            batchRoot: _transactionRoot,
-            batchSize: _batchSize,
-            prevTotalElements: totalElements,
-            extraData: hex""
-        });
- 
-        emit TransactionBatchAppended(
-            header.batchIndex,
-            header.batchRoot,
-            header.batchSize,
-            header.prevTotalElements,
-            header.extraData
-        );
- 
-        bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);
-        bytes27 latestBatchContext = _makeBatchExtraData(
-            totalElements + uint40(header.batchSize),
-            nextQueueIndex + uint40(_numQueuedTransactions),
-            _timestamp,
-            _blockNumber
-        );
- 
-        batchesRef.push(batchHeaderHash, latestBatchContext);
-    }
- 
-    /**
-     * Checks that the first batch context in a sequencer submission is valid
-     * @param _firstContext The batch context to validate.
-     */
-    function _validateFirstBatchContext(
-        BatchContext memory _firstContext
-    )
-        internal
-        view
-    {
-        // If there are existing elements, this batch must have the same context 
-        // or a later timestamp and block number.
-        if (getTotalElements() > 0) {
-            (,, uint40 lastTimestamp, uint40 lastBlockNumber) = _getBatchExtraData();
- 
-            require(
-                _firstContext.blockNumber >= lastBlockNumber,
-                "Context block number is lower than last submitted."
-            );
- 
-            Irequire(
-                _firstContext.timestamp >= lastTimestamp,
-                "Context timestamp is lower than last submitted."
-            );
-        }
- 
-        // Sequencer cannot submit contexts which are more than the force inclusion period old.
-        require(
-            _firstContext.timestamp + forceInclusionPeriodSeconds >= block.timestamp,
-            "Context timestamp too far in the past."
-        );
- 
-        require(
-            _firstContext.blockNumber + forceInclusionPeriodBlocks >= block.number,
-            "Context block number too far in the past."
-        );
-    }
- 
-    /**
-     * Checks that a given batch context has a time context which is below a given que element
-     * @param _context The batch context to validate has values lower.
-     * @param _queueIndex Index of the queue element we are validating came later than the context.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateContextBeforeEnqueue(
-        BatchContext memory _context,
-        uint40 _queueIndex,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-            Lib_OVMCodec.QueueElement memory nextQueueElement = _getQueueElement(
-                _queueIndex,
-                _queueRef
-            );
- 
-            // If the force inclusion period has passed for an enqueued transaction, it MUST be the next chain element.
-            require(
-                block.timestamp < nextQueueElement.timestamp + forceInclusionPeriodSeconds,
-                "Previously enqueued batches have expired and must be appended before a new sequencer batch."
-            );
- 
-            // Just like sequencer transaction times must be increasing relative to each other,
-            // We also require that they be increasing relative to any interspersed queue elements.
-            require(
-                _context.timestamp <= nextQueueElement.timestamp,
-                "Sequencer transaction timestamp exceeds that of next queue element."
-            );
- 
-            require(
-                _context.blockNumber <= nextQueueElement.blockNumber,
-                "Sequencer transaction blockNumber exceeds that of next queue element."
-            );
-    }
- 
-    /**
-     * Checks that a given batch context is valid based on its previous context, and the next queue elemtent.
-     * @param _prevContext The previously validated batch context.
-     * @param _nextContext The batch context to validate with this call.
-     * @param _nextQueueIndex Index of the next queue element to process for the _nextContext's subsequentQueueElements.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateNextBatchContext(
-        BatchContext memory _prevContext,
-        BatchContext memory _nextContext,
-        uint40 _nextQueueIndex,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-        // All sequencer transactions' times must be greater than or equal to the previous ones.
-        require(
-            _nextContext.timestamp >= _prevContext.timestamp,
-            "Context timestamp values must monotonically increase."
-        );
- 
-        require(
-            _nextContext.blockNumber >= _prevContext.blockNumber,
-            "Context blockNumber values must monotonically increase."
-        );
- 
-        // If there is going to be a queue element pulled in from this context:
-        if (_nextContext.numSubsequentQueueTransactions > 0) {
-            _validateContextBeforeEnqueue(
-                _nextContext,
-                _nextQueueIndex,
-                _queueRef
-            );
-        }
-    }
- 
-    /**
-     * Checks that the final batch context in a sequencer submission is valid.
-     * @param _finalContext The batch context to validate.
-     * @param _queueLength The length of the queue at the start of the batchAppend call.
-     * @param _nextQueueIndex The next element in the queue that will be pulled into the CTC.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateFinalBatchContext(
-        BatchContext memory _finalContext,
-        uint40 _nextQueueIndex,
-        uint40 _queueLength,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-        // If the queue is not now empty, check the mononoticity of whatever the next batch that will come in is.
-        if (_queueLength - _nextQueueIndex > 0 && _finalContext.numSubsequentQueueTransactions == 0) {
-            _validateContextBeforeEnqueue(
-                _finalContext,
-                _nextQueueIndex,
-                _queueRef
-            );
-        }
-        // Batches cannot be added from the future, or subsequent enqueue() contexts would violate monotonicity.
-        require(_finalContext.timestamp <= block.timestamp, "Context timestamp is from the future.");
-        require(_finalContext.blockNumber <= block.number, "Context block number is from the future.");
-    }
- 
-    /**
-     * Hashes a transaction chain element.
-     * @param _element Chain element to hash.
-     * @return Hash of the chain element.
-     */
-    function _hashTransactionChainElement(
-        Lib_OVMCodec.TransactionChainElement memory _element
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(
-            abi.encode(
-                _element.isSequenced,
-                _element.queueIndex,
-                _element.timestamp,
-                _element.blockNumber,
-                _element.txData
-            )
-        );
-    }
- 
-    /**
-     * Verifies a sequencer transaction, returning true if it was indeed included in the CTC
-     * @param _transaction The transaction we are verifying inclusion of.
-     * @param _txChainElement The chain element that the transaction is claimed to be a part of.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof An inclusion proof into the CTC at a particular index.
-     * @return True if the transaction was included in the specified location, else false.
-     */
-    function _verifySequencerTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        OVM_ExecutionManager ovmExecutionManager = OVM_ExecutionManager(resolve("OVM_ExecutionManager"));
-        uint256 gasLimit = ovmExecutionManager.getMaxTransactionGasLimit();
-        bytes32 leafHash = _getSequencerLeafHash(_txChainElement);
- 
-        Erequire(
-            _verifyElement(
-                leafHash,
-                _batchHeader,
-                _inclusionProof
-            ),
-            "Invalid Sequencer transaction inclusion proof."
-        );
- 
-        Erequire(
-            _transaction.blockNumber        == _txChainElement.blockNumber
-            && _transaction.timestamp       == _txChainElement.timestamp
-            && _transaction.entrypoint      == resolve("OVM_DecompressionPrecompileAddress")
-            && _transaction.gasLimit        == gasLimit
-            && _transaction.l1TxOrigin      == address(0)
-            && _transaction.l1QueueOrigin   == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
-            && keccak256(_transaction.data) == keccak256(_txChainElement.txData),
-            "Invalid Sequencer transaction."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * Verifies a queue transaction, returning true if it was indeed included in the CTC
-     * @param _transaction The transaction we are verifying inclusion of.
-     * @param _queueIndex The queueIndex of the queued transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof An inclusion proof into the CTC at a particular index (should point to queue tx).
-     * @return True if the transaction was included in the specified location, else false.
-     */
-    function _verifyQueueTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        uint256 _queueIndex,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 leafHash = _getQueueLeafHash(_queueIndex);
- 
-        Erequire(
-            _verifyElement(
-                leafHash,
-                _batchHeader,
-                _inclusionProof
-            ),
-            "Invalid Queue transaction inclusion proof."
-        );
- 
-        bytes32 transactionHash = keccak256(
-            abi.encode(
-                _transaction.l1TxOrigin,
-                _transaction.entrypoint,
-                _transaction.gasLimit,
-                _transaction.data
-            )
-        );
- 
-        Lib_OVMCodec.QueueElement memory el = getQueueElement(_queueIndex);
-        Erequire(
-            el.transactionHash      == transactionHash
-            && el.timestamp   == _transaction.timestamp
-            && el.blockNumber == _transaction.blockNumber,
-            "Invalid Queue transaction."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * Verifies a batch inclusion proof.
-     * @param _element Hash of the element to verify a proof for.
-     * @param _batchHeader Header of the batch in which the element was included.
-     * @param _proof Merkle inclusion proof for the element.
-     */
-    function _verifyElement(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        Erequire(
-            Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(uint32(_batchHeader.batchIndex)),
-            "Invalid batch header."
-        );
- 
-        Erequire(
-            Lib_MerkleTree.verify(
-                _batchHeader.batchRoot,
-                _element,
-                _proof.index,
-                _proof.siblings,
-                _batchHeader.batchSize
-            ),
-            "Invalid inclusion proof."
-        );
- 
-        return true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/chain/OVM_ChainStorageContainer.sol.html b/coverage/lcov-report/OVM/chain/OVM_ChainStorageContainer.sol.html deleted file mode 100644 index 537ad24b1..000000000 --- a/coverage/lcov-report/OVM/chain/OVM_ChainStorageContainer.sol.html +++ /dev/null @@ -1,680 +0,0 @@ - - - - Code coverage report for OVM/chain/OVM_ChainStorageContainer.sol - - - - - - - -
-
-

- all files / OVM/chain/ OVM_ChainStorageContainer.sol -

-
-
- 72.73% - Statements - 8/11 -
-
- 50% - Branches - 1/2 -
-
- 72.73% - Functions - 8/11 -
-
- 75% - Lines - 9/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -504× -  -  -  -  -  -  -  -  -573× -  -  -  -573× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -550× -  -  -  -  -  -  -  -  -  -  -  -  -  -441× -  -  -  -  -  -  -  -  -  -  -  -  -470× -  -  -  -  -  -  -  -  -  -  -  -  -  -102× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_RingBuffer } from "../../libraries/utils/Lib_RingBuffer.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/**
- * @title OVM_ChainStorageContainer
- * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.
- * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used
- * in a fraud proof due to the fraud window having passed, and the associated chain state or
- * transactions being finalized.
- * Three distinct Chain Storage Containers will be deployed on Layer 1:
- * 1. Stores transaction batches for the Canonical Transaction Chain
- * 2. Stores queued transactions for the Canonical Transaction Chain
- * 3. Stores chain state batches for the State Commitment Chain
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {
- 
-    /*************
-     * Libraries *
-     *************/
- 
-    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    string public owner;
-    Lib_RingBuffer.RingBuffer internal buffer;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _owner Name of the contract that owns this container (will be resolved later).
-     */
-    constructor(
-        address _libAddressManager,
-        string memory _owner
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        owner = _owner;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyOwner() {
-        Erequire(
-            msg.sender == resolve(owner),
-            "OVM_ChainStorageContainer: Function can only be called by the owner."
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function setGlobalMetadata(
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        return buffer.setExtraData(_globalMetadata);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function getGlobalMetadata()
-        override
-        public
-        view
-        returns (
-            bytes27
-        )
-    {
-        return buffer.getExtraData();
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function length()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return uint256(buffer.getLength());
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function push(
-        bytes32 _object
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.push(_object);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function push(
-        bytes32 _object,
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.push(_object, _globalMetadata);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function get(
-        uint256 _index
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        return buffer.get(uint40(_index));
-    }
-    
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.deleteElementsAfterInclusive(
-            uint40(_index)
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index,
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.deleteElementsAfterInclusive(
-            uint40(_index),
-            _globalMetadata
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function setNextOverwritableIndex(
-        uint256 _index
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.nextOverwritableIndex = _index;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/chain/OVM_StateCommitmentChain.sol.html b/coverage/lcov-report/OVM/chain/OVM_StateCommitmentChain.sol.html deleted file mode 100644 index 059e03525..000000000 --- a/coverage/lcov-report/OVM/chain/OVM_StateCommitmentChain.sol.html +++ /dev/null @@ -1,1307 +0,0 @@ - - - - Code coverage report for OVM/chain/OVM_StateCommitmentChain.sol - - - - - - - -
-
-

- all files / OVM/chain/ OVM_StateCommitmentChain.sol -

-
-
- 88.1% - Statements - 37/42 -
-
- 67.86% - Branches - 19/28 -
-
- 85.71% - Functions - 12/14 -
-
- 88.64% - Lines - 39/44 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -60× -60× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -125× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -24× -  -  -  -  -24× -  -  -  -  -23× -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -74× -  -74× -74× -74× -  -  -  -  -  -74× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -  -22× -20× -  -  -  -  -  - -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
- 
-/* Interface Imports */
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
-import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/* External Imports */
-import '@openzeppelin/contracts/math/SafeMath.sol';
- 
-/**
- * @title OVM_StateCommitmentChain
- * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which
- * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).
- * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique
- * state root calculated off-chain by applying the canonical transactions one by one.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 public FRAUD_PROOF_WINDOW;
-    uint256 public SEQUENCER_PUBLISH_WINDOW;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager,
-        uint256 _fraudProofWindow,
-        uint256 _sequencerPublishWindow
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        FRAUD_PROOF_WINDOW = _fraudProofWindow;
-        SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:SCC:batches")
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getTotalElements()
-        override
-        public
-        view
-        returns (
-            uint256 _totalElements
-        )
-    {
-        (uint40 totalElements, ) = _getBatchExtraData();
-        return uint256(totalElements);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getTotalBatches()
-        override
-        public
-        view
-        returns (
-            uint256 _totalBatches
-        )
-    {
-        return batches().length();
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getLastSequencerTimestamp()
-        override
-        public
-        view
-        returns (
-            uint256 _lastSequencerTimestamp
-        )
-    {
-        (, uint40 lastSequencerTimestamp) = _getBatchExtraData();
-        return uint256(lastSequencerTimestamp);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function appendStateBatch(
-        bytes32[] memory _batch,
-        uint256 _shouldStartAtElement
-    )
-        override
-        public
-    {
-        // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the
-        // publication of batches by some other user.
-        require(
-            _shouldStartAtElement == getTotalElements(),
-            "Actual batch start index does not match expected start index."
-        );
- 
-        // Proposers must have previously staked at the BondManager
-        Erequire(
-            iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender),
-            "Proposer does not have enough collateral posted"
-        );
- 
-        require(
-            _batch.length > 0,
-            "Cannot submit an empty state batch."
-        );
- 
-        require(
-            getTotalElements() + _batch.length <= iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(),
-            "Number of state roots cannot exceed the number of canonical transactions."
-        );
- 
-        // Pass the block's timestamp and the publisher of the data
-        // to be used in the fraud proofs
-        _appendBatch(
-            _batch,
-            abi.encode(block.timestamp, msg.sender)
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function deleteStateBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        override
-        public
-    {
-        require(
-            msg.sender == resolve("OVM_FraudVerifier"),
-            "State batches can only be deleted by the OVM_FraudVerifier."
-        );
- 
-        require(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        Erequire(
-            insideFraudProofWindow(_batchHeader),
-            "State batches can only be deleted within the fraud proof window."
-        );
- 
-        _deleteBatch(_batchHeader);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function verifyStateCommitment(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        require(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        require(
-            Lib_MerkleTree.verify(
-                _batchHeader.batchRoot,
-                _element,
-                _proof.index,
-                _proof.siblings,
-                _batchHeader.batchSize
-            ),
-            "Invalid inclusion proof."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function insideFraudProofWindow(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        override
-        public
-        view
-        returns (
-            bool _inside
-        )
-    {
-        (uint256 timestamp,) = abi.decode(
-            _batchHeader.extraData,
-            (uint256, address)
-        );
- 
-        Erequire(
-            timestamp != 0,
-            "Batch header timestamp cannot be zero"
-        );
-        return SafeMath.add(timestamp, FRAUD_PROOF_WINDOW) > block.timestamp;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Parses the batch context from the extra data.
-     * @return Total number of elements submitted.
-     * @return Timestamp of the last batch submitted by the sequencer.
-     */
-    function _getBatchExtraData()
-        internal
-        view
-        returns (
-            uint40,
-            uint40
-        )
-    {
-        bytes27 extraData = batches().getGlobalMetadata();
- 
-        uint40 totalElements;
-        uint40 lastSequencerTimestamp;
-        assembly {
-            extraData              := shr(40, extraData)
-            totalElements          :=         and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            lastSequencerTimestamp := shr(40, and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
-        }
- 
-        return (
-            totalElements,
-            lastSequencerTimestamp
-        );
-    }
- 
-    /**
-     * Encodes the batch context for the extra data.
-     * @param _totalElements Total number of elements submitted.
-     * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.
-     * @return Encoded batch context.
-     */
-    function _makeBatchExtraData(
-        uint40 _totalElements,
-        uint40 _lastSequencerTimestamp
-    )
-        internal
-        pure
-        returns (
-            bytes27
-        )
-    {
-        bytes27 extraData;
-        assembly {
-            extraData := _totalElements
-            extraData := or(extraData, shl(40, _lastSequencerTimestamp))
-            extraData := shl(40, extraData)
-        }
- 
-        return extraData;
-    }
- 
-    /**
-     * Appends a batch to the chain.
-     * @param _batch Elements within the batch.
-     * @param _extraData Any extra data to append to the batch.
-     */
-    function _appendBatch(
-        bytes32[] memory _batch,
-        bytes memory _extraData
-    )
-        internal
-    {
-        address sequencer = resolve("OVM_Proposer");
-        (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();
- 
-        if (msg.sender == sequencer) {
-            lastSequencerTimestamp = uint40(block.timestamp);
-        } else {
-            // We keep track of the last batch submitted by the sequencer so there's a window in
-            // which only the sequencer can publish state roots. A window like this just reduces
-            // the chance of "system breaking" state roots being published while we're still in
-            // testing mode. This window should be removed or significantly reduced in the future.
-            require(
-                lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,
-                "Cannot publish state roots within the sequencer publication window."
-            );
-        }
- 
-        // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place
-        // while calculating the root hash therefore any arguments passed to it must not
-        // be used again afterwards
-        Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({
-            batchIndex: getTotalBatches(),
-            batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),
-            batchSize: _batch.length,
-            prevTotalElements: totalElements,
-            extraData: _extraData
-        });
- 
-        emit StateBatchAppended(
-            batchHeader.batchIndex,
-            batchHeader.batchRoot,
-            batchHeader.batchSize,
-            batchHeader.prevTotalElements,
-            batchHeader.extraData
-        );
- 
-        batches().push(
-            Lib_OVMCodec.hashBatchHeader(batchHeader),
-            _makeBatchExtraData(
-                uint40(batchHeader.prevTotalElements + batchHeader.batchSize),
-                lastSequencerTimestamp
-            )
-        );
-    }
- 
-    /**
-     * Removes a batch and all subsequent batches from the chain.
-     * @param _batchHeader Header of the batch to remove.
-     */
-    function _deleteBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-    {
-        Erequire(
-            _batchHeader.batchIndex < batches().length(),
-            "Invalid batch index."
-        );
- 
-        Erequire(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        batches().deleteElementsAfterInclusive(
-            _batchHeader.batchIndex,
-            _makeBatchExtraData(
-                uint40(_batchHeader.prevTotalElements),
-                0
-            )
-        );
- 
-        emit StateBatchDeleted(
-            _batchHeader.batchIndex,
-            _batchHeader.batchRoot
-        );
-    }
- 
-    /**
-     * Checks that a batch header matches the stored hash for the given index.
-     * @param _batchHeader Batch header to validate.
-     * @return Whether or not the header matches the stored one.
-     */
-    function _isValidBatchHeader(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/chain/index.html b/coverage/lcov-report/OVM/chain/index.html deleted file mode 100644 index 3b8188133..000000000 --- a/coverage/lcov-report/OVM/chain/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for OVM/chain/ - - - - - - - -
-
-

- all files OVM/chain/ -

-
-
- 92.82% - Statements - 194/209 -
-
- 81.37% - Branches - 83/102 -
-
- 82.46% - Functions - 47/57 -
-
- 93.36% - Lines - 211/226 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_CanonicalTransactionChain.sol
95.51%149/15687.5%63/7284.38%27/3295.88%163/170
OVM_ChainStorageContainer.sol
72.73%8/1150%1/272.73%8/1175%9/12
OVM_StateCommitmentChain.sol
88.1%37/4267.86%19/2885.71%12/1488.64%39/44
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/execution/OVM_ExecutionManager.sol.html b/coverage/lcov-report/OVM/execution/OVM_ExecutionManager.sol.html deleted file mode 100644 index 774beb5aa..000000000 --- a/coverage/lcov-report/OVM/execution/OVM_ExecutionManager.sol.html +++ /dev/null @@ -1,5654 +0,0 @@ - - - - Code coverage report for OVM/execution/OVM_ExecutionManager.sol - - - - - - - -
-
-

- all files / OVM/execution/ OVM_ExecutionManager.sol -

-
-
- 74.58% - Statements - 176/236 -
-
- 62.2% - Branches - 51/82 -
-
- 83.61% - Functions - 51/61 -
-
- 75.21% - Lines - 182/242 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231 -1232 -1233 -1234 -1235 -1236 -1237 -1238 -1239 -1240 -1241 -1242 -1243 -1244 -1245 -1246 -1247 -1248 -1249 -1250 -1251 -1252 -1253 -1254 -1255 -1256 -1257 -1258 -1259 -1260 -1261 -1262 -1263 -1264 -1265 -1266 -1267 -1268 -1269 -1270 -1271 -1272 -1273 -1274 -1275 -1276 -1277 -1278 -1279 -1280 -1281 -1282 -1283 -1284 -1285 -1286 -1287 -1288 -1289 -1290 -1291 -1292 -1293 -1294 -1295 -1296 -1297 -1298 -1299 -1300 -1301 -1302 -1303 -1304 -1305 -1306 -1307 -1308 -1309 -1310 -1311 -1312 -1313 -1314 -1315 -1316 -1317 -1318 -1319 -1320 -1321 -1322 -1323 -1324 -1325 -1326 -1327 -1328 -1329 -1330 -1331 -1332 -1333 -1334 -1335 -1336 -1337 -1338 -1339 -1340 -1341 -1342 -1343 -1344 -1345 -1346 -1347 -1348 -1349 -1350 -1351 -1352 -1353 -1354 -1355 -1356 -1357 -1358 -1359 -1360 -1361 -1362 -1363 -1364 -1365 -1366 -1367 -1368 -1369 -1370 -1371 -1372 -1373 -1374 -1375 -1376 -1377 -1378 -1379 -1380 -1381 -1382 -1383 -1384 -1385 -1386 -1387 -1388 -1389 -1390 -1391 -1392 -1393 -1394 -1395 -1396 -1397 -1398 -1399 -1400 -1401 -1402 -1403 -1404 -1405 -1406 -1407 -1408 -1409 -1410 -1411 -1412 -1413 -1414 -1415 -1416 -1417 -1418 -1419 -1420 -1421 -1422 -1423 -1424 -1425 -1426 -1427 -1428 -1429 -1430 -1431 -1432 -1433 -1434 -1435 -1436 -1437 -1438 -1439 -1440 -1441 -1442 -1443 -1444 -1445 -1446 -1447 -1448 -1449 -1450 -1451 -1452 -1453 -1454 -1455 -1456 -1457 -1458 -1459 -1460 -1461 -1462 -1463 -1464 -1465 -1466 -1467 -1468 -1469 -1470 -1471 -1472 -1473 -1474 -1475 -1476 -1477 -1478 -1479 -1480 -1481 -1482 -1483 -1484 -1485 -1486 -1487 -1488 -1489 -1490 -1491 -1492 -1493 -1494 -1495 -1496 -1497 -1498 -1499 -1500 -1501 -1502 -1503 -1504 -1505 -1506 -1507 -1508 -1509 -1510 -1511 -1512 -1513 -1514 -1515 -1516 -1517 -1518 -1519 -1520 -1521 -1522 -1523 -1524 -1525 -1526 -1527 -1528 -1529 -1530 -1531 -1532 -1533 -1534 -1535 -1536 -1537 -1538 -1539 -1540 -1541 -1542 -1543 -1544 -1545 -1546 -1547 -1548 -1549 -1550 -1551 -1552 -1553 -1554 -1555 -1556 -1557 -1558 -1559 -1560 -1561 -1562 -1563 -1564 -1565 -1566 -1567 -1568 -1569 -1570 -1571 -1572 -1573 -1574 -1575 -1576 -1577 -1578 -1579 -1580 -1581 -1582 -1583 -1584 -1585 -1586 -1587 -1588 -1589 -1590 -1591 -1592 -1593 -1594 -1595 -1596 -1597 -1598 -1599 -1600 -1601 -1602 -1603 -1604 -1605 -1606 -1607 -1608 -1609 -1610 -1611 -1612 -1613 -1614 -1615 -1616 -1617 -1618 -1619 -1620 -1621 -1622 -1623 -1624 -1625 -1626 -1627 -1628 -1629 -1630 -1631 -1632 -1633 -1634 -1635 -1636 -1637 -1638 -1639 -1640 -1641 -1642 -1643 -1644 -1645 -1646 -1647 -1648 -1649 -1650 -1651 -1652 -1653 -1654 -1655 -1656 -1657 -1658 -1659 -1660 -1661 -1662 -1663 -1664 -1665 -1666 -1667 -1668 -1669 -1670 -1671 -1672 -1673 -1674 -1675 -1676 -1677 -1678 -1679 -1680 -1681 -1682 -1683 -1684 -1685 -1686 -1687 -1688 -1689 -1690 -1691 -1692 -1693 -1694 -1695 -1696 -1697 -1698 -1699 -1700 -1701 -1702 -1703 -1704 -1705 -1706 -1707 -1708 -1709 -1710 -1711 -1712 -1713 -1714 -1715 -1716 -1717 -1718 -1719 -1720 -1721 -1722 -1723 -1724 -1725 -1726 -1727 -1728 -1729 -1730 -1731 -1732 -1733 -1734 -1735 -1736 -1737 -1738 -1739 -1740 -1741 -1742 -1743 -1744 -1745 -1746 -1747 -1748 -1749 -1750 -1751 -1752 -1753 -1754 -1755 -1756 -1757 -1758 -1759 -1760 -1761 -1762 -1763 -1764 -1765 -1766 -1767 -1768 -1769 -1770 -1771 -1772 -1773 -1774 -1775 -1776 -1777 -1778 -1779 -1780 -1781 -1782 -1783 -1784 -1785 -1786 -1787 -1788 -1789 -1790 -1791 -1792 -1793 -1794 -1795 -1796 -1797 -1798 -1799 -1800 -1801 -1802 -1803 -1804 -1805 -1806 -1807 -1808 -1809 -1810 -1811 -1812 -1813 -1814 -1815 -1816 -1817 -1818 -1819 -1820 -1821 -1822 -1823 -1824 -1825 -1826 -1827 -1828 -1829 -1830 -1831 -1832 -1833 -1834 -1835 -1836 -1837 -1838 -1839 -1840 -1841 -1842 -1843 -1844 -1845 -1846 -1847 -1848 -1849 -1850 -1851 -1852 -1853 -1854 -1855 -1856 -1857 -1858 -1859 -1860 -1861 -1862 -1863 -1864  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -27× -27× -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -55× -55× -55× -  -  -55× -46× -  -  -  -  -  -  -  -  -  -  -  -201× -201× -192× -  -  -192× -165× -  -  -27× -  -  -  -  -  -  -  -42× - -  -38× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -150× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -  -  -  -28× -  -  -27× -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  - - -  -  -  - -  -  - -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -154× -154× -154× -  -154× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -48× -  -48× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -  -29× -  -29× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -27× -27× -27× -  -  -  -27× -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -172× -  -  -  -  - -  -  -  -171× -  -  -  -  -169× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -196× -196× -  -  -  -  -  -196× -196× -196× -  -  -  -  -  -  -  -196× -  -  -  -  -  -196× -  -  -  -196× -  -  -  -196× -23× -  -  -  -  -  -  -  -  -  -23× - -  -  -  -  -  -18× -  -  -  -  -  -14× -  -  -  -  -18× -  -  -  -10× -  - -  -  -  -  -  -  -  -18× -  -  -  -191× -  -191× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -27× -  -  -27× -  -27× -  -  -10× -10× -10× -10× -  -  -  -  -  -  -  -10× -  -  -  -  -17× -17× - -  -  -  -  -  -  -  -  -  -  -16× -  -  -  -  -  -  -16× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -29× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -57× -57× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -369× -367× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -17× -17× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -55× -55× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -535× -  -  -  -  -535× - -  -  -  -  -533× -  -  -  -  -  -533× -144× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -53× -  -  -  -53× -  -  -  -  -  -53× -47× -47× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -62× -  -  -  -  -  -  -62× -  -  -  -  -  -62× -  -  -  -  -  -62× -46× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  - -  -  - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -20× -  -  -  -  -  -  -20× - -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -23× - -  -  -  -  -  -  -  -  -20× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -196× -  -  -  -  -  -  -  -  -  -  -  -  -  -244× -  -  -  -244× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -392× -202× -  -  -  -392× -308× -  -  -  -392× -16× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -27× -27× -27× -27× -27× -  -27× -  -27× -27× -27× -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
-import { Lib_ErrorUtils } from "../../libraries/utils/Lib_ErrorUtils.sol";
- 
-/* Interface Imports */
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
- 
-/* Contract Imports */
-import { OVM_ECDSAContractAccount } from "../accounts/OVM_ECDSAContractAccount.sol";
-import { OVM_ProxyEOA } from "../accounts/OVM_ProxyEOA.sol";
-import { OVM_DeployerWhitelist } from "../predeploys/OVM_DeployerWhitelist.sol";
- 
-/**
- * @title OVM_ExecutionManager
- * @dev The Execution Manager (EM) is the core of our OVM implementation, and provides a sandboxed
- * environment allowing us to execute OVM transactions deterministically on either Layer 1 or
- * Layer 2.
- * The EM's run() function is the first function called during the execution of any
- * transaction on L2.
- * For each context-dependent EVM operation the EM has a function which implements a corresponding
- * OVM operation, which will read state from the State Manager contract.
- * The EM relies on the Safety Checker to verify that code deployed to Layer 2 does not contain any
- * context-dependent operations.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    iOVM_SafetyChecker internal ovmSafetyChecker;
-    iOVM_StateManager internal ovmStateManager;
- 
- 
-    /*******************************
-     * Execution Context Variables *
-     *******************************/
- 
-    GasMeterConfig internal gasMeterConfig;
-    GlobalContext internal globalContext;
-    TransactionContext internal transactionContext;
-    MessageContext internal messageContext;
-    TransactionRecord internal transactionRecord;
-    MessageRecord internal messageRecord;
- 
- 
-    /**************************
-     * Gas Metering Constants *
-     **************************/
- 
-    address constant GAS_METADATA_ADDRESS = 0x06a506A506a506A506a506a506A506A506A506A5;
-    uint256 constant NUISANCE_GAS_SLOAD = 20000;
-    uint256 constant NUISANCE_GAS_SSTORE = 20000;
-    uint256 constant MIN_NUISANCE_GAS_PER_CONTRACT = 30000;
-    uint256 constant NUISANCE_GAS_PER_CONTRACT_BYTE = 100;
-    uint256 constant MIN_GAS_FOR_INVALID_STATE_ACCESS = 30000;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager,
-        GasMeterConfig memory _gasMeterConfig,
-        GlobalContext memory _globalContext
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        ovmSafetyChecker = iOVM_SafetyChecker(resolve("OVM_SafetyChecker"));
-        gasMeterConfig = _gasMeterConfig;
-        globalContext = _globalContext;
-        _resetContext();
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Applies dynamically-sized refund to a transaction to account for the difference in execution
-     * between L1 and L2, so that the overall cost of the ovmOPCODE is fixed.
-     * @param _cost Desired gas cost for the function after the refund.
-     */
-    modifier netGasCost(
-        uint256 _cost
-    ) {
-        uint256 gasProvided = gasleft();
-        _;
-        uint256 gasUsed = gasProvided - gasleft();
- 
-        // We want to refund everything *except* the specified cost.
-        if (_cost < gasUsed) {
-            transactionRecord.ovmGasRefund += gasUsed - _cost;
-        }
-    }
- 
-    /**
-     * Applies a fixed-size gas refund to a transaction to account for the difference in execution
-     * between L1 and L2, so that the overall cost of an ovmOPCODE can be lowered.
-     * @param _discount Amount of gas cost to refund for the ovmOPCODE.
-     */
-    modifier fixedGasDiscount(
-        uint256 _discount
-    ) {
-        uint256 gasProvided = gasleft();
-        _;
-        uint256 gasUsed = gasProvided - gasleft();
- 
-        // We want to refund the specified _discount, unless this risks underflow.
-        if (_discount < gasUsed) {
-            transactionRecord.ovmGasRefund += _discount;
-        } else {
-            // refund all we can without risking underflow.
-            transactionRecord.ovmGasRefund += gasUsed;
-        }
-    }
- 
-    /**
-     * Makes sure we're not inside a static context.
-     */
-    modifier notStatic() {
-        if (messageContext.isStatic == true) {
-            _revertWithFlag(RevertFlag.STATIC_VIOLATION);
-        }
-        _;
-    }
- 
- 
-    /************************************
-     * Transaction Execution Entrypoint *
-     ************************************/
- 
-    /**
-     * Starts the execution of a transaction via the OVM_ExecutionManager.
-     * @param _transaction Transaction data to be executed.
-     * @param _ovmStateManager iOVM_StateManager implementation providing account state.
-     */
-    function run(
-        Lib_OVMCodec.Transaction memory _transaction,
-        address _ovmStateManager
-    )
-        override
-        public
-    {
-        require(transactionContext.ovmNUMBER == 0, "Only be callable at the start of a transaction");
-        // Store our OVM_StateManager instance (significantly easier than attempting to pass the
-        // address around in calldata).
-        ovmStateManager = iOVM_StateManager(_ovmStateManager);
- 
-        // Make sure this function can't be called by anyone except the owner of the
-        // OVM_StateManager (expected to be an OVM_StateTransitioner). We can revert here because
-        // this would make the `run` itself invalid.
-        require(
-            // This method may return false during fraud proofs, but always returns true in L2 nodes' State Manager precompile.
-            ovmStateManager.isAuthenticated(msg.sender),
-            "Only authenticated addresses in ovmStateManager can call this function"
-        );
- 
-        // Initialize the execution context, must be initialized before we perform any gas metering
-        // or we'll throw a nuisance gas error.
-        _initContext(_transaction);
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Check whether we need to start a new epoch, do so if necessary.
-        // _checkNeedsNewEpoch(_transaction.timestamp);
- 
-        // Make sure the transaction's gas limit is valid. We don't revert here because we reserve
-        // reverts for INVALID_STATE_ACCESS.
-        if (_isValidGasLimit(_transaction.gasLimit, _transaction.l1QueueOrigin) == false) {
-            _resetContext();
-            return;
-        }
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Check gas right before the call to get total gas consumed by OVM transaction.
-        // uint256 gasProvided = gasleft();
- 
-        // Run the transaction, make sure to meter the gas usage.
-        ovmCALL(
-            _transaction.gasLimit - gasMeterConfig.minTransactionGasLimit,
-            _transaction.entrypoint,
-            _transaction.data
-        );
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Update the cumulative gas based on the amount of gas used.
-        // uint256 gasUsed = gasProvided - gasleft();
-        // _updateCumulativeGas(gasUsed, _transaction.l1QueueOrigin);
- 
-        // Wipe the execution context.
-        _resetContext();
- 
-        // Reset the ovmStateManager.
-        ovmStateManager = iOVM_StateManager(address(0));
-    }
- 
- 
-    /******************************
-     * Opcodes: Execution Context *
-     ******************************/
- 
-    /**
-     * @notice Overrides CALLER.
-     * @return _CALLER Address of the CALLER within the current message context.
-     */
-    function ovmCALLER()
-        override
-        public
-        view
-        returns (
-            address _CALLER
-        )
-    {
-        return messageContext.ovmCALLER;
-    }
- 
-    /**
-     * @notice Overrides ADDRESS.
-     * @return _ADDRESS Active ADDRESS within the current message context.
-     */
-    function ovmADDRESS()
-        override
-        public
-        view
-        returns (
-            address _ADDRESS
-        )
-    {
-        return messageContext.ovmADDRESS;
-    }
- 
-    /**
-     * @notice Overrides TIMESTAMP.
-     * @return _TIMESTAMP Value of the TIMESTAMP within the transaction context.
-     */
-    function ovmTIMESTAMP()
-        override
-        public
-        view
-        returns (
-            uint256 _TIMESTAMP
-        )
-    {
-        return transactionContext.ovmTIMESTAMP;
-    }
- 
-    /**
-     * @notice Overrides NUMBER.
-     * @return _NUMBER Value of the NUMBER within the transaction context.
-     */
-    function ovmNUMBER()
-        override
-        public
-        view
-        returns (
-            uint256 _NUMBER
-        )
-    {
-        return transactionContext.ovmNUMBER;
-    }
- 
-    /**
-     * @notice Overrides GASLIMIT.
-     * @return _GASLIMIT Value of the block's GASLIMIT within the transaction context.
-     */
-    function ovmGASLIMIT()
-        override
-        public
-        view
-        returns (
-            uint256 _GASLIMIT
-        )
-    {
-        return transactionContext.ovmGASLIMIT;
-    }
- 
-    /**
-     * @notice Overrides CHAINID.
-     * @return _CHAINID Value of the chain's CHAINID within the global context.
-     */
-    function ovmCHAINID()
-        override
-        public
-        view
-        returns (
-            uint256 _CHAINID
-        )
-    {
-        return globalContext.ovmCHAINID;
-    }
- 
-    /*********************************
-     * Opcodes: L2 Execution Context *
-     *********************************/
- 
-    /**
-     * @notice Specifies from which L1 rollup queue this transaction originated from.
-     * @return _queueOrigin Address of the ovmL1QUEUEORIGIN within the current message context.
-     */
-    function ovmL1QUEUEORIGIN()
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.QueueOrigin _queueOrigin
-        )
-    {
-        return transactionContext.ovmL1QUEUEORIGIN;
-    }
- 
-    /**
-     * @notice Specifies which L1 account, if any, sent this transaction by calling enqueue().
-     * @return _l1TxOrigin Address of the account which sent the tx into L2 from L1.
-     */
-    function ovmL1TXORIGIN()
-        override
-        public
-        view
-        returns (
-            address _l1TxOrigin
-        )
-    {
-        return transactionContext.ovmL1TXORIGIN;
-    }
- 
-    /********************
-     * Opcodes: Halting *
-     ********************/
- 
-    /**
-     * @notice Overrides REVERT.
-     * @param _data Bytes data to pass along with the REVERT.
-     */
-    function ovmREVERT(
-        bytes memory _data
-    )
-        override
-        public
-    {
-        _revertWithFlag(RevertFlag.INTENTIONAL_REVERT, _data);
-    }
- 
- 
-    /******************************
-     * Opcodes: Contract Creation *
-     ******************************/
- 
-    /**
-     * @notice Overrides CREATE.
-     * @param _bytecode Code to be used to CREATE a new contract.
-     * @return Address of the created contract.
-     * @return Revert data, if and only if the creation threw an exception.
-     */
-    function ovmCREATE(
-        bytes memory _bytecode
-    )
-        override
-        public
-        notStatic
-        fixedGasDiscount(40000)
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // Creator is always the current ADDRESS.
-        address creator = ovmADDRESS();
- 
-        // Check that the deployer is whitelisted, or
-        // that arbitrary contract deployment has been enabled.
-        _checkDeployerAllowed(creator);
- 
-        // Generate the correct CREATE address.
-        address contractAddress = Lib_EthUtils.getAddressForCREATE(
-            creator,
-            _getAccountNonce(creator)
-        );
- 
-        return _createContract(
-            contractAddress,
-            _bytecode
-        );
-    }
- 
-    /**
-     * @notice Overrides CREATE2.
-     * @param _bytecode Code to be used to CREATE2 a new contract.
-     * @param _salt Value used to determine the contract's address.
-     * @return Address of the created contract.
-     * @return Revert data, if and only if the creation threw an exception.
-     */
-    function ovmCREATE2(
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        override
-        public
-        notStatic
-        fixedGasDiscount(40000)
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // Creator is always the current ADDRESS.
-        address creator = ovmADDRESS();
- 
-        // Check that the deployer is whitelisted, or
-        // that arbitrary contract deployment has been enabled.
-        _checkDeployerAllowed(creator);
- 
-        // Generate the correct CREATE2 address.
-        address contractAddress = Lib_EthUtils.getAddressForCREATE2(
-            creator,
-            _bytecode,
-            _salt
-        );
- 
-        return _createContract(
-            contractAddress,
-            _bytecode
-        );
-    }
- 
- 
-    /*******************************
-     * Account Abstraction Opcodes *
-     ******************************/
- 
-    /**
-     * Retrieves the nonce of the current ovmADDRESS.
-     * @return _nonce Nonce of the current contract.
-     */
-    function ovmGETNONCE()
-        override
-        public
-        returns (
-            uint256 _nonce
-        )
-    {
-        return _getAccountNonce(ovmADDRESS());
-    }
- 
-    /**
-     * Sets the nonce of the current ovmADDRESS.
-     * @param _nonce New nonce for the current contract.
-     */
-    function ovmSETNONCE(
-        uint256 _nonce
-    )
-        override
-        public
-        notStatic
-    {
-        _setAccountNonce(ovmADDRESS(), _nonce);
-    }
- 
-    /**
-     * Creates a new EOA contract account, for account abstraction.
-     * @dev Essentially functions like ovmCREATE or ovmCREATE2, but we can bypass a lot of checks
-     *      because the contract we're creating is trusted (no need to do safety checking or to
-     *      handle unexpected reverts). Doesn't need to return an address because the address is
-     *      assumed to be the user's actual address.
-     * @param _messageHash Hash of a message signed by some user, for verification.
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     */
-    function ovmCREATEEOA(
-        bytes32 _messageHash,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        override
-        public
-        notStatic
-    {
-        // Recover the EOA address from the message hash and signature parameters. Since we do the
-        // hashing in advance, we don't have handle different message hashing schemes. Even if this
-        // function were to return the wrong address (rather than explicitly returning the zero
-        // address), the rest of the transaction would simply fail (since there's no EOA account to
-        // actually execute the transaction).
-        address eoa = ecrecover(
-            _messageHash,
-            _v + 27,
-            _r,
-            _s
-        );
- 
-        // Invalid signature is a case we proactively handle with a revert. We could alternatively
-        // have this function return a `success` boolean, but this is just easier.
-        Iif (eoa == address(0)) {
-            ovmREVERT(bytes("Signature provided for EOA contract creation is invalid."));
-        }
- 
-        // If the user already has an EOA account, then there's no need to perform this operation.
-        Iif (_hasEmptyAccount(eoa) == false) {
-            return;
-        }
- 
-        // We always need to initialize the contract with the default account values.
-        _initPendingAccount(eoa);
- 
-        // Temporarily set the current address so it's easier to access on L2.
-        address prevADDRESS = messageContext.ovmADDRESS;
-        messageContext.ovmADDRESS = eoa;
- 
-        // Now actually create the account and get its bytecode. We're not worried about reverts
-        // (other than out of gas, which we can't capture anyway) because this contract is trusted.
-        OVM_ProxyEOA proxyEOA = new OVM_ProxyEOA(0x4200000000000000000000000000000000000003);
- 
-        // Reset the address now that we're done deploying.
-        messageContext.ovmADDRESS = prevADDRESS;
- 
-        // Commit the account with its final values.
-        _commitPendingAccount(
-            eoa,
-            address(proxyEOA),
-            keccak256(Lib_EthUtils.getCode(address(proxyEOA)))
-        );
- 
-        _setAccountNonce(eoa, 0);
-    }
- 
- 
-    /*********************************
-     * Opcodes: Contract Interaction *
-     *********************************/
- 
-    /**
-     * @notice Overrides CALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmCALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(100000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // CALL updates the CALLER and ADDRESS.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _address;
- 
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
-    /**
-     * @notice Overrides STATICCALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmSTATICCALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(80000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // STATICCALL updates the CALLER, updates the ADDRESS, and runs in a static context.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _address;
-        nextMessageContext.isStatic = true;
- 
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
-    /**
-     * @notice Overrides DELEGATECALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmDELEGATECALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(40000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // DELEGATECALL does not change anything about the message context.
-        MessageContext memory nextMessageContext = messageContext;
-        
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
- 
-    /************************************
-     * Opcodes: Contract Storage Access *
-     ************************************/
- 
-    /**
-     * @notice Overrides SLOAD.
-     * @param _key 32 byte key of the storage slot to load.
-     * @return _value 32 byte value of the requested storage slot.
-     */
-    function ovmSLOAD(
-        bytes32 _key
-    )
-        override
-        public
-        netGasCost(40000)
-        returns (
-            bytes32 _value
-        )
-    {
-        // We always SLOAD from the storage of ADDRESS.
-        address contractAddress = ovmADDRESS();
- 
-        return _getContractStorage(
-            contractAddress,
-            _key
-        );
-    }
- 
-    /**
-     * @notice Overrides SSTORE.
-     * @param _key 32 byte key of the storage slot to set.
-     * @param _value 32 byte value for the storage slot.
-     */
-    function ovmSSTORE(
-        bytes32 _key,
-        bytes32 _value
-    )
-        override
-        public
-        notStatic
-        netGasCost(60000)
-    {
-        // We always SSTORE to the storage of ADDRESS.
-        address contractAddress = ovmADDRESS();
- 
-        _putContractStorage(
-            contractAddress,
-            _key,
-            _value
-        );
-    }
- 
- 
-    /*********************************
-     * Opcodes: Contract Code Access *
-     *********************************/
- 
-    /**
-     * @notice Overrides EXTCODECOPY.
-     * @param _contract Address of the contract to copy code from.
-     * @param _offset Offset in bytes from the start of contract code to copy beyond.
-     * @param _length Total number of bytes to copy from the contract's code.
-     * @return _code Bytes of code copied from the requested contract.
-     */
-    function ovmEXTCODECOPY(
-        address _contract,
-        uint256 _offset,
-        uint256 _length
-    )
-        override
-        public
-        returns (
-            bytes memory _code
-        )
-    {
-        // `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of
-        // return data. By blocking reads of one byte, we're able to use the condition that an
-        // OVM_ExecutionManager function return value having a length of exactly one byte indicates
-        // an error without an explicit revert. If users were able to read a single byte, they
-        // could forcibly trigger behavior that should only be available to this contract.
-        uint256 length = _length == 1 ? 2 : _length;
- 
-        return Lib_EthUtils.getCode(
-            _getAccountEthAddress(_contract),
-            _offset,
-            length
-        );
-    }
- 
-    /**
-     * @notice Overrides EXTCODESIZE.
-     * @param _contract Address of the contract to query the size of.
-     * @return _EXTCODESIZE Size of the requested contract in bytes.
-     */
-    function ovmEXTCODESIZE(
-        address _contract
-    )
-        override
-        public
-        returns (
-            uint256 _EXTCODESIZE
-        )
-    {
-        return Lib_EthUtils.getCodeSize(
-            _getAccountEthAddress(_contract)
-        );
-    }
- 
-    /**
-     * @notice Overrides EXTCODEHASH.
-     * @param _contract Address of the contract to query the hash of.
-     * @return _EXTCODEHASH Hash of the requested contract.
-     */
-    function ovmEXTCODEHASH(
-        address _contract
-    )
-        override
-        public
-        returns (
-            bytes32 _EXTCODEHASH
-        )
-    {
-        return Lib_EthUtils.getCodeHash(
-            _getAccountEthAddress(_contract)
-        );
-    }
- 
-    /***************************************
-     * Public Functions: Execution Context *
-     ***************************************/
- 
-    function getMaxTransactionGasLimit()
-        external
-        view
-        override
-        returns (
-            uint256 _maxTransactionGasLimit
-        )
-    {
-        return gasMeterConfig.maxTransactionGasLimit;
-    }
- 
-    /********************************************
-     * Public Functions: Deployment Whitelisting *
-     ********************************************/
- 
-    /**
-     * Checks whether the given address is on the whitelist to ovmCREATE/ovmCREATE2, and reverts if not.
-     * @param _deployerAddress Address attempting to deploy a contract.
-     */
-    function _checkDeployerAllowed(
-        address _deployerAddress
-    )
-        internal
-    {
-        // From an OVM semantics perspective, this will appear identical to
-        // the deployer ovmCALLing the whitelist.  This is fine--in a sense, we are forcing them to.
-        (bool success, bytes memory data) = ovmCALL(
-            gasleft(),
-            0x4200000000000000000000000000000000000002,
-            abi.encodeWithSignature("isDeployerAllowed(address)", _deployerAddress)
-        );
-        bool isAllowed = abi.decode(data, (bool));
- 
-        if (!isAllowed || !success) {
-            _revertWithFlag(RevertFlag.CREATOR_NOT_ALLOWED);
-        }
-    }
- 
-    /********************************************
-     * Internal Functions: Contract Interaction *
-     ********************************************/
- 
-    /**
-     * Creates a new contract and associates it with some contract address.
-     * @param _contractAddress Address to associate the created contract with.
-     * @param _bytecode Bytecode to be used to create the contract.
-     * @return Final OVM contract address.
-     * @return Revertdata, if and only if the creation threw an exception.
-     */
-    function _createContract(
-        address _contractAddress,
-        bytes memory _bytecode
-    )
-        internal
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // We always update the nonce of the creating account, even if the creation fails.
-        _setAccountNonce(ovmADDRESS(), _getAccountNonce(ovmADDRESS()) + 1);
- 
-        // We're stepping into a CREATE or CREATE2, so we need to update ADDRESS to point
-        // to the contract's associated address and CALLER to point to the previous ADDRESS.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = messageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _contractAddress;
- 
-        // Run the common logic which occurs between call-type and create-type messages,
-        // passing in the creation bytecode and `true` to trigger create-specific logic.
-        (bool success, bytes memory data) = _handleExternalMessage(
-            nextMessageContext,
-            gasleft(),
-            _contractAddress,
-            _bytecode,
-            true
-        );
- 
-        // Yellow paper requires that address returned is zero if the contract deployment fails.
-        return (
-            success ? _contractAddress : address(0),
-            data
-        );
-    }
- 
-    /**
-     * Calls the deployed contract associated with a given address.
-     * @param _nextMessageContext Message context to be used for the call.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _contract OVM address to be called.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function _callContract(
-        MessageContext memory _nextMessageContext,
-        uint256 _gasLimit,
-        address _contract,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // We reserve addresses of the form 0xdeaddeaddead...NNNN for the container contracts in L2 geth.
-        // So, we block calls to these addresses since they are not safe to run as an OVM contract itself.
-        if (
-            (uint256(_contract) & uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000))
-            == uint256(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000)
-        ) {
-            // EVM does not return data in the success case, see: https://github.com/ethereum/go-ethereum/blob/aae7660410f0ef90279e14afaaf2f429fdc2a186/core/vm/instructions.go#L600-L604
-            return (true, hex'');
-        }
- 
-        // Both 0x0000... and the EVM precompiles have the same address on L1 and L2 --> no trie lookup needed.
-        address codeContractAddress =
-            uint(_contract) < 100
-            ? _contract
-            : _getAccountEthAddress(_contract);
- 
-        return _handleExternalMessage(
-            _nextMessageContext,
-            _gasLimit,
-            codeContractAddress,
-            _calldata,
-            false
-        );
-    }
- 
-    /**
-     * Handles all interactions which involve the execution manager calling out to untrusted code (both calls and creates).
-     * Ensures that OVM-related measures are enforced, including L2 gas refunds, nuisance gas, and flagged reversions.
-     * 
-     * @param _nextMessageContext Message context to be used for the external message.
-     * @param _gasLimit Amount of gas to be passed into this message.
-     * @param _contract OVM address being called or deployed to
-     * @param _data Data for the message (either calldata or creation code)
-     * @param _isCreate Whether this is a create-type message.
-     * @return Whether or not the message (either a call or deployment) succeeded.
-     * @return Data returned by the message.
-     */
-    function _handleExternalMessage(
-        MessageContext memory _nextMessageContext,
-        uint256 _gasLimit,
-        address _contract,
-        bytes memory _data,
-        bool _isCreate
-    )
-        internal
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        // We need to switch over to our next message context for the duration of this call.
-        MessageContext memory prevMessageContext = messageContext;
-        _switchMessageContext(prevMessageContext, _nextMessageContext);
- 
-        // Nuisance gas is a system used to bound the ability for an attacker to make fraud proofs
-        // expensive by touching a lot of different accounts or storage slots. Since most contracts
-        // only use a few storage slots during any given transaction, this shouldn't be a limiting
-        // factor.
-        uint256 prevNuisanceGasLeft = messageRecord.nuisanceGasLeft;
-        uint256 nuisanceGasLimit = _getNuisanceGasLimit(_gasLimit);
-        messageRecord.nuisanceGasLeft = nuisanceGasLimit;
- 
-        // Make the call and make sure to pass in the gas limit. Another instance of hidden
-        // complexity. `_contract` is guaranteed to be a safe contract, meaning its return/revert
-        // behavior can be controlled. In particular, we enforce that flags are passed through
-        // revert data as to retrieve execution metadata that would normally be reverted out of
-        // existence.
- 
-        (bool success, bytes memory returndata) =
-            _isCreate
-            ? _handleContractCreation(_gasLimit, _data, _contract)
-            : _contract.call{gas: _gasLimit}(_data);
- 
-        // Switch back to the original message context now that we're out of the call.
-        _switchMessageContext(_nextMessageContext, prevMessageContext);
- 
-        // Assuming there were no reverts, the message record should be accurate here. We'll update
-        // this value in the case of a revert.
-        uint256 nuisanceGasLeft = messageRecord.nuisanceGasLeft;
- 
-        // Reverts at this point are completely OK, but we need to make a few updates based on the
-        // information passed through the revert.
-        if (success == false) {
-            (
-                RevertFlag flag,
-                uint256 nuisanceGasLeftPostRevert,
-                uint256 ovmGasRefund,
-                bytes memory returndataFromFlag
-            ) = _decodeRevertData(returndata);
- 
-            // INVALID_STATE_ACCESS is the only flag that triggers an immediate abort of the
-            // parent EVM message. This behavior is necessary because INVALID_STATE_ACCESS must
-            // halt any further transaction execution that could impact the execution result.
-            if (flag == RevertFlag.INVALID_STATE_ACCESS) {
-                _revertWithFlag(flag);
-            }
- 
-            // INTENTIONAL_REVERT, UNSAFE_BYTECODE, STATIC_VIOLATION, and CREATOR_NOT_ALLOWED aren't
-            // dependent on the input state, so we can just handle them like standard reverts. Our only change here
-            // is to record the gas refund reported by the call (enforced by safety checking).
-            if (
-                flag == RevertFlag.INTENTIONAL_REVERT
-                || flag == RevertFlag.UNSAFE_BYTECODE
-                || flag == RevertFlag.STATIC_VIOLATION
-                || flag == RevertFlag.CREATOR_NOT_ALLOWED
-            ) {
-                transactionRecord.ovmGasRefund = ovmGasRefund;
-            }
- 
-            // INTENTIONAL_REVERT needs to pass up the user-provided return data encoded into the
-            // flag, *not* the full encoded flag. All other revert types return no data.
-            if (
-                flag == RevertFlag.INTENTIONAL_REVERT
-                || _isCreate
-            ) {
-                returndata = returndataFromFlag;
-            } else {
-                returndata = hex'';
-            }
- 
-            // Reverts mean we need to use up whatever "nuisance gas" was used by the call.
-            // EXCEEDS_NUISANCE_GAS explicitly reduces the remaining nuisance gas for this message
-            // to zero. OUT_OF_GAS is a "pseudo" flag given that messages return no data when they
-            // run out of gas, so we have to treat this like EXCEEDS_NUISANCE_GAS. All other flags
-            // will simply pass up the remaining nuisance gas.
-            nuisanceGasLeft = nuisanceGasLeftPostRevert;
-        }
- 
-        // We need to reset the nuisance gas back to its original value minus the amount used here.
-        messageRecord.nuisanceGasLeft = prevNuisanceGasLeft - (nuisanceGasLimit - nuisanceGasLeft);
- 
-        return (
-            success,
-            returndata
-        );
-    }
- 
-    /**
-     * Handles the creation-specific safety measures required for OVM contract deployment.
-     * This function sanitizes the return types for creation messages to match calls (bool, bytes).
-     * This allows for consistent handling of both types of messages in _handleExternalMessage().
-     * 
-     * @param _gasLimit Amount of gas to be passed into this creation.
-     * @param _creationCode Code to pass into CREATE for deployment.
-     * @param _address OVM address being deployed to.
-     * @return Whether or not the call succeeded.
-     * @return If creation fails: revert data. Otherwise: empty.
-     */
-    function _handleContractCreation(
-        uint _gasLimit,
-        bytes memory _creationCode,
-        address _address
-    )
-        internal
-        returns(
-            bool,
-            bytes memory
-        )
-    {
-        // Check that there is not already code at this address.
-        Iif (_hasEmptyAccount(_address) == false) {
-            // Note: in the EVM, this case burns all allotted gas.  For improved
-            // developer experience, we do return the remaining ones.
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.CREATE_COLLISION,
-                    Lib_ErrorUtils.encodeRevertString("A contract has already been deployed to this address")
-                )
-            );
-        }
- 
-        // Check the creation bytecode against the OVM_SafetyChecker.
-        Iif (ovmSafetyChecker.isBytecodeSafe(_creationCode) == false) {
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.UNSAFE_BYTECODE,
-                    Lib_ErrorUtils.encodeRevertString("Contract creation code contains unsafe opcodes. Did you use the right compiler or pass an unsafe constructor argument?")
-                )
-            );
-        }
- 
-        // We always need to initialize the contract with the default account values.
-        _initPendingAccount(_address);
- 
-        // Actually execute the EVM create message,
-        address ethAddress = Lib_EthUtils.createContract(_creationCode);
-        
-        if (ethAddress == address(0)) {
-            // If the creation fails, the EVM lets us grab its revert data. This may contain a revert flag
-            // to be used above in _handleExternalMessage.
-            uint256 revertDataSize;
-            assembly { revertDataSize := returndatasize() }
-            bytes memory revertdata = new bytes(revertDataSize);
-            assembly {
-                returndatacopy(
-                    add(revertdata, 0x20),
-                    0,
-                    revertDataSize
-                )
-            }
-            // Return that the creation failed, and the data it reverted with.
-            return (false, revertdata);
-        }
- 
-        // Again simply checking that the deployed code is safe too. Contracts can generate
-        // arbitrary deployment code, so there's no easy way to analyze this beforehand.
-        bytes memory deployedCode = Lib_EthUtils.getCode(ethAddress);
-        if (ovmSafetyChecker.isBytecodeSafe(deployedCode) == false) {
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.UNSAFE_BYTECODE,
-                    Lib_ErrorUtils.encodeRevertString("Constructor attempted to deploy unsafe bytecode.")
-                )
-            );
-        }
- 
-        // Contract creation didn't need to be reverted and the bytecode is safe. We finish up by
-        // associating the desired address with the newly created contract's code hash and address.
-        _commitPendingAccount(
-            _address,
-            ethAddress,
-            Lib_EthUtils.getCodeHash(ethAddress)
-        );
- 
-        // Successful deployments will not give access to returndata, in both the EVM and the OVM.
-        return (true, hex'');
-    }
- 
-    /******************************************
-     * Internal Functions: State Manipulation *
-     ******************************************/
- 
-    /**
-     * Checks whether an account exists within the OVM_StateManager.
-     * @param _address Address of the account to check.
-     * @return _exists Whether or not the account exists.
-     */
-    function _hasAccount(
-        address _address
-    )
-        internal
-        returns (
-            bool _exists
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.hasAccount(_address);
-    }
- 
-    /**
-     * Checks whether a known empty account exists within the OVM_StateManager.
-     * @param _address Address of the account to check.
-     * @return _exists Whether or not the account empty exists.
-     */
-    function _hasEmptyAccount(
-        address _address
-    )
-        internal
-        returns (
-            bool _exists
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.hasEmptyAccount(_address);
-    }
- 
-    /**
-     * Sets the nonce of an account.
-     * @param _address Address of the account to modify.
-     * @param _nonce New account nonce.
-     */
-    function _setAccountNonce(
-        address _address,
-        uint256 _nonce
-    )
-        internal
-    {
-        _checkAccountChange(_address);
-        ovmStateManager.setAccountNonce(_address, _nonce);
-    }
- 
-    /**
-     * Gets the nonce of an account.
-     * @param _address Address of the account to access.
-     * @return _nonce Nonce of the account.
-     */
-    function _getAccountNonce(
-        address _address
-    )
-        internal
-        returns (
-            uint256 _nonce
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.getAccountNonce(_address);
-    }
- 
-    /**
-     * Retrieves the Ethereum address of an account.
-     * @param _address Address of the account to access.
-     * @return _ethAddress Corresponding Ethereum address.
-     */
-    function _getAccountEthAddress(
-        address _address
-    )
-        internal
-        returns (
-            address _ethAddress
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.getAccountEthAddress(_address);
-    }
- 
-    /**
-     * Creates the default account object for the given address.
-     * @param _address Address of the account create.
-     */
-    function _initPendingAccount(
-        address _address
-    )
-        internal
-    {
-        // Although it seems like `_checkAccountChange` would be more appropriate here, we don't
-        // actually consider an account "changed" until it's inserted into the state (in this case
-        // by `_commitPendingAccount`).
-        _checkAccountLoad(_address);
-        ovmStateManager.initPendingAccount(_address);
-    }
- 
-    /**
-     * Stores additional relevant data for a new account, thereby "committing" it to the state.
-     * This function is only called during `ovmCREATE` and `ovmCREATE2` after a successful contract
-     * creation.
-     * @param _address Address of the account to commit.
-     * @param _ethAddress Address of the associated deployed contract.
-     * @param _codeHash Hash of the code stored at the address.
-     */
-    function _commitPendingAccount(
-        address _address,
-        address _ethAddress,
-        bytes32 _codeHash
-    )
-        internal
-    {
-        _checkAccountChange(_address);
-        ovmStateManager.commitPendingAccount(
-            _address,
-            _ethAddress,
-            _codeHash
-        );
-    }
- 
-    /**
-     * Retrieves the value of a storage slot.
-     * @param _contract Address of the contract to query.
-     * @param _key 32 byte key of the storage slot.
-     * @return _value 32 byte storage slot value.
-     */
-    function _getContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-        returns (
-            bytes32 _value
-        )
-    {
-        _checkContractStorageLoad(_contract, _key);
-        return ovmStateManager.getContractStorage(_contract, _key);
-    }
- 
-    /**
-     * Sets the value of a storage slot.
-     * @param _contract Address of the contract to modify.
-     * @param _key 32 byte key of the storage slot.
-     * @param _value 32 byte storage slot value.
-     */
-    function _putContractStorage(
-        address _contract,
-        bytes32 _key,
-        bytes32 _value
-    )
-        internal
-    {
-        // We don't set storage if the value didn't change. Although this acts as a convenient
-        // optimization, it's also necessary to avoid the case in which a contract with no storage
-        // attempts to store the value "0" at any key. Putting this value (and therefore requiring
-        // that the value be committed into the storage trie after execution) would incorrectly
-        // modify the storage root.
-        Iif (_getContractStorage(_contract, _key) == _value) {
-            return;
-        }
- 
-        _checkContractStorageChange(_contract, _key);
-        ovmStateManager.putContractStorage(_contract, _key, _value);
-    }
- 
-    /**
-     * Validation whenever a contract needs to be loaded. Checks that the account exists, charges
-     * nuisance gas if the account hasn't been loaded before.
-     * @param _address Address of the account to load.
-     */
-    function _checkAccountLoad(
-        address _address
-    )
-        internal
-    {
-        // See `_checkContractStorageLoad` for more information.
-        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
-            _revertWithFlag(RevertFlag.OUT_OF_GAS);
-        }
- 
-        // See `_checkContractStorageLoad` for more information.
-        if (ovmStateManager.hasAccount(_address) == false) {
-            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
-        }
- 
-        // Check whether the account has been loaded before and mark it as loaded if not. We need
-        // this because "nuisance gas" only applies to the first time that an account is loaded.
-        (
-            bool _wasAccountAlreadyLoaded
-        ) = ovmStateManager.testAndSetAccountLoaded(_address);
- 
-        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
-        // on the size of the contract code.
-        if (_wasAccountAlreadyLoaded == false) {
-            _useNuisanceGas(
-                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
-            );
-        }
-    }
- 
-    /**
-     * Validation whenever a contract needs to be changed. Checks that the account exists, charges
-     * nuisance gas if the account hasn't been changed before.
-     * @param _address Address of the account to change.
-     */
-    function _checkAccountChange(
-        address _address
-    )
-        internal
-    {
-        // Start by checking for a load as we only want to charge nuisance gas proportional to
-        // contract size once.
-        _checkAccountLoad(_address);
- 
-        // Check whether the account has been changed before and mark it as changed if not. We need
-        // this because "nuisance gas" only applies to the first time that an account is changed.
-        (
-            bool _wasAccountAlreadyChanged
-        ) = ovmStateManager.testAndSetAccountChanged(_address);
- 
-        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
-        // on the size of the contract code.
-        if (_wasAccountAlreadyChanged == false) {
-            ovmStateManager.incrementTotalUncommittedAccounts();
-            _useNuisanceGas(
-                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
-            );
-        }
-    }
- 
-    /**
-     * Validation whenever a slot needs to be loaded. Checks that the account exists, charges
-     * nuisance gas if the slot hasn't been loaded before.
-     * @param _contract Address of the account to load from.
-     * @param _key 32 byte key to load.
-     */
-    function _checkContractStorageLoad(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-    {
-        // Another case of hidden complexity. If we didn't enforce this requirement, then a
-        // contract could pass in just enough gas to cause the INVALID_STATE_ACCESS check to fail
-        // on L1 but not on L2. A contract could use this behavior to prevent the
-        // OVM_ExecutionManager from detecting an invalid state access. Reverting with OUT_OF_GAS
-        // allows us to also charge for the full message nuisance gas, because you deserve that for
-        // trying to break the contract in this way.
-        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
-            _revertWithFlag(RevertFlag.OUT_OF_GAS);
-        }
- 
-        // We need to make sure that the transaction isn't trying to access storage that hasn't
-        // been provided to the OVM_StateManager. We'll immediately abort if this is the case.
-        // We know that we have enough gas to do this check because of the above test.
-        Iif (ovmStateManager.hasContractStorage(_contract, _key) == false) {
-            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
-        }
- 
-        // Check whether the slot has been loaded before and mark it as loaded if not. We need
-        // this because "nuisance gas" only applies to the first time that a slot is loaded.
-        (
-            bool _wasContractStorageAlreadyLoaded
-        ) = ovmStateManager.testAndSetContractStorageLoaded(_contract, _key);
- 
-        // If we hadn't already loaded the account, then we'll need to charge some fixed amount of
-        // "nuisance gas".
-        if (_wasContractStorageAlreadyLoaded == false) {
-            _useNuisanceGas(NUISANCE_GAS_SLOAD);
-        }
-    }
- 
-    /**
-     * Validation whenever a slot needs to be changed. Checks that the account exists, charges
-     * nuisance gas if the slot hasn't been changed before.
-     * @param _contract Address of the account to change.
-     * @param _key 32 byte key to change.
-     */
-    function _checkContractStorageChange(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-    {
-        // Start by checking for load to make sure we have the storage slot and that we charge the
-        // "nuisance gas" necessary to prove the storage slot state.
-        _checkContractStorageLoad(_contract, _key);
- 
-        // Check whether the slot has been changed before and mark it as changed if not. We need
-        // this because "nuisance gas" only applies to the first time that a slot is changed.
-        (
-            bool _wasContractStorageAlreadyChanged
-        ) = ovmStateManager.testAndSetContractStorageChanged(_contract, _key);
- 
-        // If we hadn't already changed the account, then we'll need to charge some fixed amount of
-        // "nuisance gas".
-        Eif (_wasContractStorageAlreadyChanged == false) {
-            // Changing a storage slot means that we're also going to have to change the
-            // corresponding account, so do an account change check.
-            _checkAccountChange(_contract);
- 
-            ovmStateManager.incrementTotalUncommittedContractStorage();
-            _useNuisanceGas(NUISANCE_GAS_SSTORE);
-        }
-    }
- 
- 
-    /************************************
-     * Internal Functions: Revert Logic *
-     ************************************/
- 
-    /**
-     * Simple encoding for revert data.
-     * @param _flag Flag to revert with.
-     * @param _data Additional user-provided revert data.
-     * @return _revertdata Encoded revert data.
-     */
-    function _encodeRevertData(
-        RevertFlag _flag,
-        bytes memory _data
-    )
-        internal
-        view
-        returns (
-            bytes memory _revertdata
-        )
-    {
-        // Out of gas and create exceptions will fundamentally return no data, so simulating it shouldn't either.
-        Iif (
-            _flag == RevertFlag.OUT_OF_GAS
-        ) {
-            return bytes('');
-        }
- 
-        // INVALID_STATE_ACCESS doesn't need to return any data other than the flag.
-        if (_flag == RevertFlag.INVALID_STATE_ACCESS) {
-            return abi.encode(
-                _flag,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        // Just ABI encode the rest of the parameters.
-        return abi.encode(
-            _flag,
-            messageRecord.nuisanceGasLeft,
-            transactionRecord.ovmGasRefund,
-            _data
-        );
-    }
- 
-    /**
-     * Simple decoding for revert data.
-     * @param _revertdata Revert data to decode.
-     * @return _flag Flag used to revert.
-     * @return _nuisanceGasLeft Amount of nuisance gas unused by the message.
-     * @return _ovmGasRefund Amount of gas refunded during the message.
-     * @return _data Additional user-provided revert data.
-     */
-    function _decodeRevertData(
-        bytes memory _revertdata
-    )
-        internal
-        pure
-        returns (
-            RevertFlag _flag,
-            uint256 _nuisanceGasLeft,
-            uint256 _ovmGasRefund,
-            bytes memory _data
-        )
-    {
-        // A length of zero means the call ran out of gas, just return empty data.
-        if (_revertdata.length == 0) {
-            return (
-                RevertFlag.OUT_OF_GAS,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        // ABI decode the incoming data.
-        return abi.decode(_revertdata, (RevertFlag, uint256, uint256, bytes));
-    }
- 
-    /**
-     * Causes a message to revert or abort.
-     * @param _flag Flag to revert with.
-     * @param _data Additional user-provided data.
-     */
-    function _revertWithFlag(
-        RevertFlag _flag,
-        bytes memory _data
-    )
-        internal
-        view
-    {
-        bytes memory revertdata = _encodeRevertData(
-            _flag,
-            _data
-        );
- 
-        assembly {
-            revert(add(revertdata, 0x20), mload(revertdata))
-        }
-    }
- 
-    /**
-     * Causes a message to revert or abort.
-     * @param _flag Flag to revert with.
-     */
-    function _revertWithFlag(
-        RevertFlag _flag
-    )
-        internal
-    {
-        _revertWithFlag(_flag, bytes(''));
-    }
- 
- 
-    /******************************************
-     * Internal Functions: Nuisance Gas Logic *
-     ******************************************/
- 
-    /**
-     * Computes the nuisance gas limit from the gas limit.
-     * @dev This function is currently using a naive implementation whereby the nuisance gas limit
-     *      is set to exactly equal the lesser of the gas limit or remaining gas. It's likely that
-     *      this implementation is perfectly fine, but we may change this formula later.
-     * @param _gasLimit Gas limit to compute from.
-     * @return _nuisanceGasLimit Computed nuisance gas limit.
-     */
-    function _getNuisanceGasLimit(
-        uint256 _gasLimit
-    )
-        internal
-        view
-        returns (
-            uint256 _nuisanceGasLimit
-        )
-    {
-        return _gasLimit < gasleft() ? _gasLimit : gasleft();
-    }
- 
-    /**
-     * Uses a certain amount of nuisance gas.
-     * @param _amount Amount of nuisance gas to use.
-     */
-    function _useNuisanceGas(
-        uint256 _amount
-    )
-        internal
-    {
-        // Essentially the same as a standard OUT_OF_GAS, except we also retain a record of the gas
-        // refund to be given at the end of the transaction.
-        Iif (messageRecord.nuisanceGasLeft < _amount) {
-            _revertWithFlag(RevertFlag.EXCEEDS_NUISANCE_GAS);
-        }
- 
-        messageRecord.nuisanceGasLeft -= _amount;
-    }
- 
- 
-    /************************************
-     * Internal Functions: Gas Metering *
-     ************************************/
- 
-    /**
-     * Checks whether a transaction needs to start a new epoch and does so if necessary.
-     * @param _timestamp Transaction timestamp.
-     */
-    function _checkNeedsNewEpoch(
-        uint256 _timestamp
-    )
-        internal
-    {
-        if (
-            _timestamp >= (
-                _getGasMetadata(GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP)
-                + gasMeterConfig.secondsPerEpoch
-            )
-        ) {
-            _putGasMetadata(
-                GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP,
-                _timestamp
-            );
- 
-            _putGasMetadata(
-                GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS,
-                _getGasMetadata(
-                    GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS
-                )
-            );
- 
-            _putGasMetadata(
-                GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS,
-                _getGasMetadata(
-                    GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS
-                )
-            );
-        }
-    }
- 
-    /**
-     * Validates the gas limit for a given transaction.
-     * @param _gasLimit Gas limit provided by the transaction.
-     * param _queueOrigin Queue from which the transaction originated.
-     * @return _valid Whether or not the gas limit is valid.
-     */
-    function _isValidGasLimit(
-        uint256 _gasLimit,
-        Lib_OVMCodec.QueueOrigin // _queueOrigin
-    )
-        view
-        internal
-        returns (
-            bool _valid
-        )
-    {
-        // Always have to be below the maximum gas limit.
-        if (_gasLimit > gasMeterConfig.maxTransactionGasLimit) {
-            return false;
-        }
- 
-        // Always have to be above the minimum gas limit.
-        if (_gasLimit < gasMeterConfig.minTransactionGasLimit) {
-            return false;
-        }
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        return true;
-        // GasMetadataKey cumulativeGasKey;
-        // GasMetadataKey prevEpochGasKey;
-        // if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
-        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
-        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS;
-        // } else {
-        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
-        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS;
-        // }
- 
-        // return (
-        //     (
-        //         _getGasMetadata(cumulativeGasKey)
-        //         - _getGasMetadata(prevEpochGasKey)
-        //         + _gasLimit
-        //     ) < gasMeterConfig.maxGasPerQueuePerEpoch
-        // );
-    }
- 
-    /**
-     * Updates the cumulative gas after a transaction.
-     * @param _gasUsed Gas used by the transaction.
-     * @param _queueOrigin Queue from which the transaction originated.
-     */
-    function _updateCumulativeGas(
-        uint256 _gasUsed,
-        Lib_OVMCodec.QueueOrigin _queueOrigin
-    )
-        internal
-    {
-        GasMetadataKey cumulativeGasKey;
-        if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
-            cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
-        } else {
-            cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
-        }
- 
-        _putGasMetadata(
-            cumulativeGasKey,
-            (
-                _getGasMetadata(cumulativeGasKey)
-                + gasMeterConfig.minTransactionGasLimit
-                + _gasUsed
-                - transactionRecord.ovmGasRefund
-            )
-        );
-    }
- 
-    /**
-     * Retrieves the value of a gas metadata key.
-     * @param _key Gas metadata key to retrieve.
-     * @return _value Value stored at the given key.
-     */
-    function _getGasMetadata(
-        GasMetadataKey _key
-    )
-        internal
-        returns (
-            uint256 _value
-        )
-    {
-        return uint256(_getContractStorage(
-            GAS_METADATA_ADDRESS,
-            bytes32(uint256(_key))
-        ));
-    }
- 
-    /**
-     * Sets the value of a gas metadata key.
-     * @param _key Gas metadata key to set.
-     * @param _value Value to store at the given key.
-     */
-    function _putGasMetadata(
-        GasMetadataKey _key,
-        uint256 _value
-    )
-        internal
-    {
-        _putContractStorage(
-            GAS_METADATA_ADDRESS,
-            bytes32(uint256(_key)),
-            bytes32(uint256(_value))
-        );
-    }
- 
- 
-    /*****************************************
-     * Internal Functions: Execution Context *
-     *****************************************/
- 
-    /**
-     * Swaps over to a new message context.
-     * @param _prevMessageContext Context we're switching from.
-     * @param _nextMessageContext Context we're switching to.
-     */
-    function _switchMessageContext(
-        MessageContext memory _prevMessageContext,
-        MessageContext memory _nextMessageContext
-    )
-        internal
-    {
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.ovmCALLER != _nextMessageContext.ovmCALLER) {
-            messageContext.ovmCALLER = _nextMessageContext.ovmCALLER;
-        }
- 
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.ovmADDRESS != _nextMessageContext.ovmADDRESS) {
-            messageContext.ovmADDRESS = _nextMessageContext.ovmADDRESS;
-        }
- 
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.isStatic != _nextMessageContext.isStatic) {
-            messageContext.isStatic = _nextMessageContext.isStatic;
-        }
-    }
- 
-    /**
-     * Initializes the execution context.
-     * @param _transaction OVM transaction being executed.
-     */
-    function _initContext(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        internal
-    {
-        transactionContext.ovmTIMESTAMP = _transaction.timestamp;
-        transactionContext.ovmNUMBER = _transaction.blockNumber;
-        transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
-        transactionContext.ovmL1QUEUEORIGIN = _transaction.l1QueueOrigin;
-        transactionContext.ovmL1TXORIGIN = _transaction.l1TxOrigin;
-        transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
- 
-        messageRecord.nuisanceGasLeft = _getNuisanceGasLimit(_transaction.gasLimit);
-    }
- 
-    /**
-     * Resets the transaction and message context.
-     */
-    function _resetContext()
-        internal
-    {
-        transactionContext.ovmL1TXORIGIN = address(0);
-        transactionContext.ovmTIMESTAMP = 0;
-        transactionContext.ovmNUMBER = 0;
-        transactionContext.ovmGASLIMIT = 0;
-        transactionContext.ovmTXGASLIMIT = 0;
-        transactionContext.ovmL1QUEUEORIGIN = Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE;
- 
-        transactionRecord.ovmGasRefund = 0;
- 
-        messageContext.ovmCALLER = address(0);
-        messageContext.ovmADDRESS = address(0);
-        messageContext.isStatic = false;
- 
-        messageRecord.nuisanceGasLeft = 0;
-    }
- 
-    /*****************************
-     * L2-only Helper Functions *
-     *****************************/
- 
-    /**
-     * Unreachable helper function for simulating eth_calls with an OVM message context.
-     * This function will throw an exception in all cases other than when used as a custom entrypoint in L2 Geth to simulate eth_call.
-     * @param _transaction the message transaction to simulate.
-     * @param _from the OVM account the simulated call should be from.
-     */
-    function simulateMessage(
-        Lib_OVMCodec.Transaction memory _transaction,
-        address _from,
-        iOVM_StateManager _ovmStateManager
-    )
-        external
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        // Prevent this call from having any effect unless in a custom-set VM frame
-        require(msg.sender == address(0));
- 
-        ovmStateManager = _ovmStateManager;
-        _initContext(_transaction);
-        messageRecord.nuisanceGasLeft = uint(-1);
- 
-        messageContext.ovmADDRESS = _from;
- 
-        bool isCreate = _transaction.entrypoint == address(0);
-        if (isCreate) {
-            (address created, bytes memory revertData) = ovmCREATE(_transaction.data);
-            if (created == address(0)) {
-                return (false, revertData);
-            } else {
-                // The eth_call RPC endpoint for to = undefined will return the deployed bytecode 
-                // in the success case, differing from standard create messages.
-                return (true, Lib_EthUtils.getCode(created));
-            }
-        } else {
-            return ovmCALL(
-                _transaction.gasLimit,
-                _transaction.entrypoint,
-                _transaction.data
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/execution/OVM_SafetyChecker.sol.html b/coverage/lcov-report/OVM/execution/OVM_SafetyChecker.sol.html deleted file mode 100644 index 7c3a8f6b4..000000000 --- a/coverage/lcov-report/OVM/execution/OVM_SafetyChecker.sol.html +++ /dev/null @@ -1,509 +0,0 @@ - - - - Code coverage report for OVM/execution/OVM_SafetyChecker.sol - - - - - - - -
-
-

- all files / OVM/execution/ OVM_SafetyChecker.sol -

-
-
- 100% - Statements - 8/8 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 10/10 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -277× -  -  -  -  -  -  -  -  -  -  -277× -  -277× -  -277× -  -277× -277× -277× -  -  -277× -277× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -152× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
- 
-/**
- * @title OVM_SafetyChecker
- * @dev  The Safety Checker verifies that contracts deployed on L2 do not contain any
- * "unsafe" operations. An operation is considered unsafe if it would access state variables which
- * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used
- * to "escape the sandbox" of the OVM, resulting in non-deterministic fraud proofs. 
- * That is, an attacker would be able to "prove fraud" on an honestly applied transaction.
- * Note that a "safe" contract requires opcodes to appear in a particular pattern;
- * omission of "unsafe" opcodes is necessary, but not sufficient.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_SafetyChecker is iOVM_SafetyChecker {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Returns whether or not all of the provided bytecode is safe.
-     * @param _bytecode The bytecode to safety check.
-     * @return `true` if the bytecode is safe, `false` otherwise.
-     */
-    function isBytecodeSafe(
-        bytes memory _bytecode
-    )
-        override
-        external
-        pure
-        returns (
-            bool
-        )
-    {
-        // autogenerated by gen_safety_checker_constants.py
-        // number of bytes to skip for each opcode
-        uint256[8] memory opcodeSkippableBytes = [
-            uint256(0x0001010101010101010101010000000001010101010101010101010101010000),
-            uint256(0x0100000000000000000000000000000000000000010101010101000000010100),
-            uint256(0x0000000000000000000000000000000001010101000000010101010100000000),
-            uint256(0x0203040500000000000000000000000000000000000000000000000000000000),
-            uint256(0x0101010101010101010101010101010101010101010101010101010101010101),
-            uint256(0x0101010101000000000000000000000000000000000000000000000000000000),
-            uint256(0x0000000000000000000000000000000000000000000000000000000000000000),
-            uint256(0x0000000000000000000000000000000000000000000000000000000000000000)
-        ];
-        // Mask to gate opcode specific cases
-        uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);
-        // Halting opcodes
-        uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);
-        // PUSH opcodes
-        uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);
- 
-        uint256 codeLength;
-        uint256 _pc;
-        assembly {
-            _pc := add(_bytecode, 0x20)
-        }
-        codeLength = _pc + _bytecode.length;
-        do {
-            // current opcode: 0x00...0xff
-            uint256 opNum;
- 
-            // inline assembly removes the extra add + bounds check
-            assembly {
-                let word := mload(_pc) //load the next 32 bytes at pc into word
- 
-                // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord
-                // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4
-                // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).
-                // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,
-                // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.
-                let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                _pc := add(_pc, indexInWord)
- 
-                opNum := byte(indexInWord, word)
-            }
- 
-            // + push opcodes
-            // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]
-            // + caller opcode CALLER(0x33)
-            // + blacklisted opcodes
-            uint256 opBit = 1 << opNum;
-            if (opBit & opcodeGateMask == 0) {
-                if (opBit & opcodePushMask == 0) {
-                    // all pushes are valid opcodes
-                    // subsequent bytes are not opcodes. Skip them.
-                    _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to
-                    // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)
-                    continue;
-                } else if (opBit & opcodeHaltingMask == 0) {
-                    // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)
-                    // We are now inside unreachable code until we hit a JUMPDEST!
-                    do {
-                        _pc++;
-                        assembly {
-                            opNum := byte(0, mload(_pc))
-                        }
-                        // encountered a JUMPDEST
-                        if (opNum == 0x5b) break;
-                        // skip PUSHed bytes
-                        if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)
-                    } while (_pc < codeLength);
-                    // opNum is 0x5b, so we don't continue here since the pc++ is fine
-                } else if (opNum == 0x33) { // Caller opcode
-                    uint256 firstOps; // next 32 bytes of bytecode
-                    uint256 secondOps; // following 32 bytes of bytecode
- 
-                    assembly {
-                        firstOps := mload(_pc)
-                        // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits
-                        secondOps := shr(216, mload(add(_pc, 0x20)))
-                    }
- 
-                    // Call identity precompile
-                    // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL
-                    // 32 - 8 bytes = 24 bytes = 192
-                    if ((firstOps >> 192) == 0x3350600060045af1) {
-                        _pc += 8;
-                    // Call EM and abort execution if instructed
-                    // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST 
-                    } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {
-                        _pc += 37;
-                    } else {
-                        return false;
-                    }
-                    continue;
-                } else {
-                    // encountered a non-whitelisted opcode!
-                    return false;
-                }
-            }
-            _pc++;
-        } while (_pc < codeLength);
-        return true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/execution/OVM_StateManager.sol.html b/coverage/lcov-report/OVM/execution/OVM_StateManager.sol.html deleted file mode 100644 index 43f0df6b4..000000000 --- a/coverage/lcov-report/OVM/execution/OVM_StateManager.sol.html +++ /dev/null @@ -1,2279 +0,0 @@ - - - - Code coverage report for OVM/execution/OVM_StateManager.sol - - - - - - - -
-
-

- all files / OVM/execution/ OVM_StateManager.sol -

-
-
- 79.69% - Statements - 51/64 -
-
- 100% - Branches - 12/12 -
-
- 80% - Functions - 28/35 -
-
- 80% - Lines - 52/65 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -207× -  -  -  -  -  -  -  -  -  -  -  -  -  -921× -  -  -  -920× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -537× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -60× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -369× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -30× -30× -30× -30× -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -18× -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -61× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -70× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -  -  -  -  -14× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -57× -  -  -  - -  -  -  -51× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -74× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -69× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -606× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -97× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -687× -  -687× -268× -  -  -687× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
- 
-/**
- * @title OVM_StateManager
- * @dev The State Manager contract holds all storage values for contracts in the OVM. It can only be written to by the
- * the Execution Manager and State Transitioner. It runs on L1 during the setup and execution of a fraud proof.
- * The same logic runs on L2, but has been implemented as a precompile in the L2 go-ethereum client
- * (see https://github.com/ethereum-optimism/go-ethereum/blob/master/core/vm/ovm_state_manager.go).
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateManager is iOVM_StateManager {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 constant internal EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
-    bytes32 constant internal EMPTY_ACCOUNT_CODE_HASH =    0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
-    bytes32 constant internal STORAGE_XOR_VALUE =          0xFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEF;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    address override public owner;
-    address override public ovmExecutionManager;
-    mapping (address => Lib_OVMCodec.Account) internal accounts;
-    mapping (address => mapping (bytes32 => bytes32)) internal contractStorage;
-    mapping (address => mapping (bytes32 => bool)) internal verifiedContractStorage;
-    mapping (bytes32 => ItemState) internal itemStates;
-    uint256 internal totalUncommittedAccounts;
-    uint256 internal totalUncommittedContractStorage;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _owner Address of the owner of this contract.
-     */
-    constructor(
-        address _owner
-    )
-    {
-        owner = _owner;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Simple authentication, this contract should only be accessible to the owner (which is expected to be the State Transitioner during `PRE_EXECUTION` 
-     * or the OVM_ExecutionManager during transaction execution.
-     */
-    modifier authenticated() {
-        // owner is the State Transitioner
-        require(
-            msg.sender == owner || msg.sender == ovmExecutionManager,
-            "Function can only be called by authenticated addresses"
-        );
-        _;
-    }
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Checks whether a given address is allowed to modify this contract.
-     * @param _address Address to check.
-     * @return Whether or not the address can modify this contract.
-     */
-    function isAuthenticated(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return (_address == owner || _address == ovmExecutionManager);
-    }
- 
-    /**
-     * Sets the address of the OVM_ExecutionManager.
-     * @param _ovmExecutionManager Address of the OVM_ExecutionManager.
-     */
-    function setExecutionManager(
-        address _ovmExecutionManager
-    )
-        override
-        public
-        authenticated
-    {
-        ovmExecutionManager = _ovmExecutionManager;
-    }
- 
-    /**
-     * Inserts an account into the state.
-     * @param _address Address of the account to insert.
-     * @param _account Account to insert for the given address.
-     */
-    function putAccount(
-        address _address,
-        Lib_OVMCodec.Account memory _account
-    )
-        override
-        public
-        authenticated
-    {
-        accounts[_address] = _account;
-    }
- 
-    /**
-     * Marks an account as empty.
-     * @param _address Address of the account to mark.
-     */
-    function putEmptyAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
-        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
-    }
- 
-    /**
-     * Retrieves an account from the state.
-     * @param _address Address of the account to retrieve.
-     * @return Account for the given address.
-     */
-    function getAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.Account memory
-        )
-    {
-        return accounts[_address];
-    }
- 
-    /**
-     * Checks whether the state has a given account.
-     * @param _address Address of the account to check.
-     * @return Whether or not the state has the account.
-     */
-    function hasAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return accounts[_address].codeHash != bytes32(0);
-    }
- 
-    /**
-     * Checks whether the state has a given known empty account.
-     * @param _address Address of the account to check.
-     * @return Whether or not the state has the empty account.
-     */
-    function hasEmptyAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return (
-            accounts[_address].codeHash == EMPTY_ACCOUNT_CODE_HASH
-            && accounts[_address].nonce == 0
-        );
-    }
- 
-    /**
-     * Sets the nonce of an account.
-     * @param _address Address of the account to modify.
-     * @param _nonce New account nonce.
-     */
-    function setAccountNonce(
-        address _address,
-        uint256 _nonce
-    )
-        override
-        public
-        authenticated
-    {
-        accounts[_address].nonce = _nonce;
-    }
- 
-    /**
-     * Gets the nonce of an account.
-     * @param _address Address of the account to access.
-     * @return Nonce of the account.
-     */
-    function getAccountNonce(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return accounts[_address].nonce;
-    }
- 
-    /**
-     * Retrieves the Ethereum address of an account.
-     * @param _address Address of the account to access.
-     * @return Corresponding Ethereum address.
-     */
-    function getAccountEthAddress(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            address
-        )
-    {
-        return accounts[_address].ethAddress;
-    }
- 
-    /**
-     * Retrieves the storage root of an account.
-     * @param _address Address of the account to access.
-     * @return Corresponding storage root.
-     */
-    function getAccountStorageRoot(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        return accounts[_address].storageRoot;
-    }
- 
-    /**
-     * Initializes a pending account (during CREATE or CREATE2) with the default values.
-     * @param _address Address of the account to initialize.
-     */
-    function initPendingAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.nonce = 1;
-        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
-        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
-        account.isFresh = true;
-    }
- 
-    /**
-     * Finalizes the creation of a pending account (during CREATE or CREATE2).
-     * @param _address Address of the account to finalize.
-     * @param _ethAddress Address of the account's associated contract on Ethereum.
-     * @param _codeHash Hash of the account's code.
-     */
-    function commitPendingAccount(
-        address _address,
-        address _ethAddress,
-        bytes32 _codeHash
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.ethAddress = _ethAddress;
-        account.codeHash = _codeHash;
-    }
- 
-    /**
-     * Checks whether an account has already been retrieved, and marks it as retrieved if not.
-     * @param _address Address of the account to check.
-     * @return Whether or not the account was already loaded.
-     */
-    function testAndSetAccountLoaded(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_address),
-            ItemState.ITEM_LOADED
-        );
-    }
- 
-    /**
-     * Checks whether an account has already been modified, and marks it as modified if not.
-     * @param _address Address of the account to check.
-     * @return Whether or not the account was already modified.
-     */
-    function testAndSetAccountChanged(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_address),
-            ItemState.ITEM_CHANGED
-        );
-    }
- 
-    /**
-     * Attempts to mark an account as committed.
-     * @param _address Address of the account to commit.
-     * @return Whether or not the account was committed.
-     */
-    function commitAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        if (itemStates[item] != ItemState.ITEM_CHANGED) {
-            return false;
-        }
- 
-        itemStates[item] = ItemState.ITEM_COMMITTED;
-        totalUncommittedAccounts -= 1;
- 
-        return true;
-    }
- 
-    /**
-     * Increments the total number of uncommitted accounts.
-     */
-    function incrementTotalUncommittedAccounts()
-        override
-        public
-        authenticated
-    {
-        totalUncommittedAccounts += 1;
-    }
- 
-    /**
-     * Gets the total number of uncommitted accounts.
-     * @return Total uncommitted accounts.
-     */
-    function getTotalUncommittedAccounts()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return totalUncommittedAccounts;
-    }
- 
-    /**
-     * Checks whether a given account was changed during execution.
-     * @param _address Address to check.
-     * @return Whether or not the account was changed.
-     */
-    function wasAccountChanged(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        return itemStates[item] >= ItemState.ITEM_CHANGED;
-    }
- 
-    /**
-     * Checks whether a given account was committed after execution.
-     * @param _address Address to check.
-     * @return Whether or not the account was committed.
-     */
-    function wasAccountCommitted(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        return itemStates[item] >= ItemState.ITEM_COMMITTED;
-    }
- 
- 
-    /************************************
-     * Public Functions: Storage Access *
-     ************************************/
- 
-    /**
-     * Changes a contract storage slot value.
-     * @param _contract Address of the contract to modify.
-     * @param _key 32 byte storage slot key.
-     * @param _value 32 byte storage slot value.
-     */
-    function putContractStorage(
-        address _contract,
-        bytes32 _key,
-        bytes32 _value
-    )
-        override
-        public
-        authenticated
-    {
-        // A hilarious optimization. `SSTORE`ing a value of `bytes32(0)` is common enough that it's
-        // worth populating this with a non-zero value in advance (during the fraud proof
-        // initialization phase) to cut the execution-time cost down to 5000 gas.
-        contractStorage[_contract][_key] = _value ^ STORAGE_XOR_VALUE;
- 
-        // Only used when initially populating the contract storage. OVM_ExecutionManager will
-        // perform a `hasContractStorage` INVALID_STATE_ACCESS check before putting any contract
-        // storage because writing to zero when the actual value is nonzero causes a gas
-        // discrepancy. Could be moved into a new `putVerifiedContractStorage` function, or
-        // something along those lines.
-        if (verifiedContractStorage[_contract][_key] == false) {
-            verifiedContractStorage[_contract][_key] = true;
-        }
-    }
- 
-    /**
-     * Retrieves a contract storage slot value.
-     * @param _contract Address of the contract to access.
-     * @param _key 32 byte storage slot key.
-     * @return 32 byte storage slot value.
-     */
-    function getContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        // Storage XOR system doesn't work for newly created contracts that haven't set this
-        // storage slot value yet.
-        if (
-            verifiedContractStorage[_contract][_key] == false
-            && accounts[_contract].isFresh
-        ) {
-            return bytes32(0);
-        }
- 
-        // See `putContractStorage` for more information about the XOR here.
-        return contractStorage[_contract][_key] ^ STORAGE_XOR_VALUE;
-    }
- 
-    /**
-     * Checks whether a contract storage slot exists in the state.
-     * @param _contract Address of the contract to access.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the key was set in the state.
-     */
-    function hasContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return verifiedContractStorage[_contract][_key] || accounts[_contract].isFresh;
-    }
- 
-    /**
-     * Checks whether a storage slot has already been retrieved, and marks it as retrieved if not.
-     * @param _contract Address of the contract to check.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the slot was already loaded.
-     */
-    function testAndSetContractStorageLoaded(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_contract, _key),
-            ItemState.ITEM_LOADED
-        );
-    }
- 
-    /**
-     * Checks whether a storage slot has already been modified, and marks it as modified if not.
-     * @param _contract Address of the contract to check.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the slot was already modified.
-     */
-    function testAndSetContractStorageChanged(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_contract, _key),
-            ItemState.ITEM_CHANGED
-        );
-    }
- 
-    /**
-     * Attempts to mark a storage slot as committed.
-     * @param _contract Address of the account to commit.
-     * @param _key 32 byte slot key to commit.
-     * @return Whether or not the slot was committed.
-     */
-    function commitContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        if (itemStates[item] != ItemState.ITEM_CHANGED) {
-            return false;
-        }
- 
-        itemStates[item] = ItemState.ITEM_COMMITTED;
-        totalUncommittedContractStorage -= 1;
- 
-        return true;
-    }
- 
-    /**
-     * Increments the total number of uncommitted storage slots.
-     */
-    function incrementTotalUncommittedContractStorage()
-        override
-        public
-        authenticated
-    {
-        totalUncommittedContractStorage += 1;
-    }
- 
-    /**
-     * Gets the total number of uncommitted storage slots.
-     * @return Total uncommitted storage slots.
-     */
-    function getTotalUncommittedContractStorage()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return totalUncommittedContractStorage;
-    }
- 
-    /**
-     * Checks whether a given storage slot was changed during execution.
-     * @param _contract Address to check.
-     * @param _key Key of the storage slot to check.
-     * @return Whether or not the storage slot was changed.
-     */
-    function wasContractStorageChanged(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        return itemStates[item] >= ItemState.ITEM_CHANGED;
-    }
- 
-    /**
-     * Checks whether a given storage slot was committed after execution.
-     * @param _contract Address to check.
-     * @param _key Key of the storage slot to check.
-     * @return Whether or not the storage slot was committed.
-     */
-    function wasContractStorageCommitted(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        return itemStates[item] >= ItemState.ITEM_COMMITTED;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Generates a unique hash for an address.
-     * @param _address Address to generate a hash for.
-     * @return Unique hash for the given address.
-     */
-    function _getItemHash(
-        address _address
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(abi.encodePacked(_address));
-    }
- 
-    /**
-     * Generates a unique hash for an address/key pair.
-     * @param _contract Address to generate a hash for.
-     * @param _key Key to generate a hash for.
-     * @return Unique hash for the given pair.
-     */
-    function _getItemHash(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(abi.encodePacked(
-            _contract,
-            _key
-        ));
-    }
- 
-    /**
-     * Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets the
-     * item to the provided state if not.
-     * @param _item 32 byte item ID to check.
-     * @param _minItemState Minimum state that must be satisfied by the item.
-     * @return Whether or not the item was already in the state.
-     */
-    function _testAndSetItemState(
-        bytes32 _item,
-        ItemState _minItemState
-    )
-        internal
-        returns (
-            bool
-        )
-    {
-        bool wasItemState = itemStates[_item] >= _minItemState;
- 
-        if (wasItemState == false) {
-            itemStates[_item] = _minItemState;
-        }
- 
-        return wasItemState;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/execution/OVM_StateManagerFactory.sol.html b/coverage/lcov-report/OVM/execution/OVM_StateManagerFactory.sol.html deleted file mode 100644 index 571e900b2..000000000 --- a/coverage/lcov-report/OVM/execution/OVM_StateManagerFactory.sol.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - Code coverage report for OVM/execution/OVM_StateManagerFactory.sol - - - - - - - -
-
-

- all files / OVM/execution/ OVM_StateManagerFactory.sol -

-
-
- 0% - Statements - 0/1 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
- 
-/* Contract Imports */
-import { OVM_StateManager } from "./OVM_StateManager.sol";
- 
-/**
- * @title OVM_StateManagerFactory
- * @dev The State Manager Factory is called by a State Transitioner's init code, to create a new
- * State Manager for use in the Fraud Verification process.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateManagerFactory is iOVM_StateManagerFactory {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Creates a new OVM_StateManager
-     * @param _owner Owner of the created contract.
-     * @return New OVM_StateManager instance.
-     */
-    function create(
-        address _owner
-    )
-        override
-        public
-        returns (
-            iOVM_StateManager
-        )
-    {
-        return new OVM_StateManager(_owner);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/execution/index.html b/coverage/lcov-report/OVM/execution/index.html deleted file mode 100644 index ede1cb77a..000000000 --- a/coverage/lcov-report/OVM/execution/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for OVM/execution/ - - - - - - - -
-
-

- all files OVM/execution/ -

-
-
- 76.05% - Statements - 235/309 -
-
- 67.02% - Branches - 63/94 -
-
- 81.63% - Functions - 80/98 -
-
- 76.73% - Lines - 244/318 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_ExecutionManager.sol
74.58%176/23662.2%51/8283.61%51/6175.21%182/242
OVM_SafetyChecker.sol
100%8/8100%0/0100%1/1100%10/10
OVM_StateManager.sol
79.69%51/64100%12/1280%28/3580%52/65
OVM_StateManagerFactory.sol
0%0/1100%0/00%0/10%0/1
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/predeploys/ERC1820Registry.sol.html b/coverage/lcov-report/OVM/predeploys/ERC1820Registry.sol.html deleted file mode 100644 index e49e79f7c..000000000 --- a/coverage/lcov-report/OVM/predeploys/ERC1820Registry.sol.html +++ /dev/null @@ -1,662 +0,0 @@ - - - - Code coverage report for OVM/predeploys/ERC1820Registry.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ ERC1820Registry.sol -

-
-
- 0% - Statements - 0/38 -
-
- 0% - Branches - 0/22 -
-
- 0% - Functions - 0/10 -
-
- 0% - Lines - 0/39 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: CC0-1.0
-/* ERC1820 Pseudo-introspection Registry Contract
- * This standard defines a universal registry smart contract where any address (contract or regular account) can
- * register which interface it supports and which smart contract is responsible for its implementation.
- *
- * Written in 2019 by Jordi Baylina and Jacques Dafflon
- *
- * To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to
- * this software to the public domain worldwide. This software is distributed without any warranty.
- *
- * You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
- * <http://creativecommons.org/publicdomain/zero/1.0/>.
- */
-pragma solidity >0.5.0 <0.8.0;
- 
-/// @dev The interface a contract MUST implement if it is the implementer of
-/// some (other) interface for any address other than itself.
-interface ERC1820ImplementerInterface {
-    /// @notice Indicates whether the contract implements the interface 'interfaceHash' for the address 'addr' or not.
-    /// @param interfaceHash keccak256 hash of the name of the interface
-    /// @param addr Address for which the contract will implement the interface
-    /// @return ERC1820_ACCEPT_MAGIC only if the contract implements 'interfaceHash' for the address 'addr'.
-    function canImplementInterfaceForAddress(bytes32 interfaceHash, address addr) external view returns(bytes32);
-}
- 
-/**
- * @title ERC1820 Pseudo-introspection Registry Contract
- * @author Jordi Baylina and Jacques Dafflon
- * @dev This contract is the official implementation of the ERC1820 Registry 
- * For more details, see https://eips.ethereum.org/EIPS/eip-1820
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract ERC1820Registry {
-    bytes4 constant internal INVALID_ID = 0xffffffff;
-    bytes4 constant internal ERC165ID = 0x01ffc9a7;
-    bytes32 constant internal ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
- 
-    mapping(address => mapping(bytes32 => address)) internal interfaces;
-    mapping(address => address) internal managers;
-    mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
- 
-    /// @notice Indicates a contract is the 'implementer' of 'interfaceHash' for 'addr'.
-    event InterfaceImplementerSet(address indexed addr, bytes32 indexed interfaceHash, address indexed implementer);
-    /// @notice Indicates 'newManager' is the address of the new manager for 'addr'.
-    event ManagerChanged(address indexed addr, address indexed newManager);
- 
-    /// @notice Query if an address implements an interface and through which contract.
-    /// @param _addr Address being queried for the implementer of an interface.
-    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
-    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
-    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
-    /// @return The address of the contract which implements the interface '_interfaceHash' for '_addr'
-    /// or '0' if '_addr' did not register an implementer for this interface.
-    function getInterfaceImplementer(address _addr, bytes32 _interfaceHash) external view returns (address) {
-        address addr = _addr == address(0) ? msg.sender : _addr;
-        if (isERC165Interface(_interfaceHash)) {
-            bytes4 erc165InterfaceHash = bytes4(_interfaceHash);
-            return implementsERC165Interface(addr, erc165InterfaceHash) ? addr : address(0);
-        }
-        return interfaces[addr][_interfaceHash];
-    }
- 
-    /// @notice Sets the contract which implements a specific interface for an address.
-    /// Only the manager defined for that address can set it.
-    /// (Each address is the manager for itself until it sets a new manager.)
-    /// @param _addr Address for which to set the interface.
-    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
-    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
-    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
-    /// @param _implementer Contract address implementing '_interfaceHash' for '_addr'.
-    function setInterfaceImplementer(address _addr, bytes32 _interfaceHash, address _implementer) external {
-        address addr = _addr == address(0) ? msg.sender : _addr;
-        require(getManager(addr) == msg.sender, "Not the manager");
- 
-        require(!isERC165Interface(_interfaceHash), "Must not be an ERC165 hash");
-        if (_implementer != address(0) && _implementer != msg.sender) {
-            require(
-                ERC1820ImplementerInterface(_implementer)
-                    .canImplementInterfaceForAddress(_interfaceHash, addr) == ERC1820_ACCEPT_MAGIC,
-                "Does not implement the interface"
-            );
-        }
-        interfaces[addr][_interfaceHash] = _implementer;
-        emit InterfaceImplementerSet(addr, _interfaceHash, _implementer);
-    }
- 
-    /// @notice Sets '_newManager' as manager for '_addr'.
-    /// The new manager will be able to call 'setInterfaceImplementer' for '_addr'.
-    /// @param _addr Address for which to set the new manager.
-    /// @param _newManager Address of the new manager for 'addr'. (Pass '0x0' to reset the manager to '_addr'.)
-    function setManager(address _addr, address _newManager) external {
-        require(getManager(_addr) == msg.sender, "Not the manager");
-        managers[_addr] = _newManager == _addr ? address(0) : _newManager;
-        emit ManagerChanged(_addr, _newManager);
-    }
- 
-    /// @notice Get the manager of an address.
-    /// @param _addr Address for which to return the manager.
-    /// @return Address of the manager for a given address.
-    function getManager(address _addr) public view returns(address) {
-        // By default the manager of an address is the same address
-        if (managers[_addr] == address(0)) {
-            return _addr;
-        } else {
-            return managers[_addr];
-        }
-    }
- 
-    /// @notice Compute the keccak256 hash of an interface given its name.
-    /// @param _interfaceName Name of the interface.
-    /// @return The keccak256 hash of an interface name.
-    function interfaceHash(string calldata _interfaceName) external pure returns(bytes32) {
-        return keccak256(abi.encodePacked(_interfaceName));
-    }
- 
-    /* --- ERC165 Related Functions --- */
-    /* --- Developed in collaboration with William Entriken. --- */
- 
-    /// @notice Updates the cache with whether the contract implements an ERC165 interface or not.
-    /// @param _contract Address of the contract for which to update the cache.
-    /// @param _interfaceId ERC165 interface for which to update the cache.
-    function updateERC165Cache(address _contract, bytes4 _interfaceId) external {
-        interfaces[_contract][_interfaceId] = implementsERC165InterfaceNoCache(
-            _contract, _interfaceId) ? _contract : address(0);
-        erc165Cached[_contract][_interfaceId] = true;
-    }
- 
-    /// @notice Checks whether a contract implements an ERC165 interface or not.
-    //  If the result is not cached a direct lookup on the contract address is performed.
-    //  If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
-    //  'updateERC165Cache' with the contract address.
-    /// @param _contract Address of the contract to check.
-    /// @param _interfaceId ERC165 interface to check.
-    /// @return True if '_contract' implements '_interfaceId', false otherwise.
-    function implementsERC165Interface(address _contract, bytes4 _interfaceId) public view returns (bool) {
-        if (!erc165Cached[_contract][_interfaceId]) {
-            return implementsERC165InterfaceNoCache(_contract, _interfaceId);
-        }
-        return interfaces[_contract][_interfaceId] == _contract;
-    }
- 
-    /// @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
-    /// @param _contract Address of the contract to check.
-    /// @param _interfaceId ERC165 interface to check.
-    /// @return True if '_contract' implements '_interfaceId', false otherwise.
-    function implementsERC165InterfaceNoCache(address _contract, bytes4 _interfaceId) public view returns (bool) {
-        uint256 success;
-        uint256 result;
- 
-        (success, result) = noThrowCall(_contract, ERC165ID);
-        if (success == 0 || result == 0) {
-            return false;
-        }
- 
-        (success, result) = noThrowCall(_contract, INVALID_ID);
-        if (success == 0 || result != 0) {
-            return false;
-        }
- 
-        (success, result) = noThrowCall(_contract, _interfaceId);
-        if (success == 1 && result == 1) {
-            return true;
-        }
-        return false;
-    }
- 
-    /// @notice Checks whether the hash is a ERC165 interface (ending with 28 zeroes) or not.
-    /// @param _interfaceHash The hash to check.
-    /// @return True if '_interfaceHash' is an ERC165 interface (ending with 28 zeroes), false otherwise.
-    function isERC165Interface(bytes32 _interfaceHash) internal pure returns (bool) {
-        return _interfaceHash & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0;
-    }
- 
-    /// @dev Make a call on a contract without throwing if the function does not exist.
-    function noThrowCall(address _contract, bytes4 _interfaceId)
-        internal view returns (uint256 success, uint256 result)
-    {
-        bytes4 erc165ID = ERC165ID;
- 
-        assembly {
-            let x := mload(0x40)               // Find empty storage location using "free memory pointer"
-            mstore(x, erc165ID)                // Place signature at beginning of empty storage
-            mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
- 
-            success := staticcall(
-                30000,                         // 30k gas
-                _contract,                     // To addr
-                x,                             // Inputs are stored at location x
-                0x24,                          // Inputs are 36 (4 + 32) bytes long
-                x,                             // Store output over input (saves space)
-                0x20                           // Outputs are 32 bytes long
-            )
- 
-            result := mload(x)                 // Load the result
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/predeploys/OVM_DeployerWhitelist.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_DeployerWhitelist.sol.html deleted file mode 100644 index fb432861c..000000000 --- a/coverage/lcov-report/OVM/predeploys/OVM_DeployerWhitelist.sol.html +++ /dev/null @@ -1,701 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_DeployerWhitelist.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_DeployerWhitelist.sol -

-
-
- 36.36% - Statements - 8/22 -
-
- 66.67% - Branches - 4/6 -
-
- 12.5% - Functions - 1/8 -
-
- 34.78% - Lines - 8/23 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -29× -25× -  -  - -  -  -  - - -  -  - -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
- 
-/* Interface Imports */
-import { iOVM_DeployerWhitelist } from "../../iOVM/predeploys/iOVM_DeployerWhitelist.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_DeployerWhitelist
- * @dev The Deployer Whitelist is a temporary predeploy used to provide additional safety during the
- * initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts
- * which are allowed to deploy contracts on Layer2. The Execution Manager will only allow an 
- * ovmCREATE or ovmCREATE2 operation to proceed if the deployer's address whitelisted.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_DeployerWhitelist is iOVM_DeployerWhitelist {
- 
-    /**********************
-     * Contract Constants *
-     **********************/
- 
-    bytes32 internal constant KEY_INITIALIZED =                0x0000000000000000000000000000000000000000000000000000000000000010;
-    bytes32 internal constant KEY_OWNER =                      0x0000000000000000000000000000000000000000000000000000000000000011;
-    bytes32 internal constant KEY_ALLOW_ARBITRARY_DEPLOYMENT = 0x0000000000000000000000000000000000000000000000000000000000000012;
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
-    
-    /**
-     * Blocks functions to anyone except the contract owner.
-     */
-    modifier onlyOwner() {
-        address owner = Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                KEY_OWNER
-            )
-        );
- 
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_SafeExecutionManagerWrapper.safeCALLER() == owner,
-            "Function can only be called by the owner of this contract."
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
-    
-    /**
-     * Initializes the whitelist.
-     * @param _owner Address of the owner for this contract.
-     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
-     */
-    function initialize(
-        address _owner,
-        bool _allowArbitraryDeployment
-    )
-        override
-        public
-    {
-        bool initialized = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
-        );
- 
-        if (initialized == true) {
-            return;
-        }
- 
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_INITIALIZED,
-            Lib_Bytes32Utils.fromBool(true)
-        );
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_OWNER,
-            Lib_Bytes32Utils.fromAddress(_owner)
-        );
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
-            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
-        );
-    }
- 
-    /**
-     * Gets the owner of the whitelist.
-     */
-    function getOwner()
-        override
-        public
-        returns(
-            address
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                KEY_OWNER
-            )
-        );
-    }
- 
-    /**
-     * Adds or removes an address from the deployment whitelist.
-     * @param _deployer Address to update permissions for.
-     * @param _isWhitelisted Whether or not the address is whitelisted.
-     */
-    function setWhitelistedDeployer(
-        address _deployer,
-        bool _isWhitelisted
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            Lib_Bytes32Utils.fromAddress(_deployer),
-            Lib_Bytes32Utils.fromBool(_isWhitelisted)
-        );
-    }
- 
-    /**
-     * Updates the owner of this contract.
-     * @param _owner Address of the new owner.
-     */
-    function setOwner(
-        address _owner
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_OWNER,
-            Lib_Bytes32Utils.fromAddress(_owner)
-        );
-    }
- 
-    /**
-     * Updates the arbitrary deployment flag.
-     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
-     */
-    function setAllowArbitraryDeployment(
-        bool _allowArbitraryDeployment
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
-            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
-        );
-    }
- 
-    /**
-     * Permanently enables arbitrary contract deployment and deletes the owner.
-     */
-    function enableArbitraryContractDeployment()
-        override
-        public
-        onlyOwner
-    {
-        setAllowArbitraryDeployment(true);
-        setOwner(address(0));
-    }
- 
-    /**
-     * Checks whether an address is allowed to deploy contracts.
-     * @param _deployer Address to check.
-     * @return _allowed Whether or not the address can deploy contracts.
-     */
-    function isDeployerAllowed(
-        address _deployer
-    )
-        override
-        public
-        returns (
-            bool _allowed
-        )
-    {
-        bool initialized = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
-        );
- 
-        if (initialized == false) {
-            return true;
-        }
- 
-        bool allowArbitraryDeployment = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_ALLOW_ARBITRARY_DEPLOYMENT)
-        );
- 
-        if (allowArbitraryDeployment == true) {
-            return true;
-        }
- 
-        bool isWhitelisted = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                Lib_Bytes32Utils.fromAddress(_deployer)
-            )
-        );
- 
-        return isWhitelisted;        
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/predeploys/OVM_ETH.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_ETH.sol.html deleted file mode 100644 index c72919992..000000000 --- a/coverage/lcov-report/OVM/predeploys/OVM_ETH.sol.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_ETH.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_ETH.sol -

-
-
- 0% - Statements - 0/1 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Contract Imports */
-import { OVM_L2DepositedERC20 } from "../bridge/tokens/OVM_L2DepositedERC20.sol";
- 
-/**
- * @title OVM_ETH
- * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that 
- * unlike on Layer 1, Layer 2 accounts do not have a balance field.
- * 
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract OVM_ETH is OVM_L2DepositedERC20 {
-    constructor(
-        address _l2CrossDomainMessenger,
-        address _l1ETHGateway
-    ) 
-        OVM_L2DepositedERC20(
-            _l2CrossDomainMessenger,
-            "Ether",
-            "ETH"
-        )
-    {
-        init(iOVM_L1TokenGateway(_l1ETHGateway));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/predeploys/OVM_L1MessageSender.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_L1MessageSender.sol.html deleted file mode 100644 index 23974fcf0..000000000 --- a/coverage/lcov-report/OVM/predeploys/OVM_L1MessageSender.sol.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_L1MessageSender.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_L1MessageSender.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_L1MessageSender } from "../../iOVM/predeploys/iOVM_L1MessageSender.sol";
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
- 
-/**
- * @title OVM_L1MessageSender
- * @dev The L1MessageSender is a predeploy contract running on L2. During the execution of cross 
- * domain transaction from L1 to L2, it returns the address of the L1 account (either an EOA or
- * contract) which sent the message to L2 via the Canonical Transaction Chain's `enqueue()` 
- * function.
- * 
- * This contract exclusively serves as a getter for the ovmL1TXORIGIN operation. This is necessary 
- * because there is no corresponding operation in the EVM which the the optimistic solidity compiler 
- * can be replaced with a call to the ExecutionManager's ovmL1TXORIGIN() function.
- *
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_L1MessageSender is iOVM_L1MessageSender {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @return _l1MessageSender L1 message sender address (msg.sender).
-     */
-    function getL1MessageSender()
-        override
-        public
-        view
-        returns (
-            address _l1MessageSender
-        )
-    {
-        // Note that on L2 msg.sender (ie. evmCALLER) will always be the Execution Manager 
-        return iOVM_ExecutionManager(msg.sender).ovmL1TXORIGIN();
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html deleted file mode 100644 index 78befb65e..000000000 --- a/coverage/lcov-report/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_L2ToL1MessagePasser.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_L2ToL1MessagePasser.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_L2ToL1MessagePasser } from "../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
- 
-/**
- * @title OVM_L2ToL1MessagePasser
- * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the 
- * of a message on L2. The L1 Cross Domain Messenger performs this proof in its
- * _verifyStorageProof function, which verifies the existence of the transaction hash in this 
- * contract's `sentMessages` mapping.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    mapping (bytes32 => bool) public sentMessages;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Passes a message to L1.
-     * @param _message Message to pass to L1.
-     */
-    function passMessageToL1(
-        bytes memory _message
-    )
-        override
-        public
-    {
-        // Note: although this function is public, only messages sent from the OVM_L2CrossDomainMessenger 
-        // will be relayed by the OVM_L1CrossDomainMessenger. This is enforced by a check in 
-        // OVM_L1CrossDomainMessenger._verifyStorageProof().
-        sentMessages[keccak256(
-            abi.encodePacked(
-                _message,
-                msg.sender
-            )
-        )] = true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html deleted file mode 100644 index 26ebcbefe..000000000 --- a/coverage/lcov-report/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_ProxySequencerEntrypoint.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_ProxySequencerEntrypoint.sol -

-
-
- 100% - Statements - 10/10 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 7/7 -
-
- 100% - Lines - 10/10 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_ProxySequencerEntrypoint 
- * @dev The Proxy Sequencer Entrypoint is a predeployed proxy to the implementation of the 
- * Sequencer Entrypoint. This will enable the Optimism team to upgrade the Sequencer Entrypoint 
- * contract.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ProxySequencerEntrypoint {
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
-            gasleft(),
-            _getImplementation(),
-            msg.data
-        );
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function init(
-        address _implementation,
-        address _owner
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            _getOwner() == address(0),
-            "ProxySequencerEntrypoint has already been inited"
-        );
-        _setOwner(_owner);
-        _setImplementation(_implementation);
-    }
- 
-    function upgrade(
-        address _implementation
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            _getOwner() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
-            "Only owner can upgrade the Entrypoint"
-        );
- 
-        _setImplementation(_implementation);
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _setImplementation(
-        address _implementation
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            bytes32(uint256(0)),
-            bytes32(uint256(uint160(_implementation)))
-        );
-    }
- 
-    function _getImplementation()
-        internal
-        returns (
-            address _implementation
-        )
-    {
-        return address(uint160(uint256(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                bytes32(uint256(0))
-            )
-        )));
-    }
- 
-    function _setOwner(
-        address _owner
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            bytes32(uint256(1)),
-            bytes32(uint256(uint160(_owner)))
-        );
-    }
- 
-    function _getOwner()
-        internal
-        returns (
-            address _owner
-        )
-    {
-        return address(uint160(uint256(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                bytes32(uint256(1))
-            )
-        )));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/predeploys/OVM_SequencerEntrypoint.sol.html b/coverage/lcov-report/OVM/predeploys/OVM_SequencerEntrypoint.sol.html deleted file mode 100644 index b6e8b5067..000000000 --- a/coverage/lcov-report/OVM/predeploys/OVM_SequencerEntrypoint.sol.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - Code coverage report for OVM/predeploys/OVM_SequencerEntrypoint.sol - - - - - - - -
-
-

- all files / OVM/predeploys/ OVM_SequencerEntrypoint.sol -

-
-
- 100% - Statements - 18/18 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 17/17 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - - - -  -  - - -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  - - -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_SequencerEntrypoint
- * @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by 
- * any account. It accepts a more efficient compressed calldata format, which it decompresses and 
- * encodes to the standard EIP155 transaction format.
- * This contract is the implementation referenced by the Proxy Sequencer Entrypoint, thus enabling
- * the Optimism team to upgrade the decompression of calldata from the Sequencer.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_SequencerEntrypoint {
- 
-    /*********
-     * Enums *
-     *********/
-    
-    enum TransactionType {
-        NATIVE_ETH_TRANSACTION,
-        ETH_SIGNED_MESSAGE
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    /**
-     * Uses a custom "compressed" format to save on calldata gas:
-     * calldata[00:01]: transaction type (0 == EIP 155, 2 == Eth Sign Message)
-     * calldata[01:33]: signature "r" parameter
-     * calldata[33:65]: signature "s" parameter
-     * calldata[65:66]: signature "v" parameter
-     * calldata[66:69]: transaction gas limit
-     * calldata[69:72]: transaction gas price
-     * calldata[72:75]: transaction nonce
-     * calldata[75:95]: transaction target address
-     * calldata[95:XX]: transaction data
-     */
-    fallback()
-        external
-    {
-        TransactionType transactionType = _getTransactionType(Lib_BytesUtils.toUint8(msg.data, 0));
- 
-        bytes32 r = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 1, 32));
-        bytes32 s = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 33, 32));
-        uint8 v = Lib_BytesUtils.toUint8(msg.data, 65);
- 
-        // Remainder is the transaction to execute.
-        bytes memory compressedTx = Lib_BytesUtils.slice(msg.data, 66);
-        bool isEthSignedMessage = transactionType == TransactionType.ETH_SIGNED_MESSAGE;
- 
-        // Need to decompress and then re-encode the transaction based on the original encoding.
-        bytes memory encodedTx = Lib_OVMCodec.encodeEIP155Transaction(
-            Lib_OVMCodec.decompressEIP155Transaction(compressedTx),
-            isEthSignedMessage
-        );
- 
-        address target = Lib_ECDSAUtils.recover(
-            encodedTx,
-            isEthSignedMessage,
-            uint8(v),
-            r,
-            s
-        );
- 
-        if (Lib_SafeExecutionManagerWrapper.safeEXTCODESIZE(target) == 0) {
-            // ProxyEOA has not yet been deployed for this EOA.
-            bytes32 messageHash = Lib_ECDSAUtils.getMessageHash(encodedTx, isEthSignedMessage);
-            Lib_SafeExecutionManagerWrapper.safeCREATEEOA(messageHash, uint8(v), r, s);
-        }
- 
-        // ProxyEOA has been deployed for this EOA, continue to CALL.
-        bytes memory callbytes = abi.encodeWithSignature(
-            "execute(bytes,uint8,uint8,bytes32,bytes32)",
-            encodedTx,
-            isEthSignedMessage,
-            uint8(v),
-            r,
-            s
-        );
- 
-        Lib_SafeExecutionManagerWrapper.safeCALL(
-            gasleft(),
-            target,
-            callbytes
-        );
-    }
-    
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Converts a uint256 into a TransactionType enum.
-     * @param _transactionType Transaction type index.
-     * @return _txType Transaction type enum value.
-     */
-    function _getTransactionType(
-        uint8 _transactionType
-    )
-        internal
-        returns (
-            TransactionType _txType
-        )
-    {
-        if (_transactionType == 0) {
-            return TransactionType.NATIVE_ETH_TRANSACTION;
-        } if (_transactionType == 2) {
-            return TransactionType.ETH_SIGNED_MESSAGE;
-        } else {
-            Lib_SafeExecutionManagerWrapper.safeREVERT(
-                "Transaction type must be 0 or 2"
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/predeploys/index.html b/coverage/lcov-report/OVM/predeploys/index.html deleted file mode 100644 index fab910cad..000000000 --- a/coverage/lcov-report/OVM/predeploys/index.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - Code coverage report for OVM/predeploys/ - - - - - - - -
-
-

- all files OVM/predeploys/ -

-
-
- 41.76% - Statements - 38/91 -
-
- 29.41% - Branches - 10/34 -
-
- 40% - Functions - 12/30 -
-
- 40.22% - Lines - 37/92 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
ERC1820Registry.sol
0%0/380%0/220%0/100%0/39
OVM_DeployerWhitelist.sol
36.36%8/2266.67%4/612.5%1/834.78%8/23
OVM_ETH.sol
0%0/1100%0/00%0/10%0/1
OVM_L1MessageSender.sol
100%1/1100%0/0100%1/1100%1/1
OVM_L2ToL1MessagePasser.sol
100%1/1100%0/0100%1/1100%1/1
OVM_ProxySequencerEntrypoint.sol
100%10/10100%0/0100%7/7100%10/10
OVM_SequencerEntrypoint.sol
100%18/18100%6/6100%2/2100%17/17
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/verification/Abs_FraudContributor.sol.html b/coverage/lcov-report/OVM/verification/Abs_FraudContributor.sol.html deleted file mode 100644 index cb75b1904..000000000 --- a/coverage/lcov-report/OVM/verification/Abs_FraudContributor.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for OVM/verification/Abs_FraudContributor.sol - - - - - - - -
-
-

- all files / OVM/verification/ Abs_FraudContributor.sol -

-
-
- 100% - Statements - 3/3 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -14× -14× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/// Minimal contract to be inherited by contracts consumed by users that provide
-/// data for fraud proofs
-abstract contract Abs_FraudContributor is Lib_AddressResolver {
-    /// Decorate your functions with this modifier to store how much total gas was
-    /// consumed by the sender, to reward users fairly
-    modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
-        uint256 startGas = gasleft();
-        _;
-        uint256 gasSpent = startGas - gasleft();
-        iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/verification/OVM_BondManager.sol.html b/coverage/lcov-report/OVM/verification/OVM_BondManager.sol.html deleted file mode 100644 index d90409cfe..000000000 --- a/coverage/lcov-report/OVM/verification/OVM_BondManager.sol.html +++ /dev/null @@ -1,689 +0,0 @@ - - - - Code coverage report for OVM/verification/OVM_BondManager.sol - - - - - - - -
-
-

- all files / OVM/verification/ OVM_BondManager.sol -

-
-
- 100% - Statements - 42/42 -
-
- 86.67% - Branches - 26/30 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 41/41 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -63× -  -  -  -  -  -  -  -  -  -  -46× -46× -  -45× -45× -  -  -  -  -  -13× -12× -  -  -  -11× -  -11× -11× - - - -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -11× -  -  -  -  - -  -  -  -10× -  -  -  -  -  -18× -  -  -  -  -  -18× -  -  -  -  - - - -  - - -  -  -  -  - -  - -  -  -  - -  -  - - -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  - - -  -  - -  -  -  - -  -  - -  -  - -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_BondManager, Errors, ERC20 } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
- 
-/**
- * @title OVM_BondManager
- * @dev The Bond Manager contract handles deposits in the form of an ERC20 token from bonded 
- * Proposers. It also handles the accounting of gas costs spent by a Verifier during the course of a
- * fraud proof. In the event of a successful fraud proof, the fraudulent Proposer's bond is slashed, 
- * and the Verifier's gas costs are refunded.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
- 
-    /****************************
-     * Constants and Parameters *
-     ****************************/
- 
-    /// The period to find the earliest fraud proof for a publisher
-    uint256 public constant multiFraudProofPeriod = 7 days;
- 
-    /// The dispute period
-    uint256 public constant disputePeriodSeconds = 7 days;
- 
-    /// The minimum collateral a sequencer must post
-    uint256 public constant requiredCollateral = 1 ether;
- 
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    /// The bond token
-    ERC20 immutable public token;
- 
- 
-    /********************************************
-     * Contract Variables: Internal Accounting  *
-     *******************************************/
- 
-    /// The bonds posted by each proposer
-    mapping(address => Bond) public bonds;
- 
-    /// For each pre-state root, there's an array of witnessProviders that must be rewarded
-    /// for posting witnesses
-    mapping(bytes32 => Rewards) public witnessProviders;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /// Initializes with a ERC20 token to be used for the fidelity bonds
-    /// and with the Address Manager
-    constructor(
-        ERC20 _token,
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        token = _token;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /// Adds `who` to the list of witnessProviders for the provided `preStateRoot`.
-    function recordGasSpent(bytes32 _preStateRoot, bytes32 _txHash, address who, uint256 gasSpent) override public {
-        // The sender must be the transitioner that corresponds to the claimed pre-state root
-        address transitioner = address(iOVM_FraudVerifier(resolve("OVM_FraudVerifier")).getStateTransitioner(_preStateRoot, _txHash));
-        require(transitioner == msg.sender, Errors.ONLY_TRANSITIONER);
- 
-        witnessProviders[_preStateRoot].total += gasSpent;
-        witnessProviders[_preStateRoot].gasSpent[who] += gasSpent;
-    }
- 
-    /// Slashes + distributes rewards or frees up the sequencer's bond, only called by
-    /// `FraudVerifier.finalizeFraudVerification`
-    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) override public {
-        require(msg.sender == resolve("OVM_FraudVerifier"), Errors.ONLY_FRAUD_VERIFIER);
-        require(witnessProviders[_preStateRoot].canClaim == false, Errors.ALREADY_FINALIZED);
- 
-        // allow users to claim from that state root's
-        // pool of collateral (effectively slashing the sequencer)
-        witnessProviders[_preStateRoot].canClaim = true;
- 
-        Bond storage bond = bonds[publisher];
-        if (bond.firstDisputeAt == 0) {
-            bond.firstDisputeAt = block.timestamp;
-            bond.earliestDisputedStateRoot = _preStateRoot;
-            bond.earliestTimestamp = timestamp;
-        } else if (
-            // only update the disputed state root for the publisher if it's within
-            // the dispute period _and_ if it's before the previous one
-            block.timestamp < bond.firstDisputeAt + multiFraudProofPeriod &&
-            timestamp < bond.earliestTimestamp
-        ) {
-            bond.earliestDisputedStateRoot = _preStateRoot;
-            bond.earliestTimestamp = timestamp;
-        }
- 
-        // if the fraud proof's dispute period does not intersect with the 
-        // withdrawal's timestamp, then the user should not be slashed
-        // e.g if a user at day 10 submits a withdrawal, and a fraud proof
-        // from day 1 gets published, the user won't be slashed since day 8 (1d + 7d)
-        // is before the user started their withdrawal. on the contrary, if the user
-        // had started their withdrawal at, say, day 6, they would be slashed
-        if (
-            bond.withdrawalTimestamp != 0 && 
-            uint256(bond.withdrawalTimestamp) > timestamp + disputePeriodSeconds &&
-            bond.state == State.WITHDRAWING
-        ) {
-            return;
-        }
- 
-        // slash!
-        bond.state = State.NOT_COLLATERALIZED;
-    }
- 
-    /// Sequencers call this function to post collateral which will be used for
-    /// the `appendBatch` call
-    function deposit() override public {
-        Erequire(
-            token.transferFrom(msg.sender, address(this), requiredCollateral),
-            Errors.ERC20_ERR
-        );
- 
-        // This cannot overflow
-        bonds[msg.sender].state = State.COLLATERALIZED;
-    }
- 
-    /// Starts the withdrawal for a publisher
-    function startWithdrawal() override public {
-        Bond storage bond = bonds[msg.sender];
-        Erequire(bond.withdrawalTimestamp == 0, Errors.WITHDRAWAL_PENDING);
-        require(bond.state == State.COLLATERALIZED, Errors.WRONG_STATE);
- 
-        bond.state = State.WITHDRAWING;
-        bond.withdrawalTimestamp = uint32(block.timestamp);
-    }
- 
-    /// Finalizes a pending withdrawal from a publisher
-    function finalizeWithdrawal() override public {
-        Bond storage bond = bonds[msg.sender];
- 
-        require(
-            block.timestamp >= uint256(bond.withdrawalTimestamp) + disputePeriodSeconds, 
-            Errors.TOO_EARLY
-        );
-        require(bond.state == State.WITHDRAWING, Errors.SLASHED);
-        
-        // refunds!
-        bond.state = State.NOT_COLLATERALIZED;
-        bond.withdrawalTimestamp = 0;
-        
-        Erequire(
-            token.transfer(msg.sender, requiredCollateral),
-            Errors.ERC20_ERR
-        );
-    }
- 
-    /// Claims the user's reward for the witnesses they provided for the earliest
-    /// disputed state root of the designated publisher
-    function claim(address who) override public {
-        Bond storage bond = bonds[who];
-        require(
-            block.timestamp >= bond.firstDisputeAt + multiFraudProofPeriod,
-            Errors.WAIT_FOR_DISPUTES
-        );
- 
-        // reward the earliest state root for this publisher
-        bytes32 _preStateRoot = bond.earliestDisputedStateRoot;
-        Rewards storage rewards = witnessProviders[_preStateRoot];
- 
-        // only allow claiming if fraud was proven in `finalize`
-        require(rewards.canClaim, Errors.CANNOT_CLAIM);
- 
-        // proportional allocation - only reward 50% (rest gets locked in the
-        // contract forever
-        uint256 amount = (requiredCollateral * rewards.gasSpent[msg.sender]) / (2 * rewards.total);
- 
-        // reset the user's spent gas so they cannot double claim
-        rewards.gasSpent[msg.sender] = 0;
- 
-        // transfer
-        Erequire(token.transfer(msg.sender, amount), Errors.ERC20_ERR);
-    }
- 
-    /// Checks if the user is collateralized
-    function isCollateralized(address who) override public view returns (bool) {
-        return bonds[who].state == State.COLLATERALIZED;
-    }
- 
-    /// Gets how many witnesses the user has provided for the state root
-    function getGasSpent(bytes32 preStateRoot, address who) override public view returns (uint256) {
-        return witnessProviders[preStateRoot].gasSpent[who];
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/verification/OVM_FraudVerifier.sol.html b/coverage/lcov-report/OVM/verification/OVM_FraudVerifier.sol.html deleted file mode 100644 index 23d1fbb73..000000000 --- a/coverage/lcov-report/OVM/verification/OVM_FraudVerifier.sol.html +++ /dev/null @@ -1,953 +0,0 @@ - - - - Code coverage report for OVM/verification/OVM_FraudVerifier.sol - - - - - - - -
-
-

- all files / OVM/verification/ OVM_FraudVerifier.sol -

-
-
- 96.43% - Statements - 27/28 -
-
- 94.44% - Branches - 17/18 -
-
- 100% - Functions - 7/7 -
-
- 96.43% - Lines - 27/28 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -12× -  -  -  -12× -12× -  -12× -  -  -  -  -  -  -  -  -11× -  -  -  -  -  -  -  -  -  -10× -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - -  -  -  -  - -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
- 
-/* Contract Imports */
-import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
- 
- 
- 
-/**
- * @title OVM_FraudVerifier
- * @dev The Fraud Verifier contract coordinates the entire fraud proof verification process. 
- * If the fraud proof was successful it prunes any state batches from State Commitment Chain
- * which were published after the fraudulent state root.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_FraudVerifier is Lib_AddressResolver, Abs_FraudContributor, iOVM_FraudVerifier {
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    mapping (bytes32 => iOVM_StateTransitioner) internal transitioners;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
- 
-    /***************************************
-     * Public Functions: Transition Status *
-     ***************************************/
- 
-    /**
-     * Retrieves the state transitioner for a given root.
-     * @param _preStateRoot State root to query a transitioner for.
-     * @return _transitioner Corresponding state transitioner contract.
-     */
-    function getStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        override
-        public
-        view
-        returns (
-            iOVM_StateTransitioner _transitioner
-        )
-    {
-        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
-    }
- 
- 
-    /****************************************
-     * Public Functions: Fraud Verification *
-     ****************************************/
- 
-    /**
-     * Begins the fraud verification process.
-     * @param _preStateRoot State root before the fraudulent transaction.
-     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
-     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
-     * @param _transaction OVM transaction claimed to be fraudulent.
-     * @param _txChainElement OVM transaction chain element.
-     * @param _transactionBatchHeader Batch header for the provided transaction.
-     * @param _transactionProof Inclusion proof for the provided transaction.
-     */
-    function initializeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _transactionBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _transactionProof
-    )
-        override
-        public
-        contributesToFraudProof(_preStateRoot, Lib_OVMCodec.hashTransaction(_transaction))
-    {
-        bytes32 _txHash = Lib_OVMCodec.hashTransaction(_transaction);
- 
-        Iif (_hasStateTransitioner(_preStateRoot, _txHash)) {
-            return;
-        }
- 
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
-        iOVM_CanonicalTransactionChain ovmCanonicalTransactionChain = iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain"));
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _preStateRoot,
-                _preStateRootBatchHeader,
-                _preStateRootProof
-            ),
-            "Invalid pre-state root inclusion proof."
-        );
- 
-        require(
-            ovmCanonicalTransactionChain.verifyTransaction(
-                _transaction,
-                _txChainElement,
-                _transactionBatchHeader,
-                _transactionProof
-            ),
-            "Invalid transaction inclusion proof."
-        );
- 
-        require (
-            _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1 == _transactionBatchHeader.prevTotalElements + _transactionProof.index,
-            "Pre-state root global index must equal to the transaction root global index."
-        );
- 
-        _deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index);
- 
-        emit FraudProofInitialized(
-            _preStateRoot,
-            _preStateRootProof.index,
-            _txHash,
-            msg.sender
-        );
-    }
- 
-    /**
-     * Finalizes the fraud verification process.
-     * @param _preStateRoot State root before the fraudulent transaction.
-     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
-     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
-     * @param _txHash The transaction for the state root
-     * @param _postStateRoot State root after the fraudulent transaction.
-     * @param _postStateRootBatchHeader Batch header for the provided post-state root.
-     * @param _postStateRootProof Inclusion proof for the provided post-state root.
-     */
-    function finalizeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
-        bytes32 _txHash,
-        bytes32 _postStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _postStateRootProof
-    )
-        override
-        public
-        contributesToFraudProof(_preStateRoot, _txHash)
-    {
-        iOVM_StateTransitioner transitioner = getStateTransitioner(_preStateRoot, _txHash);
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
- 
-        require(
-            transitioner.isComplete() == true,
-            "State transition process must be completed prior to finalization."
-        );
- 
-        require (
-            _postStateRootBatchHeader.prevTotalElements + _postStateRootProof.index == _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1,
-            "Post-state root global index must equal to the pre state root global index plus one."
-        );
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _preStateRoot,
-                _preStateRootBatchHeader,
-                _preStateRootProof
-            ),
-            "Invalid pre-state root inclusion proof."
-        );
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _postStateRoot,
-                _postStateRootBatchHeader,
-                _postStateRootProof
-            ),
-            "Invalid post-state root inclusion proof."
-        );
- 
-        // If the post state root did not match, then there was fraud and we should delete the batch
-        require(
-            _postStateRoot != transitioner.getPostStateRoot(),
-            "State transition has not been proven fraudulent."
-        );
-        
-        _cancelStateTransition(_postStateRootBatchHeader, _preStateRoot);
- 
-        // TEMPORARY: Remove the transitioner; for minnet.
-        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitioner(0x0000000000000000000000000000000000000000);
- 
-        emit FraudProofFinalized(
-            _preStateRoot,
-            _preStateRootProof.index,
-            _txHash,
-            msg.sender
-        );
-    }
- 
- 
-    /************************************
-     * Internal Functions: Verification *
-     ************************************/
- 
-    /**
-     * Checks whether a transitioner already exists for a given pre-state root.
-     * @param _preStateRoot Pre-state root to check.
-     * @return _exists Whether or not we already have a transitioner for the root.
-     */
-    function _hasStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        internal
-        view
-        returns (
-            bool _exists
-        )
-    {
-        return address(getStateTransitioner(_preStateRoot, _txHash)) != address(0);
-    }
- 
-    /**
-     * Deploys a new state transitioner.
-     * @param _preStateRoot Pre-state root to initialize the transitioner with.
-     * @param _txHash Hash of the transaction this transitioner will execute.
-     * @param _stateTransitionIndex Index of the transaction in the chain.
-     */
-    function _deployTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        uint256 _stateTransitionIndex
-    )
-        internal
-    {
-        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitionerFactory(
-            resolve("OVM_StateTransitionerFactory")
-        ).create(
-            address(libAddressManager),
-            _stateTransitionIndex,
-            _preStateRoot,
-            _txHash
-        );
-    }
- 
-    /**
-     * Removes a state transition from the state commitment chain.
-     * @param _postStateRootBatchHeader Header for the post-state root.
-     * @param _preStateRoot Pre-state root hash.
-     */
-    function _cancelStateTransition(
-        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
-        bytes32 _preStateRoot
-    )
-        internal
-    {
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
-        iOVM_BondManager ovmBondManager = iOVM_BondManager(resolve("OVM_BondManager"));
- 
-        // Delete the state batch.
-        ovmStateCommitmentChain.deleteStateBatch(
-            _postStateRootBatchHeader
-        );
- 
-        // Get the timestamp and publisher for that block.
-        (uint256 timestamp, address publisher) = abi.decode(_postStateRootBatchHeader.extraData, (uint256, address));
- 
-        // Slash the bonds at the bond manager.
-        ovmBondManager.finalize(
-            _preStateRoot,
-            publisher,
-            timestamp
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/verification/OVM_StateTransitioner.sol.html b/coverage/lcov-report/OVM/verification/OVM_StateTransitioner.sol.html deleted file mode 100644 index e163ff151..000000000 --- a/coverage/lcov-report/OVM/verification/OVM_StateTransitioner.sol.html +++ /dev/null @@ -1,1484 +0,0 @@ - - - - Code coverage report for OVM/verification/OVM_StateTransitioner.sol - - - - - - - -
-
-

- all files / OVM/verification/ OVM_StateTransitioner.sol -

-
-
- 80% - Statements - 40/50 -
-
- 62.5% - Branches - 20/32 -
-
- 90.91% - Functions - 10/11 -
-
- 80.39% - Lines - 41/51 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -42× -42× -  -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  - -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
-import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
-import { Lib_SecureMerkleTrie } from "../../libraries/trie/Lib_SecureMerkleTrie.sol";
-import { Lib_RLPWriter } from "../../libraries/rlp/Lib_RLPWriter.sol";
-import { Lib_RLPReader } from "../../libraries/rlp/Lib_RLPReader.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
- 
-/* Contract Imports */
-import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
- 
-/**
- * @title OVM_StateTransitioner
- * @dev The State Transitioner coordinates the execution of a state transition during the evaluation of a
- * fraud proof. It feeds verified input to the Execution Manager's run(), and controls a State Manager (which is
- * uniquely created for each fraud proof).
- * Once a fraud proof has been initialized, this contract is provided with the pre-state root and verifies
- * that the OVM storage slots committed to the State Mangager are contained in that state
- * This contract controls the State Manager and Execution Manager, and uses them to calculate the
- * post-state root by applying the transaction. The Fraud Verifier can then check for fraud by comparing
- * the calculated post-state root with the proposed post-state root.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateTransitioner is Lib_AddressResolver, Abs_FraudContributor, iOVM_StateTransitioner {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum TransitionPhase {
-        PRE_EXECUTION,
-        POST_EXECUTION,
-        COMPLETE
-    }
- 
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    iOVM_StateManager public ovmStateManager;
- 
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    bytes32 internal preStateRoot;
-    bytes32 internal postStateRoot;
-    TransitionPhase public phase;
-    uint256 internal stateTransitionIndex;
-    bytes32 internal transactionHash;
- 
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 internal constant EMPTY_ACCOUNT_CODE_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
-    bytes32 internal constant EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _stateTransitionIndex Index of the state transition being verified.
-     * @param _preStateRoot State root before the transition was executed.
-     * @param _transactionHash Hash of the executed transaction.
-     */
-    constructor(
-        address _libAddressManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        stateTransitionIndex = _stateTransitionIndex;
-        preStateRoot = _preStateRoot;
-        postStateRoot = _preStateRoot;
-        transactionHash = _transactionHash;
- 
-        ovmStateManager = iOVM_StateManagerFactory(resolve("OVM_StateManagerFactory")).create(address(this));
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Checks that a function is only run during a specific phase.
-     * @param _phase Phase the function must run within.
-     */
-    modifier onlyDuringPhase(
-        TransitionPhase _phase
-    ) {
-        Erequire(
-            phase == _phase,
-            "Function must be called during the correct phase."
-        );
-        _;
-    }
- 
- 
-    /**********************************
-     * Public Functions: State Access *
-     **********************************/
- 
-    /**
-     * Retrieves the state root before execution.
-     * @return _preStateRoot State root before execution.
-     */
-    function getPreStateRoot()
-        override
-        public
-        view
-        returns (
-            bytes32 _preStateRoot
-        )
-    {
-        return preStateRoot;
-    }
- 
-    /**
-     * Retrieves the state root after execution.
-     * @return _postStateRoot State root after execution.
-     */
-    function getPostStateRoot()
-        override
-        public
-        view
-        returns (
-            bytes32 _postStateRoot
-        )
-    {
-        return postStateRoot;
-    }
- 
-    /**
-     * Checks whether the transitioner is complete.
-     * @return _complete Whether or not the transition process is finished.
-     */
-    function isComplete()
-        override
-        public
-        view
-        returns (
-            bool _complete
-        )
-    {
-        return phase == TransitionPhase.COMPLETE;
-    }
-    
- 
-    /***********************************
-     * Public Functions: Pre-Execution *
-     ***********************************/
- 
-    /**
-     * Allows a user to prove the initial state of a contract.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _ethContractAddress Address of the corresponding contract on L1.
-     * @param _stateTrieWitness Proof of the account state.
-     */
-    function proveContractState(
-        address _ovmContractAddress,
-        address _ethContractAddress,
-        bytes memory _stateTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        // Exit quickly to avoid unnecessary work.
-        Erequire(
-            (
-                ovmStateManager.hasAccount(_ovmContractAddress) == false
-                && ovmStateManager.hasEmptyAccount(_ovmContractAddress) == false
-            ),
-            "Account state has already been proven."
-        );
- 
-        // Function will fail if the proof is not a valid inclusion or exclusion proof.
-        (
-            bool exists,
-            bytes memory encodedAccount
-        ) = Lib_SecureMerkleTrie.get(
-            abi.encodePacked(_ovmContractAddress),
-            _stateTrieWitness,
-            preStateRoot
-        );
- 
-        Eif (exists == true) {
-            // Account exists, this was an inclusion proof.
-            Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
-                encodedAccount
-            );
- 
-            address ethContractAddress = _ethContractAddress;
-            Iif (account.codeHash == EMPTY_ACCOUNT_CODE_HASH) {
-                // Use a known empty contract to prevent an attack in which a user provides a
-                // contract address here and then later deploys code to it.
-                ethContractAddress = 0x0000000000000000000000000000000000000000;
-            } else {
-                // Otherwise, make sure that the code at the provided eth address matches the hash
-                // of the code stored on L2.
-                Erequire(
-                    Lib_EthUtils.getCodeHash(ethContractAddress) == account.codeHash,
-                    "OVM_StateTransitioner: Provided L1 contract code hash does not match L2 contract code hash."
-                );
-            }
- 
-            ovmStateManager.putAccount(
-                _ovmContractAddress,
-                Lib_OVMCodec.Account({
-                    nonce: account.nonce,
-                    balance: account.balance,
-                    storageRoot: account.storageRoot,
-                    codeHash: account.codeHash,
-                    ethAddress: ethContractAddress,
-                    isFresh: false
-                })
-            );
-        } else {
-            // Account does not exist, this was an exclusion proof.
-            ovmStateManager.putEmptyAccount(_ovmContractAddress);
-        }
-    }
- 
-    /**
-     * Allows a user to prove the initial state of a contract storage slot.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _key Claimed account slot key.
-     * @param _storageTrieWitness Proof of the storage slot.
-     */
-    function proveStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes memory _storageTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        // Exit quickly to avoid unnecessary work.
-        Erequire(
-            ovmStateManager.hasContractStorage(_ovmContractAddress, _key) == false,
-            "Storage slot has already been proven."
-        );
- 
-        require(
-            ovmStateManager.hasAccount(_ovmContractAddress) == true,
-            "Contract must be verified before proving a storage slot."
-        );
- 
-        bytes32 storageRoot = ovmStateManager.getAccountStorageRoot(_ovmContractAddress);
-        bytes32 value;
- 
-        Iif (storageRoot == EMPTY_ACCOUNT_STORAGE_ROOT) {
-            // Storage trie was empty, so the user is always allowed to insert zero-byte values.
-            value = bytes32(0);
-        } else {
-            // Function will fail if the proof is not a valid inclusion or exclusion proof.
-            (
-                bool exists,
-                bytes memory encodedValue
-            ) = Lib_SecureMerkleTrie.get(
-                abi.encodePacked(_key),
-                _storageTrieWitness,
-                storageRoot
-            );
- 
-            Eif (exists == true) {
-                // Inclusion proof.
-                // Stored values are RLP encoded, with leading zeros removed.
-                value = Lib_BytesUtils.toBytes32PadLeft(
-                    Lib_RLPReader.readBytes(encodedValue)
-                );
-            } else {
-                // Exclusion proof, can only be zero bytes.
-                value = bytes32(0);
-            }
-        }
- 
-        ovmStateManager.putContractStorage(
-            _ovmContractAddress,
-            _key,
-            value
-        );
-    }
- 
- 
-    /*******************************
-     * Public Functions: Execution *
-     *******************************/
- 
-    /**
-     * Executes the state transition.
-     * @param _transaction OVM transaction to execute.
-     */
-    function applyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        Irequire(
-            Lib_OVMCodec.hashTransaction(_transaction) == transactionHash,
-            "Invalid transaction provided."
-        );
- 
-        // We require gas to complete the logic here in run() before/after execution,
-        // But must ensure the full _tx.gasLimit can be given to the ovmCALL (determinism)
-        // This includes 1/64 of the gas getting lost because of EIP-150 (lost twice--first 
-        // going into EM, then going into the code contract).
-        require(
-            gasleft() >= 100000 + _transaction.gasLimit * 1032 / 1000, // 1032/1000 = 1.032 = (64/63)^2 rounded up
-            "Not enough gas to execute transaction deterministically."
-        );
- 
-        iOVM_ExecutionManager ovmExecutionManager = iOVM_ExecutionManager(resolve("OVM_ExecutionManager"));
- 
-        // We call `setExecutionManager` right before `run` (and not earlier) just in case the
-        // OVM_ExecutionManager address was updated between the time when this contract was created
-        // and when `applyTransaction` was called.
-        ovmStateManager.setExecutionManager(address(ovmExecutionManager));
- 
-        // `run` always succeeds *unless* the user hasn't provided enough gas to `applyTransaction`
-        // or an INVALID_STATE_ACCESS flag was triggered. Either way, we won't get beyond this line
-        // if that's the case.
-        ovmExecutionManager.run(_transaction, address(ovmStateManager));
- 
-        phase = TransitionPhase.POST_EXECUTION;
-    }
- 
- 
-    /************************************
-     * Public Functions: Post-Execution *
-     ************************************/
- 
-    /**
-     * Allows a user to commit the final state of a contract.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _stateTrieWitness Proof of the account state.
-     */
-    function commitContractState(
-        address _ovmContractAddress,
-        bytes memory _stateTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        Erequire(
-            ovmStateManager.getTotalUncommittedContractStorage() == 0,
-            "All storage must be committed before committing account states."
-        );
- 
-        require (
-            ovmStateManager.commitAccount(_ovmContractAddress) == true,
-            "Account state wasn't changed or has already been committed."
-        );
- 
-        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
- 
-        postStateRoot = Lib_SecureMerkleTrie.update(
-            abi.encodePacked(_ovmContractAddress),
-            Lib_OVMCodec.encodeEVMAccount(
-                Lib_OVMCodec.toEVMAccount(account)
-            ),
-            _stateTrieWitness,
-            postStateRoot
-        );
- 
-        // Emit an event to help clients figure out the proof ordering.
-        emit AccountCommitted(
-            _ovmContractAddress
-        );
-    }
- 
-    /**
-     * Allows a user to commit the final state of a contract storage slot.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _key Claimed account slot key.
-     * @param _storageTrieWitness Proof of the storage slot.
-     */
-    function commitStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes memory _storageTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        require(
-            ovmStateManager.commitContractStorage(_ovmContractAddress, _key) == true,
-            "Storage slot value wasn't changed or has already been committed."
-        );
- 
-        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
-        bytes32 value = ovmStateManager.getContractStorage(_ovmContractAddress, _key);
- 
-        account.storageRoot = Lib_SecureMerkleTrie.update(
-            abi.encodePacked(_key),
-            Lib_RLPWriter.writeBytes(
-                Lib_Bytes32Utils.removeLeadingZeros(value)
-            ),
-            _storageTrieWitness,
-            account.storageRoot
-        );
- 
-        ovmStateManager.putAccount(_ovmContractAddress, account);
- 
-        // Emit an event to help clients figure out the proof ordering.
-        emit ContractStorageCommitted(
-            _ovmContractAddress,
-            _key
-        );
-    }
- 
- 
-    /**********************************
-     * Public Functions: Finalization *
-     **********************************/
- 
-    /**
-     * Finalizes the transition process.
-     */
-    function completeTransition()
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-    {
-        require(
-            ovmStateManager.getTotalUncommittedAccounts() == 0,
-            "All accounts must be committed before completing a transition."
-        );
- 
-        require(
-            ovmStateManager.getTotalUncommittedContractStorage() == 0,
-            "All storage must be committed before completing a transition."
-        );
- 
-        phase = TransitionPhase.COMPLETE;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/verification/OVM_StateTransitionerFactory.sol.html b/coverage/lcov-report/OVM/verification/OVM_StateTransitionerFactory.sol.html deleted file mode 100644 index d817cc23b..000000000 --- a/coverage/lcov-report/OVM/verification/OVM_StateTransitionerFactory.sol.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - Code coverage report for OVM/verification/OVM_StateTransitionerFactory.sol - - - - - - - -
-
-

- all files / OVM/verification/ OVM_StateTransitionerFactory.sol -

-
-
- 50% - Statements - 1/2 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 2/2 -
-
- 50% - Lines - 1/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
- 
-/* Contract Imports */
-import { OVM_StateTransitioner } from "./OVM_StateTransitioner.sol";
- 
-/**
- * @title OVM_StateTransitionerFactory
- * @dev The State Transitioner Factory is used by the Fraud Verifier to create a new State 
- * Transitioner during the initialization of a fraud proof.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateTransitionerFactory is iOVM_StateTransitionerFactory, Lib_AddressResolver {
- 
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    /**
-     * Creates a new OVM_StateTransitioner
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _stateTransitionIndex Index of the state transition being verified.
-     * @param _preStateRoot State root before the transition was executed.
-     * @param _transactionHash Hash of the executed transaction.
-     * @return _ovmStateTransitioner New OVM_StateTransitioner instance.
-     */
-    function create(
-        address _libAddressManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        override
-        public
-        returns (
-            iOVM_StateTransitioner _ovmStateTransitioner
-        )
-    {
-        Irequire(
-            msg.sender == resolve("OVM_FraudVerifier"),
-            "Create can only be done by the OVM_FraudVerifier."
-        );
-        return new OVM_StateTransitioner(
-            _libAddressManager,
-            _stateTransitionIndex,
-            _preStateRoot,
-            _transactionHash
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/OVM/verification/index.html b/coverage/lcov-report/OVM/verification/index.html deleted file mode 100644 index ddf93ed3b..000000000 --- a/coverage/lcov-report/OVM/verification/index.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - Code coverage report for OVM/verification/ - - - - - - - -
-
-

- all files OVM/verification/ -

-
-
- 90.4% - Statements - 113/125 -
-
- 78.05% - Branches - 64/82 -
-
- 96.67% - Functions - 29/30 -
-
- 90.48% - Lines - 114/126 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_FraudContributor.sol
100%3/3100%0/0100%1/1100%4/4
OVM_BondManager.sol
100%42/4286.67%26/30100%9/9100%41/41
OVM_FraudVerifier.sol
96.43%27/2894.44%17/18100%7/796.43%27/28
OVM_StateTransitioner.sol
80%40/5062.5%20/3290.91%10/1180.39%41/51
OVM_StateTransitionerFactory.sol
50%1/250%1/2100%2/250%1/2
-
-
- - - - - - - diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css deleted file mode 100644 index 29737bcb0..000000000 --- a/coverage/lcov-report/base.css +++ /dev/null @@ -1,213 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.medium .chart { border:1px solid #f9cd0b; } -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } -/* light gray */ -span.cline-neutral { background: #eaeaea; } - -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/coverage/lcov-report/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html deleted file mode 100644 index 5fa3e67a7..000000000 --- a/coverage/lcov-report/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - Code coverage report for iOVM/accounts/iOVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / iOVM/accounts/ iOVM_ECDSAContractAccount.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_ECDSAContractAccount
- */
-interface iOVM_ECDSAContractAccount {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    ) external returns (bool _success, bytes memory _returndata);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/accounts/index.html b/coverage/lcov-report/iOVM/accounts/index.html deleted file mode 100644 index 62cb35f7b..000000000 --- a/coverage/lcov-report/iOVM/accounts/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for iOVM/accounts/ - - - - - - - -
-
-

- all files iOVM/accounts/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_ECDSAContractAccount.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html b/coverage/lcov-report/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html deleted file mode 100644 index 4426f72ea..000000000 --- a/coverage/lcov-report/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / iOVM/bridge/messaging/ iAbs_BaseCrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iAbs_BaseCrossDomainMessenger
- */
-interface iAbs_BaseCrossDomainMessenger {
- 
-    /**********
-     * Events *
-     **********/
-    event SentMessage(bytes message);
-    event RelayedMessage(bytes32 msgHash);
- 
-    /**********************
-     * Contract Variables *
-     **********************/
-    function xDomainMessageSender() external view returns (address);
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sends a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _message Message to send to the target.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function sendMessage(
-        address _target,
-        bytes calldata _message,
-        uint32 _gasLimit
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html b/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html deleted file mode 100644 index 7e00c950c..000000000 --- a/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / iOVM/bridge/messaging/ iOVM_L1CrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title iOVM_L1CrossDomainMessenger
- */
-interface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    struct L2MessageInclusionProof {
-        bytes32 stateRoot;
-        Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;
-        Lib_OVMCodec.ChainInclusionProof stateRootProof;
-        bytes stateTrieWitness;
-        bytes storageTrieWitness;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @param _proof Inclusion proof for the given message.
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        L2MessageInclusionProof memory _proof
-    ) external;
- 
-    /**
-     * Replays a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _sender Original sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function replayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        uint32 _gasLimit
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html b/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html deleted file mode 100644 index b32e59d35..000000000 --- a/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol - - - - - - - -
-
-

- all files / iOVM/bridge/messaging/ iOVM_L1MultiMessageRelayer.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-interface iOVM_L1MultiMessageRelayer {
- 
-    struct L2ToL1Message {
-        address target;
-        address sender;
-        bytes message;
-        uint256 messageNonce;
-        iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;
-    }
- 
-    function batchRelayMessages(L2ToL1Message[] calldata _messages) external; 
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html b/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html deleted file mode 100644 index cf02333cc..000000000 --- a/coverage/lcov-report/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / iOVM/bridge/messaging/ iOVM_L2CrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title iOVM_L2CrossDomainMessenger
- */
-interface iOVM_L2CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/bridge/messaging/index.html b/coverage/lcov-report/iOVM/bridge/messaging/index.html deleted file mode 100644 index 58a002500..000000000 --- a/coverage/lcov-report/iOVM/bridge/messaging/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for iOVM/bridge/messaging/ - - - - - - - -
-
-

- all files iOVM/bridge/messaging/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iAbs_BaseCrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MultiMessageRelayer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html b/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html deleted file mode 100644 index 84ad6f409..000000000 --- a/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - Code coverage report for iOVM/bridge/tokens/iOVM_L1ETHGateway.sol - - - - - - - -
-
-

- all files / iOVM/bridge/tokens/ iOVM_L1ETHGateway.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L1ETHGateway
- */
-interface iOVM_L1ETHGateway {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event DepositInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
- 
-    event WithdrawalFinalized(
-        address indexed _to,
-        uint256 _amount
-    );
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function deposit()
-        external
-        payable;
- 
-    function depositTo(
-        address _to
-    )
-        external
-        payable;
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external;
- 
-    function getFinalizeDepositL2Gas()
-        external
-        view
-        returns(
-            uint32
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html b/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html deleted file mode 100644 index 1a088713e..000000000 --- a/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Code coverage report for iOVM/bridge/tokens/iOVM_L1TokenGateway.sol - - - - - - - -
-
-

- all files / iOVM/bridge/tokens/ iOVM_L1TokenGateway.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L1TokenGateway
- */
-interface iOVM_L1TokenGateway {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event DepositInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
-  
-    event WithdrawalFinalized(
-        address indexed _to,
-        uint256 _amount
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function deposit(
-        uint _amount
-    )
-        external;
- 
-    function depositTo(
-        address _to,
-        uint _amount
-    )
-        external;
- 
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html b/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html deleted file mode 100644 index 8c248edb0..000000000 --- a/coverage/lcov-report/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Code coverage report for iOVM/bridge/tokens/iOVM_L2DepositedToken.sol - - - - - - - -
-
-

- all files / iOVM/bridge/tokens/ iOVM_L2DepositedToken.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L2DepositedToken
- */
-interface iOVM_L2DepositedToken {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event WithdrawalInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
- 
-    event DepositFinalized(
-        address indexed _to,
-        uint256 _amount
-    );    
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function withdraw(
-        uint _amount
-    )
-        external;
- 
-    function withdrawTo(
-        address _to,
-        uint _amount
-    )
-        external;
- 
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/bridge/tokens/index.html b/coverage/lcov-report/iOVM/bridge/tokens/index.html deleted file mode 100644 index 1ad5e98f3..000000000 --- a/coverage/lcov-report/iOVM/bridge/tokens/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for iOVM/bridge/tokens/ - - - - - - - -
-
-

- all files iOVM/bridge/tokens/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_L1ETHGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1TokenGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2DepositedToken.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html b/coverage/lcov-report/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html deleted file mode 100644 index 03738305b..000000000 --- a/coverage/lcov-report/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html +++ /dev/null @@ -1,782 +0,0 @@ - - - - Code coverage report for iOVM/chain/iOVM_CanonicalTransactionChain.sol - - - - - - - -
-
-

- all files / iOVM/chain/ iOVM_CanonicalTransactionChain.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_ChainStorageContainer } from "./iOVM_ChainStorageContainer.sol";
- 
-/**
- * @title iOVM_CanonicalTransactionChain
- */
-interface iOVM_CanonicalTransactionChain {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event TransactionEnqueued(
-        address _l1TxOrigin,
-        address _target,
-        uint256 _gasLimit,
-        bytes _data,
-        uint256 _queueIndex,
-        uint256 _timestamp
-    );
- 
-    event QueueBatchAppended(
-        uint256 _startingQueueIndex,
-        uint256 _numQueueElements,
-        uint256 _totalElements
-    );
- 
-    event SequencerBatchAppended(
-        uint256 _startingQueueIndex,
-        uint256 _numQueueElements,
-        uint256 _totalElements
-    );
- 
-    event TransactionBatchAppended(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot,
-        uint256 _batchSize,
-        uint256 _prevTotalElements,
-        bytes _extraData
-    );
- 
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct BatchContext {
-        uint256 numSequencedTransactions;
-        uint256 numSubsequentQueueTransactions;
-        uint256 timestamp;
-        uint256 blockNumber;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        external
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        );
- 
-    /**
-     * Accesses the queue storage container.
-     * @return Reference to the queue storage container.
-     */
-    function queue()
-        external
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        );
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        external
-        view
-        returns (
-            uint256 _totalElements
-        );
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        external
-        view
-        returns (
-            uint256 _totalBatches
-        );
- 
-    /**
-     * Returns the index of the next element to be enqueued.
-     * @return Index for the next queue element.
-     */
-    function getNextQueueIndex()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function getQueueElement(
-        uint256 _index
-    )
-        external
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        );
- 
-    /**
-     * Returns the timestamp of the last transaction.
-     * @return Timestamp for the last transaction.
-     */
-    function getLastTimestamp()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Returns the blocknumber of the last transaction.
-     * @return Blocknumber for the last transaction.
-     */
-    function getLastBlockNumber()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Get the number of queue elements which have not yet been included.
-     * @return Number of pending queue elements.
-     */
-    function getNumPendingQueueElements()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Retrieves the length of the queue, including
-     * both pending and canonical transactions.
-     * @return Length of the queue.
-     */
-    function getQueueLength()
-        external
-        view
-        returns (
-            uint40
-        );
- 
- 
-    /**
-     * Adds a transaction to the queue.
-     * @param _target Target contract to send the transaction to.
-     * @param _gasLimit Gas limit for the given transaction.
-     * @param _data Transaction data.
-     */
-    function enqueue(
-        address _target,
-        uint256 _gasLimit,
-        bytes memory _data
-    )
-        external;
- 
-    /**
-     * Appends a given number of queued transactions as a single batch.
-     * @param _numQueuedTransactions Number of transactions to append.
-     */
-    function appendQueueBatch(
-        uint256 _numQueuedTransactions
-    )
-        external;
- 
-    /**
-     * Allows the sequencer to append a batch of transactions.
-     * @dev This function uses a custom encoding scheme for efficiency reasons.
-     * .param _shouldStartAtElement Specific batch we expect to start appending to.
-     * .param _totalElementsToAppend Total number of batch elements we expect to append.
-     * .param _contexts Array of batch contexts.
-     * .param _transactionDataFields Array of raw transaction data.
-     */
-    function appendSequencerBatch(
-        // uint40 _shouldStartAtElement,
-        // uint24 _totalElementsToAppend,
-        // BatchContext[] _contexts,
-        // bytes[] _transactionDataFields
-    )
-        external;
- 
-    /**
-     * Verifies whether a transaction is included in the chain.
-     * @param _transaction Transaction to verify.
-     * @param _txChainElement Transaction chain element corresponding to the transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
-     * @return True if the transaction exists in the CTC, false if not.
-     */
-    function verifyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        external
-        view
-        returns (
-            bool
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/chain/iOVM_ChainStorageContainer.sol.html b/coverage/lcov-report/iOVM/chain/iOVM_ChainStorageContainer.sol.html deleted file mode 100644 index 382c309c4..000000000 --- a/coverage/lcov-report/iOVM/chain/iOVM_ChainStorageContainer.sol.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - Code coverage report for iOVM/chain/iOVM_ChainStorageContainer.sol - - - - - - - -
-
-

- all files / iOVM/chain/ iOVM_ChainStorageContainer.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_ChainStorageContainer
- */
-interface iOVM_ChainStorageContainer {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sets the container's global metadata field. We're using `bytes27` here because we use five
-     * bytes to maintain the length of the underlying data structure, meaning we have an extra
-     * 27 bytes to store arbitrary data.
-     * @param _globalMetadata New global metadata to set.
-     */
-    function setGlobalMetadata(
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Retrieves the container's global metadata field.
-     * @return Container global metadata field.
-     */
-    function getGlobalMetadata()
-        external
-        view
-        returns (
-            bytes27
-        );
- 
-    /**
-     * Retrieves the number of objects stored in the container.
-     * @return Number of objects in the container.
-     */
-    function length()
-        external
-        view
-        returns (
-            uint256
-        );
- 
-    /**
-     * Pushes an object into the container.
-     * @param _object A 32 byte value to insert into the container.
-     */
-    function push(
-        bytes32 _object
-    )
-        external;
- 
-    /**
-     * Pushes an object into the container. Function allows setting the global metadata since
-     * we'll need to touch the "length" storage slot anyway, which also contains the global
-     * metadata (it's an optimization).
-     * @param _object A 32 byte value to insert into the container.
-     * @param _globalMetadata New global metadata for the container.
-     */
-    function push(
-        bytes32 _object,
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Retrieves an object from the container.
-     * @param _index Index of the particular object to access.
-     * @return 32 byte object value.
-     */
-    function get(
-        uint256 _index
-    )
-        external
-        view
-        returns (
-            bytes32
-        );
- 
-    /**
-     * Removes all objects after and including a given index.
-     * @param _index Object index to delete from.
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index
-    )
-        external;
- 
-    /**
-     * Removes all objects after and including a given index. Also allows setting the global
-     * metadata field.
-     * @param _index Object index to delete from.
-     * @param _globalMetadata New global metadata for the container.
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index,
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Marks an index as overwritable, meaing the underlying buffer can start to write values over
-     * any objects before and including the given index.
-     */
-    function setNextOverwritableIndex(
-        uint256 _index
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/chain/iOVM_StateCommitmentChain.sol.html b/coverage/lcov-report/iOVM/chain/iOVM_StateCommitmentChain.sol.html deleted file mode 100644 index 713fcd358..000000000 --- a/coverage/lcov-report/iOVM/chain/iOVM_StateCommitmentChain.sol.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - Code coverage report for iOVM/chain/iOVM_StateCommitmentChain.sol - - - - - - - -
-
-

- all files / iOVM/chain/ iOVM_StateCommitmentChain.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateCommitmentChain
- */
-interface iOVM_StateCommitmentChain {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event StateBatchAppended(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot,
-        uint256 _batchSize,
-        uint256 _prevTotalElements,
-        bytes _extraData
-    );
- 
-    event StateBatchDeleted(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        external
-        view
-        returns (
-            uint256 _totalElements
-        );
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        external
-        view
-        returns (
-            uint256 _totalBatches
-        );
- 
-    /**
-     * Retrieves the timestamp of the last batch submitted by the sequencer.
-     * @return _lastSequencerTimestamp Last sequencer batch timestamp.
-     */
-    function getLastSequencerTimestamp()
-        external
-        view
-        returns (
-            uint256 _lastSequencerTimestamp
-        );
- 
-    /**
-     * Appends a batch of state roots to the chain.
-     * @param _batch Batch of state roots.
-     * @param _shouldStartAtElement Index of the element at which this batch should start.
-     */
-    function appendStateBatch(
-        bytes32[] calldata _batch,
-        uint256 _shouldStartAtElement
-    )
-        external;
- 
-    /**
-     * Deletes all state roots after (and including) a given batch.
-     * @param _batchHeader Header of the batch to start deleting from.
-     */
-    function deleteStateBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        external;
- 
-    /**
-     * Verifies a batch inclusion proof.
-     * @param _element Hash of the element to verify a proof for.
-     * @param _batchHeader Header of the batch in which the element was included.
-     * @param _proof Merkle inclusion proof for the element.
-     */
-    function verifyStateCommitment(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        external
-        view
-        returns (
-            bool _verified
-        );
- 
-    /**
-     * Checks whether a given batch is still inside its fraud proof window.
-     * @param _batchHeader Header of the batch to check.
-     * @return _inside Whether or not the batch is inside the fraud proof window.
-     */
-    function insideFraudProofWindow(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        external
-        view
-        returns (
-            bool _inside
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/chain/index.html b/coverage/lcov-report/iOVM/chain/index.html deleted file mode 100644 index bba16e950..000000000 --- a/coverage/lcov-report/iOVM/chain/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for iOVM/chain/ - - - - - - - -
-
-

- all files iOVM/chain/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_CanonicalTransactionChain.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ChainStorageContainer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateCommitmentChain.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/execution/iOVM_ExecutionManager.sol.html b/coverage/lcov-report/iOVM/execution/iOVM_ExecutionManager.sol.html deleted file mode 100644 index 18c089ea7..000000000 --- a/coverage/lcov-report/iOVM/execution/iOVM_ExecutionManager.sol.html +++ /dev/null @@ -1,533 +0,0 @@ - - - - Code coverage report for iOVM/execution/iOVM_ExecutionManager.sol - - - - - - - -
-
-

- all files / iOVM/execution/ iOVM_ExecutionManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-interface iOVM_ExecutionManager {
-    /**********
-     * Enums *
-     *********/
- 
-    enum RevertFlag {
-        OUT_OF_GAS,
-        INTENTIONAL_REVERT,
-        EXCEEDS_NUISANCE_GAS,
-        INVALID_STATE_ACCESS,
-        UNSAFE_BYTECODE,
-        CREATE_COLLISION,
-        STATIC_VIOLATION,
-        CREATOR_NOT_ALLOWED
-    }
- 
-    enum GasMetadataKey {
-        CURRENT_EPOCH_START_TIMESTAMP,
-        CUMULATIVE_SEQUENCER_QUEUE_GAS,
-        CUMULATIVE_L1TOL2_QUEUE_GAS,
-        PREV_EPOCH_SEQUENCER_QUEUE_GAS,
-        PREV_EPOCH_L1TOL2_QUEUE_GAS
-    }
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct GasMeterConfig {
-        uint256 minTransactionGasLimit;
-        uint256 maxTransactionGasLimit;
-        uint256 maxGasPerQueuePerEpoch;
-        uint256 secondsPerEpoch;
-    }
- 
-    struct GlobalContext {
-        uint256 ovmCHAINID;
-    }
- 
-    struct TransactionContext {
-        Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;
-        uint256 ovmTIMESTAMP;
-        uint256 ovmNUMBER;
-        uint256 ovmGASLIMIT;
-        uint256 ovmTXGASLIMIT;
-        address ovmL1TXORIGIN;
-    }
- 
-    struct TransactionRecord {
-        uint256 ovmGasRefund;
-    }
- 
-    struct MessageContext {
-        address ovmCALLER;
-        address ovmADDRESS;
-        bool isStatic;
-    }
- 
-    struct MessageRecord {
-        uint256 nuisanceGasLeft;
-    }
- 
- 
-    /************************************
-     * Transaction Execution Entrypoint *
-     ************************************/
- 
-    function run(
-        Lib_OVMCodec.Transaction calldata _transaction,
-        address _txStateManager
-    ) external;
- 
- 
-    /*******************
-     * Context Opcodes *
-     *******************/
- 
-    function ovmCALLER() external view returns (address _caller);
-    function ovmADDRESS() external view returns (address _address);
-    function ovmTIMESTAMP() external view returns (uint256 _timestamp);
-    function ovmNUMBER() external view returns (uint256 _number);
-    function ovmGASLIMIT() external view returns (uint256 _gasLimit);
-    function ovmCHAINID() external view returns (uint256 _chainId);
- 
- 
-    /**********************
-     * L2 Context Opcodes *
-     **********************/
- 
-    function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
-    function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
- 
- 
-    /*******************
-     * Halting Opcodes *
-     *******************/
- 
-    function ovmREVERT(bytes memory _data) external;
- 
- 
-    /*****************************
-     * Contract Creation Opcodes *
-     *****************************/
- 
-    function ovmCREATE(bytes memory _bytecode) external returns (address _contract, bytes memory _revertdata);
-    function ovmCREATE2(bytes memory _bytecode, bytes32 _salt) external returns (address _contract, bytes memory _revertdata);
- 
- 
-    /*******************************
-     * Account Abstraction Opcodes *
-     ******************************/
- 
-    function ovmGETNONCE() external returns (uint256 _nonce);
-    function ovmSETNONCE(uint256 _nonce) external;
-    function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
- 
- 
-    /****************************
-     * Contract Calling Opcodes *
-     ****************************/
- 
-    function ovmCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
-    function ovmSTATICCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
-    function ovmDELEGATECALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
- 
- 
-    /****************************
-     * Contract Storage Opcodes *
-     ****************************/
- 
-    function ovmSLOAD(bytes32 _key) external returns (bytes32 _value);
-    function ovmSSTORE(bytes32 _key, bytes32 _value) external;
- 
- 
-    /*************************
-     * Contract Code Opcodes *
-     *************************/
- 
-    function ovmEXTCODECOPY(address _contract, uint256 _offset, uint256 _length) external returns (bytes memory _code);
-    function ovmEXTCODESIZE(address _contract) external returns (uint256 _size);
-    function ovmEXTCODEHASH(address _contract) external returns (bytes32 _hash);
- 
- 
-    /***************************************
-     * Public Functions: Execution Context *
-     ***************************************/
- 
-    function getMaxTransactionGasLimit() external view returns (uint _maxTransactionGasLimit);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/execution/iOVM_SafetyChecker.sol.html b/coverage/lcov-report/iOVM/execution/iOVM_SafetyChecker.sol.html deleted file mode 100644 index 32921e244..000000000 --- a/coverage/lcov-report/iOVM/execution/iOVM_SafetyChecker.sol.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Code coverage report for iOVM/execution/iOVM_SafetyChecker.sol - - - - - - - -
-
-

- all files / iOVM/execution/ iOVM_SafetyChecker.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_SafetyChecker
- */
-interface iOVM_SafetyChecker {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/execution/iOVM_StateManager.sol.html b/coverage/lcov-report/iOVM/execution/iOVM_StateManager.sol.html deleted file mode 100644 index 10e5b015f..000000000 --- a/coverage/lcov-report/iOVM/execution/iOVM_StateManager.sol.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - Code coverage report for iOVM/execution/iOVM_StateManager.sol - - - - - - - -
-
-

- all files / iOVM/execution/ iOVM_StateManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateManager
- */
-interface iOVM_StateManager {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum ItemState {
-        ITEM_UNTOUCHED,
-        ITEM_LOADED,
-        ITEM_CHANGED,
-        ITEM_COMMITTED
-    }
- 
-    /***************************
-     * Public Functions: Misc *
-     ***************************/
- 
-    function isAuthenticated(address _address) external view returns (bool);
- 
-    /***************************
-     * Public Functions: Setup *
-     ***************************/
- 
-    function owner() external view returns (address _owner);
-    function ovmExecutionManager() external view returns (address _ovmExecutionManager);
-    function setExecutionManager(address _ovmExecutionManager) external;
- 
- 
-    /************************************
-     * Public Functions: Account Access *
-     ************************************/
- 
-    function putAccount(address _address, Lib_OVMCodec.Account memory _account) external;
-    function putEmptyAccount(address _address) external;
-    function getAccount(address _address) external view returns (Lib_OVMCodec.Account memory _account);
-    function hasAccount(address _address) external view returns (bool _exists);
-    function hasEmptyAccount(address _address) external view returns (bool _exists);
-    function setAccountNonce(address _address, uint256 _nonce) external;
-    function getAccountNonce(address _address) external view returns (uint256 _nonce);
-    function getAccountEthAddress(address _address) external view returns (address _ethAddress);
-    function getAccountStorageRoot(address _address) external view returns (bytes32 _storageRoot);
-    function initPendingAccount(address _address) external;
-    function commitPendingAccount(address _address, address _ethAddress, bytes32 _codeHash) external;
-    function testAndSetAccountLoaded(address _address) external returns (bool _wasAccountAlreadyLoaded);
-    function testAndSetAccountChanged(address _address) external returns (bool _wasAccountAlreadyChanged);
-    function commitAccount(address _address) external returns (bool _wasAccountCommitted);
-    function incrementTotalUncommittedAccounts() external;
-    function getTotalUncommittedAccounts() external view returns (uint256 _total);
-    function wasAccountChanged(address _address) external view returns (bool);
-    function wasAccountCommitted(address _address) external view returns (bool);
- 
- 
-    /************************************
-     * Public Functions: Storage Access *
-     ************************************/
- 
-    function putContractStorage(address _contract, bytes32 _key, bytes32 _value) external;
-    function getContractStorage(address _contract, bytes32 _key) external view returns (bytes32 _value);
-    function hasContractStorage(address _contract, bytes32 _key) external view returns (bool _exists);
-    function testAndSetContractStorageLoaded(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyLoaded);
-    function testAndSetContractStorageChanged(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyChanged);
-    function commitContractStorage(address _contract, bytes32 _key) external returns (bool _wasContractStorageCommitted);
-    function incrementTotalUncommittedContractStorage() external;
-    function getTotalUncommittedContractStorage() external view returns (uint256 _total);
-    function wasContractStorageChanged(address _contract, bytes32 _key) external view returns (bool);
-    function wasContractStorageCommitted(address _contract, bytes32 _key) external view returns (bool);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/execution/iOVM_StateManagerFactory.sol.html b/coverage/lcov-report/iOVM/execution/iOVM_StateManagerFactory.sol.html deleted file mode 100644 index ccc0b1d51..000000000 --- a/coverage/lcov-report/iOVM/execution/iOVM_StateManagerFactory.sol.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - Code coverage report for iOVM/execution/iOVM_StateManagerFactory.sol - - - - - - - -
-
-

- all files / iOVM/execution/ iOVM_StateManagerFactory.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { iOVM_StateManager } from "./iOVM_StateManager.sol";
- 
-/**
- * @title iOVM_StateManagerFactory
- */
-interface iOVM_StateManagerFactory {
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    function create(
-        address _owner
-    )
-        external
-        returns (
-            iOVM_StateManager _ovmStateManager
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/execution/index.html b/coverage/lcov-report/iOVM/execution/index.html deleted file mode 100644 index 920d0dec2..000000000 --- a/coverage/lcov-report/iOVM/execution/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for iOVM/execution/ - - - - - - - -
-
-

- all files iOVM/execution/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_ExecutionManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_SafetyChecker.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManagerFactory.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html b/coverage/lcov-report/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html deleted file mode 100644 index 32c1ad98b..000000000 --- a/coverage/lcov-report/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/iOVM_DeployerWhitelist.sol - - - - - - - -
-
-

- all files / iOVM/predeploys/ iOVM_DeployerWhitelist.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_DeployerWhitelist
- */
-interface iOVM_DeployerWhitelist {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function initialize(address _owner, bool _allowArbitraryDeployment) external;
-    function getOwner() external returns (address _owner);
-    function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;
-    function setOwner(address _newOwner) external;
-    function setAllowArbitraryDeployment(bool _allowArbitraryDeployment) external;
-    function enableArbitraryContractDeployment() external;
-    function isDeployerAllowed(address _deployer) external returns (bool _allowed);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/predeploys/iOVM_ERC20.sol.html b/coverage/lcov-report/iOVM/predeploys/iOVM_ERC20.sol.html deleted file mode 100644 index b9619f473..000000000 --- a/coverage/lcov-report/iOVM/predeploys/iOVM_ERC20.sol.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/iOVM_ERC20.sol - - - - - - - -
-
-

- all files / iOVM/predeploys/ iOVM_ERC20.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_ERC20
- */
-interface iOVM_ERC20 {
-    /* This is a slight change to the ERC20 base standard.
-    function totalSupply() constant returns (uint256 supply);
-    is replaced with:
-    uint256 public totalSupply;
-    This automatically creates a getter function for the totalSupply.
-    This is moved to the base contract since public getter functions are not
-    currently recognised as an implementation of the matching abstract
-    function by the compiler.
-    */
-    /// total amount of tokens
-    function totalSupply() external view returns (uint256);
- 
-    /// @param _owner The address from which the balance will be retrieved
-    /// @return balance The balance
-    function balanceOf(address _owner) external view returns (uint256 balance);
- 
-    /// @notice send `_value` token to `_to` from `msg.sender`
-    /// @param _to The address of the recipient
-    /// @param _value The amount of token to be transferred
-    /// @return success Whether the transfer was successful or not
-    function transfer(address _to, uint256 _value) external returns (bool success);
- 
-    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
-    /// @param _from The address of the sender
-    /// @param _to The address of the recipient
-    /// @param _value The amount of token to be transferred
-    /// @return success Whether the transfer was successful or not
-    function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
- 
-    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
-    /// @param _spender The address of the account able to transfer the tokens
-    /// @param _value The amount of tokens to be approved for transfer
-    /// @return success Whether the approval was successful or not
-    function approve(address _spender, uint256 _value) external returns (bool success);
- 
-    /// @param _owner The address of the account owning tokens
-    /// @param _spender The address of the account able to transfer the tokens
-    /// @return remaining Amount of remaining tokens allowed to spent
-    function allowance(address _owner, address _spender) external view returns (uint256 remaining);
- 
-    // solhint-disable-next-line no-simple-event-func-name
-    event Transfer(address indexed _from, address indexed _to, uint256 _value);
-    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
-    event Mint(address indexed _account, uint256 _amount);
-    event Burn(address indexed _account, uint256 _amount);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/predeploys/iOVM_L1MessageSender.sol.html b/coverage/lcov-report/iOVM/predeploys/iOVM_L1MessageSender.sol.html deleted file mode 100644 index 1fb36e2dd..000000000 --- a/coverage/lcov-report/iOVM/predeploys/iOVM_L1MessageSender.sol.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/iOVM_L1MessageSender.sol - - - - - - - -
-
-

- all files / iOVM/predeploys/ iOVM_L1MessageSender.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_L1MessageSender
- */
-interface iOVM_L1MessageSender {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function getL1MessageSender() external view returns (address _l1MessageSender);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html b/coverage/lcov-report/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html deleted file mode 100644 index d43cbd99b..000000000 --- a/coverage/lcov-report/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol - - - - - - - -
-
-

- all files / iOVM/predeploys/ iOVM_L2ToL1MessagePasser.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_L2ToL1MessagePasser
- */
-interface iOVM_L2ToL1MessagePasser {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event L2ToL1Message(
-        uint256 _nonce,
-        address _sender,
-        bytes _data
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function passMessageToL1(bytes calldata _message) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/predeploys/index.html b/coverage/lcov-report/iOVM/predeploys/index.html deleted file mode 100644 index d766508c8..000000000 --- a/coverage/lcov-report/iOVM/predeploys/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for iOVM/predeploys/ - - - - - - - -
-
-

- all files iOVM/predeploys/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_DeployerWhitelist.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ERC20.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MessageSender.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2ToL1MessagePasser.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/verification/iOVM_BondManager.sol.html b/coverage/lcov-report/iOVM/verification/iOVM_BondManager.sol.html deleted file mode 100644 index 8d7748deb..000000000 --- a/coverage/lcov-report/iOVM/verification/iOVM_BondManager.sol.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - Code coverage report for iOVM/verification/iOVM_BondManager.sol - - - - - - - -
-
-

- all files / iOVM/verification/ iOVM_BondManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-interface ERC20 {
-    function transfer(address, uint256) external returns (bool);
-    function transferFrom(address, address, uint256) external returns (bool);
-}
- 
-/// All the errors which may be encountered on the bond manager
-library Errors {
-    string constant ERC20_ERR = "BondManager: Could not post bond";
-    string constant ALREADY_FINALIZED = "BondManager: Fraud proof for this pre-state root has already been finalized";
-    string constant SLASHED = "BondManager: Cannot finalize withdrawal, you probably got slashed";
-    string constant WRONG_STATE = "BondManager: Wrong bond state for proposer";
-    string constant CANNOT_CLAIM = "BondManager: Cannot claim yet. Dispute must be finalized first";
- 
-    string constant WITHDRAWAL_PENDING = "BondManager: Withdrawal already pending";
-    string constant TOO_EARLY = "BondManager: Too early to finalize your withdrawal";
- 
-    string constant ONLY_TRANSITIONER = "BondManager: Only the transitioner for this pre-state root may call this function";
-    string constant ONLY_FRAUD_VERIFIER = "BondManager: Only the fraud verifier may call this function";
-    string constant ONLY_STATE_COMMITMENT_CHAIN = "BondManager: Only the state commitment chain may call this function";
-    string constant WAIT_FOR_DISPUTES = "BondManager: Wait for other potential disputes";
-}
- 
-/**
- * @title iOVM_BondManager
- */
-interface iOVM_BondManager {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    /// The lifecycle of a proposer's bond
-    enum State {
-        // Before depositing or after getting slashed, a user is uncollateralized
-        NOT_COLLATERALIZED,
-        // After depositing, a user is collateralized
-        COLLATERALIZED,
-        // After a user has initiated a withdrawal
-        WITHDRAWING
-    }
- 
-    /// A bond posted by a proposer
-    struct Bond {
-        // The user's state
-        State state;
-        // The timestamp at which a proposer issued their withdrawal request
-        uint32 withdrawalTimestamp;
-        // The time when the first disputed was initiated for this bond
-        uint256 firstDisputeAt;
-        // The earliest observed state root for this bond which has had fraud
-        bytes32 earliestDisputedStateRoot;
-        // The state root's timestamp
-        uint256 earliestTimestamp;
-    }
- 
-    // Per pre-state root, store the number of state provisions that were made
-    // and how many of these calls were made by each user. Payouts will then be
-    // claimed by users proportionally for that dispute.
-    struct Rewards {
-        // Flag to check if rewards for a fraud proof are claimable
-        bool canClaim;
-        // Total number of `recordGasSpent` calls made
-        uint256 total;
-        // The gas spent by each user to provide witness data. The sum of all
-        // values inside this map MUST be equal to the value of `total`
-        mapping(address => uint256) gasSpent;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function recordGasSpent(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        address _who,
-        uint256 _gasSpent
-    ) external;
- 
-    function finalize(
-        bytes32 _preStateRoot,
-        address _publisher,
-        uint256 _timestamp
-    ) external;
- 
-    function deposit() external;
- 
-    function startWithdrawal() external;
- 
-    function finalizeWithdrawal() external;
- 
-    function claim(
-        address _who
-    ) external;
- 
-    function isCollateralized(
-        address _who
-    ) external view returns (bool);
- 
-    function getGasSpent(
-        bytes32 _preStateRoot,
-        address _who
-    ) external view returns (uint256);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/verification/iOVM_FraudVerifier.sol.html b/coverage/lcov-report/iOVM/verification/iOVM_FraudVerifier.sol.html deleted file mode 100644 index a3b2ed104..000000000 --- a/coverage/lcov-report/iOVM/verification/iOVM_FraudVerifier.sol.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - Code coverage report for iOVM/verification/iOVM_FraudVerifier.sol - - - - - - - -
-
-

- all files / iOVM/verification/ iOVM_FraudVerifier.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
- 
-/**
- * @title iOVM_FraudVerifier
- */
-interface iOVM_FraudVerifier {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event FraudProofInitialized(
-        bytes32 _preStateRoot,
-        uint256 _preStateRootIndex,
-        bytes32 _transactionHash,
-        address _who
-    );
- 
-    event FraudProofFinalized(
-        bytes32 _preStateRoot,
-        uint256 _preStateRootIndex,
-        bytes32 _transactionHash,
-        address _who
-    );
- 
- 
-    /***************************************
-     * Public Functions: Transition Status *
-     ***************************************/
- 
-    function getStateTransitioner(bytes32 _preStateRoot, bytes32 _txHash) external view returns (iOVM_StateTransitioner _transitioner);
- 
- 
-    /****************************************
-     * Public Functions: Fraud Verification *
-     ****************************************/
- 
-    function initializeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
-        Lib_OVMCodec.Transaction calldata _transaction,
-        Lib_OVMCodec.TransactionChainElement calldata _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader calldata _transactionBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _transactionProof
-    ) external;
- 
-    function finalizeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
-        bytes32 _txHash,
-        bytes32 _postStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _postStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _postStateRootProof
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/verification/iOVM_StateTransitioner.sol.html b/coverage/lcov-report/iOVM/verification/iOVM_StateTransitioner.sol.html deleted file mode 100644 index 3a0d781b4..000000000 --- a/coverage/lcov-report/iOVM/verification/iOVM_StateTransitioner.sol.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - Code coverage report for iOVM/verification/iOVM_StateTransitioner.sol - - - - - - - -
-
-

- all files / iOVM/verification/ iOVM_StateTransitioner.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateTransitioner
- */
-interface iOVM_StateTransitioner {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event AccountCommitted(
-        address _address
-    );
- 
-    event ContractStorageCommitted(
-        address _address,
-        bytes32 _key
-    );
- 
- 
-    /**********************************
-     * Public Functions: State Access *
-     **********************************/
- 
-    function getPreStateRoot() external view returns (bytes32 _preStateRoot);
-    function getPostStateRoot() external view returns (bytes32 _postStateRoot);
-    function isComplete() external view returns (bool _complete);
- 
- 
-    /***********************************
-     * Public Functions: Pre-Execution *
-     ***********************************/
- 
-    function proveContractState(
-        address _ovmContractAddress,
-        address _ethContractAddress,
-        bytes calldata _stateTrieWitness
-    ) external;
- 
-    function proveStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes calldata _storageTrieWitness
-    ) external;
- 
- 
-    /*******************************
-     * Public Functions: Execution *
-     *******************************/
- 
-    function applyTransaction(
-        Lib_OVMCodec.Transaction calldata _transaction
-    ) external;
- 
- 
-    /************************************
-     * Public Functions: Post-Execution *
-     ************************************/
- 
-    function commitContractState(
-        address _ovmContractAddress,
-        bytes calldata _stateTrieWitness
-    ) external;
- 
-    function commitStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes calldata _storageTrieWitness
-    ) external;
- 
- 
-    /**********************************
-     * Public Functions: Finalization *
-     **********************************/
- 
-    function completeTransition() external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/verification/iOVM_StateTransitionerFactory.sol.html b/coverage/lcov-report/iOVM/verification/iOVM_StateTransitionerFactory.sol.html deleted file mode 100644 index a4498df98..000000000 --- a/coverage/lcov-report/iOVM/verification/iOVM_StateTransitionerFactory.sol.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - Code coverage report for iOVM/verification/iOVM_StateTransitionerFactory.sol - - - - - - - -
-
-

- all files / iOVM/verification/ iOVM_StateTransitionerFactory.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
- 
-/**
- * @title iOVM_StateTransitionerFactory
- */
-interface iOVM_StateTransitionerFactory {
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    function create(
-        address _proxyManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        external
-        returns (
-            iOVM_StateTransitioner _ovmStateTransitioner
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/iOVM/verification/index.html b/coverage/lcov-report/iOVM/verification/index.html deleted file mode 100644 index bc1507a4f..000000000 --- a/coverage/lcov-report/iOVM/verification/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for iOVM/verification/ - - - - - - - -
-
-

- all files iOVM/verification/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_BondManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_FraudVerifier.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitioner.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitionerFactory.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html deleted file mode 100644 index ea6ba8e13..000000000 --- a/coverage/lcov-report/index.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - Code coverage report for All files - - - - - - - -
-
-

- / -

-
-
- 82.21% - Statements - 1248/1518 -
-
- 67.99% - Branches - 393/578 -
-
- 82.88% - Functions - 363/438 -
-
- 82.63% - Lines - 1313/1589 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM/accounts/
91.67%22/2466.67%4/6100%6/692%23/25
OVM/bridge/messaging/
96.55%56/5876.92%20/2695.24%20/2196.67%58/60
OVM/bridge/tokens/
90.7%39/4350%3/686.67%26/3088.89%40/45
OVM/chain/
92.82%194/20981.37%83/10282.46%47/5793.36%211/226
OVM/execution/
76.05%235/30967.02%63/9481.63%80/9876.73%244/318
OVM/predeploys/
41.76%38/9129.41%10/3440%12/3040.22%37/92
OVM/verification/
90.4%113/12578.05%64/8296.67%29/3090.48%114/126
iOVM/accounts/
100%0/0100%0/0100%0/0100%0/0
iOVM/bridge/messaging/
100%0/0100%0/0100%0/0100%0/0
iOVM/bridge/tokens/
100%0/0100%0/0100%0/0100%0/0
iOVM/chain/
100%0/0100%0/0100%0/0100%0/0
iOVM/execution/
100%0/0100%0/0100%0/0100%0/0
iOVM/predeploys/
100%0/0100%0/0100%0/0100%0/0
iOVM/verification/
100%0/0100%0/0100%0/0100%0/0
libraries/bridge/
100%5/5100%4/4100%4/4100%6/6
libraries/codec/
100%33/33100%6/6100%9/9100%33/33
libraries/resolver/
75%15/2050%4/881.82%9/1178.26%18/23
libraries/rlp/
96.95%127/13172.92%35/4893.1%27/2997.22%140/144
libraries/standards/
80.65%25/3125%3/1283.33%10/1281.25%26/32
libraries/trie/
71.98%149/20755.88%38/6881.25%26/3271.57%146/204
libraries/utils/
89.07%163/18367.57%50/7491.11%41/4589.27%183/205
libraries/wrappers/
69.39%34/4975%6/870.83%17/2468%34/50
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/bridge/OVM_CrossDomainEnabled.sol.html b/coverage/lcov-report/libraries/bridge/OVM_CrossDomainEnabled.sol.html deleted file mode 100644 index c4c3bfaff..000000000 --- a/coverage/lcov-report/libraries/bridge/OVM_CrossDomainEnabled.sol.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - Code coverage report for libraries/bridge/OVM_CrossDomainEnabled.sol - - - - - - - -
-
-

- all files / libraries/bridge/ OVM_CrossDomainEnabled.sol -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 4/4 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 6/6 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -78× -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_CrossDomainEnabled
- * @dev Helper contract for contracts performing cross-domain communications
- *
- * Compiler used: defined by inheriting contract
- * Runtime target: defined by inheriting contract
- */
-contract OVM_CrossDomainEnabled {
-    // Messenger contract used to send and recieve messages from the other domain.
-    address public messenger;
- 
-    /***************
-     * Constructor *
-     ***************/    
-    constructor(
-        address _messenger
-    ) {
-        messenger = _messenger;
-    }
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * @notice Enforces that the modified function is only callable by a specific cross-domain account.
-     * @param _sourceDomainAccount The only account on the originating domain which is authenticated to call this function.
-     */
-    modifier onlyFromCrossDomainAccount(
-        address _sourceDomainAccount
-    ) {
-        require(
-            msg.sender == address(getCrossDomainMessenger()),
-            "OVM_XCHAIN: messenger contract unauthenticated"
-        );
- 
-        require(
-            getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,
-            "OVM_XCHAIN: wrong sender of cross-domain message"
-        );
- 
-        _;
-    }
-    
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Gets the messenger, usually from storage.  This function is exposed in case a child contract needs to override.
-     * @return The address of the cross-domain messenger contract which should be used. 
-     */
-    function getCrossDomainMessenger()
-        internal
-        virtual
-        returns(
-            iAbs_BaseCrossDomainMessenger
-        )
-    {
-        return iAbs_BaseCrossDomainMessenger(messenger);
-    }
- 
-    /**
-     * @notice Sends a message to an account on another domain
-     * @param _crossDomainTarget The intended recipient on the destination domain
-     * @param _data The data to send to the target (usually calldata to a function with `onlyFromCrossDomainAccount()`)
-     * @param _gasLimit The gasLimit for the receipt of the message on the target domain.
-     */
-    function sendCrossDomainMessage(
-        address _crossDomainTarget,
-        bytes memory _data,
-        uint32 _gasLimit
-    ) internal {
-        getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/bridge/index.html b/coverage/lcov-report/libraries/bridge/index.html deleted file mode 100644 index 0b17ee495..000000000 --- a/coverage/lcov-report/libraries/bridge/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for libraries/bridge/ - - - - - - - -
-
-

- all files libraries/bridge/ -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 4/4 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 6/6 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_CrossDomainEnabled.sol
100%5/5100%4/4100%4/4100%6/6
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/codec/Lib_OVMCodec.sol.html b/coverage/lcov-report/libraries/codec/Lib_OVMCodec.sol.html deleted file mode 100644 index 925baaa05..000000000 --- a/coverage/lcov-report/libraries/codec/Lib_OVMCodec.sol.html +++ /dev/null @@ -1,1178 +0,0 @@ - - - - Code coverage report for libraries/codec/Lib_OVMCodec.sol - - - - - - - -
-
-

- all files / libraries/codec/ Lib_OVMCodec.sol -

-
-
- 100% - Statements - 33/33 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 33/33 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  - -  - - - - - -  - -  - - - - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -107× -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
-import { Lib_Bytes32Utils } from "../utils/Lib_Bytes32Utils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title Lib_OVMCodec
- */
-library Lib_OVMCodec {
- 
-    /*********
-     * Enums *
-     *********/
- 
-    enum EOASignatureType {
-        EIP155_TRANSACTON,
-        ETH_SIGNED_MESSAGE
-    }
- 
-    enum QueueOrigin {
-        SEQUENCER_QUEUE,
-        L1TOL2_QUEUE
-    }
- 
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct Account {
-        uint256 nonce;
-        uint256 balance;
-        bytes32 storageRoot;
-        bytes32 codeHash;
-        address ethAddress;
-        bool isFresh;
-    }
- 
-    struct EVMAccount {
-        uint256 nonce;
-        uint256 balance;
-        bytes32 storageRoot;
-        bytes32 codeHash;
-    }
- 
-    struct ChainBatchHeader {
-        uint256 batchIndex;
-        bytes32 batchRoot;
-        uint256 batchSize;
-        uint256 prevTotalElements;
-        bytes extraData;
-    }
- 
-    struct ChainInclusionProof {
-        uint256 index;
-        bytes32[] siblings;
-    }
- 
-    struct Transaction {
-        uint256 timestamp;
-        uint256 blockNumber;
-        QueueOrigin l1QueueOrigin;
-        address l1TxOrigin;
-        address entrypoint;
-        uint256 gasLimit;
-        bytes data;
-    }
- 
-    struct TransactionChainElement {
-        bool isSequenced;
-        uint256 queueIndex;  // QUEUED TX ONLY
-        uint256 timestamp;   // SEQUENCER TX ONLY
-        uint256 blockNumber; // SEQUENCER TX ONLY
-        bytes txData;        // SEQUENCER TX ONLY
-    }
- 
-    struct QueueElement {
-        bytes32 transactionHash;
-        uint40 timestamp;
-        uint40 blockNumber;
-    }
- 
-    struct EIP155Transaction {
-        uint256 nonce;
-        uint256 gasPrice;
-        uint256 gasLimit;
-        address to;
-        uint256 value;
-        bytes data;
-        uint256 chainId;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Decodes an EOA transaction (i.e., native Ethereum RLP encoding).
-     * @param _transaction Encoded EOA transaction.
-     * @return Transaction decoded into a struct.
-     */
-    function decodeEIP155Transaction(
-        bytes memory _transaction,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (
-            EIP155Transaction memory
-        )
-    {
-        if (_isEthSignedMessage) {
-            (
-                uint256 _nonce,
-                uint256 _gasLimit,
-                uint256 _gasPrice,
-                uint256 _chainId,
-                address _to,
-                bytes memory _data
-            ) = abi.decode(
-                _transaction,
-                (uint256, uint256, uint256, uint256, address ,bytes)
-            );
-            return EIP155Transaction({
-                nonce: _nonce,
-                gasPrice: _gasPrice,
-                gasLimit: _gasLimit,
-                to: _to,
-                value: 0,
-                data: _data,
-                chainId: _chainId
-            });
-        } else {
-            Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);
- 
-            return EIP155Transaction({
-                nonce: Lib_RLPReader.readUint256(decoded[0]),
-                gasPrice: Lib_RLPReader.readUint256(decoded[1]),
-                gasLimit: Lib_RLPReader.readUint256(decoded[2]),
-                to: Lib_RLPReader.readAddress(decoded[3]),
-                value: Lib_RLPReader.readUint256(decoded[4]),
-                data: Lib_RLPReader.readBytes(decoded[5]),
-                chainId:  Lib_RLPReader.readUint256(decoded[6])
-            });
-        }
-    }
- 
-    /**
-     * Decompresses a compressed EIP155 transaction.
-     * @param _transaction Compressed EIP155 transaction bytes.
-     * @return Transaction parsed into a struct.
-     */
-    function decompressEIP155Transaction(
-        bytes memory _transaction
-    )
-        internal
-        returns (
-            EIP155Transaction memory
-        )
-    {
-        return EIP155Transaction({
-            gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),
-            gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,
-            nonce: Lib_BytesUtils.toUint24(_transaction, 6),
-            to: Lib_BytesUtils.toAddress(_transaction, 9),
-            data: Lib_BytesUtils.slice(_transaction, 29),
-            chainId: Lib_SafeExecutionManagerWrapper.safeCHAINID(),
-            value: 0
-        });
-    }
- 
-    /**
-     * Encodes an EOA transaction back into the original transaction.
-     * @param _transaction EIP155transaction to encode.
-     * @param _isEthSignedMessage Whether or not this was an eth signed message.
-     * @return Encoded transaction.
-     */
-    function encodeEIP155Transaction(
-        EIP155Transaction memory _transaction,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        if (_isEthSignedMessage) {
-            return abi.encode(
-                _transaction.nonce,
-                _transaction.gasLimit,
-                _transaction.gasPrice,
-                _transaction.chainId,
-                _transaction.to,
-                _transaction.data
-            );
-        } else {
-            bytes[] memory raw = new bytes[](9);
- 
-            raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
-            raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
-            raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
-            if (_transaction.to == address(0)) {
-                raw[3] = Lib_RLPWriter.writeBytes('');
-            } else {
-                raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
-            }
-            raw[4] = Lib_RLPWriter.writeUint(0);
-            raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
-            raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
-            raw[7] = Lib_RLPWriter.writeBytes(bytes(''));
-            raw[8] = Lib_RLPWriter.writeBytes(bytes(''));
- 
-            return Lib_RLPWriter.writeList(raw);
-        }
-    }
- 
-    /**
-     * Encodes a standard OVM transaction.
-     * @param _transaction OVM transaction to encode.
-     * @return Encoded transaction bytes.
-     */
-    function encodeTransaction(
-        Transaction memory _transaction
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodePacked(
-            _transaction.timestamp,
-            _transaction.blockNumber,
-            _transaction.l1QueueOrigin,
-            _transaction.l1TxOrigin,
-            _transaction.entrypoint,
-            _transaction.gasLimit,
-            _transaction.data
-        );
-    }
- 
-    /**
-     * Hashes a standard OVM transaction.
-     * @param _transaction OVM transaction to encode.
-     * @return Hashed transaction
-     */
-    function hashTransaction(
-        Transaction memory _transaction
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(encodeTransaction(_transaction));
-    }
- 
-    /**
-     * Converts an OVM account to an EVM account.
-     * @param _in OVM account to convert.
-     * @return Converted EVM account.
-     */
-    function toEVMAccount(
-        Account memory _in
-    )
-        internal
-        pure
-        returns (
-            EVMAccount memory
-        )
-    {
-        return EVMAccount({
-            nonce: _in.nonce,
-            balance: _in.balance,
-            storageRoot: _in.storageRoot,
-            codeHash: _in.codeHash
-        });
-    }
- 
-    /**
-     * @notice RLP-encodes an account state struct.
-     * @param _account Account state struct.
-     * @return RLP-encoded account state.
-     */
-    function encodeEVMAccount(
-        EVMAccount memory _account
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes[] memory raw = new bytes[](4);
- 
-        // Unfortunately we can't create this array outright because
-        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning
-        // index-by-index circumvents this issue.
-        raw[0] = Lib_RLPWriter.writeBytes(
-            Lib_Bytes32Utils.removeLeadingZeros(
-                bytes32(_account.nonce)
-            )
-        );
-        raw[1] = Lib_RLPWriter.writeBytes(
-            Lib_Bytes32Utils.removeLeadingZeros(
-                bytes32(_account.balance)
-            )
-        );
-        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));
-        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));
- 
-        return Lib_RLPWriter.writeList(raw);
-    }
- 
-    /**
-     * @notice Decodes an RLP-encoded account state into a useful struct.
-     * @param _encoded RLP-encoded account state.
-     * @return Account state struct.
-     */
-    function decodeEVMAccount(
-        bytes memory _encoded
-    )
-        internal
-        pure
-        returns (
-            EVMAccount memory
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);
- 
-        return EVMAccount({
-            nonce: Lib_RLPReader.readUint256(accountState[0]),
-            balance: Lib_RLPReader.readUint256(accountState[1]),
-            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),
-            codeHash: Lib_RLPReader.readBytes32(accountState[3])
-        });
-    }
- 
-    /**
-     * Calculates a hash for a given batch header.
-     * @param _batchHeader Header to hash.
-     * @return Hash of the header.
-     */
-    function hashBatchHeader(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(
-            abi.encode(
-                _batchHeader.batchRoot,
-                _batchHeader.batchSize,
-                _batchHeader.prevTotalElements,
-                _batchHeader.extraData
-            )
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/codec/index.html b/coverage/lcov-report/libraries/codec/index.html deleted file mode 100644 index 938f11b95..000000000 --- a/coverage/lcov-report/libraries/codec/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for libraries/codec/ - - - - - - - -
-
-

- all files libraries/codec/ -

-
-
- 100% - Statements - 33/33 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 33/33 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_OVMCodec.sol
100%33/33100%6/6100%9/9100%33/33
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/resolver/Lib_AddressManager.sol.html b/coverage/lcov-report/libraries/resolver/Lib_AddressManager.sol.html deleted file mode 100644 index 2a868eb60..000000000 --- a/coverage/lcov-report/libraries/resolver/Lib_AddressManager.sol.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - Code coverage report for libraries/resolver/Lib_AddressManager.sol - - - - - - - -
-
-

- all files / libraries/resolver/ Lib_AddressManager.sol -

-
-
- 100% - Statements - 4/4 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -379× -379× -  -  -  -  -  -  -  -  -  -2107× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2486× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { Ownable } from "./Lib_Ownable.sol";
- 
-/**
- * @title Lib_AddressManager
- */
-contract Lib_AddressManager is Ownable {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event AddressSet(
-        string _name,
-        address _newAddress
-    );
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    mapping (bytes32 => address) private addresses;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function setAddress(
-        string memory _name,
-        address _address
-    )
-        public
-        onlyOwner
-    {
-        emit AddressSet(_name, _address);
-        addresses[_getNameHash(_name)] = _address;
-    }
- 
-    function getAddress(
-        string memory _name
-    )
-        public
-        view
-        returns (address)
-    {
-        return addresses[_getNameHash(_name)];
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _getNameHash(
-        string memory _name
-    )
-        internal
-        pure
-        returns (
-            bytes32 _hash
-        )
-    {
-        return keccak256(abi.encodePacked(_name));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/resolver/Lib_AddressResolver.sol.html b/coverage/lcov-report/libraries/resolver/Lib_AddressResolver.sol.html deleted file mode 100644 index c16b6c033..000000000 --- a/coverage/lcov-report/libraries/resolver/Lib_AddressResolver.sol.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - Code coverage report for libraries/resolver/Lib_AddressResolver.sol - - - - - - - -
-
-

- all files / libraries/resolver/ Lib_AddressResolver.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1041× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2076× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressManager } from "./Lib_AddressManager.sol";
- 
-/**
- * @title Lib_AddressResolver
- */
-abstract contract Lib_AddressResolver {
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    Lib_AddressManager internal libAddressManager;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Lib_AddressManager.
-     */
-    constructor(
-        address _libAddressManager
-    )  {
-        libAddressManager = Lib_AddressManager(_libAddressManager);
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function resolve(
-        string memory _name
-    )
-        public
-        view
-        returns (
-            address _contract
-        )
-    {
-        return libAddressManager.getAddress(_name);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/resolver/Lib_Ownable.sol.html b/coverage/lcov-report/libraries/resolver/Lib_Ownable.sol.html deleted file mode 100644 index 8b947582e..000000000 --- a/coverage/lcov-report/libraries/resolver/Lib_Ownable.sol.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - Code coverage report for libraries/resolver/Lib_Ownable.sol - - - - - - - -
-
-

- all files / libraries/resolver/ Lib_Ownable.sol -

-
-
- 37.5% - Statements - 3/8 -
-
- 25% - Branches - 1/4 -
-
- 50% - Functions - 2/4 -
-
- 44.44% - Lines - 4/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -120× -120× -  -  -  -  -  -  -  -  -379× -  -  -  -379× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Ownable
- * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
- */
-abstract contract Ownable {
- 
-    /*************
-     * Variables *
-     *************/
- 
-    address public owner;
- 
- 
-    /**********
-     * Events *
-     **********/
- 
-    event OwnershipTransferred(
-        address indexed previousOwner,
-        address indexed newOwner
-    );
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    constructor() {
-        owner = msg.sender;
-        emit OwnershipTransferred(address(0), owner);
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyOwner() {
-        Erequire(
-            owner == msg.sender,
-            "Ownable: caller is not the owner"
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function renounceOwnership()
-        public
-        virtual
-        onlyOwner
-    {
-        emit OwnershipTransferred(owner, address(0));
-        owner = address(0);
-    }
- 
-    function transferOwnership(address _newOwner)
-        public
-        virtual
-        onlyOwner
-    {
-        require(
-            _newOwner != address(0),
-            "Ownable: new owner cannot be the zero address"
-        );
- 
-        emit OwnershipTransferred(owner, _newOwner);
-        owner = _newOwner;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html b/coverage/lcov-report/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html deleted file mode 100644 index dfa334ef9..000000000 --- a/coverage/lcov-report/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - Code coverage report for libraries/resolver/Lib_ResolvedDelegateProxy.sol - - - - - - - -
-
-

- all files / libraries/resolver/ Lib_ResolvedDelegateProxy.sol -

-
-
- 100% - Statements - 6/6 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 8/8 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -36× -36× -  -  -  -  -  -  -  -  -  -  -31× -31× -  -  -  -  -31× -  -31× -22× -  -  -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressManager } from "./Lib_AddressManager.sol";
- 
-/**
- * @title Lib_ResolvedDelegateProxy
- */
-contract Lib_ResolvedDelegateProxy {
- 
-    /*************
-     * Variables *
-     *************/
- 
- 
-    // Using mappings to store fields to avoid overwriting storage slots in the
-    // implementation contract. For example, instead of storing these fields at
-    // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.
-    // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html
-    // NOTE: Do not use this code in your own contract system. 
-    //      There is a known flaw in this contract, and we will remove it from the repository
-    //      in the near future. Due to the very limited way that we are using it, this flaw is
-    //      not an issue in our system. 
-    mapping(address=>string) private implementationName;
-    mapping(address=>Lib_AddressManager) private addressManager;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Lib_AddressManager.
-     * @param _implementationName implementationName of the contract to proxy to.
-     */
-    constructor(
-        address _libAddressManager,
-        string memory _implementationName
-    )
-    {
-        addressManager[address(this)] = Lib_AddressManager(_libAddressManager);
-        implementationName[address(this)] = _implementationName;
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        address target = addressManager[address(this)].getAddress((implementationName[address(this)]));
-        Erequire(
-            target != address(0),
-            "Target address must be initialized."
-        );
- 
-        (bool success, bytes memory returndata) = target.delegatecall(msg.data);
- 
-        if (success == true) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/resolver/index.html b/coverage/lcov-report/libraries/resolver/index.html deleted file mode 100644 index 0b43123ea..000000000 --- a/coverage/lcov-report/libraries/resolver/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for libraries/resolver/ - - - - - - - -
-
-

- all files libraries/resolver/ -

-
-
- 75% - Statements - 15/20 -
-
- 50% - Branches - 4/8 -
-
- 81.82% - Functions - 9/11 -
-
- 78.26% - Lines - 18/23 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_AddressManager.sol
100%4/4100%0/0100%3/3100%4/4
Lib_AddressResolver.sol
100%2/2100%0/0100%2/2100%2/2
Lib_Ownable.sol
37.5%3/825%1/450%2/444.44%4/9
Lib_ResolvedDelegateProxy.sol
100%6/675%3/4100%2/2100%8/8
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/rlp/Lib_RLPReader.sol.html b/coverage/lcov-report/libraries/rlp/Lib_RLPReader.sol.html deleted file mode 100644 index 490fb050e..000000000 --- a/coverage/lcov-report/libraries/rlp/Lib_RLPReader.sol.html +++ /dev/null @@ -1,1925 +0,0 @@ - - - - Code coverage report for libraries/rlp/Lib_RLPReader.sol - - - - - - - -
-
-

- all files / libraries/rlp/ Lib_RLPReader.sol -

-
-
- 98.68% - Statements - 75/76 -
-
- 67.5% - Branches - 27/40 -
-
- 94.74% - Functions - 18/19 -
-
- 98.8% - Lines - 82/83 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -512× -512× -  -  -  -512× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -450× -  -  -  -  -  -446× -  -  -  -  -  -  -  -  -446× -  -446× -446× -446× -4230× -  -  -  -  -4230× -  -  -  -  -  -  -  -4230× -  -  -  -  -4230× -4230× -  -  -  -446× -  -  -  -446× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -450× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -651× -  -  -  -  -  -651× -  -  -  -  -651× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -68× -  -  -  -  -68× -  -  -  -  -  -68× -  -  -  -  -68× -68× -68× -  -  -  -  -  -  -  -  -68× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -56× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - - - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -776× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -5399× -  -  -  -  -5395× -5395× -5395× -  -  -  -5395× -  -  -33× -  -  -  -4334× -  -4334× -  -  -  -  -4334× -  -  -536× -  -536× -  -  -  -  -536× -536× -  -  -  -  -  -  -  -536× -  -  -  -  -536× -  -  -89× -  -89× -  -  -  -  -89× -  -  -403× -  -403× -  -  -  -  -403× -403× -  -  -  -  -  -  -  -403× -  -  -  -  -403× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1427× -1427× - -  -  -1426× -1426× -1426× -  -  -  -  -1426× -2634× -  -  -  -2634× -2634× -  -  -  -1426× -1426× -  -  -  -  -  -  -  -  -  -1426× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -776× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_RLPReader
- * @dev Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).
- */
-library Lib_RLPReader {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 constant internal MAX_LIST_LENGTH = 32;
- 
- 
-    /*********
-     * Enums *
-     *********/
- 
-    enum RLPItemType {
-        DATA_ITEM,
-        LIST_ITEM
-    }
- 
-    
-    /***********
-     * Structs *
-     ***********/
- 
-    struct RLPItem {
-        uint256 length;
-        uint256 ptr;
-    }
-    
- 
-    /**********************
-     * Internal Functions *
-     **********************/
-    
-    /**
-     * Converts bytes to a reference to memory position and length.
-     * @param _in Input bytes to convert.
-     * @return Output memory reference.
-     */
-    function toRLPItem(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem memory
-        )
-    {
-        uint256 ptr;
-        assembly {
-            ptr := add(_in, 32)
-        }
- 
-        return RLPItem({
-            length: _in.length,
-            ptr: ptr
-        });
-    }
- 
-    /**
-     * Reads an RLP list value into a list of RLP items.
-     * @param _in RLP list value.
-     * @return Decoded RLP list items.
-     */
-    function readList(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem[] memory
-        )
-    {
-        (
-            uint256 listOffset,
-            ,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.LIST_ITEM,
-            "Invalid RLP list value."
-        );
- 
-        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by
-        // writing to the length. Since we can't know the number of RLP items without looping over
-        // the entire input, we'd have to loop twice to accurately size this array. It's easier to
-        // simply set a reasonable maximum list length and decrease the size before we finish.
-        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);
- 
-        uint256 itemCount = 0;
-        uint256 offset = listOffset;
-        while (offset < _in.length) {
-            Erequire(
-                itemCount < MAX_LIST_LENGTH,
-                "Provided RLP list exceeds max list length."
-            );
- 
-            (
-                uint256 itemOffset,
-                uint256 itemLength,
-            ) = _decodeLength(RLPItem({
-                length: _in.length - offset,
-                ptr: _in.ptr + offset
-            }));
- 
-            out[itemCount] = RLPItem({
-                length: itemLength + itemOffset,
-                ptr: _in.ptr + offset
-            });
- 
-            itemCount += 1;
-            offset += itemOffset + itemLength;
-        }
- 
-        // Decrease the array size to match the actual item count.
-        assembly {
-            mstore(out, itemCount)
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Reads an RLP list value into a list of RLP items.
-     * @param _in RLP list value.
-     * @return Decoded RLP list items.
-     */
-    function readList(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem[] memory
-        )
-    {
-        return readList(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bytes value into bytes.
-     * @param _in RLP bytes value.
-     * @return Decoded bytes.
-     */
-    function readBytes(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        (
-            uint256 itemOffset,
-            uint256 itemLength,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.DATA_ITEM,
-            "Invalid RLP bytes value."
-        );
- 
-        return _copy(_in.ptr, itemOffset, itemLength);
-    }
- 
-    /**
-     * Reads an RLP bytes value into bytes.
-     * @param _in RLP bytes value.
-     * @return Decoded bytes.
-     */
-    function readBytes(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return readBytes(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP string value into a string.
-     * @param _in RLP string value.
-     * @return Decoded string.
-     */
-    function readString(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            string memory
-        )
-    {
-        return string(readBytes(_in));
-    }
- 
-    /**
-     * Reads an RLP string value into a string.
-     * @param _in RLP string value.
-     * @return Decoded string.
-     */
-    function readString(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            string memory
-        )
-    {
-        return readString(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bytes32 value into a bytes32.
-     * @param _in RLP bytes32 value.
-     * @return Decoded bytes32.
-     */
-    function readBytes32(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        Erequire(
-            _in.length <= 33,
-            "Invalid RLP bytes32 value."
-        );
- 
-        (
-            uint256 itemOffset,
-            uint256 itemLength,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.DATA_ITEM,
-            "Invalid RLP bytes32 value."
-        );
- 
-        uint256 ptr = _in.ptr + itemOffset;
-        bytes32 out;
-        assembly {
-            out := mload(ptr)
- 
-            // Shift the bytes over to match the item size.
-            if lt(itemLength, 32) {
-                out := div(out, exp(256, sub(32, itemLength)))
-            }
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Reads an RLP bytes32 value into a bytes32.
-     * @param _in RLP bytes32 value.
-     * @return Decoded bytes32.
-     */
-    function readBytes32(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return readBytes32(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP uint256 value into a uint256.
-     * @param _in RLP uint256 value.
-     * @return Decoded uint256.
-     */
-    function readUint256(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        return uint256(readBytes32(_in));
-    }
- 
-    /**
-     * Reads an RLP uint256 value into a uint256.
-     * @param _in RLP uint256 value.
-     * @return Decoded uint256.
-     */
-    function readUint256(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        return readUint256(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bool value into a bool.
-     * @param _in RLP bool value.
-     * @return Decoded bool.
-     */
-    function readBool(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        Erequire(
-            _in.length == 1,
-            "Invalid RLP boolean value."
-        );
- 
-        uint256 ptr = _in.ptr;
-        uint256 out;
-        assembly {
-            out := byte(0, mload(ptr))
-        }
- 
-        return out != 0;
-    }
- 
-    /**
-     * Reads an RLP bool value into a bool.
-     * @param _in RLP bool value.
-     * @return Decoded bool.
-     */
-    function readBool(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        return readBool(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP address value into a address.
-     * @param _in RLP address value.
-     * @return Decoded address.
-     */
-    function readAddress(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        if (_in.length == 1) {
-            return address(0);
-        }
- 
-        Erequire(
-            _in.length == 21,
-            "Invalid RLP address value."
-        );
- 
-        return address(readUint256(_in));
-    }
- 
-    /**
-     * Reads an RLP address value into a address.
-     * @param _in RLP address value.
-     * @return Decoded address.
-     */
-    function readAddress(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        return readAddress(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads the raw bytes of an RLP item.
-     * @param _in RLP item to read.
-     * @return Raw RLP bytes.
-     */
-    function readRawBytes(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return _copy(_in);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Decodes the length of an RLP item.
-     * @param _in RLP item to decode.
-     * @return Offset of the encoded data.
-     * @return Length of the encoded data.
-     * @return RLP item type (LIST_ITEM or DATA_ITEM).
-     */
-    function _decodeLength(
-        RLPItem memory _in
-    )
-        private
-        pure
-        returns (
-            uint256,
-            uint256,
-            RLPItemType
-        )
-    {
-        require(
-            _in.length > 0,
-            "RLP item cannot be null."
-        );
- 
-        uint256 ptr = _in.ptr;
-        uint256 prefix;
-        assembly {
-            prefix := byte(0, mload(ptr))
-        }
- 
-        if (prefix <= 0x7f) {
-            // Single byte.
- 
-            return (0, 1, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xb7) {
-            // Short string.
- 
-            uint256 strLen = prefix - 0x80;
-            
-            Erequire(
-                _in.length > strLen,
-                "Invalid RLP short string."
-            );
- 
-            return (1, strLen, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xbf) {
-            // Long string.
-            uint256 lenOfStrLen = prefix - 0xb7;
- 
-            Erequire(
-                _in.length > lenOfStrLen,
-                "Invalid RLP long string length."
-            );
- 
-            uint256 strLen;
-            assembly {
-                // Pick out the string length.
-                strLen := div(
-                    mload(add(ptr, 1)),
-                    exp(256, sub(32, lenOfStrLen))
-                )
-            }
- 
-            Erequire(
-                _in.length > lenOfStrLen + strLen,
-                "Invalid RLP long string."
-            );
- 
-            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xf7) {
-            // Short list.
-            uint256 listLen = prefix - 0xc0;
- 
-            Erequire(
-                _in.length > listLen,
-                "Invalid RLP short list."
-            );
- 
-            return (1, listLen, RLPItemType.LIST_ITEM);
-        } else {
-            // Long list.
-            uint256 lenOfListLen = prefix - 0xf7;
- 
-            Erequire(
-                _in.length > lenOfListLen,
-                "Invalid RLP long list length."
-            );
- 
-            uint256 listLen;
-            assembly {
-                // Pick out the list length.
-                listLen := div(
-                    mload(add(ptr, 1)),
-                    exp(256, sub(32, lenOfListLen))
-                )
-            }
- 
-            Erequire(
-                _in.length > lenOfListLen + listLen,
-                "Invalid RLP long list."
-            );
- 
-            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);
-        }
-    }
- 
-    /**
-     * Copies the bytes from a memory location.
-     * @param _src Pointer to the location to read from.
-     * @param _offset Offset to start reading from.
-     * @param _length Number of bytes to read.
-     * @return Copied bytes.
-     */
-    function _copy(
-        uint256 _src,
-        uint256 _offset,
-        uint256 _length
-    )
-        private
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes memory out = new bytes(_length);
-        if (out.length == 0) {
-            return out;
-        }
- 
-        uint256 src = _src + _offset;
-        uint256 dest;
-        assembly {
-            dest := add(out, 32)
-        }
- 
-        // Copy over as many complete words as we can.
-        for (uint256 i = 0; i < _length / 32; i++) {
-            assembly {
-                mstore(dest, mload(src))
-            }
- 
-            src += 32;
-            dest += 32;
-        }
- 
-        // Pick out the remaining bytes.
-        uint256 mask = 256 ** (32 - (_length % 32)) - 1;
-        assembly {
-            mstore(
-                dest,
-                or(
-                    and(mload(src), not(mask)),
-                    and(mload(dest), mask)
-                )
-            )
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Copies an RLP item into bytes.
-     * @param _in RLP item to copy.
-     * @return Copied bytes.
-     */
-    function _copy(
-        RLPItem memory _in
-    )
-        private
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return _copy(_in.ptr, 0, _in.length);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/rlp/Lib_RLPWriter.sol.html b/coverage/lcov-report/libraries/rlp/Lib_RLPWriter.sol.html deleted file mode 100644 index dee20330d..000000000 --- a/coverage/lcov-report/libraries/rlp/Lib_RLPWriter.sol.html +++ /dev/null @@ -1,911 +0,0 @@ - - - - Code coverage report for libraries/rlp/Lib_RLPWriter.sol - - - - - - - -
-
-

- all files / libraries/rlp/ Lib_RLPWriter.sol -

-
-
- 94.55% - Statements - 52/55 -
-
- 100% - Branches - 8/8 -
-
- 90% - Functions - 9/10 -
-
- 95.08% - Lines - 58/61 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -324× -  -324× -16× -  -308× -  -  -324× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -157× -157× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -139× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -465× -  -465× -415× -415× -  -50× -50× -50× -72× -72× -  -  -50× -50× -50× -72× -  -  -  -465× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -  -52× -52× -1643× -24× -  -  -  -52× -52× -45× -  -  -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1030× -1030× -1030× -  -1030× -420× -  -  -420× -420× -  -  -1030× -1030× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -157× - -  -  -149× -149× -149× -1030× -  -  -149× -149× -149× -  -149× -1030× -  -1030× -1030× -  -1030× -1030× -  -  -149× -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
- 
-/**
- * @title Lib_RLPWriter
- * @author Bakaoh (with modifications)
- */
-library Lib_RLPWriter {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * RLP encodes a byte string.
-     * @param _in The byte string to encode.
-     * @return _out The RLP encoded string in bytes.
-     */
-    function writeBytes(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory encoded;
- 
-        if (_in.length == 1 && uint8(_in[0]) < 128) {
-            encoded = _in;
-        } else {
-            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);
-        }
- 
-        return encoded;
-    }
- 
-    /**
-     * RLP encodes a list of RLP encoded byte byte strings.
-     * @param _in The list of RLP encoded byte strings.
-     * @return _out The RLP encoded list of items in bytes.
-     */
-    function writeList(
-        bytes[] memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory list = _flatten(_in);
-        return abi.encodePacked(_writeLength(list.length, 192), list);
-    }
- 
-    /**
-     * RLP encodes a string.
-     * @param _in The string to encode.
-     * @return _out The RLP encoded string in bytes.
-     */
-    function writeString(
-        string memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(bytes(_in));
-    }
- 
-    /**
-     * RLP encodes an address.
-     * @param _in The address to encode.
-     * @return _out The RLP encoded address in bytes.
-     */
-    function writeAddress(
-        address _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(abi.encodePacked(_in));
-    }
- 
-    /**
-     * RLP encodes a uint.
-     * @param _in The uint256 to encode.
-     * @return _out The RLP encoded uint256 in bytes.
-     */
-    function writeUint(
-        uint256 _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(_toBinary(_in));
-    }
- 
-    /**
-     * RLP encodes a bool.
-     * @param _in The bool to encode.
-     * @return _out The RLP encoded bool in bytes.
-     */
-    function writeBool(
-        bool _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory encoded = new bytes(1);
-        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));
-        return encoded;
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.
-     * @param _len The length of the string or the payload.
-     * @param _offset 128 if item is string, 192 if item is list.
-     * @return _encoded RLP encoded bytes.
-     */
-    function _writeLength(
-        uint256 _len,
-        uint256 _offset
-    )
-        private
-        pure
-        returns (
-            bytes memory _encoded
-        )
-    {
-        bytes memory encoded;
- 
-        if (_len < 56) {
-            encoded = new bytes(1);
-            encoded[0] = byte(uint8(_len) + uint8(_offset));
-        } else {
-            uint256 lenLen;
-            uint256 i = 1;
-            while (_len / i != 0) {
-                lenLen++;
-                i *= 256;
-            }
- 
-            encoded = new bytes(lenLen + 1);
-            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);
-            for(i = 1; i <= lenLen; i++) {
-                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));
-            }
-        }
- 
-        return encoded;
-    }
- 
-    /**
-     * Encode integer in big endian binary form with no leading zeroes.
-     * @notice TODO: This should be optimized with assembly to save gas costs.
-     * @param _x The integer to encode.
-     * @return _binary RLP encoded bytes.
-     */
-    function _toBinary(
-        uint256 _x
-    )
-        private
-        pure
-        returns (
-            bytes memory _binary
-        )
-    {
-        bytes memory b = abi.encodePacked(_x);
- 
-        uint256 i = 0;
-        for (; i < 32; i++) {
-            if (b[i] != 0) {
-                break;
-            }
-        }
- 
-        bytes memory res = new bytes(32 - i);
-        for (uint256 j = 0; j < res.length; j++) {
-            res[j] = b[i++];
-        }
- 
-        return res;
-    }
- 
-    /**
-     * Copies a piece of memory to another location.
-     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.
-     * @param _dest Destination location.
-     * @param _src Source location.
-     * @param _len Length of memory to copy.
-     */
-    function _memcpy(
-        uint256 _dest,
-        uint256 _src,
-        uint256 _len
-    )
-        private
-        pure
-    {
-        uint256 dest = _dest;
-        uint256 src = _src;
-        uint256 len = _len;
- 
-        for(; len >= 32; len -= 32) {
-            assembly {
-                mstore(dest, mload(src))
-            }
-            dest += 32;
-            src += 32;
-        }
- 
-        uint256 mask = 256 ** (32 - len) - 1;
-        assembly {
-            let srcpart := and(mload(src), not(mask))
-            let destpart := and(mload(dest), mask)
-            mstore(dest, or(destpart, srcpart))
-        }
-    }
- 
-    /**
-     * Flattens a list of byte strings into one byte string.
-     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.
-     * @param _list List of byte strings to flatten.
-     * @return _flattened The flattened byte string.
-     */
-    function _flatten(
-        bytes[] memory _list
-    )
-        private
-        pure
-        returns (
-            bytes memory _flattened
-        )
-    {
-        if (_list.length == 0) {
-            return new bytes(0);
-        }
- 
-        uint256 len;
-        uint256 i = 0;
-        for (; i < _list.length; i++) {
-            len += _list[i].length;
-        }
- 
-        bytes memory flattened = new bytes(len);
-        uint256 flattenedPtr;
-        assembly { flattenedPtr := add(flattened, 0x20) }
- 
-        for(i = 0; i < _list.length; i++) {
-            bytes memory item = _list[i];
- 
-            uint256 listPtr;
-            assembly { listPtr := add(item, 0x20)}
- 
-            _memcpy(flattenedPtr, listPtr, item.length);
-            flattenedPtr += _list[i].length;
-        }
- 
-        return flattened;
-    }
-}
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/rlp/index.html b/coverage/lcov-report/libraries/rlp/index.html deleted file mode 100644 index bcae97d2c..000000000 --- a/coverage/lcov-report/libraries/rlp/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for libraries/rlp/ - - - - - - - -
-
-

- all files libraries/rlp/ -

-
-
- 96.95% - Statements - 127/131 -
-
- 72.92% - Branches - 35/48 -
-
- 93.1% - Functions - 27/29 -
-
- 97.22% - Lines - 140/144 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_RLPReader.sol
98.68%75/7667.5%27/4094.74%18/1998.8%82/83
Lib_RLPWriter.sol
94.55%52/55100%8/890%9/1095.08%58/61
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/standards/IUniswapV2ERC20.sol.html b/coverage/lcov-report/libraries/standards/IUniswapV2ERC20.sol.html deleted file mode 100644 index 76e84e00c..000000000 --- a/coverage/lcov-report/libraries/standards/IUniswapV2ERC20.sol.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - Code coverage report for libraries/standards/IUniswapV2ERC20.sol - - - - - - - -
-
-

- all files / libraries/standards/ IUniswapV2ERC20.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-interface IUniswapV2ERC20 {
-    event Approval(address indexed owner, address indexed spender, uint value);
-    event Transfer(address indexed from, address indexed to, uint value);
- 
-    function name() external view returns (string memory);
-    function symbol() external view returns (string memory);
-    function decimals() external view returns (uint8);
-    function totalSupply() external view returns (uint);
-    function balanceOf(address owner) external view returns (uint);
-    function allowance(address owner, address spender) external view returns (uint);
- 
-    function approve(address spender, uint value) external returns (bool);
-    function transfer(address to, uint value) external returns (bool);
-    function transferFrom(address from, address to, uint value) external returns (bool);
- 
-    function DOMAIN_SEPARATOR() external view returns (bytes32);
-    function PERMIT_TYPEHASH() external pure returns (bytes32);
-    function nonces(address owner) external view returns (uint);
- 
-    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/standards/UniSafeMath.sol.html b/coverage/lcov-report/libraries/standards/UniSafeMath.sol.html deleted file mode 100644 index 72011637e..000000000 --- a/coverage/lcov-report/libraries/standards/UniSafeMath.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for libraries/standards/UniSafeMath.sol - - - - - - - -
-
-

- all files / libraries/standards/ UniSafeMath.sol -

-
-
- 66.67% - Statements - 2/3 -
-
- 33.33% - Branches - 2/6 -
-
- 66.67% - Functions - 2/3 -
-
- 66.67% - Lines - 2/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  - -  -  -  -10× -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
- 
-library UniSafeMath {
-    function add(uint x, uint y) internal pure returns (uint z) {
-        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
-    }
- 
-    function sub(uint x, uint y) internal pure returns (uint z) {
-        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
-    }
- 
-    function mul(uint x, uint y) internal pure returns (uint z) {
-        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/standards/UniswapV2ERC20.sol.html b/coverage/lcov-report/libraries/standards/UniswapV2ERC20.sol.html deleted file mode 100644 index a80601a95..000000000 --- a/coverage/lcov-report/libraries/standards/UniswapV2ERC20.sol.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - Code coverage report for libraries/standards/UniswapV2ERC20.sol - - - - - - - -
-
-

- all files / libraries/standards/ UniswapV2ERC20.sol -

-
-
- 82.14% - Statements - 23/28 -
-
- 16.67% - Branches - 1/6 -
-
- 88.89% - Functions - 8/9 -
-
- 82.76% - Lines - 24/29 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -39× -39× -  -39× -39× -  -  -39× -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  - - - -  -  -  - - -  -  -  - - - -  -  -  - - -  -  -  - - -  -  -  - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-import './IUniswapV2ERC20.sol';
-import './UniSafeMath.sol';
- 
-contract UniswapV2ERC20 is IUniswapV2ERC20 {
-    using UniSafeMath for uint;
- 
-    string public override name;
-    string public override symbol;
-    uint8 public constant override decimals = 18;
-    uint public override totalSupply;
-    mapping(address => uint) public override balanceOf;
-    mapping(address => mapping(address => uint)) public override allowance;
- 
-    bytes32 public override DOMAIN_SEPARATOR;
-    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
-    bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
-    mapping(address => uint) public override nonces;
- 
-    constructor(
-    string memory _name,
-        string memory _symbol
-    ) {
-        name = _name;
-        symbol = _symbol;
- 
-        uint chainId;
-        assembly {
-            chainId := chainid()
-        }
-        DOMAIN_SEPARATOR = keccak256(
-            abi.encode(
-                keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
-                keccak256(bytes(name)),
-                keccak256(bytes('1')),
-                chainId,
-                address(this)
-            )
-        );
-    }
- 
-    function _mint(address to, uint value) internal {
-        totalSupply = totalSupply.add(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(address(0), to, value);
-    }
- 
-    function _burn(address from, uint value) internal {
-        balanceOf[from] = balanceOf[from].sub(value);
-        totalSupply = totalSupply.sub(value);
-        emit Transfer(from, address(0), value);
-    }
- 
-    function _approve(address owner, address spender, uint value) private {
-        allowance[owner][spender] = value;
-        emit Approval(owner, spender, value);
-    }
- 
-    function _transfer(address from, address to, uint value) private {
-        balanceOf[from] = balanceOf[from].sub(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(from, to, value);
-    }
- 
-    function approve(address spender, uint value) external override returns (bool) {
-        _approve(msg.sender, spender, value);
-        return true;
-    }
- 
-    function transfer(address to, uint value) external override returns (bool) {
-        _transfer(msg.sender, to, value);
-        return true;
-    }
- 
-    function transferFrom(address from, address to, uint value) external override returns (bool) {
-        Eif (allowance[from][msg.sender] != uint(-1)) {
-            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
-        }
-        _transfer(from, to, value);
-        return true;
-    }
- 
-    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override {
-        require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
-        bytes32 digest = keccak256(
-            abi.encodePacked(
-                '\x19\x01',
-                DOMAIN_SEPARATOR,
-                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
-            )
-        );
-        address recoveredAddress = ecrecover(digest, v, r, s);
-        require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
-        _approve(owner, spender, value);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/standards/index.html b/coverage/lcov-report/libraries/standards/index.html deleted file mode 100644 index 220cb4426..000000000 --- a/coverage/lcov-report/libraries/standards/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for libraries/standards/ - - - - - - - -
-
-

- all files libraries/standards/ -

-
-
- 80.65% - Statements - 25/31 -
-
- 25% - Branches - 3/12 -
-
- 83.33% - Functions - 10/12 -
-
- 81.25% - Lines - 26/32 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
IUniswapV2ERC20.sol
100%0/0100%0/0100%0/0100%0/0
UniSafeMath.sol
66.67%2/333.33%2/666.67%2/366.67%2/3
UniswapV2ERC20.sol
82.14%23/2816.67%1/688.89%8/982.76%24/29
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/trie/Lib_MerkleTrie.sol.html b/coverage/lcov-report/libraries/trie/Lib_MerkleTrie.sol.html deleted file mode 100644 index cfc1241f8..000000000 --- a/coverage/lcov-report/libraries/trie/Lib_MerkleTrie.sol.html +++ /dev/null @@ -1,2945 +0,0 @@ - - - - Code coverage report for libraries/trie/Lib_MerkleTrie.sol - - - - - - - -
-
-

- all files / libraries/trie/ Lib_MerkleTrie.sol -

-
-
- 72.45% - Statements - 142/196 -
-
- 55.88% - Branches - 38/68 -
-
- 84.62% - Functions - 22/26 -
-
- 72.02% - Lines - 139/193 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -22× -22× -22× -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -77× -73× -  -58× -  -58× -  -  -  -  -58× -  -58× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -95× -95× -  -95× -95× -95× -95× -  -  -95× -243× -243× -  -  -  -243× -  -243× -  -95× -  -  -  -  -  -148× -  -  -  -  -  -  -  -  -  -  -  -229× -147× -  -  -  -  -  -147× -147× -147× -147× -147× -  -  -82× -82× -82× -82× -82× -82× -  -82× -80× -  -  -  -  -  -73× -  -  -  -80× -80× -  - -  -  -  -  -  -  -  - - - -  -  - -  -  -  -  -  -  -  -80× -80× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -22× -  -  -  -  -  -22× -22× -  -22× -  -  -22× -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -22× -22× -  -  -22× -  -65× -65× -  -65× -  -  -22× -22× -  -  - - -  -  -  - -  - -  -  -  -  -42× -  -42× -42× -42× -  -  -  -  -65× -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -99× -95× -  -95× -265× -265× -  -  -  -  -  -95× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -148× -  -148× -  -  -  -  -148× -  -  -148× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -172× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -45× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -51× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -65× -  -  -65× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -87× -42× -  -45× -45× -  -45× -44× -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -82× -82× -4991× -  -82× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -65× -  -65× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -714× -  -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -22× -22× -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -23× -23× -23× -23× -23× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -45× -26× -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -43× -  -  -  -22× -22× -  -  -22× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
-import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
- 
-/**
- * @title Lib_MerkleTrie
- */
-library Lib_MerkleTrie {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum NodeType {
-        BranchNode,
-        ExtensionNode,
-        LeafNode
-    }
- 
-    struct TrieNode {
-        bytes encoded;
-        Lib_RLPReader.RLPItem[] decoded;
-    }
- 
- 
-    /**********************
-     * Contract Constants *
-     **********************/
- 
-    // TREE_RADIX determines the number of elements per branch node.
-    uint256 constant TREE_RADIX = 16;
-    // Branch nodes have TREE_RADIX elements plus an additional `value` slot.
-    uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;
-    // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.
-    uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;
- 
-    // Prefixes are prepended to the `path` within a leaf or extension node and
-    // allow us to differentiate between the two node types. `ODD` or `EVEN` is
-    // determined by the number of nibbles within the unprefixed `path`. If the
-    // number of nibbles if even, we need to insert an extra padding nibble so
-    // the resulting prefixed `path` has an even number of nibbles.
-    uint8 constant PREFIX_EXTENSION_EVEN = 0;
-    uint8 constant PREFIX_EXTENSION_ODD = 1;
-    uint8 constant PREFIX_LEAF_EVEN = 2;
-    uint8 constant PREFIX_LEAF_ODD = 3;
- 
-    // Just a utility constant. RLP represents `NULL` as 0x80.
-    bytes1 constant RLP_NULL = bytes1(0x80);
-    bytes constant RLP_NULL_BYTES = hex'80';
-    bytes32 constant internal KECCAK256_RLP_NULL_BYTES = keccak256(RLP_NULL_BYTES);
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Verifies a proof that a given key/value pair is present in the
-     * Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _value Value of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
-     * traditional Merkle trees, this proof is executed top-down and consists
-     * of a list of RLP-encoded nodes that make a path down to the target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
-     */
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        (
-            bool exists,
-            bytes memory value
-        ) = get(_key, _proof, _root);
- 
-        return (
-            exists && Lib_BytesUtils.equal(_value, value)
-        );
-    }
- 
-    /**
-     * @notice Verifies a proof that a given key is *not* present in
-     * the Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the key is absent in the trie, `false` otherwise.
-     */
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        (
-            bool exists,
-        ) = get(_key, _proof, _root);
- 
-        return exists == false;
-    }
- 
-    /**
-     * @notice Updates a Merkle trie and returns a new root hash.
-     * @param _key Key of the node to update, as a hex string.
-     * @param _value Value of the node to update, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node. If the key exists, we can simply update the value.
-     * Otherwise, we need to modify the trie to handle the new k/v pair.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _updatedRoot Root hash of the newly constructed trie.
-     */
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        // Special case when inserting the very first node.
-        Iif (_root == KECCAK256_RLP_NULL_BYTES) {
-            return getSingleNodeRootHash(_key, _value);
-        }
- 
-        TrieNode[] memory proof = _parseProof(_proof);
-        (uint256 pathLength, bytes memory keyRemainder, ) = _walkNodePath(proof, _key, _root);
-        TrieNode[] memory newPath = _getNewPath(proof, pathLength, keyRemainder, _value);
- 
-        return _getUpdatedTrieRoot(newPath, _key);
-    }
- 
-    /**
-     * @notice Retrieves the value associated with a given key.
-     * @param _key Key to search for, as hex bytes.
-     * @param _proof Merkle trie inclusion proof for the key.
-     * @param _root Known root of the Merkle trie.
-     * @return _exists Whether or not the key exists.
-     * @return _value Value of the key if it exists.
-     */
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _exists,
-            bytes memory _value
-        )
-    {
-        TrieNode[] memory proof = _parseProof(_proof);
-        (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(proof, _key, _root);
- 
-        bool exists = keyRemainder.length == 0;
- 
-        Erequire(
-            exists || isFinalNode,
-            "Provided proof is invalid."
-        );
- 
-        bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes('');
- 
-        return (
-            exists,
-            value
-        );
-    }
- 
-    /**
-     * Computes the root hash for a trie with a single node.
-     * @param _key Key for the single node.
-     * @param _value Value for the single node.
-     * @return _updatedRoot Hash of the trie.
-     */
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        return keccak256(_makeLeafNode(
-            Lib_BytesUtils.toNibbles(_key),
-            _value
-        ).encoded);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * @notice Walks through a proof using a provided key.
-     * @param _proof Inclusion proof to walk through.
-     * @param _key Key to use for the walk.
-     * @param _root Known root of the trie.
-     * @return _pathLength Length of the final path
-     * @return _keyRemainder Portion of the key remaining after the walk.
-     * @return _isFinalNode Whether or not we've hit a dead end.
-     */
-    function _walkNodePath(
-        TrieNode[] memory _proof,
-        bytes memory _key,
-        bytes32 _root
-    )
-        private
-        pure
-        returns (
-            uint256 _pathLength,
-            bytes memory _keyRemainder,
-            bool _isFinalNode
-        )
-    {
-        uint256 pathLength = 0;
-        bytes memory key = Lib_BytesUtils.toNibbles(_key);
- 
-        bytes32 currentNodeID = _root;
-        uint256 currentKeyIndex = 0;
-        uint256 currentKeyIncrement = 0;
-        TrieNode memory currentNode;
- 
-        // Proof is top-down, so we start at the first element (root).
-        for (uint256 i = 0; i < _proof.length; i++) {
-            currentNode = _proof[i];
-            currentKeyIndex += currentKeyIncrement;
- 
-            // Keep track of the proof elements we actually need.
-            // It's expensive to resize arrays, so this simply reduces gas costs.
-            pathLength += 1;
- 
-            if (currentKeyIndex == 0) {
-                // First proof element is always the root node.
-                require(
-                    keccak256(currentNode.encoded) == currentNodeID,
-                    "Invalid root hash"
-                );
-            } else Eif (currentNode.encoded.length >= 32) {
-                // Nodes 32 bytes or larger are hashed inside branch nodes.
-                require(
-                    keccak256(currentNode.encoded) == currentNodeID,
-                    "Invalid large internal hash"
-                );
-            } else {
-                // Nodes smaller than 31 bytes aren't hashed.
-                require(
-                    Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
-                    "Invalid internal node hash"
-                );
-            }
- 
-            if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {
-                Iif (currentKeyIndex == key.length) {
-                    // We've hit the end of the key, meaning the value should be within this branch node.
-                    break;
-                } else {
-                    // We're not at the end of the key yet.
-                    // Figure out what the next node ID should be and continue.
-                    uint8 branchKey = uint8(key[currentKeyIndex]);
-                    Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
-                    currentNodeID = _getNodeID(nextNode);
-                    currentKeyIncrement = 1;
-                    continue;
-                }
-            } else Eif (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
-                bytes memory path = _getNodePath(currentNode);
-                uint8 prefix = uint8(path[0]);
-                uint8 offset = 2 - prefix % 2;
-                bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);
-                bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);
-                uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
- 
-                if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
-                    if (
-                        pathRemainder.length == sharedNibbleLength &&
-                        keyRemainder.length == sharedNibbleLength
-                    ) {
-                        // The key within this leaf matches our key exactly.
-                        // Increment the key index to reflect that we have no remainder.
-                        currentKeyIndex += sharedNibbleLength;
-                    }
- 
-                    // We've hit a leaf node, so our next node should be NULL.
-                    currentNodeID = bytes32(RLP_NULL);
-                    break;
-                } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
-                    Iif (sharedNibbleLength == 0) {
-                        // Our extension node doesn't share any part of our key.
-                        // We've hit the end of this path, updates will need to modify this extension.
-                        currentNodeID = bytes32(RLP_NULL);
-                        break;
-                    } else {
-                        // Our extension shares some nibbles.
-                        // Carry on to the next node.
-                        currentNodeID = _getNodeID(currentNode.decoded[1]);
-                        currentKeyIncrement = sharedNibbleLength;
-                        continue;
-                    }
-                } else {
-                    revert("Received a node with an unknown prefix");
-                }
-            } else {
-                revert("Received an unparseable node.");
-            }
-        }
- 
-        // If our node ID is NULL, then we're at a dead end.
-        bool isFinalNode = currentNodeID == bytes32(RLP_NULL);
-        return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);
-    }
- 
-    /**
-     * @notice Creates new nodes to support a k/v pair insertion into a given
-     * Merkle trie path.
-     * @param _path Path to the node nearest the k/v pair.
-     * @param _pathLength Length of the path. Necessary because the provided
-     * path may include additional nodes (e.g., it comes directly from a proof)
-     * and we can't resize in-memory arrays without costly duplication.
-     * @param _keyRemainder Portion of the initial key that must be inserted
-     * into the trie.
-     * @param _value Value to insert at the given key.
-     * @return _newPath A new path with the inserted k/v pair and extra supporting nodes.
-     */
-    function _getNewPath(
-        TrieNode[] memory _path,
-        uint256 _pathLength,
-        bytes memory _keyRemainder,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _newPath
-        )
-    {
-        bytes memory keyRemainder = _keyRemainder;
- 
-        // Most of our logic depends on the status of the last node in the path.
-        TrieNode memory lastNode = _path[_pathLength - 1];
-        NodeType lastNodeType = _getNodeType(lastNode);
- 
-        // Create an array for newly created nodes.
-        // We need up to three new nodes, depending on the contents of the last node.
-        // Since array resizing is expensive, we'll keep track of the size manually.
-        // We're using an explicit `totalNewNodes += 1` after insertions for clarity.
-        TrieNode[] memory newNodes = new TrieNode[](3);
-        uint256 totalNewNodes = 0;
- 
-        Eif (keyRemainder.length == 0 && lastNodeType == NodeType.LeafNode) {
-            // We've found a leaf node with the given key.
-            // Simply need to update the value of the node to match.
-            newNodes[totalNewNodes] = _makeLeafNode(_getNodeKey(lastNode), _value);
-            totalNewNodes += 1;
-        } else if (lastNodeType == NodeType.BranchNode) {
-            if (keyRemainder.length == 0) {
-                // We've found a branch node with the given key.
-                // Simply need to update the value of the node to match.
-                newNodes[totalNewNodes] = _editBranchValue(lastNode, _value);
-                totalNewNodes += 1;
-            } else {
-                // We've found a branch node, but it doesn't contain our key.
-                // Reinsert the old branch for now.
-                newNodes[totalNewNodes] = lastNode;
-                totalNewNodes += 1;
-                // Create a new leaf node, slicing our remainder since the first byte points
-                // to our branch node.
-                newNodes[totalNewNodes] = _makeLeafNode(Lib_BytesUtils.slice(keyRemainder, 1), _value);
-                totalNewNodes += 1;
-            }
-        } else {
-            // Our last node is either an extension node or a leaf node with a different key.
-            bytes memory lastNodeKey = _getNodeKey(lastNode);
-            uint256 sharedNibbleLength = _getSharedNibbleLength(lastNodeKey, keyRemainder);
- 
-            if (sharedNibbleLength != 0) {
-                // We've got some shared nibbles between the last node and our key remainder.
-                // We'll need to insert an extension node that covers these shared nibbles.
-                bytes memory nextNodeKey = Lib_BytesUtils.slice(lastNodeKey, 0, sharedNibbleLength);
-                newNodes[totalNewNodes] = _makeExtensionNode(nextNodeKey, _getNodeHash(_value));
-                totalNewNodes += 1;
- 
-                // Cut down the keys since we've just covered these shared nibbles.
-                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, sharedNibbleLength);
-                keyRemainder = Lib_BytesUtils.slice(keyRemainder, sharedNibbleLength);
-            }
- 
-            // Create an empty branch to fill in.
-            TrieNode memory newBranch = _makeEmptyBranchNode();
- 
-            if (lastNodeKey.length == 0) {
-                // Key remainder was larger than the key for our last node.
-                // The value within our last node is therefore going to be shifted into
-                // a branch value slot.
-                newBranch = _editBranchValue(newBranch, _getNodeValue(lastNode));
-            } else {
-                // Last node key was larger than the key remainder.
-                // We're going to modify some index of our branch.
-                uint8 branchKey = uint8(lastNodeKey[0]);
-                // Move on to the next nibble.
-                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, 1);
- 
-                if (lastNodeType == NodeType.LeafNode) {
-                    // We're dealing with a leaf node.
-                    // We'll modify the key and insert the old leaf node into the branch index.
-                    TrieNode memory modifiedLastNode = _makeLeafNode(lastNodeKey, _getNodeValue(lastNode));
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
-                } else if (lastNodeKey.length != 0) {
-                    // We're dealing with a shrinking extension node.
-                    // We need to modify the node to decrease the size of the key.
-                    TrieNode memory modifiedLastNode = _makeExtensionNode(lastNodeKey, _getNodeValue(lastNode));
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
-                } else {
-                    // We're dealing with an unnecessary extension node.
-                    // We're going to delete the node entirely.
-                    // Simply insert its current value into the branch index.
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeValue(lastNode));
-                }
-            }
- 
-            if (keyRemainder.length == 0) {
-                // We've got nothing left in the key remainder.
-                // Simply insert the value into the branch value slot.
-                newBranch = _editBranchValue(newBranch, _value);
-                // Push the branch into the list of new nodes.
-                newNodes[totalNewNodes] = newBranch;
-                totalNewNodes += 1;
-            } else {
-                // We've got some key remainder to work with.
-                // We'll be inserting a leaf node into the trie.
-                // First, move on to the next nibble.
-                keyRemainder = Lib_BytesUtils.slice(keyRemainder, 1);
-                // Push the branch into the list of new nodes.
-                newNodes[totalNewNodes] = newBranch;
-                totalNewNodes += 1;
-                // Push a new leaf node for our k/v pair.
-                newNodes[totalNewNodes] = _makeLeafNode(keyRemainder, _value);
-                totalNewNodes += 1;
-            }
-        }
- 
-        // Finally, join the old path with our newly created nodes.
-        // Since we're overwriting the last node in the path, we use `_pathLength - 1`.
-        return _joinNodeArrays(_path, _pathLength - 1, newNodes, totalNewNodes);
-    }
- 
-    /**
-     * @notice Computes the trie root from a given path.
-     * @param _nodes Path to some k/v pair.
-     * @param _key Key for the k/v pair.
-     * @return _updatedRoot Root hash for the updated trie.
-     */
-    function _getUpdatedTrieRoot(
-        TrieNode[] memory _nodes,
-        bytes memory _key
-    )
-        private
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = Lib_BytesUtils.toNibbles(_key);
- 
-        // Some variables to keep track of during iteration.
-        TrieNode memory currentNode;
-        NodeType currentNodeType;
-        bytes memory previousNodeHash;
- 
-        // Run through the path backwards to rebuild our root hash.
-        for (uint256 i = _nodes.length; i > 0; i--) {
-            // Pick out the current node.
-            currentNode = _nodes[i - 1];
-            currentNodeType = _getNodeType(currentNode);
- 
-            if (currentNodeType == NodeType.LeafNode) {
-                // Leaf nodes are already correctly encoded.
-                // Shift the key over to account for the nodes key.
-                bytes memory nodeKey = _getNodeKey(currentNode);
-                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
-            } else if (currentNodeType == NodeType.ExtensionNode) {
-                // Shift the key over to account for the nodes key.
-                bytes memory nodeKey = _getNodeKey(currentNode);
-                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
- 
-                // If this node is the last element in the path, it'll be correctly encoded
-                // and we can skip this part.
-                Eif (previousNodeHash.length > 0) {
-                    // Re-encode the node based on the previous node.
-                    currentNode = _makeExtensionNode(nodeKey, previousNodeHash);
-                }
-            } else Eif (currentNodeType == NodeType.BranchNode) {
-                // If this node is the last element in the path, it'll be correctly encoded
-                // and we can skip this part.
-                Eif (previousNodeHash.length > 0) {
-                    // Re-encode the node based on the previous node.
-                    uint8 branchKey = uint8(key[key.length - 1]);
-                    key = Lib_BytesUtils.slice(key, 0, key.length - 1);
-                    currentNode = _editBranchIndex(currentNode, branchKey, previousNodeHash);
-                }
-            }
- 
-            // Compute the node hash for the next iteration.
-            previousNodeHash = _getNodeHash(currentNode.encoded);
-        }
- 
-        // Current node should be the root at this point.
-        // Simply return the hash of its encoding.
-        return keccak256(currentNode.encoded);
-    }
- 
-    /**
-     * @notice Parses an RLP-encoded proof into something more useful.
-     * @param _proof RLP-encoded proof to parse.
-     * @return _parsed Proof parsed into easily accessible structs.
-     */
-    function _parseProof(
-        bytes memory _proof
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _parsed
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);
-        TrieNode[] memory proof = new TrieNode[](nodes.length);
- 
-        for (uint256 i = 0; i < nodes.length; i++) {
-            bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);
-            proof[i] = TrieNode({
-                encoded: encoded,
-                decoded: Lib_RLPReader.readList(encoded)
-            });
-        }
- 
-        return proof;
-    }
- 
-    /**
-     * @notice Picks out the ID for a node. Node ID is referred to as the
-     * "hash" within the specification, but nodes < 32 bytes are not actually
-     * hashed.
-     * @param _node Node to pull an ID for.
-     * @return _nodeID ID for the node, depending on the size of its contents.
-     */
-    function _getNodeID(
-        Lib_RLPReader.RLPItem memory _node
-    )
-        private
-        pure
-        returns (
-            bytes32 _nodeID
-        )
-    {
-        bytes memory nodeID;
- 
-        Iif (_node.length < 32) {
-            // Nodes smaller than 32 bytes are RLP encoded.
-            nodeID = Lib_RLPReader.readRawBytes(_node);
-        } else {
-            // Nodes 32 bytes or larger are hashed.
-            nodeID = Lib_RLPReader.readBytes(_node);
-        }
- 
-        return Lib_BytesUtils.toBytes32(nodeID);
-    }
- 
-    /**
-     * @notice Gets the path for a leaf or extension node.
-     * @param _node Node to get a path for.
-     * @return _path Node path, converted to an array of nibbles.
-     */
-    function _getNodePath(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _path
-        )
-    {
-        return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));
-    }
- 
-    /**
-     * @notice Gets the key for a leaf or extension node. Keys are essentially
-     * just paths without any prefix.
-     * @param _node Node to get a key for.
-     * @return _key Node key, converted to an array of nibbles.
-     */
-    function _getNodeKey(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _key
-        )
-    {
-        return _removeHexPrefix(_getNodePath(_node));
-    }
- 
-    /**
-     * @notice Gets the path for a node.
-     * @param _node Node to get a value for.
-     * @return _value Node value, as hex bytes.
-     */
-    function _getNodeValue(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _value
-        )
-    {
-        return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
-    }
- 
-    /**
-     * @notice Computes the node hash for an encoded node. Nodes < 32 bytes
-     * are not hashed, all others are keccak256 hashed.
-     * @param _encoded Encoded node to hash.
-     * @return _hash Hash of the encoded node. Simply the input if < 32 bytes.
-     */
-    function _getNodeHash(
-        bytes memory _encoded
-    )
-        private
-        pure
-        returns (
-            bytes memory _hash
-        )
-    {
-        Iif (_encoded.length < 32) {
-            return _encoded;
-        } else {
-            return abi.encodePacked(keccak256(_encoded));
-        }
-    }
- 
-    /**
-     * @notice Determines the type for a given node.
-     * @param _node Node to determine a type for.
-     * @return _type Type of the node; BranchNode/ExtensionNode/LeafNode.
-     */
-    function _getNodeType(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            NodeType _type
-        )
-    {
-        if (_node.decoded.length == BRANCH_NODE_LENGTH) {
-            return NodeType.BranchNode;
-        } else Eif (_node.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
-            bytes memory path = _getNodePath(_node);
-            uint8 prefix = uint8(path[0]);
- 
-            if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
-                return NodeType.LeafNode;
-            } else Eif (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
-                return NodeType.ExtensionNode;
-            }
-        }
- 
-        revert("Invalid node type");
-    }
- 
-    /**
-     * @notice Utility; determines the number of nibbles shared between two
-     * nibble arrays.
-     * @param _a First nibble array.
-     * @param _b Second nibble array.
-     * @return _shared Number of shared nibbles.
-     */
-    function _getSharedNibbleLength(
-        bytes memory _a,
-        bytes memory _b
-    )
-        private
-        pure
-        returns (
-            uint256 _shared
-        )
-    {
-        uint256 i = 0;
-        while (_a.length > i && _b.length > i && _a[i] == _b[i]) {
-            i++;
-        }
-        return i;
-    }
- 
-    /**
-     * @notice Utility; converts an RLP-encoded node into our nice struct.
-     * @param _raw RLP-encoded node to convert.
-     * @return _node Node as a TrieNode struct.
-     */
-    function _makeNode(
-        bytes[] memory _raw
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes memory encoded = Lib_RLPWriter.writeList(_raw);
- 
-        return TrieNode({
-            encoded: encoded,
-            decoded: Lib_RLPReader.readList(encoded)
-        });
-    }
- 
-    /**
-     * @notice Utility; converts an RLP-decoded node into our nice struct.
-     * @param _items RLP-decoded node to convert.
-     * @return _node Node as a TrieNode struct.
-     */
-    function _makeNode(
-        Lib_RLPReader.RLPItem[] memory _items
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](_items.length);
-        for (uint256 i = 0; i < _items.length; i++) {
-            raw[i] = Lib_RLPReader.readRawBytes(_items[i]);
-        }
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates a new extension node.
-     * @param _key Key for the extension node, unprefixed.
-     * @param _value Value for the extension node.
-     * @return _node New extension node with the given k/v pair.
-     */
-    function _makeExtensionNode(
-        bytes memory _key,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](2);
-        bytes memory key = _addHexPrefix(_key, false);
-        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
-        raw[1] = Lib_RLPWriter.writeBytes(_value);
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates a new leaf node.
-     * @dev This function is essentially identical to `_makeExtensionNode`.
-     * Although we could route both to a single method with a flag, it's
-     * more gas efficient to keep them separate and duplicate the logic.
-     * @param _key Key for the leaf node, unprefixed.
-     * @param _value Value for the leaf node.
-     * @return _node New leaf node with the given k/v pair.
-     */
-    function _makeLeafNode(
-        bytes memory _key,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](2);
-        bytes memory key = _addHexPrefix(_key, true);
-        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
-        raw[1] = Lib_RLPWriter.writeBytes(_value);
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates an empty branch node.
-     * @return _node Empty branch node as a TrieNode struct.
-     */
-    function _makeEmptyBranchNode()
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](BRANCH_NODE_LENGTH);
-        for (uint256 i = 0; i < raw.length; i++) {
-            raw[i] = RLP_NULL_BYTES;
-        }
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Modifies the value slot for a given branch.
-     * @param _branch Branch node to modify.
-     * @param _value Value to insert into the branch.
-     * @return _updatedNode Modified branch node.
-     */
-    function _editBranchValue(
-        TrieNode memory _branch,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _updatedNode
-        )
-    {
-        bytes memory encoded = Lib_RLPWriter.writeBytes(_value);
-        _branch.decoded[_branch.decoded.length - 1] = Lib_RLPReader.toRLPItem(encoded);
-        return _makeNode(_branch.decoded);
-    }
- 
-    /**
-     * @notice Modifies a slot at an index for a given branch.
-     * @param _branch Branch node to modify.
-     * @param _index Slot index to modify.
-     * @param _value Value to insert into the slot.
-     * @return _updatedNode Modified branch node.
-     */
-    function _editBranchIndex(
-        TrieNode memory _branch,
-        uint8 _index,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _updatedNode
-        )
-    {
-        bytes memory encoded = _value.length < 32 ? _value : Lib_RLPWriter.writeBytes(_value);
-        _branch.decoded[_index] = Lib_RLPReader.toRLPItem(encoded);
-        return _makeNode(_branch.decoded);
-    }
- 
-    /**
-     * @notice Utility; adds a prefix to a key.
-     * @param _key Key to prefix.
-     * @param _isLeaf Whether or not the key belongs to a leaf.
-     * @return _prefixedKey Prefixed key.
-     */
-    function _addHexPrefix(
-        bytes memory _key,
-        bool _isLeaf
-    )
-        private
-        pure
-        returns (
-            bytes memory _prefixedKey
-        )
-    {
-        uint8 prefix = _isLeaf ? uint8(0x02) : uint8(0x00);
-        uint8 offset = uint8(_key.length % 2);
-        bytes memory prefixed = new bytes(2 - offset);
-        prefixed[0] = bytes1(prefix + offset);
-        return abi.encodePacked(prefixed, _key);
-    }
- 
-    /**
-     * @notice Utility; removes a prefix from a path.
-     * @param _path Path to remove the prefix from.
-     * @return _unprefixedKey Unprefixed key.
-     */
-    function _removeHexPrefix(
-        bytes memory _path
-    )
-        private
-        pure
-        returns (
-            bytes memory _unprefixedKey
-        )
-    {
-        if (uint8(_path[0]) % 2 == 0) {
-            return Lib_BytesUtils.slice(_path, 2);
-        } else {
-            return Lib_BytesUtils.slice(_path, 1);
-        }
-    }
- 
-    /**
-     * @notice Utility; combines two node arrays. Array lengths are required
-     * because the actual lengths may be longer than the filled lengths.
-     * Array resizing is extremely costly and should be avoided.
-     * @param _a First array to join.
-     * @param _aLength Length of the first array.
-     * @param _b Second array to join.
-     * @param _bLength Length of the second array.
-     * @return _joined Combined node array.
-     */
-    function _joinNodeArrays(
-        TrieNode[] memory _a,
-        uint256 _aLength,
-        TrieNode[] memory _b,
-        uint256 _bLength
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _joined
-        )
-    {
-        TrieNode[] memory ret = new TrieNode[](_aLength + _bLength);
- 
-        // Copy elements from the first array.
-        for (uint256 i = 0; i < _aLength; i++) {
-            ret[i] = _a[i];
-        }
- 
-        // Copy elements from the second array.
-        for (uint256 i = 0; i < _bLength; i++) {
-            ret[i + _aLength] = _b[i];
-        }
- 
-        return ret;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/trie/Lib_SecureMerkleTrie.sol.html b/coverage/lcov-report/libraries/trie/Lib_SecureMerkleTrie.sol.html deleted file mode 100644 index 14a776a75..000000000 --- a/coverage/lcov-report/libraries/trie/Lib_SecureMerkleTrie.sol.html +++ /dev/null @@ -1,548 +0,0 @@ - - - - Code coverage report for libraries/trie/Lib_SecureMerkleTrie.sol - - - - - - - -
-
-

- all files / libraries/trie/ Lib_SecureMerkleTrie.sol -

-
-
- 63.64% - Statements - 7/11 -
-
- 100% - Branches - 0/0 -
-
- 66.67% - Functions - 4/6 -
-
- 63.64% - Lines - 7/11 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -20× -20× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -47× -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_MerkleTrie } from "./Lib_MerkleTrie.sol";
- 
-/**
- * @title Lib_SecureMerkleTrie
- */
-library Lib_SecureMerkleTrie {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Verifies a proof that a given key/value pair is present in the
-     * Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _value Value of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
-     * traditional Merkle trees, this proof is executed top-down and consists
-     * of a list of RLP-encoded nodes that make a path down to the target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
-     */
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
-    }
- 
-    /**
-     * @notice Verifies a proof that a given key is *not* present in
-     * the Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the key is not present in the trie, `false` otherwise.
-     */
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.verifyExclusionProof(key, _proof, _root);
-    }
- 
-    /**
-     * @notice Updates a Merkle trie and returns a new root hash.
-     * @param _key Key of the node to update, as a hex string.
-     * @param _value Value of the node to update, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node. If the key exists, we can simply update the value.
-     * Otherwise, we need to modify the trie to handle the new k/v pair.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _updatedRoot Root hash of the newly constructed trie.
-     */
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.update(key, _value, _proof, _root);
-    }
- 
-    /**
-     * @notice Retrieves the value associated with a given key.
-     * @param _key Key to search for, as hex bytes.
-     * @param _proof Merkle trie inclusion proof for the key.
-     * @param _root Known root of the Merkle trie.
-     * @return _exists Whether or not the key exists.
-     * @return _value Value of the key if it exists.
-     */
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _exists,
-            bytes memory _value
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.get(key, _proof, _root);
-    }
- 
-    /**
-     * Computes the root hash for a trie with a single node.
-     * @param _key Key for the single node.
-     * @param _value Value for the single node.
-     * @return _updatedRoot Hash of the trie.
-     */
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.getSingleNodeRootHash(key, _value);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Computes the secure counterpart to a key.
-     * @param _key Key to get a secure key from.
-     * @return _secureKey Secure version of the key.
-     */
-    function _getSecureKey(
-        bytes memory _key
-    )
-        private
-        pure
-        returns (
-            bytes memory _secureKey
-        )
-    {
-        return abi.encodePacked(keccak256(_key));
-    }
-}
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/trie/index.html b/coverage/lcov-report/libraries/trie/index.html deleted file mode 100644 index 14d44409f..000000000 --- a/coverage/lcov-report/libraries/trie/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for libraries/trie/ - - - - - - - -
-
-

- all files libraries/trie/ -

-
-
- 71.98% - Statements - 149/207 -
-
- 55.88% - Branches - 38/68 -
-
- 81.25% - Functions - 26/32 -
-
- 71.57% - Lines - 146/204 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_MerkleTrie.sol
72.45%142/19655.88%38/6884.62%22/2672.02%139/193
Lib_SecureMerkleTrie.sol
63.64%7/11100%0/066.67%4/663.64%7/11
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/Lib_Bytes32Utils.sol.html b/coverage/lcov-report/libraries/utils/Lib_Bytes32Utils.sol.html deleted file mode 100644 index 23b140949..000000000 --- a/coverage/lcov-report/libraries/utils/Lib_Bytes32Utils.sol.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_Bytes32Utils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_Bytes32Utils.sol -

-
-
- 100% - Statements - 6/6 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 5/5 -
-
- 100% - Lines - 7/7 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -40× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_Byte32Utils
- */
-library Lib_Bytes32Utils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to "true."
-     * @param _in Input bytes32 value.
-     * @return Bytes32 as a boolean.
-     */
-    function toBool(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        return _in != 0;
-    }
- 
-    /**
-     * Converts a boolean to a bytes32 value.
-     * @param _in Input boolean value.
-     * @return Boolean as a bytes32.
-     */
-    function fromBool(
-        bool _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return bytes32(uint256(_in ? 1 : 0));
-    }
- 
-    /**
-     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.
-     * @param _in Input bytes32 value.
-     * @return Bytes32 as an address.
-     */
-    function toAddress(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        return address(uint160(uint256(_in)));
-    }
- 
-    /**
-     * Converts an address to a bytes32.
-     * @param _in Input address value.
-     * @return Address as a bytes32.
-     */
-    function fromAddress(
-        address _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return bytes32(uint256(_in));
-    }
- 
-    /**
-     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.
-     * @param _in Input bytes32 value.
-     * @return Bytes32 without any leading zeros.
-     */
-    function removeLeadingZeros(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes memory out;
- 
-        assembly {
-            // Figure out how many leading zero bytes to remove.
-            let shift := 0
-            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {
-                shift := add(shift, 1)
-            }
- 
-            // Reserve some space for our output and fix the free memory pointer.
-            out := mload(0x40)
-            mstore(0x40, add(out, 0x40))
- 
-            // Shift the value and store it into the output bytes.
-            mstore(add(out, 0x20), shl(mul(shift, 8), _in))
- 
-            // Store the new size (with leading zero bytes removed) in the output byte size.
-            mstore(out, sub(32, shift))
-        }
- 
-        return out;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/Lib_BytesUtils.sol.html b/coverage/lcov-report/libraries/utils/Lib_BytesUtils.sol.html deleted file mode 100644 index ebdd55e85..000000000 --- a/coverage/lcov-report/libraries/utils/Lib_BytesUtils.sol.html +++ /dev/null @@ -1,728 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_BytesUtils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_BytesUtils.sol -

-
-
- 100% - Statements - 38/38 -
-
- 63.64% - Branches - 14/22 -
-
- 100% - Functions - 11/11 -
-
- 100% - Lines - 44/44 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -311× -311× -311× -  -308× -  -308× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -308× -  -  -  -  -  -  -  -  -  -  -299× -73× -  -  -226× -  -  -  -  -  -  -  -  -  - - - -  -  - -  -  -  -  -  -  -  -  -  -164× - - -  -  - -  -  -162× -  -  -  -  -  -  -  -  -  - -  -  -  -15× -15× -15× -  -15× -  -  -  -15× -  -  -  -12× -12× -12× -  -12× -  -  -  -12× -  -  -  - - - -  - -  -  -  - -  -  -  -  -  -  -  -  -  -292× -  -292× -9144× -9144× -  -  -292× -  -  -  -  -  -  -  -  -  -26× -  -26× -708× -  -  -26× -  -  -  -  -  -  -  -  -  -  -26× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_BytesUtils
- */
-library Lib_BytesUtils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start,
-        uint256 _length
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        Erequire(_length + 31 >= _length, "slice_overflow");
-        Erequire(_start + _length >= _start, "slice_overflow");
-        require(_bytes.length >= _start + _length, "slice_outOfBounds");
- 
-        bytes memory tempBytes;
- 
-        assembly {
-            switch iszero(_length)
-            case 0 {
-                // Get a location of some free memory and store it in tempBytes as
-                // Solidity does for memory variables.
-                tempBytes := mload(0x40)
- 
-                // The first word of the slice result is potentially a partial
-                // word read from the original array. To read it, we calculate
-                // the length of that partial word and start copying that many
-                // bytes into the array. The first word we copy will start with
-                // data we don't care about, but the last `lengthmod` bytes will
-                // land at the beginning of the contents of the new array. When
-                // we're done copying, we overwrite the full first word with
-                // the actual length of the slice.
-                let lengthmod := and(_length, 31)
- 
-                // The multiplication in the next line is necessary
-                // because when slicing multiples of 32 bytes (lengthmod == 0)
-                // the following copy loop was copying the origin's length
-                // and then ending prematurely not copying everything it should.
-                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
-                let end := add(mc, _length)
- 
-                for {
-                    // The multiplication in the next line has the same exact purpose
-                    // as the one above.
-                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
-                } lt(mc, end) {
-                    mc := add(mc, 0x20)
-                    cc := add(cc, 0x20)
-                } {
-                    mstore(mc, mload(cc))
-                }
- 
-                mstore(tempBytes, _length)
- 
-                //update free-memory pointer
-                //allocating the array padded to 32 bytes like the compiler does now
-                mstore(0x40, and(add(mc, 31), not(31)))
-            }
-            //if we want a zero-length slice let's just return a zero-length array
-            default {
-                tempBytes := mload(0x40)
- 
-                //zero out the 32 bytes slice we are about to return
-                //we need to do it because Solidity does not garbage collect
-                mstore(tempBytes, 0)
- 
-                mstore(0x40, add(tempBytes, 0x20))
-            }
-        }
- 
-        return tempBytes;
-    }
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        if (_bytes.length - _start == 0) {
-            return bytes('');
-        }
- 
-        return slice(_bytes, _start, _bytes.length - _start);
-    }
- 
-    function toBytes32PadLeft(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes32)
-    {
-        bytes32 ret;
-        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;
-        assembly {
-            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))
-        }
-        return ret;
-    }
- 
-    function toBytes32(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes32)
-    {
-        if (_bytes.length < 32) {
-            bytes32 ret;
-            assembly {
-                ret := mload(add(_bytes, 32))
-            }
-            return ret;
-        }
- 
-        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes
-    }
- 
-    function toUint256(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (uint256)
-    {
-        return uint256(toBytes32(_bytes));
-    }
- 
-    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
-        Erequire(_start + 3 >= _start, "toUint24_overflow");
-        Erequire(_bytes.length >= _start + 3 , "toUint24_outOfBounds");
-        uint24 tempUint;
- 
-        assembly {
-            tempUint := mload(add(add(_bytes, 0x3), _start))
-        }
- 
-        return tempUint;
-    }
- 
-    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
-        Erequire(_start + 1 >= _start, "toUint8_overflow");
-        Erequire(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
-        uint8 tempUint;
- 
-        assembly {
-            tempUint := mload(add(add(_bytes, 0x1), _start))
-        }
- 
-        return tempUint;
-    }
- 
-    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
-        Erequire(_start + 20 >= _start, "toAddress_overflow");
-        Erequire(_bytes.length >= _start + 20, "toAddress_outOfBounds");
-        address tempAddress;
- 
-        assembly {
-            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
-        }
- 
-        return tempAddress;
-    }
- 
-    function toNibbles(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        bytes memory nibbles = new bytes(_bytes.length * 2);
- 
-        for (uint256 i = 0; i < _bytes.length; i++) {
-            nibbles[i * 2] = _bytes[i] >> 4;
-            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);
-        }
- 
-        return nibbles;
-    }
- 
-    function fromNibbles(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        bytes memory ret = new bytes(_bytes.length / 2);
- 
-        for (uint256 i = 0; i < ret.length; i++) {
-            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);
-        }
- 
-        return ret;
-    }
- 
-    function equal(
-        bytes memory _bytes,
-        bytes memory _other
-    )
-        internal
-        pure
-        returns (bool)
-    {
-        return keccak256(_bytes) == keccak256(_other);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/Lib_ECDSAUtils.sol.html b/coverage/lcov-report/libraries/utils/Lib_ECDSAUtils.sol.html deleted file mode 100644 index 713191c61..000000000 --- a/coverage/lcov-report/libraries/utils/Lib_ECDSAUtils.sol.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_ECDSAUtils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_ECDSAUtils.sol -

-
-
- 100% - Statements - 9/9 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 9/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× - -  -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_ECDSAUtils
- */
-library Lib_ECDSAUtils {
- 
-    /**************************************
-     * Internal Functions: ECDSA Recovery *
-     **************************************/
- 
-    /**
-     * Recovers a signed address given a message and signature.
-     * @param _message Message that was originally signed.
-     * @param _isEthSignedMessage Whether or not the user used the `Ethereum Signed Message` prefix.
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     * @return _sender Signer address.
-     */
-    function recover(
-        bytes memory _message,
-        bool _isEthSignedMessage,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        internal
-        pure
-        returns (
-            address _sender
-        )
-    {
-        bytes32 messageHash = getMessageHash(_message, _isEthSignedMessage);
- 
-        return ecrecover(
-            messageHash,
-            _v + 27,
-            _r,
-            _s
-        );
-    }
- 
-    function getMessageHash(
-        bytes memory _message,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (bytes32) {
-        if (_isEthSignedMessage) {
-            return getEthSignedMessageHash(_message);
-        }
-        return getNativeMessageHash(_message);
-    }
- 
- 
-    /*************************************
-     * Private Functions: ECDSA Recovery *
-     *************************************/
- 
-    /**
-     * Gets the native message hash (simple keccak256) for a message.
-     * @param _message Message to hash.
-     * @return _messageHash Native message hash.
-     */
-    function getNativeMessageHash(
-        bytes memory _message
-    )
-        private
-        pure
-        returns (
-            bytes32 _messageHash
-        )
-    {
-        return keccak256(_message);
-    }
- 
-    /**
-     * Gets the hash of a message with the `Ethereum Signed Message` prefix.
-     * @param _message Message to hash.
-     * @return _messageHash Prefixed message hash.
-     */
-    function getEthSignedMessageHash(
-        bytes memory _message
-    )
-        private
-        pure
-        returns (
-            bytes32 _messageHash
-        )
-    {
-        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
-        bytes32 messageHash = keccak256(_message);
-        return keccak256(abi.encodePacked(prefix, messageHash));
-    }
-}
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/Lib_ErrorUtils.sol.html b/coverage/lcov-report/libraries/utils/Lib_ErrorUtils.sol.html deleted file mode 100644 index 5f34eb479..000000000 --- a/coverage/lcov-report/libraries/utils/Lib_ErrorUtils.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_ErrorUtils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_ErrorUtils.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title Lib_ErrorUtils
- */
-library Lib_ErrorUtils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Encodes an error string into raw solidity-style revert data.
-     * (i.e. ascii bytes, prefixed with bytes4(keccak("Error(string))"))
-     * Ref: https://docs.soliditylang.org/en/v0.8.2/control-structures.html?highlight=Error(string)#panic-via-assert-and-error-via-require
-     * @param _reason Reason for the reversion.
-     * @return Standard solidity revert data for the given reason.
-     */
-    function encodeRevertString(
-        string memory _reason
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodeWithSignature(
-            "Error(string)",
-            _reason
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/Lib_EthUtils.sol.html b/coverage/lcov-report/libraries/utils/Lib_EthUtils.sol.html deleted file mode 100644 index a7d7a6455..000000000 --- a/coverage/lcov-report/libraries/utils/Lib_EthUtils.sol.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_EthUtils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_EthUtils.sol -

-
-
- 83.33% - Statements - 10/12 -
-
- 100% - Branches - 0/0 -
-
- 85.71% - Functions - 6/7 -
-
- 87.5% - Lines - 14/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -34× -  -  -  -  -  -  -34× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -212× -  -  -  -212× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -27× -27× -  -27× -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
-import { Lib_Bytes32Utils } from "./Lib_Bytes32Utils.sol";
- 
-/**
- * @title Lib_EthUtils
- */
-library Lib_EthUtils {
- 
-    /***********************************
-     * Internal Functions: Code Access *
-     ***********************************/
- 
-    /**
-     * Gets the code for a given address.
-     * @param _address Address to get code for.
-     * @param _offset Offset to start reading from.
-     * @param _length Number of bytes to read.
-     * @return _code Code read from the contract.
-     */
-    function getCode(
-        address _address,
-        uint256 _offset,
-        uint256 _length
-    )
-        internal
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        assembly {
-            _code := mload(0x40)
-            mstore(0x40, add(_code, add(_length, 0x20)))
-            mstore(_code, _length)
-            extcodecopy(_address, add(_code, 0x20), _offset, _length)
-        }
- 
-        return _code;
-    }
- 
-    /**
-     * Gets the full code for a given address.
-     * @param _address Address to get code for.
-     * @return _code Full code of the contract.
-     */
-    function getCode(
-        address _address
-    )
-        internal
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        return getCode(
-            _address,
-            0,
-            getCodeSize(_address)
-        );
-    }
- 
-    /**
-     * Gets the size of a contract's code in bytes.
-     * @param _address Address to get code size for.
-     * @return _codeSize Size of the contract's code in bytes.
-     */
-    function getCodeSize(
-        address _address
-    )
-        internal
-        view
-        returns (
-            uint256 _codeSize
-        )
-    {
-        assembly {
-            _codeSize := extcodesize(_address)
-        }
- 
-        return _codeSize;
-    }
- 
-    /**
-     * Gets the hash of a contract's code.
-     * @param _address Address to get a code hash for.
-     * @return _codeHash Hash of the contract's code.
-     */
-    function getCodeHash(
-        address _address
-    )
-        internal
-        view
-        returns (
-            bytes32 _codeHash
-        )
-    {
-        assembly {
-            _codeHash := extcodehash(_address)
-        }
- 
-        return _codeHash;
-    }
- 
- 
-    /*****************************************
-     * Internal Functions: Contract Creation *
-     *****************************************/
- 
-    /**
-     * Creates a contract with some given initialization code.
-     * @param _code Contract initialization code.
-     * @return _created Address of the created contract.
-     */
-    function createContract(
-        bytes memory _code
-    )
-        internal
-        returns (
-            address _created
-        )
-    {
-        assembly {
-            _created := create(
-                0,
-                add(_code, 0x20),
-                mload(_code)
-            )
-        }
- 
-        return _created;
-    }
- 
-    /**
-     * Computes the address that would be generated by CREATE.
-     * @param _creator Address creating the contract.
-     * @param _nonce Creator's nonce.
-     * @return _address Address to be generated by CREATE.
-     */
-    function getAddressForCREATE(
-        address _creator,
-        uint256 _nonce
-    )
-        internal
-        pure
-        returns (
-            address _address
-        )
-    {
-        bytes[] memory encoded = new bytes[](2);
-        encoded[0] = Lib_RLPWriter.writeAddress(_creator);
-        encoded[1] = Lib_RLPWriter.writeUint(_nonce);
- 
-        bytes memory encodedList = Lib_RLPWriter.writeList(encoded);
-        return Lib_Bytes32Utils.toAddress(keccak256(encodedList));
-    }
- 
-    /**
-     * Computes the address that would be generated by CREATE2.
-     * @param _creator Address creating the contract.
-     * @param _bytecode Bytecode of the contract to be created.
-     * @param _salt 32 byte salt value mixed into the hash.
-     * @return _address Address to be generated by CREATE2.
-     */
-    function getAddressForCREATE2(
-        address _creator,
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        internal
-        pure
-        returns (address _address)
-    {
-        bytes32 hashedData = keccak256(abi.encodePacked(
-            byte(0xff),
-            _creator,
-            _salt,
-            keccak256(_bytecode)
-        ));
- 
-        return Lib_Bytes32Utils.toAddress(hashedData);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/Lib_Math.sol.html b/coverage/lcov-report/libraries/utils/Lib_Math.sol.html deleted file mode 100644 index a1abd31af..000000000 --- a/coverage/lcov-report/libraries/utils/Lib_Math.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_Math.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_Math.sol -

-
-
- 0% - Statements - 0/3 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_Math
- */
-library Lib_Math {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Calculates the minumum of two numbers.
-     * @param _x First number to compare.
-     * @param _y Second number to compare.
-     * @return Lesser of the two numbers.
-     */
-    function min(
-        uint256 _x,
-        uint256 _y
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        if (_x < _y) {
-            return _x;
-        }
- 
-        return _y;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/Lib_MerkleTree.sol.html b/coverage/lcov-report/libraries/utils/Lib_MerkleTree.sol.html deleted file mode 100644 index ddc48113f..000000000 --- a/coverage/lcov-report/libraries/utils/Lib_MerkleTree.sol.html +++ /dev/null @@ -1,725 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_MerkleTree.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_MerkleTree.sol -

-
-
- 97.83% - Statements - 45/46 -
-
- 90.91% - Branches - 20/22 -
-
- 100% - Functions - 3/3 -
-
- 97.96% - Lines - 48/49 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -118× -  -  -  -  -117× -  -  -  -117× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -117× -  -  -117× -117× -  -  -117× -  -  -117× -  -  -117× -117× -  -117× -273× -273× -  -273× -4620× -4620× -4620× -  -  -  -  -4620× -  -  -273× -27× -27× -27× -  -  -  -  -27× -  -  -273× -273× -  -  -117× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -102× -  -  -  -  -101× -  -  -  -  -100× -  -  -  -  -99× -  -99× -653× -146× -  -  -  -  -  -  -507× -  -  -  -  -  -  -  -653× -  -  -99× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -  -  -  -  -100× - -  -  -  -  -97× -97× -97× -776× -206× -206× -  -  -  -  -97× -70× -  -  -97× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_MerkleTree
- * @author River Keefer
- */
-library Lib_MerkleTree {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Calculates a merkle root for a list of 32-byte leaf hashes.  WARNING: If the number
-     * of leaves passed in is not a power of two, it pads out the tree with zero hashes.
-     * If you do not know the original length of elements for the tree you are verifying,
-     * then this may allow empty leaves past _elements.length to pass a verification check down the line.
-     * Note that the _elements argument is modified, therefore it must not be used again afterwards
-     * @param _elements Array of hashes from which to generate a merkle root.
-     * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).
-     */
-    function getMerkleRoot(
-        bytes32[] memory _elements
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        require(
-            _elements.length > 0,
-            "Lib_MerkleTree: Must provide at least one leaf hash."
-        );
- 
-        Iif (_elements.length == 0) {
-            return _elements[0];
-        }
- 
-        uint256[16] memory defaults = [
-            0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,
-            0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,
-            0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,
-            0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,
-            0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,
-            0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,
-            0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,
-            0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,
-            0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,
-            0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,
-            0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,
-            0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,
-            0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,
-            0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,
-            0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,
-            0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10
-        ];
- 
-        // Reserve memory space for our hashes.
-        bytes memory buf = new bytes(64);
- 
-        // We'll need to keep track of left and right siblings.
-        bytes32 leftSibling;
-        bytes32 rightSibling;
- 
-        // Number of non-empty nodes at the current depth.
-        uint256 rowSize = _elements.length;
- 
-        // Current depth, counting from 0 at the leaves
-        uint256 depth = 0;
- 
-        // Common sub-expressions
-        uint256 halfRowSize;         // rowSize / 2
-        bool rowSizeIsOdd;           // rowSize % 2 == 1
- 
-        while (rowSize > 1) {
-            halfRowSize = rowSize / 2;
-            rowSizeIsOdd = rowSize % 2 == 1;
- 
-            for (uint256 i = 0; i < halfRowSize; i++) {
-                leftSibling  = _elements[(2 * i)    ];
-                rightSibling = _elements[(2 * i) + 1];
-                assembly {
-                    mstore(add(buf, 32), leftSibling )
-                    mstore(add(buf, 64), rightSibling)
-                }
- 
-                _elements[i] = keccak256(buf);
-            }
- 
-            if (rowSizeIsOdd) {
-                leftSibling  = _elements[rowSize - 1];
-                rightSibling = bytes32(defaults[depth]);
-                assembly {
-                    mstore(add(buf, 32), leftSibling)
-                    mstore(add(buf, 64), rightSibling)
-                }
- 
-                _elements[halfRowSize] = keccak256(buf);
-            }
- 
-            rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);
-            depth++;
-        }
- 
-        return _elements[0];
-    }
- 
-    /**
-     * Verifies a merkle branch for the given leaf hash.  Assumes the original length
-     * of leaves generated is a known, correct input, and does not return true for indices
-     * extending past that index (even if _siblings would be otherwise valid.)
-     * @param _root The Merkle root to verify against.
-     * @param _leaf The leaf hash to verify inclusion of.
-     * @param _index The index in the tree of this leaf.
-     * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
-     * @param _totalLeaves The total number of leaves originally passed into.
-     * @return Whether or not the merkle branch and leaf passes verification.
-     */
-    function verify(
-        bytes32 _root,
-        bytes32 _leaf,
-        uint256 _index,
-        bytes32[] memory _siblings,
-        uint256 _totalLeaves
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        require(
-            _totalLeaves > 0,
-            "Lib_MerkleTree: Total leaves must be greater than zero."
-        );
- 
-        require(
-            _index < _totalLeaves,
-            "Lib_MerkleTree: Index out of bounds."
-        );
- 
-        require(
-            _siblings.length == _ceilLog2(_totalLeaves),
-            "Lib_MerkleTree: Total siblings does not correctly correspond to total leaves."
-        );
- 
-        bytes32 computedRoot = _leaf;
- 
-        for (uint256 i = 0; i < _siblings.length; i++) {
-            if ((_index & 1) == 1) {
-                computedRoot = keccak256(
-                    abi.encodePacked(
-                        _siblings[i],
-                        computedRoot
-                    )
-                );
-            } else {
-                computedRoot = keccak256(
-                    abi.encodePacked(
-                        computedRoot,
-                        _siblings[i]
-                    )
-                );
-            }
- 
-            _index >>= 1;
-        }
- 
-        return _root == computedRoot;
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Calculates the integer ceiling of the log base 2 of an input.
-     * @param _in Unsigned input to calculate the log.
-     * @return ceil(log_base_2(_in))
-     */
-    function _ceilLog2(
-        uint256 _in
-    )
-        private
-        pure
-        returns (
-            uint256
-        )
-    {
-        Erequire(
-            _in > 0,
-            "Lib_MerkleTree: Cannot compute ceil(log_2) of 0."
-        );
- 
-        if (_in == 1) {
-            return 0;
-        }
- 
-        // Find the highest set bit (will be floor(log_2)).
-        // Borrowed with <3 from https://github.com/ethereum/solidity-examples
-        uint256 val = _in;
-        uint256 highest = 0;
-        for (uint8 i = 128; i >= 1; i >>= 1) {
-            if (val & (uint(1) << i) - 1 << i != 0) {
-                highest += i;
-                val >>= i;
-            }
-        }
- 
-        // Increment by one if this is not a perfect logarithm.
-        if ((uint(1) << highest) != _in) {
-            highest += 1;
-        }
- 
-        return highest;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/Lib_ReentrancyGuard.sol.html b/coverage/lcov-report/libraries/utils/Lib_ReentrancyGuard.sol.html deleted file mode 100644 index f9285d350..000000000 --- a/coverage/lcov-report/libraries/utils/Lib_ReentrancyGuard.sol.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_ReentrancyGuard.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_ReentrancyGuard.sol -

-
-
- 100% - Statements - 4/4 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 5/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -54× -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -14× -  -14× -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @dev Contract module that helps prevent reentrant calls to a function.
- *
- * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
- * available, which can be applied to functions to make sure there are no nested
- * (reentrant) calls to them.
- *
- * Note that because there is a single `nonReentrant` guard, functions marked as
- * `nonReentrant` may not call one another. This can be worked around by making
- * those functions `private`, and then adding `external` `nonReentrant` entry
- * points to them.
- *
- * TIP: If you would like to learn more about reentrancy and alternative ways
- * to protect against it, check out our blog post
- * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
- */
-abstract contract Lib_ReentrancyGuard {
-    // Booleans are more expensive than uint256 or any type that takes up a full
-    // word because each write operation emits an extra SLOAD to first read the
-    // slot's contents, replace the bits taken up by the boolean, and then write
-    // back. This is the compiler's defense against contract upgrades and
-    // pointer aliasing, and it cannot be disabled.
- 
-    // The values being non-zero value makes deployment a bit more expensive,
-    // but in exchange the refund on every call to nonReentrant will be lower in
-    // amount. Since refunds are capped to a percentage of the total
-    // transaction's gas, it is best to keep them low in cases like this one, to
-    // increase the likelihood of the full refund coming into effect.
-    uint256 private constant _NOT_ENTERED = 1;
-    uint256 private constant _ENTERED = 2;
- 
-    uint256 private _status;
- 
-    constructor () {
-        _status = _NOT_ENTERED;
-    }
- 
-    /**
-     * @dev Prevents a contract from calling itself, directly or indirectly.
-     * Calling a `nonReentrant` function from another `nonReentrant`
-     * function is not supported. It is possible to prevent this from happening
-     * by making the `nonReentrant` function external, and make it call a
-     * `private` function that does the actual work.
-     */
-    modifier nonReentrant() {
-        // On the first call to nonReentrant, _notEntered will be true
-        Erequire(_status != _ENTERED, "ReentrancyGuard: reentrant call");
- 
-        // Any calls to nonReentrant after this point will fail
-        _status = _ENTERED;
- 
-        _;
- 
-        // By storing the original value once again, a refund is triggered (see
-        // https://eips.ethereum.org/EIPS/eip-2200)
-        _status = _NOT_ENTERED;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/Lib_RingBuffer.sol.html b/coverage/lcov-report/libraries/utils/Lib_RingBuffer.sol.html deleted file mode 100644 index a0835844d..000000000 --- a/coverage/lcov-report/libraries/utils/Lib_RingBuffer.sol.html +++ /dev/null @@ -1,1193 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_RingBuffer.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_RingBuffer.sol -

-
-
- 78.13% - Statements - 50/64 -
-
- 54.17% - Branches - 13/24 -
-
- 81.82% - Functions - 9/11 -
-
- 77.46% - Lines - 55/71 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -572× -572× -  -  -572× -134× -  -  -  -572× -11× -  -  -  -  -  -  -  -  -  -  -11× -  -  -  -  -572× -572× -  -  -572× -572× -572× -  -  -  -  -  -  -  -  -  -  -  -  -  -470× -  -470× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -538× -  -  -  -  -535× -535× -  -535× -  -  -535× -  -  -535× -  -  -  -  -535× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  - -  -  -  -  -  -  -  -  - - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -441× -441× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -550× -550× -  -  -  -  -  -  -  -  -  -  -  -  -  -573× -573× -  -573× -573× -573× -  -  -  -  -573× -573× -573× -573× -  -  -  -  -  -573× -573× -  -  -573× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2572× -2572× -  -2572× -2572× -2572× -  -  -  -  -2572× -2572× -2572× -2572× -  -  -  -  -  -2572× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1642× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-library Lib_RingBuffer {
-    using Lib_RingBuffer for RingBuffer;
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct Buffer {
-        uint256 length;
-        mapping (uint256 => bytes32) buf;
-    }
- 
-    struct RingBuffer {
-        bytes32 contextA;
-        bytes32 contextB;
-        Buffer bufferA;
-        Buffer bufferB;
-        uint256 nextOverwritableIndex;
-    }
- 
-    struct RingBufferContext {
-        // contextA
-        uint40 globalIndex;
-        bytes27 extraData;
- 
-        // contextB
-        uint64 currBufferIndex;
-        uint40 prevResetIndex;
-        uint40 currResetIndex;
-    }
- 
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 constant MIN_CAPACITY = 16;
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Pushes a single element to the buffer.
-     * @param _self Buffer to access.
-     * @param _value Value to push to the buffer.
-     * @param _extraData Optional global extra data.
-     */
-    function push(
-        RingBuffer storage _self,
-        bytes32 _value,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
- 
-        // Set a minimum capacity.
-        if (currBuffer.length == 0) {
-            currBuffer.length = MIN_CAPACITY;
-        }
- 
-        // Check if we need to expand the buffer.
-        if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {
-            Iif (ctx.currResetIndex < _self.nextOverwritableIndex) {
-                // We're going to overwrite the inactive buffer.
-                // Bump the buffer index, reset the delete offset, and set our reset indices.
-                ctx.currBufferIndex++;
-                ctx.prevResetIndex = ctx.currResetIndex;
-                ctx.currResetIndex = ctx.globalIndex;
- 
-                // Swap over to the next buffer.
-                currBuffer = _self.getBuffer(ctx.currBufferIndex);
-            } else {
-                // We're not overwriting yet, double the length of the current buffer.
-                currBuffer.length *= 2;
-            }
-        }
- 
-        // Index to write to is the difference of the global and reset indices.
-        uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;
-        currBuffer.buf[writeHead] = _value;
- 
-        // Bump the global index and insert our extra data, then save the context.
-        ctx.globalIndex++;
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Pushes a single element to the buffer.
-     * @param _self Buffer to access.
-     * @param _value Value to push to the buffer.
-     */
-    function push(
-        RingBuffer storage _self,
-        bytes32 _value
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        
-        _self.push(
-            _value,
-            ctx.extraData
-        );
-    }
- 
-    /**
-     * Retrieves an element from the buffer.
-     * @param _self Buffer to access.
-     * @param _index Element index to retrieve.
-     * @return Value of the element at the given index.
-     */
-    function get(
-        RingBuffer storage _self,
-        uint256 _index
-    )
-        internal
-        view
-        returns (
-            bytes32    
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
- 
-        require(
-            _index < ctx.globalIndex,
-            "Index out of bounds."
-        );
- 
-        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
-        Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);
- 
-        Eif (_index >= ctx.currResetIndex) {
-            // We're trying to load an element from the current buffer.
-            // Relative index is just the difference from the reset index.
-            uint256 relativeIndex = _index - ctx.currResetIndex;
- 
-            // Shouldn't happen but why not check.
-            Erequire(
-                relativeIndex < currBuffer.length,
-                "Index out of bounds."
-            );
- 
-            return currBuffer.buf[relativeIndex];
-        } else {
-            // We're trying to load an element from the previous buffer.
-            // Relative index is the difference from the reset index in the other direction.
-            uint256 relativeIndex = ctx.currResetIndex - _index;
- 
-            // Condition only fails in the case that we deleted and flipped buffers.
-            require(
-                ctx.currResetIndex > ctx.prevResetIndex,
-                "Index out of bounds."
-            );
- 
-            // Make sure we're not trying to read beyond the array.
-            require(
-                relativeIndex <= prevBuffer.length,
-                "Index out of bounds."
-            );
- 
-            return prevBuffer.buf[prevBuffer.length - relativeIndex];
-        }
-    }
- 
-    /**
-     * Deletes all elements after (and including) a given index.
-     * @param _self Buffer to access.
-     * @param _index Index of the element to delete from (inclusive).
-     * @param _extraData Optional global extra data.
-     */
-    function deleteElementsAfterInclusive(
-        RingBuffer storage _self,
-        uint40 _index,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
- 
-        Erequire(
-            _index < ctx.globalIndex && _index >= ctx.prevResetIndex,
-            "Index out of bounds."
-        );
- 
-        Iif (_index < ctx.currResetIndex) {
-            // We're switching back to the previous buffer.
-            // Reduce the buffer index, set the current reset index back to match the previous one.
-            // We use the equality of these two values to prevent reading beyond this buffer.
-            ctx.currBufferIndex--;
-            ctx.currResetIndex = ctx.prevResetIndex;
-        }
- 
-        // Set our global index and extra data, save the context.
-        ctx.globalIndex = _index;
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Deletes all elements after (and including) a given index.
-     * @param _self Buffer to access.
-     * @param _index Index of the element to delete from (inclusive).
-     */
-    function deleteElementsAfterInclusive(
-        RingBuffer storage _self,
-        uint40 _index
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        _self.deleteElementsAfterInclusive(
-            _index,
-            ctx.extraData
-        );
-    }
- 
-    /**
-     * Retrieves the current global index.
-     * @param _self Buffer to access.
-     * @return Current global index.
-     */
-    function getLength(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        return ctx.globalIndex;
-    }
- 
-    /**
-     * Changes current global extra data.
-     * @param _self Buffer to access.
-     * @param _extraData New global extra data.
-     */
-    function setExtraData(
-        RingBuffer storage _self,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Retrieves the current global extra data.
-     * @param _self Buffer to access.
-     * @return Current global extra data.
-     */
-    function getExtraData(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            bytes27
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        return ctx.extraData;
-    }
- 
-    /**
-     * Sets the current ring buffer context.
-     * @param _self Buffer to access.
-     * @param _ctx Current ring buffer context.
-     */
-    function setContext(
-        RingBuffer storage _self,
-        RingBufferContext memory _ctx
-    )
-        internal
-    {
-        bytes32 contextA;
-        bytes32 contextB;
- 
-        uint40 globalIndex = _ctx.globalIndex;
-        bytes27 extraData = _ctx.extraData;
-        assembly {
-            contextA := globalIndex
-            contextA := or(contextA, extraData)
-        }
- 
-        uint64 currBufferIndex = _ctx.currBufferIndex;
-        uint40 prevResetIndex = _ctx.prevResetIndex;
-        uint40 currResetIndex = _ctx.currResetIndex;
-        assembly {
-            contextB := currBufferIndex
-            contextB := or(contextB, shl(64, prevResetIndex))
-            contextB := or(contextB, shl(104, currResetIndex))
-        }
- 
-        Eif (_self.contextA != contextA) {
-            _self.contextA = contextA;
-        }
- 
-        Iif (_self.contextB != contextB) {
-            _self.contextB = contextB;
-        }
-    }
- 
-    /**
-     * Retrieves the current ring buffer context.
-     * @param _self Buffer to access.
-     * @return Current ring buffer context.
-     */
-    function getContext(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            RingBufferContext memory
-        )
-    {
-        bytes32 contextA = _self.contextA;
-        bytes32 contextB = _self.contextB;
- 
-        uint40 globalIndex;
-        bytes27 extraData;
-        assembly {
-            globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            extraData   := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)
-        }
- 
-        uint64 currBufferIndex;
-        uint40 prevResetIndex;
-        uint40 currResetIndex;
-        assembly {
-            currBufferIndex :=          and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)
-            prevResetIndex  := shr(64,  and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))
-            currResetIndex  := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))
-        }
- 
-        return RingBufferContext({
-            globalIndex: globalIndex,
-            extraData: extraData,
-            currBufferIndex: currBufferIndex,
-            prevResetIndex: prevResetIndex,
-            currResetIndex: currResetIndex
-        });
-    }
- 
-    /**
-     * Retrieves the a buffer from the ring buffer by index.
-     * @param _self Buffer to access.
-     * @param _which Index of the sub buffer to access.
-     * @return Sub buffer for the index.
-     */
-    function getBuffer(
-        RingBuffer storage _self,
-        uint256 _which
-    )
-        internal
-        view
-        returns (
-            Buffer storage
-        )
-    {
-        return _which % 2 == 0 ? _self.bufferA : _self.bufferB;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/utils/index.html b/coverage/lcov-report/libraries/utils/index.html deleted file mode 100644 index c793f1883..000000000 --- a/coverage/lcov-report/libraries/utils/index.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - Code coverage report for libraries/utils/ - - - - - - - -
-
-

- all files libraries/utils/ -

-
-
- 89.07% - Statements - 163/183 -
-
- 67.57% - Branches - 50/74 -
-
- 91.11% - Functions - 41/45 -
-
- 89.27% - Lines - 183/205 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_Bytes32Utils.sol
100%6/6100%0/0100%5/5100%7/7
Lib_BytesUtils.sol
100%38/3863.64%14/22100%11/11100%44/44
Lib_ECDSAUtils.sol
100%9/9100%2/2100%4/4100%9/9
Lib_ErrorUtils.sol
100%1/1100%0/0100%1/1100%1/1
Lib_EthUtils.sol
83.33%10/12100%0/085.71%6/787.5%14/16
Lib_Math.sol
0%0/30%0/20%0/10%0/3
Lib_MerkleTree.sol
97.83%45/4690.91%20/22100%3/397.96%48/49
Lib_ReentrancyGuard.sol
100%4/450%1/2100%2/2100%5/5
Lib_RingBuffer.sol
78.13%50/6454.17%13/2481.82%9/1177.46%55/71
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html b/coverage/lcov-report/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html deleted file mode 100644 index 5e49d6ba8..000000000 --- a/coverage/lcov-report/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html +++ /dev/null @@ -1,1205 +0,0 @@ - - - - Code coverage report for libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol - - - - - - - -
-
-

- all files / libraries/wrappers/ Lib_SafeExecutionManagerWrapper.sol -

-
-
- 100% - Statements - 30/30 -
-
- 83.33% - Branches - 5/6 -
-
- 100% - Functions - 16/16 -
-
- 96.77% - Lines - 30/31 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -11× -  -  -  -  -  -11× -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -41× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -43× -  -  -  -  -  -  -43× -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -146× -146× -  -  -  -  -146× - -  -  -  -  -  -  -  -144× -  -  -  -  -  -  -  -  -  -  -  -145× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_ErrorUtils } from "../utils/Lib_ErrorUtils.sol";
- 
-/**
- * @title Lib_SafeExecutionManagerWrapper
- * @dev The Safe Execution Manager Wrapper provides functions which facilitate writing OVM safe 
- * code using the standard solidity compiler, by routing all its operations through the Execution 
- * Manager.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-library Lib_SafeExecutionManagerWrapper {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Performs a safe ovmCALL.
-     * @param _gasLimit Gas limit for the call.
-     * @param _target Address to call.
-     * @param _calldata Data to send to the call.
-     * @return _success Whether or not the call reverted.
-     * @return _returndata Data returned by the call.
-     */
-    function safeCALL(
-        uint256 _gasLimit,
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCALL(uint256,address,bytes)",
-                _gasLimit,
-                _target,
-                _calldata
-            )
-        );
- 
-        return abi.decode(returndata, (bool, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmDELEGATECALL.
-     * @param _gasLimit Gas limit for the call.
-     * @param _target Address to call.
-     * @param _calldata Data to send to the call.
-     * @return _success Whether or not the call reverted.
-     * @return _returndata Data returned by the call.
-     */
-    function safeDELEGATECALL(
-        uint256 _gasLimit,
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmDELEGATECALL(uint256,address,bytes)",
-                _gasLimit,
-                _target,
-                _calldata
-            )
-        );
- 
-        return abi.decode(returndata, (bool, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmCREATE call.
-     * @param _gasLimit Gas limit for the creation.
-     * @param _bytecode Code for the new contract.
-     * @return _contract Address of the created contract.
-     */
-    function safeCREATE(
-        uint256 _gasLimit,
-        bytes memory _bytecode
-    )
-        internal
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            _gasLimit,
-            abi.encodeWithSignature(
-                "ovmCREATE(bytes)",
-                _bytecode
-            )
-        );
- 
-        return abi.decode(returndata, (address, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmEXTCODESIZE call.
-     * @param _contract Address of the contract to query the size of.
-     * @return _EXTCODESIZE Size of the requested contract in bytes.
-     */
-    function safeEXTCODESIZE(
-        address _contract
-    )
-        internal
-        returns (
-            uint256 _EXTCODESIZE
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmEXTCODESIZE(address)",
-                _contract
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmCHAINID call.
-     * @return _CHAINID Result of calling ovmCHAINID.
-     */
-    function safeCHAINID()
-        internal
-        returns (
-            uint256 _CHAINID
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCHAINID()"
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmCALLER call.
-     * @return _CALLER Result of calling ovmCALLER.
-     */
-    function safeCALLER()
-        internal
-        returns (
-            address _CALLER
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCALLER()"
-            )
-        );
- 
-        return abi.decode(returndata, (address));
-    }
- 
-    /**
-     * Performs a safe ovmADDRESS call.
-     * @return _ADDRESS Result of calling ovmADDRESS.
-     */
-    function safeADDRESS()
-        internal
-        returns (
-            address _ADDRESS
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmADDRESS()"
-            )
-        );
- 
-        return abi.decode(returndata, (address));
-    }
- 
-    /**
-     * Performs a safe ovmGETNONCE call.
-     * @return _nonce Result of calling ovmGETNONCE.
-     */
-    function safeGETNONCE()
-        internal
-        returns (
-            uint256 _nonce
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmGETNONCE()"
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmSETNONCE call.
-     * @param _nonce New account nonce.
-     */
-    function safeSETNONCE(
-        uint256 _nonce
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSETNONCE(uint256)",
-                _nonce
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe ovmCREATEEOA call.
-     * @param _messageHash Message hash which was signed by EOA
-     * @param _v v value of signature (0 or 1)
-     * @param _r r value of signature
-     * @param _s s value of signature
-     */
-    function safeCREATEEOA(
-        bytes32 _messageHash,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCREATEEOA(bytes32,uint8,bytes32,bytes32)",
-                _messageHash,
-                _v,
-                _r,
-                _s
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe REVERT.
-     * @param _reason String revert reason to pass along with the REVERT.
-     */
-    function safeREVERT(
-        string memory _reason
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmREVERT(bytes)",
-                Lib_ErrorUtils.encodeRevertString(
-                    _reason
-                )
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe "require".
-     * @param _condition Boolean condition that must be true or will revert.
-     * @param _reason String revert reason to pass along with the REVERT.
-     */
-    function safeREQUIRE(
-        bool _condition,
-        string memory _reason
-    )
-        internal
-    {
-        if (!_condition) {
-            safeREVERT(
-                _reason
-            );
-        }
-    }
- 
-    /**
-     * Performs a safe ovmSLOAD call.
-     */
-    function safeSLOAD(
-        bytes32 _key
-    )
-        internal
-        returns (
-            bytes32
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSLOAD(bytes32)",
-                _key
-            )
-        );
- 
-        return abi.decode(returndata, (bytes32));
-    }
- 
-    /**
-     * Performs a safe ovmSSTORE call.
-     */
-    function safeSSTORE(
-        bytes32 _key,
-        bytes32 _value
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSSTORE(bytes32,bytes32)",
-                _key,
-                _value
-            )
-        );
-    }
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Performs an ovm interaction and the necessary safety checks.
-     * @param _gasLimit Gas limit for the interaction.
-     * @param _calldata Data to send to the OVM_ExecutionManager (encoded with sighash).
-     * @return _returndata Data sent back by the OVM_ExecutionManager.
-     */
-    function _safeExecutionManagerInteraction(
-        uint256 _gasLimit,
-        bytes memory _calldata
-    )
-        private
-        returns (
-            bytes memory _returndata
-        )
-    {
-        address ovmExecutionManager = msg.sender;
-        (
-            bool success,
-            bytes memory returndata
-        ) = ovmExecutionManager.call{gas: _gasLimit}(_calldata);
- 
-        if (success == false) {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        } else Iif (returndata.length == 1) {
-            assembly {
-                return(0, 1)
-            }
-        } else {
-            return returndata;
-        }
-    }
- 
-    function _safeExecutionManagerInteraction(
-        bytes memory _calldata
-    )
-        private
-        returns (
-            bytes memory _returndata
-        )
-    {
-        return _safeExecutionManagerInteraction(
-            gasleft(),
-            _calldata
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/wrappers/Lib_SafeMathWrapper.sol.html b/coverage/lcov-report/libraries/wrappers/Lib_SafeMathWrapper.sol.html deleted file mode 100644 index 09c54906c..000000000 --- a/coverage/lcov-report/libraries/wrappers/Lib_SafeMathWrapper.sol.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - Code coverage report for libraries/wrappers/Lib_SafeMathWrapper.sol - - - - - - - -
-
-

- all files / libraries/wrappers/ Lib_SafeMathWrapper.sol -

-
-
- 21.05% - Statements - 4/19 -
-
- 50% - Branches - 1/2 -
-
- 12.5% - Functions - 1/8 -
-
- 21.05% - Lines - 4/19 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// Pulled from @openzeppelin/contracts/math/SafeMath.sol
-// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_SafeExecutionManagerWrapper } from "./Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title Lib_SafeMathWrapper
- */
- 
-/**
- * @dev Wrappers over Solidity's arithmetic operations with added overflow
- * checks.
- *
- * Arithmetic operations in Solidity wrap on overflow. This can easily result
- * in bugs, because programmers usually assume that an overflow raises an
- * error, which is the standard behavior in high level programming languages.
- * `SafeMath` restores this intuition by reverting the transaction when an
- * operation overflows.
- *
- * Using this library instead of the unchecked operations eliminates an entire
- * class of bugs, so it's recommended to use it always.
- */
- 
-library Lib_SafeMathWrapper {
-    /**
-     * @dev Returns the addition of two unsigned integers, reverting on
-     * overflow.
-     *
-     * Counterpart to Solidity's `+` operator.
-     *
-     * Requirements:
-     *
-     * - Addition cannot overflow.
-     */
-    function add(uint256 a, uint256 b) internal returns (uint256) {
-        uint256 c = a + b;
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c >= a, "Lib_SafeMathWrapper: addition overflow");
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the subtraction of two unsigned integers, reverting on
-     * overflow (when the result is negative).
-     *
-     * Counterpart to Solidity's `-` operator.
-     *
-     * Requirements:
-     *
-     * - Subtraction cannot overflow.
-     */
-    function sub(uint256 a, uint256 b) internal returns (uint256) {
-        return sub(a, b, "Lib_SafeMathWrapper: subtraction overflow");
-    }
- 
-    /**
-     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
-     * overflow (when the result is negative).
-     *
-     * Counterpart to Solidity's `-` operator.
-     *
-     * Requirements:
-     *
-     * - Subtraction cannot overflow.
-     */
-    function sub(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b <= a, errorMessage);
-        uint256 c = a - b;
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the multiplication of two unsigned integers, reverting on
-     * overflow.
-     *
-     * Counterpart to Solidity's `*` operator.
-     *
-     * Requirements:
-     *
-     * - Multiplication cannot overflow.
-     */
-    function mul(uint256 a, uint256 b) internal returns (uint256) {
-        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
-        // benefit is lost if 'b' is also tested.
-        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
-        Iif (a == 0) {
-            return 0;
-        }
- 
-        uint256 c = a * b;
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c / a == b, "Lib_SafeMathWrapper: multiplication overflow");
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the integer division of two unsigned integers. Reverts on
-     * division by zero. The result is rounded towards zero.
-     *
-     * Counterpart to Solidity's `/` operator. Note: this function uses a
-     * `revert` opcode (which leaves remaining gas untouched) while Solidity
-     * uses an invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function div(uint256 a, uint256 b) internal returns (uint256) {
-        return div(a, b, "Lib_SafeMathWrapper: division by zero");
-    }
- 
-    /**
-     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
-     * division by zero. The result is rounded towards zero.
-     *
-     * Counterpart to Solidity's `/` operator. Note: this function uses a
-     * `revert` opcode (which leaves remaining gas untouched) while Solidity
-     * uses an invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function div(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b > 0, errorMessage);
-        uint256 c = a / b;
-        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
-     * Reverts when dividing by zero.
-     *
-     * Counterpart to Solidity's `%` operator. This function uses a `revert`
-     * opcode (which leaves remaining gas untouched) while Solidity uses an
-     * invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function mod(uint256 a, uint256 b) internal returns (uint256) {
-        return mod(a, b, "Lib_SafeMathWrapper: modulo by zero");
-    }
- 
-    /**
-     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
-     * Reverts with custom message when dividing by zero.
-     *
-     * Counterpart to Solidity's `%` operator. This function uses a `revert`
-     * opcode (which leaves remaining gas untouched) while Solidity uses an
-     * invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function mod(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b != 0, errorMessage);
-        return a % b;
-    }
-}
-
-
- - - - - - - diff --git a/coverage/lcov-report/libraries/wrappers/index.html b/coverage/lcov-report/libraries/wrappers/index.html deleted file mode 100644 index 4fa651258..000000000 --- a/coverage/lcov-report/libraries/wrappers/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for libraries/wrappers/ - - - - - - - -
-
-

- all files libraries/wrappers/ -

-
-
- 69.39% - Statements - 34/49 -
-
- 75% - Branches - 6/8 -
-
- 70.83% - Functions - 17/24 -
-
- 68% - Lines - 34/50 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_SafeExecutionManagerWrapper.sol
100%30/3083.33%5/6100%16/1696.77%30/31
Lib_SafeMathWrapper.sol
21.05%4/1950%1/212.5%1/821.05%4/19
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html deleted file mode 100644 index bf9e75672..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/accounts/ OVM_ECDSAContractAccount.sol -

-
-
- 93.75% - Statements - 15/16 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 1/1 -
-
- 93.75% - Lines - 15/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  -  - -  -  -  -  -  - - -  -  -  -  -  - - -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
-import { Lib_SafeMathWrapper } from "../../libraries/wrappers/Lib_SafeMathWrapper.sol";
- 
-/**
- * @title OVM_ECDSAContractAccount
- * @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the
- * ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by 
- * providing eth_sign and EIP155 formatted transaction encodings.
- *
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    // TODO: should be the amount sufficient to cover the gas costs of all of the transactions up
-    // to and including the CALL/CREATE which forms the entrypoint of the transaction.
-    uint256 constant EXECUTION_VALIDATION_GAS_OVERHEAD = 25000;
-    address constant ETH_ERC20_ADDRESS = 0x4200000000000000000000000000000000000006;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Executes a signed transaction.
-     * @param _transaction Signed EOA transaction.
-     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     * @return Whether or not the call returned (rather than reverted).
-     * @return Data returned by the call.
-     */
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        override
-        public
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
- 
-        // Address of this contract within the ovm (ovmADDRESS) should be the same as the
-        // recovered address of the user who signed this message. This is how we manage to shim
-        // account abstraction even though the user isn't a contract.
-        // Need to make sure that the transaction nonce is right and bump it if so.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_ECDSAUtils.recover(
-                _transaction,
-                isEthSign,
-                _v,
-                _r,
-                _s
-            ) == Lib_SafeExecutionManagerWrapper.safeADDRESS(),
-            "Signature provided for EOA transaction execution is invalid."
-        );
- 
-        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
- 
-        // Need to make sure that the transaction chainId is correct.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.chainId == Lib_SafeExecutionManagerWrapper.safeCHAINID(),
-            "Transaction chainId does not match expected OVM chainId."
-        );
- 
-        // Need to make sure that the transaction nonce is right.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
-            "Transaction nonce does not match the expected nonce."
-        );
- 
-        // TEMPORARY: Disable gas checks for mainnet.
-        // // Need to make sure that the gas is sufficient to execute the transaction.
-        // Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-        //    gasleft() >= Lib_SafeMathWrapper.add(decodedTx.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD),
-        //    "Gas is not sufficient to execute the transaction."
-        // );
- 
-        // Transfer fee to relayer.
-        address relayer = Lib_SafeExecutionManagerWrapper.safeCALLER();
-        uint256 fee = Lib_SafeMathWrapper.mul(decodedTx.gasLimit, decodedTx.gasPrice);
-        (bool success, ) = Lib_SafeExecutionManagerWrapper.safeCALL(
-            gasleft(),
-            ETH_ERC20_ADDRESS,
-            abi.encodeWithSignature("transfer(address,uint256)", relayer, fee)
-        );
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            success == true,
-            "Fee was not transferred to relayer."
-        );
- 
-        // Contract creations are signalled by sending a transaction to the zero address.
-        if (decodedTx.to == address(0)) {
-            (address created, bytes memory revertData) = Lib_SafeExecutionManagerWrapper.safeCREATE(
-                decodedTx.gasLimit,
-                decodedTx.data
-            );
- 
-            // Return true if the contract creation succeeded, false w/ revertData otherwise.
-            Eif (created != address(0)) {
-                return (true, abi.encode(created));
-            } else {
-                return (false, revertData);
-            }
-        } else {
-            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
-            // the nonce of the calling account. Normally an EOA would bump the nonce for both
-            // cases, but since this is a contract we'd end up bumping the nonce twice.
-            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
- 
-            return Lib_SafeExecutionManagerWrapper.safeCALL(
-                decodedTx.gasLimit,
-                decodedTx.to,
-                decodedTx.data
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html deleted file mode 100644 index ff7ae303f..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/accounts/ OVM_ProxyEOA.sol -

-
-
- 87.5% - Statements - 7/8 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 5/5 -
-
- 88.89% - Lines - 8/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_ProxyEOA
- * @dev The Proxy EOA contract uses a delegate call to execute the logic in an implementation contract.
- * In combination with the logic implemented in the ECDSA Contract Account, this enables a form of upgradable 
- * 'account abstraction' on layer 2. 
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ProxyEOA {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _implementation Address of the initial implementation contract.
-     */
-    constructor(
-        address _implementation
-    )
-    {
-        _setImplementation(_implementation);
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        (bool success, bytes memory returndata) = Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
-            gasleft(),
-            getImplementation(),
-            msg.data
-        );
- 
-        Eif (success) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            Lib_SafeExecutionManagerWrapper.safeREVERT(
-                string(returndata)
-            );
-        }
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Changes the implementation address.
-     * @param _implementation New implementation address.
-     */
-    function upgrade(
-        address _implementation
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_SafeExecutionManagerWrapper.safeADDRESS() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
-            "EOAs can only upgrade their own EOA implementation"
-        );
- 
-        _setImplementation(_implementation);
-    }
- 
-    /**
-     * Gets the address of the current implementation.
-     * @return Current implementation address.
-     */
-    function getImplementation()
-        public
-        returns (
-            address
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                IMPLEMENTATION_KEY
-            )
-        );
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _setImplementation(
-        address _implementation
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            IMPLEMENTATION_KEY,
-            Lib_Bytes32Utils.fromAddress(_implementation)
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/accounts/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/accounts/index.html deleted file mode 100644 index 83293fefa..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/accounts/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/accounts/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/accounts/ -

-
-
- 91.67% - Statements - 22/24 -
-
- 66.67% - Branches - 4/6 -
-
- 100% - Functions - 6/6 -
-
- 92% - Lines - 23/25 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_ECDSAContractAccount.sol
93.75%15/1675%3/4100%1/193.75%15/16
OVM_ProxyEOA.sol
87.5%7/850%1/2100%5/588.89%8/9
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html deleted file mode 100644 index 165d915d8..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/messaging/ Abs_BaseCrossDomainMessenger.sol -

-
-
- 77.78% - Statements - 7/9 -
-
- 50% - Branches - 1/2 -
-
- 80% - Functions - 4/5 -
-
- 77.78% - Lines - 7/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/* Library Imports */
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/**
- * @title Abs_BaseCrossDomainMessenger
- * @dev The Base Cross Domain Messenger is an abstract contract providing the interface and common functionality used in the
- * L1 and L2 Cross Domain Messengers. It can also serve as a template for developers wishing to implement a custom bridge 
- * contract to suit their needs.
- *
- * Compiler used: defined by child contract
- * Runtime target: defined by child contract
- */
-abstract contract Abs_BaseCrossDomainMessenger is iAbs_BaseCrossDomainMessenger, Lib_ReentrancyGuard {
-    /**************
-     *  Constants *
-     **************/
- 
-    // The default x-domain message sender being set to a non-zero value makes
-    // deployment a bit more expensive, but in exchange the refund on every call to
-    // `relayMessage` by the L1 and L2 messengers will be higher.
-    address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    mapping (bytes32 => bool) public relayedMessages;
-    mapping (bytes32 => bool) public successfulMessages;
-    mapping (bytes32 => bool) public sentMessages;
-    uint256 public messageNonce;
-    address internal xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    constructor() Lib_ReentrancyGuard() {}
- 
-    function xDomainMessageSender() public override view returns (address) {
-        Irequire(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set");
-        return xDomainMsgSender;
-    }
- 
-    /**
-     * Sends a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _message Message to send to the target.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function sendMessage(
-        address _target,
-        bytes memory _message,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            msg.sender,
-            _message,
-            messageNonce
-        );
- 
-        messageNonce += 1;
-        sentMessages[keccak256(xDomainCalldata)] = true;
- 
-        _sendXDomainMessage(xDomainCalldata, _gasLimit);
-        emit SentMessage(xDomainCalldata);
-    }
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Generates the correct cross domain calldata for a message.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @return ABI encoded cross domain calldata.
-     */
-    function _getXDomainCalldata(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodeWithSignature(
-            "relayMessage(address,address,bytes,uint256)",
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * param // Message to send.
-     * param // Gas limit for the provided message.
-     */
-    function _sendXDomainMessage(
-        bytes memory, // _message,
-        uint256 // _gasLimit
-    )
-        virtual
-        internal
-    {
-        revert("Implement me in child contracts!");
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html deleted file mode 100644 index 64986d93c..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html +++ /dev/null @@ -1,947 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L1CrossDomainMessenger.sol -

-
-
- 100% - Statements - 30/30 -
-
- 75% - Branches - 12/16 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 31/31 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -12× -12× -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  - -  -  -  -  - - - -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_AddressManager } from "../../../libraries/resolver/Lib_AddressManager.sol";
-import { Lib_SecureMerkleTrie } from "../../../libraries/trie/Lib_SecureMerkleTrie.sol";
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-import { iOVM_CanonicalTransactionChain } from "../../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_StateCommitmentChain } from "../../../iOVM/chain/iOVM_StateCommitmentChain.sol";
- 
-/* Contract Imports */
-import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_L1CrossDomainMessenger
- * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. 
- * In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted 
- * via this contract's replay function. 
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * Pass a default zero address to the address resolver. This will be updated when initialized.
-     */
-    constructor()
-        Lib_AddressResolver(address(0))
-    {}
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    function initialize(
-        address _libAddressManager
-    )
-        public
-    {
-        Erequire(address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized.");
-        libAddressManager = Lib_AddressManager(_libAddressManager);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may successfully call a method.
-     */
-    modifier onlyRelayer() {
-        address relayer = resolve("OVM_L2MessageRelayer");
-        if (relayer != address(0)) {
-            Irequire(
-                msg.sender == relayer,
-                "Only OVM_L2MessageRelayer can relay L2-to-L1 messages."
-            );
-        }
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @inheritdoc iOVM_L1CrossDomainMessenger
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        L2MessageInclusionProof memory _proof
-    )
-        override
-        public
-        nonReentrant
-        onlyRelayer()
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        require(
-            _verifyXDomainMessage(
-                xDomainCalldata,
-                _proof
-            ) == true,
-            "Provided message could not be verified."
-        );
- 
-        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
- 
-        require(
-            successfulMessages[xDomainCalldataHash] == false,
-            "Provided message has already been received."
-        );
- 
-        xDomainMsgSender = _sender;
-        (bool success, ) = _target.call(_message);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-        // Mark the message as received if the call was successful. Ensures that a message can be
-        // relayed multiple times in the case that the call reverted.
-        Eif (success == true) {
-            successfulMessages[xDomainCalldataHash] = true;
-            emit RelayedMessage(xDomainCalldataHash);
-        }
- 
-        // Store an identifier that can be used to prove that the given message was relayed by some
-        // user. Gives us an easy way to pay relayers for their work.
-        bytes32 relayId = keccak256(
-            abi.encodePacked(
-                xDomainCalldata,
-                msg.sender,
-                block.number
-            )
-        );
-        relayedMessages[relayId] = true;
-    }
- 
-    /**
-     * Replays a cross domain message to the target messenger.
-     * @inheritdoc iOVM_L1CrossDomainMessenger
-     */
-    function replayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        require(
-            sentMessages[keccak256(xDomainCalldata)] == true,
-            "Provided message has not already been sent."
-        );
- 
-        _sendXDomainMessage(xDomainCalldata, _gasLimit);
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Verifies that the given message is valid.
-     * @param _xDomainCalldata Calldata to verify.
-     * @param _proof Inclusion proof for the message.
-     * @return Whether or not the provided message is valid.
-     */
-    function _verifyXDomainMessage(
-        bytes memory _xDomainCalldata,
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        return (
-            _verifyStateRootProof(_proof)
-            && _verifyStorageProof(_xDomainCalldata, _proof)
-        );
-    }
- 
-    /**
-     * Verifies that the state root within an inclusion proof is valid.
-     * @param _proof Message inclusion proof.
-     * @return Whether or not the provided proof is valid.
-     */
-    function _verifyStateRootProof(
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
- 
-        return (
-            ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) == false
-            && ovmStateCommitmentChain.verifyStateCommitment(
-                _proof.stateRoot,
-                _proof.stateRootBatchHeader,
-                _proof.stateRootProof
-            )
-        );
-    }
- 
-    /**
-     * Verifies that the storage proof within an inclusion proof is valid.
-     * @param _xDomainCalldata Encoded message calldata.
-     * @param _proof Message inclusion proof.
-     * @return Whether or not the provided proof is valid.
-     */
-    function _verifyStorageProof(
-        bytes memory _xDomainCalldata,
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 storageKey = keccak256(
-            abi.encodePacked(
-                keccak256(
-                    abi.encodePacked(
-                        _xDomainCalldata,
-                        resolve("OVM_L2CrossDomainMessenger")
-                    )
-                ),
-                uint256(0)
-            )
-        );
- 
-        (
-            bool exists,
-            bytes memory encodedMessagePassingAccount
-        ) = Lib_SecureMerkleTrie.get(
-            abi.encodePacked(0x4200000000000000000000000000000000000000),
-            _proof.stateTrieWitness,
-            _proof.stateRoot
-        );
- 
-        Erequire(
-            exists == true,
-            "Message passing predeploy has not been initialized or invalid proof provided."
-        );
- 
-        Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
-            encodedMessagePassingAccount
-        );
- 
-        return Lib_SecureMerkleTrie.verifyInclusionProof(
-            abi.encodePacked(storageKey),
-            abi.encodePacked(uint8(1)),
-            _proof.storageTrieWitness,
-            account.storageRoot
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * @param _message Message to send.
-     * @param _gasLimit OVM gas limit for the message.
-     */
-    function _sendXDomainMessage(
-        bytes memory _message,
-        uint256 _gasLimit
-    )
-        override
-        internal
-    {
-        iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).enqueue(
-            resolve("OVM_L2CrossDomainMessenger"),
-            _gasLimit,
-            _message
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html deleted file mode 100644 index 71f510689..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L1MultiMessageRelayer.sol -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 6/6 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-import { iOVM_L1MultiMessageRelayer } from "../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol";
- 
-/* Contract Imports */
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
- 
- 
-/**
- * @title OVM_L1MultiMessageRelayer
- * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the 
- * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain
- * Message Sender.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
-    constructor(
-        address _libAddressManager
-    ) 
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyBatchRelayer() {
-        require(
-            msg.sender == resolve("OVM_L2BatchMessageRelayer"),
-            "OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer"
-        );
-        _;
-    }
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying
-     * @param _messages An array of L2 to L1 messages
-     */
-    function batchRelayMessages(L2ToL1Message[] calldata _messages) 
-        override
-        external
-        onlyBatchRelayer 
-    {
-        iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(resolve("Proxy__OVM_L1CrossDomainMessenger"));
-        for (uint256 i = 0; i < _messages.length; i++) {
-            L2ToL1Message memory message = _messages[i];
-            messenger.relayMessage(
-                message.target,
-                message.sender,
-                message.message,
-                message.messageNonce,
-                message.proof
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html deleted file mode 100644 index a646692ae..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L2CrossDomainMessenger.sol -

-
-
- 100% - Statements - 14/14 -
-
- 83.33% - Branches - 5/6 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 14/14 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  - -  - -  -  -  -  - - - -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/* Interface Imports */
-import { iOVM_L2CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol";
-import { iOVM_L1MessageSender } from "../../../iOVM/predeploys/iOVM_L1MessageSender.sol";
-import { iOVM_L2ToL1MessagePasser } from "../../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
- 
-/* Contract Imports */
-import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_L2CrossDomainMessenger
- * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point
- * for L2 messages sent via the L1 Cross Domain Messenger.
- * 
- * Compiler used: optimistic-solc
- * Runtime target: OVM
-  */
-contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @inheritdoc iOVM_L2CrossDomainMessenger
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    )
-        override
-        nonReentrant
-        public
-    {
-        require(
-            _verifyXDomainMessage() == true,
-            "Provided message could not be verified."
-        );
- 
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
- 
-        require(
-            successfulMessages[xDomainCalldataHash] == false,
-            "Provided message has already been received."
-        );
- 
-        xDomainMsgSender = _sender;
-        (bool success, ) = _target.call(_message);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-        // Mark the message as received if the call was successful. Ensures that a message can be
-        // relayed multiple times in the case that the call reverted.
-        Eif (success == true) {
-            successfulMessages[xDomainCalldataHash] = true;
-            emit RelayedMessage(xDomainCalldataHash);
-        }
- 
-        // Store an identifier that can be used to prove that the given message was relayed by some
-        // user. Gives us an easy way to pay relayers for their work.
-        bytes32 relayId = keccak256(
-            abi.encodePacked(
-                xDomainCalldata,
-                msg.sender,
-                block.number
-            )
-        );
-        relayedMessages[relayId] = true;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Verifies that a received cross domain message is valid.
-     * @return _valid Whether or not the message is valid.
-     */
-    function _verifyXDomainMessage()
-        view
-        internal
-        returns (
-            bool _valid
-        )
-    {
-        return (
-            iOVM_L1MessageSender(resolve("OVM_L1MessageSender")).getL1MessageSender() == resolve("OVM_L1CrossDomainMessenger")
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * @param _message Message to send.
-     * param _gasLimit Gas limit for the provided message.
-     */
-    function _sendXDomainMessage(
-        bytes memory _message,
-        uint256 // _gasLimit
-    )
-        override
-        internal
-    {
-        iOVM_L2ToL1MessagePasser(resolve("OVM_L2ToL1MessagePasser")).passMessageToL1(_message);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/index.html deleted file mode 100644 index 69677e4b5..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/messaging/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/bridge/messaging/ -

-
-
- 96.55% - Statements - 56/58 -
-
- 76.92% - Branches - 20/26 -
-
- 95.24% - Functions - 20/21 -
-
- 96.67% - Lines - 58/60 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_BaseCrossDomainMessenger.sol
77.78%7/950%1/280%4/577.78%7/9
OVM_L1CrossDomainMessenger.sol
100%30/3075%12/16100%9/9100%31/31
OVM_L1MultiMessageRelayer.sol
100%5/5100%2/2100%3/3100%6/6
OVM_L2CrossDomainMessenger.sol
100%14/1483.33%5/6100%4/4100%14/14
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html deleted file mode 100644 index 6be8e110e..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html +++ /dev/null @@ -1,692 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ Abs_L1TokenGateway.sol -

-
-
- 83.33% - Statements - 10/12 -
-
- 100% - Branches - 0/0 -
-
- 75% - Functions - 6/8 -
-
- 83.33% - Lines - 10/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm 
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
- 
-/**
- * @title Abs_L1TokenGateway
- * @dev An L1 Token Gateway is a contract which stores deposited L1 funds that are in use on L2.
- * It synchronizes a corresponding L2 representation of the "deposited token", informing it
- * of new deposits and releasing L1 funds when there are newly finalized withdrawals.
- *
- * NOTE: This abstract contract gives all the core functionality of an L1 token gateway, 
- * but provides easy hooks in case developers need extensions in child contracts.
- * In many cases, the default OVM_L1ERC20Gateway will suffice.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-abstract contract Abs_L1TokenGateway is iOVM_L1TokenGateway, OVM_CrossDomainEnabled {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    address public l2DepositedToken;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l2DepositedToken iOVM_L2DepositedToken-compatible address on the chain being deposited into.
-     * @param _l1messenger L1 Messenger address being used for cross-chain communications.
-     */
-    constructor(
-        address _l2DepositedToken,
-        address _l1messenger 
-    )
-        OVM_CrossDomainEnabled(_l1messenger)
-    {
-        l2DepositedToken = _l2DepositedToken;
-    }
- 
-    /********************************
-     * Overridable Accounting logic *
-     ********************************/
- 
-    // Default gas value which can be overridden if more complex logic runs on L2.
-    uint32 public DEFAULT_FINALIZE_DEPOSIT_L2_GAS = 1200000;
- 
-    /**
-     * @dev Core logic to be performed when a withdrawal is finalized on L1.
-     * In most cases, this will simply send locked funds to the withdrawer.
-     *
-     * param _to Address being withdrawn to.
-     * param _amount Amount being withdrawn.
-     */
-    function _handleFinalizeWithdrawal(
-        address, // _to,
-        uint256 // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Implement me in child contracts");
-    }
- 
-    /**
-     * @dev Core logic to be performed when a deposit is initiated on L1.
-     * In most cases, this will simply send locked funds to the withdrawer.
-     *
-     * param _from Address being deposited from on L1.
-     * param _to Address being deposited into on L2.
-     * param _amount Amount being deposited.
-     */
-    function _handleInitiateDeposit(
-        address, // _from,
-        address, // _to,
-        uint256 // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Implement me in child contracts");
-    }
- 
-    /**
-     * @dev Overridable getter for the L2 gas limit, in the case it may be
-     * dynamic, and the above public constant does not suffice.
-     *
-     */
- 
-    function getFinalizeDepositL2Gas()
-        public
-        view
-        returns(
-            uint32
-        )
-    {
-        return DEFAULT_FINALIZE_DEPOSIT_L2_GAS;
-    }
- 
-    /**************
-     * Depositing *
-     **************/
- 
-    /**
-     * @dev deposit an amount of the ERC20 to the caller's balance on L2
-     * @param _amount Amount of the ERC20 to deposit
-     */
-    function deposit(
-        uint _amount
-    )
-        public
-        override
-    {
-        _initiateDeposit(msg.sender, msg.sender, _amount);
-    }
- 
-    /**
-     * @dev deposit an amount of ERC20 to a recipients's balance on L2
-     * @param _to L2 address to credit the withdrawal to
-     * @param _amount Amount of the ERC20 to deposit
-     */
-    function depositTo(
-        address _to,
-        uint _amount
-    )
-        public
-        override
-    {
-        _initiateDeposit(msg.sender, _to, _amount);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by informing the L2 Deposited Token
-     * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)
-     *
-     * @param _from Account to pull the deposit from on L1
-     * @param _to Account to give the deposit to on L2
-     * @param _amount Amount of the ERC20 to deposit.
-     */
-    function _initiateDeposit(
-        address _from,
-        address _to,
-        uint _amount
-    )
-        internal
-    {
-        // Call our deposit accounting handler implemented by child contracts.
-        _handleInitiateDeposit(
-            _from,
-            _to,
-            _amount
-        );
- 
-        // Construct calldata for l2DepositedToken.finalizeDeposit(_to, _amount)
-        bytes memory data = abi.encodeWithSelector(
-            iOVM_L2DepositedToken.finalizeDeposit.selector,
-            _to,
-            _amount
-        );
- 
-        // Send calldata into L2
-        sendCrossDomainMessage(
-            l2DepositedToken,
-            data,
-            getFinalizeDepositL2Gas()
-        );
- 
-        emit DepositInitiated(_from, _to, _amount);
-    }
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    /**
-     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the 
-     * L1 ERC20 token. 
-     * This call will fail if the initialized withdrawal from L2 has not been finalized. 
-     *
-     * @param _to L1 address to credit the withdrawal to
-     * @param _amount Amount of the ERC20 to withdraw
-     */
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external
-        override 
-        onlyFromCrossDomainAccount(l2DepositedToken)
-    {
-        // Call our withdrawal accounting handler implemented by child contracts.
-        _handleFinalizeWithdrawal(
-            _to,
-            _amount
-        );
- 
-        emit WithdrawalFinalized(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html deleted file mode 100644 index a16bb0653..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html +++ /dev/null @@ -1,755 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ Abs_L2DepositedToken.sol -

-
-
- 86.67% - Statements - 13/15 -
-
- 50% - Branches - 2/4 -
-
- 80% - Functions - 8/10 -
-
- 87.5% - Lines - 14/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  - -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
- 
-/**
- * @title Abs_L2DepositedToken
- * @dev An L2 Deposited Token is an L2 representation of funds which were deposited from L1.
- * Usually contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
- * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
- *
- * NOTE: This abstract contract gives all the core functionality of a deposited token implementation except for the
- * token's internal accounting itself.  This gives developers an easy way to implement children with their own token code.
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-abstract contract Abs_L2DepositedToken is iOVM_L2DepositedToken, OVM_CrossDomainEnabled {
- 
-    /*******************
-     * Contract Events *
-     *******************/
- 
-    event Initialized(iOVM_L1TokenGateway _l1TokenGateway);
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    iOVM_L1TokenGateway public l1TokenGateway;
- 
-    /********************************
-     * Constructor & Initialization *
-     ********************************/
- 
-    /**
-     * @param _l2CrossDomainMessenger L1 Messenger address being used for cross-chain communications.
-     */
-    constructor(
-        address _l2CrossDomainMessenger
-    )
-        OVM_CrossDomainEnabled(_l2CrossDomainMessenger)
-    {}
- 
-    /**
-     * @dev Initialize this contract with the L1 token gateway address.
-     * The flow: 1) this contract gets deployed on L2, 2) the L1
-     * gateway is deployed with addr from (1), 3) L1 gateway address passed here.
-     *
-     * @param _l1TokenGateway Address of the corresponding L1 gateway deployed to the main chain
-     */
- 
-    function init(
-        iOVM_L1TokenGateway _l1TokenGateway
-    )
-        public
-    {
-        Erequire(address(l1TokenGateway) == address(0), "Contract has already been initialized");
- 
-        l1TokenGateway = _l1TokenGateway;
-        
-        emit Initialized(l1TokenGateway);
-    }
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyInitialized() {
-        Erequire(address(l1TokenGateway) != address(0), "Contract has not yet been initialized");
-        _;
-    }
- 
-    /********************************
-     * Overridable Accounting logic *
-     ********************************/
- 
-    // Default gas value which can be overridden if more complex logic runs on L2.
-    uint32 constant DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS = 100000;
- 
-    /**
-     * @dev Core logic to be performed when a withdrawal from L2 is initialized.
-     * In most cases, this will simply burn the withdrawn L2 funds.
-     *
-     * param _to Address being withdrawn to
-     * param _amount Amount being withdrawn
-     */
- 
-    function _handleInitiateWithdrawal(
-        address, // _to,
-        uint // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Accounting must be implemented by child contract.");
-    }
- 
-    /**
-     * @dev Core logic to be performed when a deposit from L2 is finalized on L2.
-     * In most cases, this will simply _mint() to credit L2 funds to the recipient.
-     *
-     * param _to Address being deposited to on L2
-     * param _amount Amount which was deposited on L1
-     */
-    function _handleFinalizeDeposit(
-        address, // _to
-        uint // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Accounting must be implemented by child contract.");
-    }
- 
-    /**
-     * @dev Overridable getter for the *L1* gas limit of settling the withdrawal, in the case it may be
-     * dynamic, and the above public constant does not suffice.
-     *
-     */
- 
-    function getFinalizeWithdrawalL1Gas()
-        public
-        view
-        virtual
-        returns(
-            uint32
-        )
-    {
-        return DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS;
-    }
- 
- 
-    /***************
-     * Withdrawing *
-     ***************/
- 
-    /**
-     * @dev initiate a withdraw of some tokens to the caller's account on L1
-     * @param _amount Amount of the token to withdraw
-     */
-    function withdraw(
-        uint _amount
-    )
-        external
-        override
-        onlyInitialized()
-    {
-        _initiateWithdrawal(msg.sender, _amount);
-    }
- 
-    /**
-     * @dev initiate a withdraw of some token to a recipient's account on L1
-     * @param _to L1 adress to credit the withdrawal to
-     * @param _amount Amount of the token to withdraw
-     */
-    function withdrawTo(
-        address _to,
-        uint _amount
-    )
-        external
-        override
-        onlyInitialized()
-    {
-        _initiateWithdrawal(_to, _amount);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by storing the token and informing the L2 token Gateway of the deposit.
-     *
-     * @param _to Account to give the withdrawal to on L1
-     * @param _amount Amount of the token to withdraw
-     */
-    function _initiateWithdrawal(
-        address _to,
-        uint _amount
-    )
-        internal
-    {
-        // Call our withdrawal accounting handler implemented by child contracts (usually a _burn)
-        _handleInitiateWithdrawal(_to, _amount);
- 
-        // Construct calldata for l1TokenGateway.finalizeWithdrawal(_to, _amount)
-        bytes memory data = abi.encodeWithSelector(
-            iOVM_L1TokenGateway.finalizeWithdrawal.selector,
-            _to,
-            _amount
-        );
- 
-        // Send message up to L1 gateway
-        sendCrossDomainMessage(
-            address(l1TokenGateway),
-            data,
-            getFinalizeWithdrawalL1Gas()
-        );
- 
-        emit WithdrawalInitiated(msg.sender, _to, _amount);
-    }
- 
-    /************************************
-     * Cross-chain Function: Depositing *
-     ************************************/
- 
-    /**
-     * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this 
-     * L2 token. 
-     * This call will fail if it did not originate from a corresponding deposit in OVM_l1TokenGateway. 
-     *
-     * @param _to Address to receive the withdrawal at
-     * @param _amount Amount of the token to withdraw
-     */
-    function finalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        external
-        override 
-        onlyInitialized()
-        onlyFromCrossDomainAccount(address(l1TokenGateway))
-    {
-        _handleFinalizeDeposit(_to, _amount);
-        emit DepositFinalized(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html deleted file mode 100644 index d1b1fb47f..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L1ERC20Gateway.sol -

-
-
- 100% - Statements - 3/3 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 3/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm 
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
-import { Abs_L1TokenGateway } from "./Abs_L1TokenGateway.sol";
-import { iOVM_ERC20 } from "../../../iOVM/predeploys/iOVM_ERC20.sol";
- 
-/**
- * @title OVM_L1ERC20Gateway
- * @dev The L1 ERC20 Gateway is a contract which stores deposited L1 funds that are in use on L2.
- * It synchronizes a corresponding L2 ERC20 Gateway, informing it of deposits, and listening to it
- * for newly finalized withdrawals.
- *
- * NOTE: This contract extends Abs_L1TokenGateway, which is where we
- * takes care of most of the initialization and the cross-chain logic.
- * If you are looking to implement your own deposit/withdrawal contracts, you
- * may also want to extend the abstract contract in a similar manner.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1ERC20Gateway is Abs_L1TokenGateway {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
-    
-    iOVM_ERC20 public l1ERC20;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l1ERC20 L1 ERC20 address this contract stores deposits for
-     * @param _l2DepositedERC20 L2 Gateway address on the chain being deposited into
-     */
-    constructor(
-        iOVM_ERC20 _l1ERC20,
-        address _l2DepositedERC20,
-        address _l1messenger 
-    )
-        Abs_L1TokenGateway(
-            _l2DepositedERC20,
-            _l1messenger
-        )
-    {
-        l1ERC20 = _l1ERC20;
-    }
- 
- 
-    /**************
-     * Accounting *
-     **************/
- 
-    /**
-     * @dev When a deposit is initiated on L1, the L1 Gateway
-     * transfers the funds to itself for future withdrawals
-     *
-     * @param _from L1 address ETH is being deposited from
-     * param _to L2 address that the ETH is being deposited to
-     * @param _amount Amount of ERC20 to send
-     */
-    function _handleInitiateDeposit(
-        address _from,
-        address, // _to,
-        uint256 _amount
-    )
-        internal
-        override
-    {
-         // Hold on to the newly deposited funds
-        l1ERC20.transferFrom(
-            _from,
-            address(this),
-            _amount
-        );
-    }
- 
-    /**
-     * @dev When a withdrawal is finalized on L1, the L1 Gateway
-     * transfers the funds to the withdrawer
-     *
-     * @param _to L1 address that the ERC20 is being withdrawn to
-     * @param _amount Amount of ERC20 to send
-     */
-    function _handleFinalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        // Transfer withdrawn funds out to withdrawer
-        l1ERC20.transfer(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html deleted file mode 100644 index 64267feef..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html +++ /dev/null @@ -1,557 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L1ETHGateway.sol -

-
-
- 100% - Statements - 11/11 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 6/6 -
-
- 91.67% - Lines - 11/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1ETHGateway } from "../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol";
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/**
- * @title OVM_L1ETHGateway
- * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {
- 
-    /********************
-     * Public Constants *
-     ********************/
- 
-    uint32 public constant override getFinalizeDepositL2Gas = 1200000;
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    address public ovmEth;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address manager for this OE deployment
-     * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken
-     */
-    constructor(
-        address _libAddressManager,
-        address _ovmEth
-    )
-        OVM_CrossDomainEnabled(address(0)) // overridden in constructor code
-        Lib_AddressResolver(_libAddressManager)
-    {
-        ovmEth = _ovmEth;
-        messenger = resolve("Proxy__OVM_L1CrossDomainMessenger"); // overrides OVM_CrossDomainEnabled constructor setting because resolve() is not yet accessible
-    }
- 
-    /**************
-     * Depositing *
-     **************/
- 
-    receive()
-        external
-        payable
-    {
-        _initiateDeposit(msg.sender, msg.sender);
-    }
- 
-    /**
-     * @dev deposit an amount of the ETH to the caller's balance on L2
-     */
-    function deposit() 
-        external
-        override
-        payable
-    {
-        _initiateDeposit(msg.sender, msg.sender);
-    }
- 
-    /**
-     * @dev deposit an amount of ETH to a recipients's balance on L2
-     * @param _to L2 address to credit the withdrawal to
-     */
-    function depositTo(
-        address _to
-    )
-        external
-        override
-        payable
-    {
-        _initiateDeposit(msg.sender, _to);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.
-     *
-     * @param _from Account to pull the deposit from on L1
-     * @param _to Account to give the deposit to on L2
-     */
-    function _initiateDeposit(
-        address _from,
-        address _to
-    )
-        internal
-    {
-        // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)
-        bytes memory data =
-            abi.encodeWithSelector(
-                iOVM_L2DepositedToken.finalizeDeposit.selector,
-                _to,
-                msg.value
-            );
- 
-        // Send calldata into L2
-        sendCrossDomainMessage(
-            ovmEth,
-            data,
-            getFinalizeDepositL2Gas
-        );
- 
-        emit DepositInitiated(_from, _to, msg.value);
-    }
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    /**
-     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the
-     * L1 ETH token.
-     * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized. 
-     *
-     * @param _to L1 address to credit the withdrawal to
-     * @param _amount Amount of the ETH to withdraw
-     */
-    function finalizeWithdrawal(
-        address _to,
-        uint256 _amount
-    )
-        external
-        override
-        onlyFromCrossDomainAccount(ovmEth)
-    {
-        _safeTransferETH(_to, _amount);
- 
-        emit WithdrawalFinalized(_to, _amount);
-    }
- 
-    /**********************************
-     * Internal Functions: Accounting *
-     **********************************/
- 
-    /**
-     * @dev Internal accounting function for moving around L1 ETH.
-     *
-     * @param _to L1 address to transfer ETH to
-     * @param _value Amount of ETH to send to
-     */
-    function _safeTransferETH(
-        address _to,
-        uint256 _value
-    )
-        internal
-    {
-        (bool success, ) = _to.call{value: _value}(new bytes(0));
-        Erequire(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html deleted file mode 100644 index 703ace05a..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L2DepositedERC20.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Contract Imports */
-import { UniswapV2ERC20 } from "../../../libraries/standards/UniswapV2ERC20.sol";
- 
-/* Library Imports */
-import { Abs_L2DepositedToken } from "./Abs_L2DepositedToken.sol";
- 
-/**
- * @title OVM_L2DepositedERC20
- * @dev The L2 Deposited ERC20 is an ERC20 implementation which represents L1 assets deposited into L2.
- * This contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
- * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
- *
- * NOTE: This contract implements the Abs_L2DepositedToken contract using Uniswap's ERC20 as the implementation.
- * Alternative implementations can be used in this similar manner.
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract OVM_L2DepositedERC20 is Abs_L2DepositedToken, UniswapV2ERC20 {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.
-     * @param _name ERC20 name
-     * @param _symbol ERC20 symbol
-     */
-    constructor(
-        address _l2CrossDomainMessenger,
-        string memory _name,
-        string memory _symbol
-    )
-        Abs_L2DepositedToken(_l2CrossDomainMessenger)
-        UniswapV2ERC20(_name, _symbol)
-    {}
- 
-    // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2 usage.
-    function _handleInitiateWithdrawal(
-        address, // _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        _burn(msg.sender, _amount);
-    }
- 
-    // When a deposit is finalized, we credit the account on L2 with the same amount of tokens.
-    function _handleFinalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        _mint(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/index.html deleted file mode 100644 index 6d14f7c59..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/bridge/tokens/index.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/bridge/tokens/ -

-
-
- 90.7% - Statements - 39/43 -
-
- 50% - Branches - 3/6 -
-
- 86.67% - Functions - 26/30 -
-
- 88.89% - Lines - 40/45 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_L1TokenGateway.sol
83.33%10/12100%0/075%6/883.33%10/12
Abs_L2DepositedToken.sol
86.67%13/1550%2/480%8/1087.5%14/16
OVM_L1ERC20Gateway.sol
100%3/3100%0/0100%3/3100%3/3
OVM_L1ETHGateway.sol
100%11/1150%1/2100%6/691.67%11/12
OVM_L2DepositedERC20.sol
100%2/2100%0/0100%3/3100%2/2
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html deleted file mode 100644 index a87b5bba5..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html +++ /dev/null @@ -1,3755 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/chain/ OVM_CanonicalTransactionChain.sol -

-
-
- 95.51% - Statements - 149/156 -
-
- 87.5% - Branches - 63/72 -
-
- 84.38% - Functions - 27/32 -
-
- 95.88% - Lines - 163/170 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -228× -228× -228× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -595× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -388× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -309× -309× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -106× -106× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -47× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -239× -  -  -  -  -238× -  -  -  -  -237× -  -  -  -  -  -  -  -236× -236× -  -  -  -236× -  -  -  -  -  -  -235× -235× -37600× -  -  -235× -  -  -  -  -  -  -  -  -235× -235× -  -  -  -  -235× -  -235× -235× -  -  -  -  -235× -235× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -110× -110× -110× -110× -  -  -  -  -  -110× -  -  -  -  -109× -  -  -  -  -108× -  -  -  -  -107× -  -  -  -  -106× -  -106× -  -  -  -  -  -  -  -106× -106× -  -  -  -  -106× -  -  -106× -  -  -106× -  -  -106× -  -  -  -106× -  -106× -106× -835× -  -835× -  -106× -  -  -  -829× -  -  -  -  -  -  -  -824× -  -  -824× -1639× -1639× -  -  -  -1639× -  -  -  -  -  -  -1639× -1639× -1639× -  -  -  -824× -179× -  -  -  -  -178× -178× -178× -  -  -  -94× -  -  -  -  -  -  -88× -  -  -  -  -87× -  -  -  -  -  -87× -87× -87× -87× -  -45× -45× -  -  -  -  -  -42× -  -  -  -  -42× -42× -  -  -  -  -  -87× -  -  -  -  -  -  -  -87× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -835× -835× -835× -835× -835× -  -835× -  -  -  -  -  -  -835× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -506× -  -506× -506× -506× -506× -506× -  -  -  -  -  -  -  -506× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -87× -87× -  -  -  -  -  -  -  -87× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -179× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -267× -267× -265× -  -265× -265× -265× -  -  -  -  -265× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -106× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1639× -419× -  -  -1639× -1639× -  -1639× -1639× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1639× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -87× -87× -  -87× -  -  -  -  -  -  -  -87× -  -  -  -  -  -  -  -87× -87× -  -  -  -  -  -  -87× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -106× - -  - -  -  -  -  - -  -  -  -  -  -  -102× -  -  -  -  -101× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -178× -  -  -  -  -  -177× -  -  -  -  -  -  -176× -  -  -  -  -174× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -829× -  -  -  -  -828× -  -  -  -  -  -827× -175× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -94× - -  -  -  -  -  -  -91× -89× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -179× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
-import { Lib_Math } from "../../libraries/utils/Lib_Math.sol";
- 
-/* Interface Imports */
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/* Contract Imports */
-import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
- 
- 
-/**
- * @title OVM_CanonicalTransactionChain
- * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions
- * which must be applied to the rollup state. It defines the ordering of rollup transactions by
- * writing them to the 'CTC:batches' instance of the Chain Storage Container.
- * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer
- * will eventually append it to the rollup state.
- * If the Sequencer does not include an enqueued transaction within the 'force inclusion period',
- * then any account may force it to be included by calling appendQueueBatch().
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_AddressResolver {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    // L2 tx gas-related
-    uint256 constant public MIN_ROLLUP_TX_GAS = 100000;
-    uint256 constant public MAX_ROLLUP_TX_SIZE = 10000;
-    uint256 constant public L2_GAS_DISCOUNT_DIVISOR = 32;
- 
-    // Encoding-related (all in bytes)
-    uint256 constant internal BATCH_CONTEXT_SIZE = 16;
-    uint256 constant internal BATCH_CONTEXT_LENGTH_POS = 12;
-    uint256 constant internal BATCH_CONTEXT_START_POS = 15;
-    uint256 constant internal TX_DATA_HEADER_SIZE = 3;
-    uint256 constant internal BYTES_TILL_TX_DATA = 65;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    uint256 public forceInclusionPeriodSeconds;
-    uint256 public forceInclusionPeriodBlocks;
-    uint256 public maxTransactionGasLimit;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    constructor(
-        address _libAddressManager,
-        uint256 _forceInclusionPeriodSeconds,
-        uint256 _forceInclusionPeriodBlocks,
-        uint256 _maxTransactionGasLimit
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        forceInclusionPeriodSeconds = _forceInclusionPeriodSeconds;
-        forceInclusionPeriodBlocks = _forceInclusionPeriodBlocks;
-        maxTransactionGasLimit = _maxTransactionGasLimit;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        override
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:CTC:batches")
-        );
-    }
- 
-    /**
-     * Accesses the queue storage container.
-     * @return Reference to the queue storage container.
-     */
-    function queue()
-        override
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:CTC:queue")
-        );
-    }
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        override
-        public
-        view
-        returns (
-            uint256 _totalElements
-        )
-    {
-        (uint40 totalElements,,,) = _getBatchExtraData();
-        return uint256(totalElements);
-    }
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        override
-        public
-        view
-        returns (
-            uint256 _totalBatches
-        )
-    {
-        return batches().length();
-    }
- 
-    /**
-     * Returns the index of the next element to be enqueued.
-     * @return Index for the next queue element.
-     */
-    function getNextQueueIndex()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,uint40 nextQueueIndex,,) = _getBatchExtraData();
-        return nextQueueIndex;
-    }
- 
-    /**
-     * Returns the timestamp of the last transaction.
-     * @return Timestamp for the last transaction.
-     */
-    function getLastTimestamp()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,,uint40 lastTimestamp,) = _getBatchExtraData();
-        return lastTimestamp;
-    }
- 
-    /**
-     * Returns the blocknumber of the last transaction.
-     * @return Blocknumber for the last transaction.
-     */
-    function getLastBlockNumber()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,,,uint40 lastBlockNumber) = _getBatchExtraData();
-        return lastBlockNumber;
-    }
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function getQueueElement(
-        uint256 _index
-    )
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        )
-    {
-        return _getQueueElement(
-            _index,
-            queue()
-        );
-    }
- 
-    /**
-     * Get the number of queue elements which have not yet been included.
-     * @return Number of pending queue elements.
-     */
-    function getNumPendingQueueElements()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        return getQueueLength() - getNextQueueIndex();
-    }
- 
-   /**
-     * Retrieves the length of the queue, including
-     * both pending and canonical transactions.
-     * @return Length of the queue.
-     */
-    function getQueueLength()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        return _getQueueLength(
-            queue()
-        );
-    }
- 
-    /**
-     * Adds a transaction to the queue.
-     * @param _target Target L2 contract to send the transaction to.
-     * @param _gasLimit Gas limit for the enqueued L2 transaction.
-     * @param _data Transaction data.
-     */
-    function enqueue(
-        address _target,
-        uint256 _gasLimit,
-        bytes memory _data
-    )
-        override
-        public
-    {
-        require(
-            _data.length <= MAX_ROLLUP_TX_SIZE,
-            "Transaction data size exceeds maximum for rollup transaction."
-        );
- 
-        require(
-            _gasLimit <= maxTransactionGasLimit,
-            "Transaction gas limit exceeds maximum for rollup transaction."
-        );
- 
-        require(
-            _gasLimit >= MIN_ROLLUP_TX_GAS,
-            "Transaction gas limit too low to enqueue."
-        );
- 
-        // We need to consume some amount of L1 gas in order to rate limit transactions going into
-        // L2. However, L2 is cheaper than L1 so we only need to burn some small proportion of the
-        // provided L1 gas.
-        uint256 gasToConsume = _gasLimit/L2_GAS_DISCOUNT_DIVISOR;
-        uint256 startingGas = gasleft();
- 
-        // Although this check is not necessary (burn below will run out of gas if not true), it
-        // gives the user an explicit reason as to why the enqueue attempt failed.
-        require(
-            startingGas > gasToConsume,
-            "Insufficient gas for L2 rate limiting burn."
-        );
- 
-        // Here we do some "dumb" work in order to burn gas, although we should probably replace
-        // this with something like minting gas token later on.
-        uint256 i;
-        while(startingGas - gasleft() < gasToConsume) {
-            i++;
-        }
- 
-        bytes32 transactionHash = keccak256(
-            abi.encode(
-                msg.sender,
-                _target,
-                _gasLimit,
-                _data
-            )
-        );
- 
-        bytes32 timestampAndBlockNumber;
-        assembly {
-            timestampAndBlockNumber := timestamp()
-            timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
-        }
- 
-        iOVM_ChainStorageContainer queueRef = queue();
- 
-        queueRef.push(transactionHash);
-        queueRef.push(timestampAndBlockNumber);
- 
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the real queue length we need
-        // to divide by 2 and subtract 1.
-        uint256 queueIndex = queueRef.length() / 2 - 1;
-        emit TransactionEnqueued(
-            msg.sender,
-            _target,
-            _gasLimit,
-            _data,
-            queueIndex,
-            block.timestamp
-        );
-    }
- 
-    /**
-     * Appends a given number of queued transactions as a single batch.
-     * param _numQueuedTransactions Number of transactions to append.
-     */
-    function appendQueueBatch(
-        uint256 // _numQueuedTransactions
-    )
-        override
-        public
-        pure
-    {
-        // TEMPORARY: Disable `appendQueueBatch` for minnet
-        revert("appendQueueBatch is currently disabled.");
- 
-        // _numQueuedTransactions = Lib_Math.min(_numQueuedTransactions, getNumPendingQueueElements());
-        // require(
-        //     _numQueuedTransactions > 0,
-        //     "Must append more than zero transactions."
-        // );
- 
-        // bytes32[] memory leaves = new bytes32[](_numQueuedTransactions);
-        // uint40 nextQueueIndex = getNextQueueIndex();
- 
-        // for (uint256 i = 0; i < _numQueuedTransactions; i++) {
-        //     if (msg.sender != resolve("OVM_Sequencer")) {
-        //         Lib_OVMCodec.QueueElement memory el = getQueueElement(nextQueueIndex);
-        //         require(
-        //             el.timestamp + forceInclusionPeriodSeconds < block.timestamp,
-        //             "Queue transactions cannot be submitted during the sequencer inclusion period."
-        //         );
-        //     }
-        //     leaves[i] = _getQueueLeafHash(nextQueueIndex);
-        //     nextQueueIndex++;
-        // }
- 
-        // Lib_OVMCodec.QueueElement memory lastElement = getQueueElement(nextQueueIndex - 1);
- 
-        // _appendBatch(
-        //     Lib_MerkleTree.getMerkleRoot(leaves),
-        //     _numQueuedTransactions,
-        //     _numQueuedTransactions,
-        //     lastElement.timestamp,
-        //     lastElement.blockNumber
-        // );
- 
-        // emit QueueBatchAppended(
-        //     nextQueueIndex - _numQueuedTransactions,
-        //     _numQueuedTransactions,
-        //     getTotalElements()
-        // );
-    }
- 
-    /**
-     * Allows the sequencer to append a batch of transactions.
-     * @dev This function uses a custom encoding scheme for efficiency reasons.
-     * .param _shouldStartAtElement Specific batch we expect to start appending to.
-     * .param _totalElementsToAppend Total number of batch elements we expect to append.
-     * .param _contexts Array of batch contexts.
-     * .param _transactionDataFields Array of raw transaction data.
-     */
-    function appendSequencerBatch()
-        override
-        public
-    {
-        uint40 shouldStartAtElement;
-        uint24 totalElementsToAppend;
-        uint24 numContexts;
-        assembly {
-            shouldStartAtElement  := shr(216, calldataload(4))
-            totalElementsToAppend := shr(232, calldataload(9))
-            numContexts           := shr(232, calldataload(12))
-        }
- 
-        require(
-            shouldStartAtElement == getTotalElements(),
-            "Actual batch start index does not match expected start index."
-        );
- 
-        require(
-            msg.sender == resolve("OVM_Sequencer"),
-            "Function can only be called by the Sequencer."
-        );
- 
-        require(
-            numContexts > 0,
-            "Must provide at least one batch context."
-        );
- 
-        require(
-            totalElementsToAppend > 0,
-            "Must append at least one element."
-        );
- 
-        uint40 nextTransactionPtr = uint40(BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts);
- 
-        Erequire(
-            msg.data.length >= nextTransactionPtr,
-            "Not enough BatchContexts provided."
-        );
- 
-        // Take a reference to the queue and its length so we don't have to keep resolving it.
-        // Length isn't going to change during the course of execution, so it's fine to simply
-        // resolve this once at the start. Saves gas.
-        iOVM_ChainStorageContainer queueRef = queue();
-        uint40 queueLength = _getQueueLength(queueRef);
- 
-        // Reserve some memory to save gas on hashing later on. This is a relatively safe estimate
-        // for the average transaction size that will prevent having to resize this chunk of memory
-        // later on. Saves gas.
-        bytes memory hashMemory = new bytes((msg.data.length / totalElementsToAppend) * 2);
- 
-        // Initialize the array of canonical chain leaves that we will append.
-        bytes32[] memory leaves = new bytes32[](totalElementsToAppend);
- 
-        // Each leaf index corresponds to a tx, either sequenced or enqueued.
-        uint32 leafIndex = 0;
- 
-        // Counter for number of sequencer transactions appended so far.
-        uint32 numSequencerTransactions = 0;
- 
-        // We will sequentially append leaves which are pointers to the queue.
-        // The initial queue index is what is currently in storage.
-        uint40 nextQueueIndex = getNextQueueIndex();
- 
-        BatchContext memory curContext;
-        for (uint32 i = 0; i < numContexts; i++) {
-            BatchContext memory nextContext = _getBatchContext(i);
- 
-            if (i == 0) {
-                // Execute a special check for the first batch.
-                _validateFirstBatchContext(nextContext);
-            }
- 
-            // Execute this check on every single batch, including the first one.
-            _validateNextBatchContext(
-                curContext,
-                nextContext,
-                nextQueueIndex,
-                queueRef
-            );
- 
-            // Now we can update our current context.
-            curContext = nextContext;
- 
-            // Process sequencer transactions first.
-            for (uint32 j = 0; j < curContext.numSequencedTransactions; j++) {
-                uint256 txDataLength;
-                assembly {
-                    txDataLength := shr(232, calldataload(nextTransactionPtr))
-                }
- 
-                leaves[leafIndex] = _getSequencerLeafHash(
-                    curContext,
-                    nextTransactionPtr,
-                    txDataLength,
-                    hashMemory
-                );
- 
-                nextTransactionPtr += uint40(TX_DATA_HEADER_SIZE + txDataLength);
-                numSequencerTransactions++;
-                leafIndex++;
-            }
- 
-            // Now process any subsequent queue transactions.
-            for (uint32 j = 0; j < curContext.numSubsequentQueueTransactions; j++) {
-                require(
-                    nextQueueIndex < queueLength,
-                    "Not enough queued transactions to append."
-                );
- 
-                leaves[leafIndex] = _getQueueLeafHash(nextQueueIndex);
-                nextQueueIndex++;
-                leafIndex++;
-            }
-        }
- 
-        _validateFinalBatchContext(
-            curContext,
-            nextQueueIndex,
-            queueLength,
-            queueRef
-        );
- 
-        require(
-            msg.data.length == nextTransactionPtr,
-            "Not all sequencer transactions were processed."
-        );
- 
-        Erequire(
-            leafIndex == totalElementsToAppend,
-            "Actual transaction index does not match expected total elements to append."
-        );
- 
-        // Generate the required metadata that we need to append this batch
-        uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
-        uint40 blockTimestamp;
-        uint40 blockNumber;
-        if (curContext.numSubsequentQueueTransactions == 0) {
-            // The last element is a sequencer tx, therefore pull timestamp and block number from the last context.
-            blockTimestamp = uint40(curContext.timestamp);
-            blockNumber = uint40(curContext.blockNumber);
-        } else {
-            // The last element is a queue tx, therefore pull timestamp and block number from the queue element.
-            // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at least one queue element.
-            // We increment nextQueueIndex after processing each queue element,
-            // so the index of the last element we processed is nextQueueIndex - 1.
-            Lib_OVMCodec.QueueElement memory lastElement = _getQueueElement(
-                nextQueueIndex - 1,
-                queueRef
-            );
- 
-            blockTimestamp = lastElement.timestamp;
-            blockNumber = lastElement.blockNumber;
-        }
- 
-        // For efficiency reasons getMerkleRoot modifies the `leaves` argument in place
-        // while calculating the root hash therefore any arguments passed to it must not
-        // be used again afterwards
-        _appendBatch(
-            Lib_MerkleTree.getMerkleRoot(leaves),
-            totalElementsToAppend,
-            numQueuedTransactions,
-            blockTimestamp,
-            blockNumber
-        );
- 
-        emit SequencerBatchAppended(
-            nextQueueIndex - numQueuedTransactions,
-            numQueuedTransactions,
-            getTotalElements()
-        );
-    }
- 
-    /**
-     * Verifies whether a transaction is included in the chain.
-     * @param _transaction Transaction to verify.
-     * @param _txChainElement Transaction chain element corresponding to the transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
-     * @return True if the transaction exists in the CTC, false if not.
-     */
-    function verifyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        if (_txChainElement.isSequenced == true) {
-            return _verifySequencerTransaction(
-                _transaction,
-                _txChainElement,
-                _batchHeader,
-                _inclusionProof
-            );
-        } else {
-            return _verifyQueueTransaction(
-                _transaction,
-                _txChainElement.queueIndex,
-                _batchHeader,
-                _inclusionProof
-            );
-        }
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Returns the BatchContext located at a particular index.
-     * @param _index The index of the BatchContext
-     * @return The BatchContext at the specified index.
-     */
-    function _getBatchContext(
-        uint256 _index
-    )
-        internal
-        pure
-        returns (
-            BatchContext memory
-        )
-    {
-        uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;
-        uint256 numSequencedTransactions;
-        uint256 numSubsequentQueueTransactions;
-        uint256 ctxTimestamp;
-        uint256 ctxBlockNumber;
- 
-        assembly {
-            numSequencedTransactions       := shr(232, calldataload(contextPtr))
-            numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))
-            ctxTimestamp                   := shr(216, calldataload(add(contextPtr, 6)))
-            ctxBlockNumber                 := shr(216, calldataload(add(contextPtr, 11)))
-        }
- 
-        return BatchContext({
-            numSequencedTransactions: numSequencedTransactions,
-            numSubsequentQueueTransactions: numSubsequentQueueTransactions,
-            timestamp: ctxTimestamp,
-            blockNumber: ctxBlockNumber
-        });
-    }
- 
-    /**
-     * Parses the batch context from the extra data.
-     * @return Total number of elements submitted.
-     * @return Index of the next queue element.
-     */
-    function _getBatchExtraData()
-        internal
-        view
-        returns (
-            uint40,
-            uint40,
-            uint40,
-            uint40
-        )
-    {
-        bytes27 extraData = batches().getGlobalMetadata();
- 
-        uint40 totalElements;
-        uint40 nextQueueIndex;
-        uint40 lastTimestamp;
-        uint40 lastBlockNumber;
-        assembly {
-            extraData       :=  shr(40, extraData)
-            totalElements   :=  and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            nextQueueIndex  :=  shr(40, and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000))
-            lastTimestamp   :=  shr(80, and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000))
-            lastBlockNumber :=  shr(120, and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000))
-        }
- 
-        return (
-            totalElements,
-            nextQueueIndex,
-            lastTimestamp,
-            lastBlockNumber
-        );
-    }
- 
-    /**
-     * Encodes the batch context for the extra data.
-     * @param _totalElements Total number of elements submitted.
-     * @param _nextQueueIndex Index of the next queue element.
-     * @param _timestamp Timestamp for the last batch.
-     * @param _blockNumber Block number of the last batch.
-     * @return Encoded batch context.
-     */
-    function _makeBatchExtraData(
-        uint40 _totalElements,
-        uint40 _nextQueueIndex,
-        uint40 _timestamp,
-        uint40 _blockNumber
-    )
-        internal
-        pure
-        returns (
-            bytes27
-        )
-    {
-        bytes27 extraData;
-        assembly {
-            extraData := _totalElements
-            extraData := or(extraData, shl(40, _nextQueueIndex))
-            extraData := or(extraData, shl(80, _timestamp))
-            extraData := or(extraData, shl(120, _blockNumber))
-            extraData := shl(40, extraData)
-        }
- 
-        return extraData;
-    }
- 
-    /**
-     * Retrieves the hash of a queue element.
-     * @param _index Index of the queue element to retrieve a hash for.
-     * @return Hash of the queue element.
-     */
-    function _getQueueLeafHash(
-        uint256 _index
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return _hashTransactionChainElement(
-            Lib_OVMCodec.TransactionChainElement({
-                isSequenced: false,
-                queueIndex: _index,
-                timestamp: 0,
-                blockNumber: 0,
-                txData: hex""
-            })
-        );
-    }
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function _getQueueElement(
-        uint256 _index,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        )
-    {
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the actual desired queue index
-        // we need to multiply by 2.
-        uint40 trueIndex = uint40(_index * 2);
-        bytes32 transactionHash = _queueRef.get(trueIndex);
-        bytes32 timestampAndBlockNumber = _queueRef.get(trueIndex + 1);
- 
-        uint40 elementTimestamp;
-        uint40 elementBlockNumber;
-        assembly {
-            elementTimestamp   :=         and(timestampAndBlockNumber, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            elementBlockNumber := shr(40, and(timestampAndBlockNumber, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
-        }
- 
-        return Lib_OVMCodec.QueueElement({
-            transactionHash: transactionHash,
-            timestamp: elementTimestamp,
-            blockNumber: elementBlockNumber
-        });
-    }
- 
-    /**
-     * Retrieves the length of the queue.
-     * @return Length of the queue.
-     */
-    function _getQueueLength(
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the real queue length we need
-        // to divide by 2.
-        return uint40(_queueRef.length() / 2);
-    }
- 
-    /**
-     * Retrieves the hash of a sequencer element.
-     * @param _context Batch context for the given element.
-     * @param _nextTransactionPtr Pointer to the next transaction in the calldata.
-     * @param _txDataLength Length of the transaction item.
-     * @return Hash of the sequencer element.
-     */
-    function _getSequencerLeafHash(
-        BatchContext memory _context,
-        uint256 _nextTransactionPtr,
-        uint256 _txDataLength,
-        bytes memory _hashMemory
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        // Only allocate more memory if we didn't reserve enough to begin with.
-        if (BYTES_TILL_TX_DATA + _txDataLength > _hashMemory.length) {
-            _hashMemory = new bytes(BYTES_TILL_TX_DATA + _txDataLength);
-        }
- 
-        uint256 ctxTimestamp = _context.timestamp;
-        uint256 ctxBlockNumber = _context.blockNumber;
- 
-        bytes32 leafHash;
-        assembly {
-            let chainElementStart := add(_hashMemory, 0x20)
- 
-            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
-            // This distinguishes sequencer ChainElements from queue ChainElements because
-            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
-            // elements is always zero
-            mstore8(chainElementStart, 1)
- 
-            mstore(add(chainElementStart, 1), ctxTimestamp)
-            mstore(add(chainElementStart, 33), ctxBlockNumber)
- 
-            calldatacopy(add(chainElementStart, BYTES_TILL_TX_DATA), add(_nextTransactionPtr, 3), _txDataLength)
- 
-            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, _txDataLength))
-        }
- 
-        return leafHash;
-    }
- 
-    /**
-     * Retrieves the hash of a sequencer element.
-     * @param _txChainElement The chain element which is hashed to calculate the leaf.
-     * @return Hash of the sequencer element.
-     */
-    function _getSequencerLeafHash(
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement
-    )
-        internal
-        view
-        returns(
-            bytes32
-        )
-    {
-        bytes memory txData = _txChainElement.txData;
-        uint256 txDataLength = _txChainElement.txData.length;
- 
-        bytes memory chainElement = new bytes(BYTES_TILL_TX_DATA + txDataLength);
-        uint256 ctxTimestamp = _txChainElement.timestamp;
-        uint256 ctxBlockNumber = _txChainElement.blockNumber;
- 
-        bytes32 leafHash;
-        assembly {
-            let chainElementStart := add(chainElement, 0x20)
- 
-            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
-            // This distinguishes sequencer ChainElements from queue ChainElements because
-            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
-            // elements is always zero
-            mstore8(chainElementStart, 1)
- 
-            mstore(add(chainElementStart, 1), ctxTimestamp)
-            mstore(add(chainElementStart, 33), ctxBlockNumber)
- 
-            pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart, BYTES_TILL_TX_DATA), txDataLength))
- 
-            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, txDataLength))
-        }
- 
-        return leafHash;
-    }
- 
-    /**
-     * Inserts a batch into the chain of batches.
-     * @param _transactionRoot Root of the transaction tree for this batch.
-     * @param _batchSize Number of elements in the batch.
-     * @param _numQueuedTransactions Number of queue transactions in the batch.
-     * @param _timestamp The latest batch timestamp.
-     * @param _blockNumber The latest batch blockNumber.
-     */
-    function _appendBatch(
-        bytes32 _transactionRoot,
-        uint256 _batchSize,
-        uint256 _numQueuedTransactions,
-        uint40 _timestamp,
-        uint40 _blockNumber
-    )
-        internal
-    {
-        iOVM_ChainStorageContainer batchesRef = batches();
-        (uint40 totalElements, uint40 nextQueueIndex,,) = _getBatchExtraData();
- 
-        Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({
-            batchIndex: batchesRef.length(),
-            batchRoot: _transactionRoot,
-            batchSize: _batchSize,
-            prevTotalElements: totalElements,
-            extraData: hex""
-        });
- 
-        emit TransactionBatchAppended(
-            header.batchIndex,
-            header.batchRoot,
-            header.batchSize,
-            header.prevTotalElements,
-            header.extraData
-        );
- 
-        bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);
-        bytes27 latestBatchContext = _makeBatchExtraData(
-            totalElements + uint40(header.batchSize),
-            nextQueueIndex + uint40(_numQueuedTransactions),
-            _timestamp,
-            _blockNumber
-        );
- 
-        batchesRef.push(batchHeaderHash, latestBatchContext);
-    }
- 
-    /**
-     * Checks that the first batch context in a sequencer submission is valid
-     * @param _firstContext The batch context to validate.
-     */
-    function _validateFirstBatchContext(
-        BatchContext memory _firstContext
-    )
-        internal
-        view
-    {
-        // If there are existing elements, this batch must have the same context 
-        // or a later timestamp and block number.
-        if (getTotalElements() > 0) {
-            (,, uint40 lastTimestamp, uint40 lastBlockNumber) = _getBatchExtraData();
- 
-            require(
-                _firstContext.blockNumber >= lastBlockNumber,
-                "Context block number is lower than last submitted."
-            );
- 
-            Irequire(
-                _firstContext.timestamp >= lastTimestamp,
-                "Context timestamp is lower than last submitted."
-            );
-        }
- 
-        // Sequencer cannot submit contexts which are more than the force inclusion period old.
-        require(
-            _firstContext.timestamp + forceInclusionPeriodSeconds >= block.timestamp,
-            "Context timestamp too far in the past."
-        );
- 
-        require(
-            _firstContext.blockNumber + forceInclusionPeriodBlocks >= block.number,
-            "Context block number too far in the past."
-        );
-    }
- 
-    /**
-     * Checks that a given batch context has a time context which is below a given que element
-     * @param _context The batch context to validate has values lower.
-     * @param _queueIndex Index of the queue element we are validating came later than the context.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateContextBeforeEnqueue(
-        BatchContext memory _context,
-        uint40 _queueIndex,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-            Lib_OVMCodec.QueueElement memory nextQueueElement = _getQueueElement(
-                _queueIndex,
-                _queueRef
-            );
- 
-            // If the force inclusion period has passed for an enqueued transaction, it MUST be the next chain element.
-            require(
-                block.timestamp < nextQueueElement.timestamp + forceInclusionPeriodSeconds,
-                "Previously enqueued batches have expired and must be appended before a new sequencer batch."
-            );
- 
-            // Just like sequencer transaction times must be increasing relative to each other,
-            // We also require that they be increasing relative to any interspersed queue elements.
-            require(
-                _context.timestamp <= nextQueueElement.timestamp,
-                "Sequencer transaction timestamp exceeds that of next queue element."
-            );
- 
-            require(
-                _context.blockNumber <= nextQueueElement.blockNumber,
-                "Sequencer transaction blockNumber exceeds that of next queue element."
-            );
-    }
- 
-    /**
-     * Checks that a given batch context is valid based on its previous context, and the next queue elemtent.
-     * @param _prevContext The previously validated batch context.
-     * @param _nextContext The batch context to validate with this call.
-     * @param _nextQueueIndex Index of the next queue element to process for the _nextContext's subsequentQueueElements.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateNextBatchContext(
-        BatchContext memory _prevContext,
-        BatchContext memory _nextContext,
-        uint40 _nextQueueIndex,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-        // All sequencer transactions' times must be greater than or equal to the previous ones.
-        require(
-            _nextContext.timestamp >= _prevContext.timestamp,
-            "Context timestamp values must monotonically increase."
-        );
- 
-        require(
-            _nextContext.blockNumber >= _prevContext.blockNumber,
-            "Context blockNumber values must monotonically increase."
-        );
- 
-        // If there is going to be a queue element pulled in from this context:
-        if (_nextContext.numSubsequentQueueTransactions > 0) {
-            _validateContextBeforeEnqueue(
-                _nextContext,
-                _nextQueueIndex,
-                _queueRef
-            );
-        }
-    }
- 
-    /**
-     * Checks that the final batch context in a sequencer submission is valid.
-     * @param _finalContext The batch context to validate.
-     * @param _queueLength The length of the queue at the start of the batchAppend call.
-     * @param _nextQueueIndex The next element in the queue that will be pulled into the CTC.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateFinalBatchContext(
-        BatchContext memory _finalContext,
-        uint40 _nextQueueIndex,
-        uint40 _queueLength,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-        // If the queue is not now empty, check the mononoticity of whatever the next batch that will come in is.
-        if (_queueLength - _nextQueueIndex > 0 && _finalContext.numSubsequentQueueTransactions == 0) {
-            _validateContextBeforeEnqueue(
-                _finalContext,
-                _nextQueueIndex,
-                _queueRef
-            );
-        }
-        // Batches cannot be added from the future, or subsequent enqueue() contexts would violate monotonicity.
-        require(_finalContext.timestamp <= block.timestamp, "Context timestamp is from the future.");
-        require(_finalContext.blockNumber <= block.number, "Context block number is from the future.");
-    }
- 
-    /**
-     * Hashes a transaction chain element.
-     * @param _element Chain element to hash.
-     * @return Hash of the chain element.
-     */
-    function _hashTransactionChainElement(
-        Lib_OVMCodec.TransactionChainElement memory _element
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(
-            abi.encode(
-                _element.isSequenced,
-                _element.queueIndex,
-                _element.timestamp,
-                _element.blockNumber,
-                _element.txData
-            )
-        );
-    }
- 
-    /**
-     * Verifies a sequencer transaction, returning true if it was indeed included in the CTC
-     * @param _transaction The transaction we are verifying inclusion of.
-     * @param _txChainElement The chain element that the transaction is claimed to be a part of.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof An inclusion proof into the CTC at a particular index.
-     * @return True if the transaction was included in the specified location, else false.
-     */
-    function _verifySequencerTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        OVM_ExecutionManager ovmExecutionManager = OVM_ExecutionManager(resolve("OVM_ExecutionManager"));
-        uint256 gasLimit = ovmExecutionManager.getMaxTransactionGasLimit();
-        bytes32 leafHash = _getSequencerLeafHash(_txChainElement);
- 
-        Erequire(
-            _verifyElement(
-                leafHash,
-                _batchHeader,
-                _inclusionProof
-            ),
-            "Invalid Sequencer transaction inclusion proof."
-        );
- 
-        Erequire(
-            _transaction.blockNumber        == _txChainElement.blockNumber
-            && _transaction.timestamp       == _txChainElement.timestamp
-            && _transaction.entrypoint      == resolve("OVM_DecompressionPrecompileAddress")
-            && _transaction.gasLimit        == gasLimit
-            && _transaction.l1TxOrigin      == address(0)
-            && _transaction.l1QueueOrigin   == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
-            && keccak256(_transaction.data) == keccak256(_txChainElement.txData),
-            "Invalid Sequencer transaction."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * Verifies a queue transaction, returning true if it was indeed included in the CTC
-     * @param _transaction The transaction we are verifying inclusion of.
-     * @param _queueIndex The queueIndex of the queued transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof An inclusion proof into the CTC at a particular index (should point to queue tx).
-     * @return True if the transaction was included in the specified location, else false.
-     */
-    function _verifyQueueTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        uint256 _queueIndex,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 leafHash = _getQueueLeafHash(_queueIndex);
- 
-        Erequire(
-            _verifyElement(
-                leafHash,
-                _batchHeader,
-                _inclusionProof
-            ),
-            "Invalid Queue transaction inclusion proof."
-        );
- 
-        bytes32 transactionHash = keccak256(
-            abi.encode(
-                _transaction.l1TxOrigin,
-                _transaction.entrypoint,
-                _transaction.gasLimit,
-                _transaction.data
-            )
-        );
- 
-        Lib_OVMCodec.QueueElement memory el = getQueueElement(_queueIndex);
-        Erequire(
-            el.transactionHash      == transactionHash
-            && el.timestamp   == _transaction.timestamp
-            && el.blockNumber == _transaction.blockNumber,
-            "Invalid Queue transaction."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * Verifies a batch inclusion proof.
-     * @param _element Hash of the element to verify a proof for.
-     * @param _batchHeader Header of the batch in which the element was included.
-     * @param _proof Merkle inclusion proof for the element.
-     */
-    function _verifyElement(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        Erequire(
-            Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(uint32(_batchHeader.batchIndex)),
-            "Invalid batch header."
-        );
- 
-        Erequire(
-            Lib_MerkleTree.verify(
-                _batchHeader.batchRoot,
-                _element,
-                _proof.index,
-                _proof.siblings,
-                _batchHeader.batchSize
-            ),
-            "Invalid inclusion proof."
-        );
- 
-        return true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html deleted file mode 100644 index 1e2bd3a07..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html +++ /dev/null @@ -1,680 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/chain/ OVM_ChainStorageContainer.sol -

-
-
- 72.73% - Statements - 8/11 -
-
- 50% - Branches - 1/2 -
-
- 72.73% - Functions - 8/11 -
-
- 75% - Lines - 9/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -516× -  -  -  -  -  -  -  -  -579× -  -  -  -579× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -580× -  -  -  -  -  -  -  -  -  -  -  -  -  -453× -  -  -  -  -  -  -  -  -  -  -  -  -470× -  -  -  -  -  -  -  -  -  -  -  -  -  -108× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_RingBuffer } from "../../libraries/utils/Lib_RingBuffer.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/**
- * @title OVM_ChainStorageContainer
- * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.
- * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used
- * in a fraud proof due to the fraud window having passed, and the associated chain state or
- * transactions being finalized.
- * Three distinct Chain Storage Containers will be deployed on Layer 1:
- * 1. Stores transaction batches for the Canonical Transaction Chain
- * 2. Stores queued transactions for the Canonical Transaction Chain
- * 3. Stores chain state batches for the State Commitment Chain
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {
- 
-    /*************
-     * Libraries *
-     *************/
- 
-    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    string public owner;
-    Lib_RingBuffer.RingBuffer internal buffer;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _owner Name of the contract that owns this container (will be resolved later).
-     */
-    constructor(
-        address _libAddressManager,
-        string memory _owner
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        owner = _owner;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyOwner() {
-        Erequire(
-            msg.sender == resolve(owner),
-            "OVM_ChainStorageContainer: Function can only be called by the owner."
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function setGlobalMetadata(
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        return buffer.setExtraData(_globalMetadata);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function getGlobalMetadata()
-        override
-        public
-        view
-        returns (
-            bytes27
-        )
-    {
-        return buffer.getExtraData();
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function length()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return uint256(buffer.getLength());
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function push(
-        bytes32 _object
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.push(_object);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function push(
-        bytes32 _object,
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.push(_object, _globalMetadata);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function get(
-        uint256 _index
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        return buffer.get(uint40(_index));
-    }
-    
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.deleteElementsAfterInclusive(
-            uint40(_index)
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index,
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.deleteElementsAfterInclusive(
-            uint40(_index),
-            _globalMetadata
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function setNextOverwritableIndex(
-        uint256 _index
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.nextOverwritableIndex = _index;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html deleted file mode 100644 index 8b0dbf3fb..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html +++ /dev/null @@ -1,1307 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/chain/ OVM_StateCommitmentChain.sol -

-
-
- 88.1% - Statements - 37/42 -
-
- 67.86% - Branches - 19/28 -
-
- 85.71% - Functions - 12/14 -
-
- 88.64% - Lines - 39/44 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -60× -60× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -125× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -24× -  -  -  -  -24× -  -  -  -  -23× -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -74× -  -74× -74× -74× -  -  -  -  -  -74× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -  -22× -20× -  -  -  -  -  - -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
- 
-/* Interface Imports */
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
-import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/* External Imports */
-import '@openzeppelin/contracts/math/SafeMath.sol';
- 
-/**
- * @title OVM_StateCommitmentChain
- * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which
- * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).
- * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique
- * state root calculated off-chain by applying the canonical transactions one by one.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 public FRAUD_PROOF_WINDOW;
-    uint256 public SEQUENCER_PUBLISH_WINDOW;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager,
-        uint256 _fraudProofWindow,
-        uint256 _sequencerPublishWindow
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        FRAUD_PROOF_WINDOW = _fraudProofWindow;
-        SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:SCC:batches")
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getTotalElements()
-        override
-        public
-        view
-        returns (
-            uint256 _totalElements
-        )
-    {
-        (uint40 totalElements, ) = _getBatchExtraData();
-        return uint256(totalElements);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getTotalBatches()
-        override
-        public
-        view
-        returns (
-            uint256 _totalBatches
-        )
-    {
-        return batches().length();
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getLastSequencerTimestamp()
-        override
-        public
-        view
-        returns (
-            uint256 _lastSequencerTimestamp
-        )
-    {
-        (, uint40 lastSequencerTimestamp) = _getBatchExtraData();
-        return uint256(lastSequencerTimestamp);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function appendStateBatch(
-        bytes32[] memory _batch,
-        uint256 _shouldStartAtElement
-    )
-        override
-        public
-    {
-        // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the
-        // publication of batches by some other user.
-        require(
-            _shouldStartAtElement == getTotalElements(),
-            "Actual batch start index does not match expected start index."
-        );
- 
-        // Proposers must have previously staked at the BondManager
-        Erequire(
-            iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender),
-            "Proposer does not have enough collateral posted"
-        );
- 
-        require(
-            _batch.length > 0,
-            "Cannot submit an empty state batch."
-        );
- 
-        require(
-            getTotalElements() + _batch.length <= iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(),
-            "Number of state roots cannot exceed the number of canonical transactions."
-        );
- 
-        // Pass the block's timestamp and the publisher of the data
-        // to be used in the fraud proofs
-        _appendBatch(
-            _batch,
-            abi.encode(block.timestamp, msg.sender)
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function deleteStateBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        override
-        public
-    {
-        require(
-            msg.sender == resolve("OVM_FraudVerifier"),
-            "State batches can only be deleted by the OVM_FraudVerifier."
-        );
- 
-        require(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        Erequire(
-            insideFraudProofWindow(_batchHeader),
-            "State batches can only be deleted within the fraud proof window."
-        );
- 
-        _deleteBatch(_batchHeader);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function verifyStateCommitment(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        require(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        require(
-            Lib_MerkleTree.verify(
-                _batchHeader.batchRoot,
-                _element,
-                _proof.index,
-                _proof.siblings,
-                _batchHeader.batchSize
-            ),
-            "Invalid inclusion proof."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function insideFraudProofWindow(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        override
-        public
-        view
-        returns (
-            bool _inside
-        )
-    {
-        (uint256 timestamp,) = abi.decode(
-            _batchHeader.extraData,
-            (uint256, address)
-        );
- 
-        Erequire(
-            timestamp != 0,
-            "Batch header timestamp cannot be zero"
-        );
-        return SafeMath.add(timestamp, FRAUD_PROOF_WINDOW) > block.timestamp;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Parses the batch context from the extra data.
-     * @return Total number of elements submitted.
-     * @return Timestamp of the last batch submitted by the sequencer.
-     */
-    function _getBatchExtraData()
-        internal
-        view
-        returns (
-            uint40,
-            uint40
-        )
-    {
-        bytes27 extraData = batches().getGlobalMetadata();
- 
-        uint40 totalElements;
-        uint40 lastSequencerTimestamp;
-        assembly {
-            extraData              := shr(40, extraData)
-            totalElements          :=         and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            lastSequencerTimestamp := shr(40, and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
-        }
- 
-        return (
-            totalElements,
-            lastSequencerTimestamp
-        );
-    }
- 
-    /**
-     * Encodes the batch context for the extra data.
-     * @param _totalElements Total number of elements submitted.
-     * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.
-     * @return Encoded batch context.
-     */
-    function _makeBatchExtraData(
-        uint40 _totalElements,
-        uint40 _lastSequencerTimestamp
-    )
-        internal
-        pure
-        returns (
-            bytes27
-        )
-    {
-        bytes27 extraData;
-        assembly {
-            extraData := _totalElements
-            extraData := or(extraData, shl(40, _lastSequencerTimestamp))
-            extraData := shl(40, extraData)
-        }
- 
-        return extraData;
-    }
- 
-    /**
-     * Appends a batch to the chain.
-     * @param _batch Elements within the batch.
-     * @param _extraData Any extra data to append to the batch.
-     */
-    function _appendBatch(
-        bytes32[] memory _batch,
-        bytes memory _extraData
-    )
-        internal
-    {
-        address sequencer = resolve("OVM_Proposer");
-        (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();
- 
-        if (msg.sender == sequencer) {
-            lastSequencerTimestamp = uint40(block.timestamp);
-        } else {
-            // We keep track of the last batch submitted by the sequencer so there's a window in
-            // which only the sequencer can publish state roots. A window like this just reduces
-            // the chance of "system breaking" state roots being published while we're still in
-            // testing mode. This window should be removed or significantly reduced in the future.
-            require(
-                lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,
-                "Cannot publish state roots within the sequencer publication window."
-            );
-        }
- 
-        // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place
-        // while calculating the root hash therefore any arguments passed to it must not
-        // be used again afterwards
-        Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({
-            batchIndex: getTotalBatches(),
-            batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),
-            batchSize: _batch.length,
-            prevTotalElements: totalElements,
-            extraData: _extraData
-        });
- 
-        emit StateBatchAppended(
-            batchHeader.batchIndex,
-            batchHeader.batchRoot,
-            batchHeader.batchSize,
-            batchHeader.prevTotalElements,
-            batchHeader.extraData
-        );
- 
-        batches().push(
-            Lib_OVMCodec.hashBatchHeader(batchHeader),
-            _makeBatchExtraData(
-                uint40(batchHeader.prevTotalElements + batchHeader.batchSize),
-                lastSequencerTimestamp
-            )
-        );
-    }
- 
-    /**
-     * Removes a batch and all subsequent batches from the chain.
-     * @param _batchHeader Header of the batch to remove.
-     */
-    function _deleteBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-    {
-        Erequire(
-            _batchHeader.batchIndex < batches().length(),
-            "Invalid batch index."
-        );
- 
-        Erequire(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        batches().deleteElementsAfterInclusive(
-            _batchHeader.batchIndex,
-            _makeBatchExtraData(
-                uint40(_batchHeader.prevTotalElements),
-                0
-            )
-        );
- 
-        emit StateBatchDeleted(
-            _batchHeader.batchIndex,
-            _batchHeader.batchRoot
-        );
-    }
- 
-    /**
-     * Checks that a batch header matches the stored hash for the given index.
-     * @param _batchHeader Batch header to validate.
-     * @return Whether or not the header matches the stored one.
-     */
-    function _isValidBatchHeader(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/chain/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/chain/index.html deleted file mode 100644 index 4929bf6b5..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/chain/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/chain/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/chain/ -

-
-
- 92.82% - Statements - 194/209 -
-
- 81.37% - Branches - 83/102 -
-
- 82.46% - Functions - 47/57 -
-
- 93.36% - Lines - 211/226 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_CanonicalTransactionChain.sol
95.51%149/15687.5%63/7284.38%27/3295.88%163/170
OVM_ChainStorageContainer.sol
72.73%8/1150%1/272.73%8/1175%9/12
OVM_StateCommitmentChain.sol
88.1%37/4267.86%19/2885.71%12/1488.64%39/44
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html deleted file mode 100644 index 89edc14b7..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html +++ /dev/null @@ -1,5654 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/execution/ OVM_ExecutionManager.sol -

-
-
- 82.2% - Statements - 194/236 -
-
- 68.29% - Branches - 56/82 -
-
- 88.52% - Functions - 54/61 -
-
- 82.64% - Lines - 200/242 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231 -1232 -1233 -1234 -1235 -1236 -1237 -1238 -1239 -1240 -1241 -1242 -1243 -1244 -1245 -1246 -1247 -1248 -1249 -1250 -1251 -1252 -1253 -1254 -1255 -1256 -1257 -1258 -1259 -1260 -1261 -1262 -1263 -1264 -1265 -1266 -1267 -1268 -1269 -1270 -1271 -1272 -1273 -1274 -1275 -1276 -1277 -1278 -1279 -1280 -1281 -1282 -1283 -1284 -1285 -1286 -1287 -1288 -1289 -1290 -1291 -1292 -1293 -1294 -1295 -1296 -1297 -1298 -1299 -1300 -1301 -1302 -1303 -1304 -1305 -1306 -1307 -1308 -1309 -1310 -1311 -1312 -1313 -1314 -1315 -1316 -1317 -1318 -1319 -1320 -1321 -1322 -1323 -1324 -1325 -1326 -1327 -1328 -1329 -1330 -1331 -1332 -1333 -1334 -1335 -1336 -1337 -1338 -1339 -1340 -1341 -1342 -1343 -1344 -1345 -1346 -1347 -1348 -1349 -1350 -1351 -1352 -1353 -1354 -1355 -1356 -1357 -1358 -1359 -1360 -1361 -1362 -1363 -1364 -1365 -1366 -1367 -1368 -1369 -1370 -1371 -1372 -1373 -1374 -1375 -1376 -1377 -1378 -1379 -1380 -1381 -1382 -1383 -1384 -1385 -1386 -1387 -1388 -1389 -1390 -1391 -1392 -1393 -1394 -1395 -1396 -1397 -1398 -1399 -1400 -1401 -1402 -1403 -1404 -1405 -1406 -1407 -1408 -1409 -1410 -1411 -1412 -1413 -1414 -1415 -1416 -1417 -1418 -1419 -1420 -1421 -1422 -1423 -1424 -1425 -1426 -1427 -1428 -1429 -1430 -1431 -1432 -1433 -1434 -1435 -1436 -1437 -1438 -1439 -1440 -1441 -1442 -1443 -1444 -1445 -1446 -1447 -1448 -1449 -1450 -1451 -1452 -1453 -1454 -1455 -1456 -1457 -1458 -1459 -1460 -1461 -1462 -1463 -1464 -1465 -1466 -1467 -1468 -1469 -1470 -1471 -1472 -1473 -1474 -1475 -1476 -1477 -1478 -1479 -1480 -1481 -1482 -1483 -1484 -1485 -1486 -1487 -1488 -1489 -1490 -1491 -1492 -1493 -1494 -1495 -1496 -1497 -1498 -1499 -1500 -1501 -1502 -1503 -1504 -1505 -1506 -1507 -1508 -1509 -1510 -1511 -1512 -1513 -1514 -1515 -1516 -1517 -1518 -1519 -1520 -1521 -1522 -1523 -1524 -1525 -1526 -1527 -1528 -1529 -1530 -1531 -1532 -1533 -1534 -1535 -1536 -1537 -1538 -1539 -1540 -1541 -1542 -1543 -1544 -1545 -1546 -1547 -1548 -1549 -1550 -1551 -1552 -1553 -1554 -1555 -1556 -1557 -1558 -1559 -1560 -1561 -1562 -1563 -1564 -1565 -1566 -1567 -1568 -1569 -1570 -1571 -1572 -1573 -1574 -1575 -1576 -1577 -1578 -1579 -1580 -1581 -1582 -1583 -1584 -1585 -1586 -1587 -1588 -1589 -1590 -1591 -1592 -1593 -1594 -1595 -1596 -1597 -1598 -1599 -1600 -1601 -1602 -1603 -1604 -1605 -1606 -1607 -1608 -1609 -1610 -1611 -1612 -1613 -1614 -1615 -1616 -1617 -1618 -1619 -1620 -1621 -1622 -1623 -1624 -1625 -1626 -1627 -1628 -1629 -1630 -1631 -1632 -1633 -1634 -1635 -1636 -1637 -1638 -1639 -1640 -1641 -1642 -1643 -1644 -1645 -1646 -1647 -1648 -1649 -1650 -1651 -1652 -1653 -1654 -1655 -1656 -1657 -1658 -1659 -1660 -1661 -1662 -1663 -1664 -1665 -1666 -1667 -1668 -1669 -1670 -1671 -1672 -1673 -1674 -1675 -1676 -1677 -1678 -1679 -1680 -1681 -1682 -1683 -1684 -1685 -1686 -1687 -1688 -1689 -1690 -1691 -1692 -1693 -1694 -1695 -1696 -1697 -1698 -1699 -1700 -1701 -1702 -1703 -1704 -1705 -1706 -1707 -1708 -1709 -1710 -1711 -1712 -1713 -1714 -1715 -1716 -1717 -1718 -1719 -1720 -1721 -1722 -1723 -1724 -1725 -1726 -1727 -1728 -1729 -1730 -1731 -1732 -1733 -1734 -1735 -1736 -1737 -1738 -1739 -1740 -1741 -1742 -1743 -1744 -1745 -1746 -1747 -1748 -1749 -1750 -1751 -1752 -1753 -1754 -1755 -1756 -1757 -1758 -1759 -1760 -1761 -1762 -1763 -1764 -1765 -1766 -1767 -1768 -1769 -1770 -1771 -1772 -1773 -1774 -1775 -1776 -1777 -1778 -1779 -1780 -1781 -1782 -1783 -1784 -1785 -1786 -1787 -1788 -1789 -1790 -1791 -1792 -1793 -1794 -1795 -1796 -1797 -1798 -1799 -1800 -1801 -1802 -1803 -1804 -1805 -1806 -1807 -1808 -1809 -1810 -1811 -1812 -1813 -1814 -1815 -1816 -1817 -1818 -1819 -1820 -1821 -1822 -1823 -1824 -1825 -1826 -1827 -1828 -1829 -1830 -1831 -1832 -1833 -1834 -1835 -1836 -1837 -1838 -1839 -1840 -1841 -1842 -1843 -1844 -1845 -1846 -1847 -1848 -1849 -1850 -1851 -1852 -1853 -1854 -1855 -1856 -1857 -1858 -1859 -1860 -1861 -1862 -1863 -1864  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -30× -30× -30× -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -55× -55× -55× -  -  -55× -46× -  -  -  -  -  -  -  -  -  -  -  -202× -202× -193× -  -  -193× -165× -  -  -28× -  -  -  -  -  -  -  -42× - -  -38× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -150× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -  -  -  -28× -  -  -27× -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  - - -  -  -  - -  -  - -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -155× -155× -155× -  -155× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -48× -  -48× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -  -29× -  -29× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -27× -27× -27× -  -  -  -27× -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -173× -  -  -  -  - -  -  -  -172× -  -  -  -  -170× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -197× -197× -  -  -  -  -  -197× -197× -197× -  -  -  -  -  -  -  -197× -  -  -  -  -  -197× -  -  -  -197× -  -  -  -197× -23× -  -  -  -  -  -  -  -  -  -23× - -  -  -  -  -  -18× -  -  -  -  -  -14× -  -  -  -  -18× -  -  -  -10× -  - -  -  -  -  -  -  -  -18× -  -  -  -192× -  -192× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -27× -  -  -27× -  -27× -  -  -10× -10× -10× -10× -  -  -  -  -  -  -  -10× -  -  -  -  -17× -17× - -  -  -  -  -  -  -  -  -  -  -16× -  -  -  -  -  -  -16× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -29× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -57× -57× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -370× -368× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -17× -17× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -55× -55× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -536× -  -  -  -  -536× - -  -  -  -  -534× -  -  -  -  -  -534× -144× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -53× -  -  -  -53× -  -  -  -  -  -53× -47× -47× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -62× -  -  -  -  -  -  -62× -  -  -  -  -  -62× -  -  -  -  -  -62× -46× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  - -  -  - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -20× -  -  -  -  -  -  -20× - -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -23× - -  -  -  -  -  -  -  -  -20× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -198× -  -  -  -  -  -  -  -  -  -  -  -  -  -244× -  -  -  -244× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -394× -202× -  -  -  -394× -310× -  -  -  -394× -16× -  -  -  -  -  -  -  -  -  -  -  -  - - - - - - -  - -  -  -  -  -  -  -  -  -31× -31× -31× -31× -31× -31× -  -31× -  -31× -31× -31× -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
-import { Lib_ErrorUtils } from "../../libraries/utils/Lib_ErrorUtils.sol";
- 
-/* Interface Imports */
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
- 
-/* Contract Imports */
-import { OVM_ECDSAContractAccount } from "../accounts/OVM_ECDSAContractAccount.sol";
-import { OVM_ProxyEOA } from "../accounts/OVM_ProxyEOA.sol";
-import { OVM_DeployerWhitelist } from "../predeploys/OVM_DeployerWhitelist.sol";
- 
-/**
- * @title OVM_ExecutionManager
- * @dev The Execution Manager (EM) is the core of our OVM implementation, and provides a sandboxed
- * environment allowing us to execute OVM transactions deterministically on either Layer 1 or
- * Layer 2.
- * The EM's run() function is the first function called during the execution of any
- * transaction on L2.
- * For each context-dependent EVM operation the EM has a function which implements a corresponding
- * OVM operation, which will read state from the State Manager contract.
- * The EM relies on the Safety Checker to verify that code deployed to Layer 2 does not contain any
- * context-dependent operations.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    iOVM_SafetyChecker internal ovmSafetyChecker;
-    iOVM_StateManager internal ovmStateManager;
- 
- 
-    /*******************************
-     * Execution Context Variables *
-     *******************************/
- 
-    GasMeterConfig internal gasMeterConfig;
-    GlobalContext internal globalContext;
-    TransactionContext internal transactionContext;
-    MessageContext internal messageContext;
-    TransactionRecord internal transactionRecord;
-    MessageRecord internal messageRecord;
- 
- 
-    /**************************
-     * Gas Metering Constants *
-     **************************/
- 
-    address constant GAS_METADATA_ADDRESS = 0x06a506A506a506A506a506a506A506A506A506A5;
-    uint256 constant NUISANCE_GAS_SLOAD = 20000;
-    uint256 constant NUISANCE_GAS_SSTORE = 20000;
-    uint256 constant MIN_NUISANCE_GAS_PER_CONTRACT = 30000;
-    uint256 constant NUISANCE_GAS_PER_CONTRACT_BYTE = 100;
-    uint256 constant MIN_GAS_FOR_INVALID_STATE_ACCESS = 30000;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager,
-        GasMeterConfig memory _gasMeterConfig,
-        GlobalContext memory _globalContext
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        ovmSafetyChecker = iOVM_SafetyChecker(resolve("OVM_SafetyChecker"));
-        gasMeterConfig = _gasMeterConfig;
-        globalContext = _globalContext;
-        _resetContext();
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Applies dynamically-sized refund to a transaction to account for the difference in execution
-     * between L1 and L2, so that the overall cost of the ovmOPCODE is fixed.
-     * @param _cost Desired gas cost for the function after the refund.
-     */
-    modifier netGasCost(
-        uint256 _cost
-    ) {
-        uint256 gasProvided = gasleft();
-        _;
-        uint256 gasUsed = gasProvided - gasleft();
- 
-        // We want to refund everything *except* the specified cost.
-        if (_cost < gasUsed) {
-            transactionRecord.ovmGasRefund += gasUsed - _cost;
-        }
-    }
- 
-    /**
-     * Applies a fixed-size gas refund to a transaction to account for the difference in execution
-     * between L1 and L2, so that the overall cost of an ovmOPCODE can be lowered.
-     * @param _discount Amount of gas cost to refund for the ovmOPCODE.
-     */
-    modifier fixedGasDiscount(
-        uint256 _discount
-    ) {
-        uint256 gasProvided = gasleft();
-        _;
-        uint256 gasUsed = gasProvided - gasleft();
- 
-        // We want to refund the specified _discount, unless this risks underflow.
-        if (_discount < gasUsed) {
-            transactionRecord.ovmGasRefund += _discount;
-        } else {
-            // refund all we can without risking underflow.
-            transactionRecord.ovmGasRefund += gasUsed;
-        }
-    }
- 
-    /**
-     * Makes sure we're not inside a static context.
-     */
-    modifier notStatic() {
-        if (messageContext.isStatic == true) {
-            _revertWithFlag(RevertFlag.STATIC_VIOLATION);
-        }
-        _;
-    }
- 
- 
-    /************************************
-     * Transaction Execution Entrypoint *
-     ************************************/
- 
-    /**
-     * Starts the execution of a transaction via the OVM_ExecutionManager.
-     * @param _transaction Transaction data to be executed.
-     * @param _ovmStateManager iOVM_StateManager implementation providing account state.
-     */
-    function run(
-        Lib_OVMCodec.Transaction memory _transaction,
-        address _ovmStateManager
-    )
-        override
-        public
-    {
-        Erequire(transactionContext.ovmNUMBER == 0, "Only be callable at the start of a transaction");
-        // Store our OVM_StateManager instance (significantly easier than attempting to pass the
-        // address around in calldata).
-        ovmStateManager = iOVM_StateManager(_ovmStateManager);
- 
-        // Make sure this function can't be called by anyone except the owner of the
-        // OVM_StateManager (expected to be an OVM_StateTransitioner). We can revert here because
-        // this would make the `run` itself invalid.
-        Erequire(
-            // This method may return false during fraud proofs, but always returns true in L2 nodes' State Manager precompile.
-            ovmStateManager.isAuthenticated(msg.sender),
-            "Only authenticated addresses in ovmStateManager can call this function"
-        );
- 
-        // Initialize the execution context, must be initialized before we perform any gas metering
-        // or we'll throw a nuisance gas error.
-        _initContext(_transaction);
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Check whether we need to start a new epoch, do so if necessary.
-        // _checkNeedsNewEpoch(_transaction.timestamp);
- 
-        // Make sure the transaction's gas limit is valid. We don't revert here because we reserve
-        // reverts for INVALID_STATE_ACCESS.
-        Iif (_isValidGasLimit(_transaction.gasLimit, _transaction.l1QueueOrigin) == false) {
-            _resetContext();
-            return;
-        }
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Check gas right before the call to get total gas consumed by OVM transaction.
-        // uint256 gasProvided = gasleft();
- 
-        // Run the transaction, make sure to meter the gas usage.
-        ovmCALL(
-            _transaction.gasLimit - gasMeterConfig.minTransactionGasLimit,
-            _transaction.entrypoint,
-            _transaction.data
-        );
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Update the cumulative gas based on the amount of gas used.
-        // uint256 gasUsed = gasProvided - gasleft();
-        // _updateCumulativeGas(gasUsed, _transaction.l1QueueOrigin);
- 
-        // Wipe the execution context.
-        _resetContext();
- 
-        // Reset the ovmStateManager.
-        ovmStateManager = iOVM_StateManager(address(0));
-    }
- 
- 
-    /******************************
-     * Opcodes: Execution Context *
-     ******************************/
- 
-    /**
-     * @notice Overrides CALLER.
-     * @return _CALLER Address of the CALLER within the current message context.
-     */
-    function ovmCALLER()
-        override
-        public
-        view
-        returns (
-            address _CALLER
-        )
-    {
-        return messageContext.ovmCALLER;
-    }
- 
-    /**
-     * @notice Overrides ADDRESS.
-     * @return _ADDRESS Active ADDRESS within the current message context.
-     */
-    function ovmADDRESS()
-        override
-        public
-        view
-        returns (
-            address _ADDRESS
-        )
-    {
-        return messageContext.ovmADDRESS;
-    }
- 
-    /**
-     * @notice Overrides TIMESTAMP.
-     * @return _TIMESTAMP Value of the TIMESTAMP within the transaction context.
-     */
-    function ovmTIMESTAMP()
-        override
-        public
-        view
-        returns (
-            uint256 _TIMESTAMP
-        )
-    {
-        return transactionContext.ovmTIMESTAMP;
-    }
- 
-    /**
-     * @notice Overrides NUMBER.
-     * @return _NUMBER Value of the NUMBER within the transaction context.
-     */
-    function ovmNUMBER()
-        override
-        public
-        view
-        returns (
-            uint256 _NUMBER
-        )
-    {
-        return transactionContext.ovmNUMBER;
-    }
- 
-    /**
-     * @notice Overrides GASLIMIT.
-     * @return _GASLIMIT Value of the block's GASLIMIT within the transaction context.
-     */
-    function ovmGASLIMIT()
-        override
-        public
-        view
-        returns (
-            uint256 _GASLIMIT
-        )
-    {
-        return transactionContext.ovmGASLIMIT;
-    }
- 
-    /**
-     * @notice Overrides CHAINID.
-     * @return _CHAINID Value of the chain's CHAINID within the global context.
-     */
-    function ovmCHAINID()
-        override
-        public
-        view
-        returns (
-            uint256 _CHAINID
-        )
-    {
-        return globalContext.ovmCHAINID;
-    }
- 
-    /*********************************
-     * Opcodes: L2 Execution Context *
-     *********************************/
- 
-    /**
-     * @notice Specifies from which L1 rollup queue this transaction originated from.
-     * @return _queueOrigin Address of the ovmL1QUEUEORIGIN within the current message context.
-     */
-    function ovmL1QUEUEORIGIN()
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.QueueOrigin _queueOrigin
-        )
-    {
-        return transactionContext.ovmL1QUEUEORIGIN;
-    }
- 
-    /**
-     * @notice Specifies which L1 account, if any, sent this transaction by calling enqueue().
-     * @return _l1TxOrigin Address of the account which sent the tx into L2 from L1.
-     */
-    function ovmL1TXORIGIN()
-        override
-        public
-        view
-        returns (
-            address _l1TxOrigin
-        )
-    {
-        return transactionContext.ovmL1TXORIGIN;
-    }
- 
-    /********************
-     * Opcodes: Halting *
-     ********************/
- 
-    /**
-     * @notice Overrides REVERT.
-     * @param _data Bytes data to pass along with the REVERT.
-     */
-    function ovmREVERT(
-        bytes memory _data
-    )
-        override
-        public
-    {
-        _revertWithFlag(RevertFlag.INTENTIONAL_REVERT, _data);
-    }
- 
- 
-    /******************************
-     * Opcodes: Contract Creation *
-     ******************************/
- 
-    /**
-     * @notice Overrides CREATE.
-     * @param _bytecode Code to be used to CREATE a new contract.
-     * @return Address of the created contract.
-     * @return Revert data, if and only if the creation threw an exception.
-     */
-    function ovmCREATE(
-        bytes memory _bytecode
-    )
-        override
-        public
-        notStatic
-        fixedGasDiscount(40000)
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // Creator is always the current ADDRESS.
-        address creator = ovmADDRESS();
- 
-        // Check that the deployer is whitelisted, or
-        // that arbitrary contract deployment has been enabled.
-        _checkDeployerAllowed(creator);
- 
-        // Generate the correct CREATE address.
-        address contractAddress = Lib_EthUtils.getAddressForCREATE(
-            creator,
-            _getAccountNonce(creator)
-        );
- 
-        return _createContract(
-            contractAddress,
-            _bytecode
-        );
-    }
- 
-    /**
-     * @notice Overrides CREATE2.
-     * @param _bytecode Code to be used to CREATE2 a new contract.
-     * @param _salt Value used to determine the contract's address.
-     * @return Address of the created contract.
-     * @return Revert data, if and only if the creation threw an exception.
-     */
-    function ovmCREATE2(
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        override
-        public
-        notStatic
-        fixedGasDiscount(40000)
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // Creator is always the current ADDRESS.
-        address creator = ovmADDRESS();
- 
-        // Check that the deployer is whitelisted, or
-        // that arbitrary contract deployment has been enabled.
-        _checkDeployerAllowed(creator);
- 
-        // Generate the correct CREATE2 address.
-        address contractAddress = Lib_EthUtils.getAddressForCREATE2(
-            creator,
-            _bytecode,
-            _salt
-        );
- 
-        return _createContract(
-            contractAddress,
-            _bytecode
-        );
-    }
- 
- 
-    /*******************************
-     * Account Abstraction Opcodes *
-     ******************************/
- 
-    /**
-     * Retrieves the nonce of the current ovmADDRESS.
-     * @return _nonce Nonce of the current contract.
-     */
-    function ovmGETNONCE()
-        override
-        public
-        returns (
-            uint256 _nonce
-        )
-    {
-        return _getAccountNonce(ovmADDRESS());
-    }
- 
-    /**
-     * Sets the nonce of the current ovmADDRESS.
-     * @param _nonce New nonce for the current contract.
-     */
-    function ovmSETNONCE(
-        uint256 _nonce
-    )
-        override
-        public
-        notStatic
-    {
-        _setAccountNonce(ovmADDRESS(), _nonce);
-    }
- 
-    /**
-     * Creates a new EOA contract account, for account abstraction.
-     * @dev Essentially functions like ovmCREATE or ovmCREATE2, but we can bypass a lot of checks
-     *      because the contract we're creating is trusted (no need to do safety checking or to
-     *      handle unexpected reverts). Doesn't need to return an address because the address is
-     *      assumed to be the user's actual address.
-     * @param _messageHash Hash of a message signed by some user, for verification.
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     */
-    function ovmCREATEEOA(
-        bytes32 _messageHash,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        override
-        public
-        notStatic
-    {
-        // Recover the EOA address from the message hash and signature parameters. Since we do the
-        // hashing in advance, we don't have handle different message hashing schemes. Even if this
-        // function were to return the wrong address (rather than explicitly returning the zero
-        // address), the rest of the transaction would simply fail (since there's no EOA account to
-        // actually execute the transaction).
-        address eoa = ecrecover(
-            _messageHash,
-            _v + 27,
-            _r,
-            _s
-        );
- 
-        // Invalid signature is a case we proactively handle with a revert. We could alternatively
-        // have this function return a `success` boolean, but this is just easier.
-        Iif (eoa == address(0)) {
-            ovmREVERT(bytes("Signature provided for EOA contract creation is invalid."));
-        }
- 
-        // If the user already has an EOA account, then there's no need to perform this operation.
-        Iif (_hasEmptyAccount(eoa) == false) {
-            return;
-        }
- 
-        // We always need to initialize the contract with the default account values.
-        _initPendingAccount(eoa);
- 
-        // Temporarily set the current address so it's easier to access on L2.
-        address prevADDRESS = messageContext.ovmADDRESS;
-        messageContext.ovmADDRESS = eoa;
- 
-        // Now actually create the account and get its bytecode. We're not worried about reverts
-        // (other than out of gas, which we can't capture anyway) because this contract is trusted.
-        OVM_ProxyEOA proxyEOA = new OVM_ProxyEOA(0x4200000000000000000000000000000000000003);
- 
-        // Reset the address now that we're done deploying.
-        messageContext.ovmADDRESS = prevADDRESS;
- 
-        // Commit the account with its final values.
-        _commitPendingAccount(
-            eoa,
-            address(proxyEOA),
-            keccak256(Lib_EthUtils.getCode(address(proxyEOA)))
-        );
- 
-        _setAccountNonce(eoa, 0);
-    }
- 
- 
-    /*********************************
-     * Opcodes: Contract Interaction *
-     *********************************/
- 
-    /**
-     * @notice Overrides CALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmCALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(100000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // CALL updates the CALLER and ADDRESS.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _address;
- 
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
-    /**
-     * @notice Overrides STATICCALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmSTATICCALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(80000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // STATICCALL updates the CALLER, updates the ADDRESS, and runs in a static context.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _address;
-        nextMessageContext.isStatic = true;
- 
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
-    /**
-     * @notice Overrides DELEGATECALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmDELEGATECALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(40000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // DELEGATECALL does not change anything about the message context.
-        MessageContext memory nextMessageContext = messageContext;
-        
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
- 
-    /************************************
-     * Opcodes: Contract Storage Access *
-     ************************************/
- 
-    /**
-     * @notice Overrides SLOAD.
-     * @param _key 32 byte key of the storage slot to load.
-     * @return _value 32 byte value of the requested storage slot.
-     */
-    function ovmSLOAD(
-        bytes32 _key
-    )
-        override
-        public
-        netGasCost(40000)
-        returns (
-            bytes32 _value
-        )
-    {
-        // We always SLOAD from the storage of ADDRESS.
-        address contractAddress = ovmADDRESS();
- 
-        return _getContractStorage(
-            contractAddress,
-            _key
-        );
-    }
- 
-    /**
-     * @notice Overrides SSTORE.
-     * @param _key 32 byte key of the storage slot to set.
-     * @param _value 32 byte value for the storage slot.
-     */
-    function ovmSSTORE(
-        bytes32 _key,
-        bytes32 _value
-    )
-        override
-        public
-        notStatic
-        netGasCost(60000)
-    {
-        // We always SSTORE to the storage of ADDRESS.
-        address contractAddress = ovmADDRESS();
- 
-        _putContractStorage(
-            contractAddress,
-            _key,
-            _value
-        );
-    }
- 
- 
-    /*********************************
-     * Opcodes: Contract Code Access *
-     *********************************/
- 
-    /**
-     * @notice Overrides EXTCODECOPY.
-     * @param _contract Address of the contract to copy code from.
-     * @param _offset Offset in bytes from the start of contract code to copy beyond.
-     * @param _length Total number of bytes to copy from the contract's code.
-     * @return _code Bytes of code copied from the requested contract.
-     */
-    function ovmEXTCODECOPY(
-        address _contract,
-        uint256 _offset,
-        uint256 _length
-    )
-        override
-        public
-        returns (
-            bytes memory _code
-        )
-    {
-        // `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of
-        // return data. By blocking reads of one byte, we're able to use the condition that an
-        // OVM_ExecutionManager function return value having a length of exactly one byte indicates
-        // an error without an explicit revert. If users were able to read a single byte, they
-        // could forcibly trigger behavior that should only be available to this contract.
-        uint256 length = _length == 1 ? 2 : _length;
- 
-        return Lib_EthUtils.getCode(
-            _getAccountEthAddress(_contract),
-            _offset,
-            length
-        );
-    }
- 
-    /**
-     * @notice Overrides EXTCODESIZE.
-     * @param _contract Address of the contract to query the size of.
-     * @return _EXTCODESIZE Size of the requested contract in bytes.
-     */
-    function ovmEXTCODESIZE(
-        address _contract
-    )
-        override
-        public
-        returns (
-            uint256 _EXTCODESIZE
-        )
-    {
-        return Lib_EthUtils.getCodeSize(
-            _getAccountEthAddress(_contract)
-        );
-    }
- 
-    /**
-     * @notice Overrides EXTCODEHASH.
-     * @param _contract Address of the contract to query the hash of.
-     * @return _EXTCODEHASH Hash of the requested contract.
-     */
-    function ovmEXTCODEHASH(
-        address _contract
-    )
-        override
-        public
-        returns (
-            bytes32 _EXTCODEHASH
-        )
-    {
-        return Lib_EthUtils.getCodeHash(
-            _getAccountEthAddress(_contract)
-        );
-    }
- 
-    /***************************************
-     * Public Functions: Execution Context *
-     ***************************************/
- 
-    function getMaxTransactionGasLimit()
-        external
-        view
-        override
-        returns (
-            uint256 _maxTransactionGasLimit
-        )
-    {
-        return gasMeterConfig.maxTransactionGasLimit;
-    }
- 
-    /********************************************
-     * Public Functions: Deployment Whitelisting *
-     ********************************************/
- 
-    /**
-     * Checks whether the given address is on the whitelist to ovmCREATE/ovmCREATE2, and reverts if not.
-     * @param _deployerAddress Address attempting to deploy a contract.
-     */
-    function _checkDeployerAllowed(
-        address _deployerAddress
-    )
-        internal
-    {
-        // From an OVM semantics perspective, this will appear identical to
-        // the deployer ovmCALLing the whitelist.  This is fine--in a sense, we are forcing them to.
-        (bool success, bytes memory data) = ovmCALL(
-            gasleft(),
-            0x4200000000000000000000000000000000000002,
-            abi.encodeWithSignature("isDeployerAllowed(address)", _deployerAddress)
-        );
-        bool isAllowed = abi.decode(data, (bool));
- 
-        if (!isAllowed || !success) {
-            _revertWithFlag(RevertFlag.CREATOR_NOT_ALLOWED);
-        }
-    }
- 
-    /********************************************
-     * Internal Functions: Contract Interaction *
-     ********************************************/
- 
-    /**
-     * Creates a new contract and associates it with some contract address.
-     * @param _contractAddress Address to associate the created contract with.
-     * @param _bytecode Bytecode to be used to create the contract.
-     * @return Final OVM contract address.
-     * @return Revertdata, if and only if the creation threw an exception.
-     */
-    function _createContract(
-        address _contractAddress,
-        bytes memory _bytecode
-    )
-        internal
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // We always update the nonce of the creating account, even if the creation fails.
-        _setAccountNonce(ovmADDRESS(), _getAccountNonce(ovmADDRESS()) + 1);
- 
-        // We're stepping into a CREATE or CREATE2, so we need to update ADDRESS to point
-        // to the contract's associated address and CALLER to point to the previous ADDRESS.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = messageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _contractAddress;
- 
-        // Run the common logic which occurs between call-type and create-type messages,
-        // passing in the creation bytecode and `true` to trigger create-specific logic.
-        (bool success, bytes memory data) = _handleExternalMessage(
-            nextMessageContext,
-            gasleft(),
-            _contractAddress,
-            _bytecode,
-            true
-        );
- 
-        // Yellow paper requires that address returned is zero if the contract deployment fails.
-        return (
-            success ? _contractAddress : address(0),
-            data
-        );
-    }
- 
-    /**
-     * Calls the deployed contract associated with a given address.
-     * @param _nextMessageContext Message context to be used for the call.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _contract OVM address to be called.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function _callContract(
-        MessageContext memory _nextMessageContext,
-        uint256 _gasLimit,
-        address _contract,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // We reserve addresses of the form 0xdeaddeaddead...NNNN for the container contracts in L2 geth.
-        // So, we block calls to these addresses since they are not safe to run as an OVM contract itself.
-        if (
-            (uint256(_contract) & uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000))
-            == uint256(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000)
-        ) {
-            // EVM does not return data in the success case, see: https://github.com/ethereum/go-ethereum/blob/aae7660410f0ef90279e14afaaf2f429fdc2a186/core/vm/instructions.go#L600-L604
-            return (true, hex'');
-        }
- 
-        // Both 0x0000... and the EVM precompiles have the same address on L1 and L2 --> no trie lookup needed.
-        address codeContractAddress =
-            uint(_contract) < 100
-            ? _contract
-            : _getAccountEthAddress(_contract);
- 
-        return _handleExternalMessage(
-            _nextMessageContext,
-            _gasLimit,
-            codeContractAddress,
-            _calldata,
-            false
-        );
-    }
- 
-    /**
-     * Handles all interactions which involve the execution manager calling out to untrusted code (both calls and creates).
-     * Ensures that OVM-related measures are enforced, including L2 gas refunds, nuisance gas, and flagged reversions.
-     * 
-     * @param _nextMessageContext Message context to be used for the external message.
-     * @param _gasLimit Amount of gas to be passed into this message.
-     * @param _contract OVM address being called or deployed to
-     * @param _data Data for the message (either calldata or creation code)
-     * @param _isCreate Whether this is a create-type message.
-     * @return Whether or not the message (either a call or deployment) succeeded.
-     * @return Data returned by the message.
-     */
-    function _handleExternalMessage(
-        MessageContext memory _nextMessageContext,
-        uint256 _gasLimit,
-        address _contract,
-        bytes memory _data,
-        bool _isCreate
-    )
-        internal
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        // We need to switch over to our next message context for the duration of this call.
-        MessageContext memory prevMessageContext = messageContext;
-        _switchMessageContext(prevMessageContext, _nextMessageContext);
- 
-        // Nuisance gas is a system used to bound the ability for an attacker to make fraud proofs
-        // expensive by touching a lot of different accounts or storage slots. Since most contracts
-        // only use a few storage slots during any given transaction, this shouldn't be a limiting
-        // factor.
-        uint256 prevNuisanceGasLeft = messageRecord.nuisanceGasLeft;
-        uint256 nuisanceGasLimit = _getNuisanceGasLimit(_gasLimit);
-        messageRecord.nuisanceGasLeft = nuisanceGasLimit;
- 
-        // Make the call and make sure to pass in the gas limit. Another instance of hidden
-        // complexity. `_contract` is guaranteed to be a safe contract, meaning its return/revert
-        // behavior can be controlled. In particular, we enforce that flags are passed through
-        // revert data as to retrieve execution metadata that would normally be reverted out of
-        // existence.
- 
-        (bool success, bytes memory returndata) =
-            _isCreate
-            ? _handleContractCreation(_gasLimit, _data, _contract)
-            : _contract.call{gas: _gasLimit}(_data);
- 
-        // Switch back to the original message context now that we're out of the call.
-        _switchMessageContext(_nextMessageContext, prevMessageContext);
- 
-        // Assuming there were no reverts, the message record should be accurate here. We'll update
-        // this value in the case of a revert.
-        uint256 nuisanceGasLeft = messageRecord.nuisanceGasLeft;
- 
-        // Reverts at this point are completely OK, but we need to make a few updates based on the
-        // information passed through the revert.
-        if (success == false) {
-            (
-                RevertFlag flag,
-                uint256 nuisanceGasLeftPostRevert,
-                uint256 ovmGasRefund,
-                bytes memory returndataFromFlag
-            ) = _decodeRevertData(returndata);
- 
-            // INVALID_STATE_ACCESS is the only flag that triggers an immediate abort of the
-            // parent EVM message. This behavior is necessary because INVALID_STATE_ACCESS must
-            // halt any further transaction execution that could impact the execution result.
-            if (flag == RevertFlag.INVALID_STATE_ACCESS) {
-                _revertWithFlag(flag);
-            }
- 
-            // INTENTIONAL_REVERT, UNSAFE_BYTECODE, STATIC_VIOLATION, and CREATOR_NOT_ALLOWED aren't
-            // dependent on the input state, so we can just handle them like standard reverts. Our only change here
-            // is to record the gas refund reported by the call (enforced by safety checking).
-            if (
-                flag == RevertFlag.INTENTIONAL_REVERT
-                || flag == RevertFlag.UNSAFE_BYTECODE
-                || flag == RevertFlag.STATIC_VIOLATION
-                || flag == RevertFlag.CREATOR_NOT_ALLOWED
-            ) {
-                transactionRecord.ovmGasRefund = ovmGasRefund;
-            }
- 
-            // INTENTIONAL_REVERT needs to pass up the user-provided return data encoded into the
-            // flag, *not* the full encoded flag. All other revert types return no data.
-            if (
-                flag == RevertFlag.INTENTIONAL_REVERT
-                || _isCreate
-            ) {
-                returndata = returndataFromFlag;
-            } else {
-                returndata = hex'';
-            }
- 
-            // Reverts mean we need to use up whatever "nuisance gas" was used by the call.
-            // EXCEEDS_NUISANCE_GAS explicitly reduces the remaining nuisance gas for this message
-            // to zero. OUT_OF_GAS is a "pseudo" flag given that messages return no data when they
-            // run out of gas, so we have to treat this like EXCEEDS_NUISANCE_GAS. All other flags
-            // will simply pass up the remaining nuisance gas.
-            nuisanceGasLeft = nuisanceGasLeftPostRevert;
-        }
- 
-        // We need to reset the nuisance gas back to its original value minus the amount used here.
-        messageRecord.nuisanceGasLeft = prevNuisanceGasLeft - (nuisanceGasLimit - nuisanceGasLeft);
- 
-        return (
-            success,
-            returndata
-        );
-    }
- 
-    /**
-     * Handles the creation-specific safety measures required for OVM contract deployment.
-     * This function sanitizes the return types for creation messages to match calls (bool, bytes).
-     * This allows for consistent handling of both types of messages in _handleExternalMessage().
-     * 
-     * @param _gasLimit Amount of gas to be passed into this creation.
-     * @param _creationCode Code to pass into CREATE for deployment.
-     * @param _address OVM address being deployed to.
-     * @return Whether or not the call succeeded.
-     * @return If creation fails: revert data. Otherwise: empty.
-     */
-    function _handleContractCreation(
-        uint _gasLimit,
-        bytes memory _creationCode,
-        address _address
-    )
-        internal
-        returns(
-            bool,
-            bytes memory
-        )
-    {
-        // Check that there is not already code at this address.
-        Iif (_hasEmptyAccount(_address) == false) {
-            // Note: in the EVM, this case burns all allotted gas.  For improved
-            // developer experience, we do return the remaining ones.
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.CREATE_COLLISION,
-                    Lib_ErrorUtils.encodeRevertString("A contract has already been deployed to this address")
-                )
-            );
-        }
- 
-        // Check the creation bytecode against the OVM_SafetyChecker.
-        Iif (ovmSafetyChecker.isBytecodeSafe(_creationCode) == false) {
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.UNSAFE_BYTECODE,
-                    Lib_ErrorUtils.encodeRevertString("Contract creation code contains unsafe opcodes. Did you use the right compiler or pass an unsafe constructor argument?")
-                )
-            );
-        }
- 
-        // We always need to initialize the contract with the default account values.
-        _initPendingAccount(_address);
- 
-        // Actually execute the EVM create message,
-        address ethAddress = Lib_EthUtils.createContract(_creationCode);
-        
-        if (ethAddress == address(0)) {
-            // If the creation fails, the EVM lets us grab its revert data. This may contain a revert flag
-            // to be used above in _handleExternalMessage.
-            uint256 revertDataSize;
-            assembly { revertDataSize := returndatasize() }
-            bytes memory revertdata = new bytes(revertDataSize);
-            assembly {
-                returndatacopy(
-                    add(revertdata, 0x20),
-                    0,
-                    revertDataSize
-                )
-            }
-            // Return that the creation failed, and the data it reverted with.
-            return (false, revertdata);
-        }
- 
-        // Again simply checking that the deployed code is safe too. Contracts can generate
-        // arbitrary deployment code, so there's no easy way to analyze this beforehand.
-        bytes memory deployedCode = Lib_EthUtils.getCode(ethAddress);
-        if (ovmSafetyChecker.isBytecodeSafe(deployedCode) == false) {
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.UNSAFE_BYTECODE,
-                    Lib_ErrorUtils.encodeRevertString("Constructor attempted to deploy unsafe bytecode.")
-                )
-            );
-        }
- 
-        // Contract creation didn't need to be reverted and the bytecode is safe. We finish up by
-        // associating the desired address with the newly created contract's code hash and address.
-        _commitPendingAccount(
-            _address,
-            ethAddress,
-            Lib_EthUtils.getCodeHash(ethAddress)
-        );
- 
-        // Successful deployments will not give access to returndata, in both the EVM and the OVM.
-        return (true, hex'');
-    }
- 
-    /******************************************
-     * Internal Functions: State Manipulation *
-     ******************************************/
- 
-    /**
-     * Checks whether an account exists within the OVM_StateManager.
-     * @param _address Address of the account to check.
-     * @return _exists Whether or not the account exists.
-     */
-    function _hasAccount(
-        address _address
-    )
-        internal
-        returns (
-            bool _exists
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.hasAccount(_address);
-    }
- 
-    /**
-     * Checks whether a known empty account exists within the OVM_StateManager.
-     * @param _address Address of the account to check.
-     * @return _exists Whether or not the account empty exists.
-     */
-    function _hasEmptyAccount(
-        address _address
-    )
-        internal
-        returns (
-            bool _exists
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.hasEmptyAccount(_address);
-    }
- 
-    /**
-     * Sets the nonce of an account.
-     * @param _address Address of the account to modify.
-     * @param _nonce New account nonce.
-     */
-    function _setAccountNonce(
-        address _address,
-        uint256 _nonce
-    )
-        internal
-    {
-        _checkAccountChange(_address);
-        ovmStateManager.setAccountNonce(_address, _nonce);
-    }
- 
-    /**
-     * Gets the nonce of an account.
-     * @param _address Address of the account to access.
-     * @return _nonce Nonce of the account.
-     */
-    function _getAccountNonce(
-        address _address
-    )
-        internal
-        returns (
-            uint256 _nonce
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.getAccountNonce(_address);
-    }
- 
-    /**
-     * Retrieves the Ethereum address of an account.
-     * @param _address Address of the account to access.
-     * @return _ethAddress Corresponding Ethereum address.
-     */
-    function _getAccountEthAddress(
-        address _address
-    )
-        internal
-        returns (
-            address _ethAddress
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.getAccountEthAddress(_address);
-    }
- 
-    /**
-     * Creates the default account object for the given address.
-     * @param _address Address of the account create.
-     */
-    function _initPendingAccount(
-        address _address
-    )
-        internal
-    {
-        // Although it seems like `_checkAccountChange` would be more appropriate here, we don't
-        // actually consider an account "changed" until it's inserted into the state (in this case
-        // by `_commitPendingAccount`).
-        _checkAccountLoad(_address);
-        ovmStateManager.initPendingAccount(_address);
-    }
- 
-    /**
-     * Stores additional relevant data for a new account, thereby "committing" it to the state.
-     * This function is only called during `ovmCREATE` and `ovmCREATE2` after a successful contract
-     * creation.
-     * @param _address Address of the account to commit.
-     * @param _ethAddress Address of the associated deployed contract.
-     * @param _codeHash Hash of the code stored at the address.
-     */
-    function _commitPendingAccount(
-        address _address,
-        address _ethAddress,
-        bytes32 _codeHash
-    )
-        internal
-    {
-        _checkAccountChange(_address);
-        ovmStateManager.commitPendingAccount(
-            _address,
-            _ethAddress,
-            _codeHash
-        );
-    }
- 
-    /**
-     * Retrieves the value of a storage slot.
-     * @param _contract Address of the contract to query.
-     * @param _key 32 byte key of the storage slot.
-     * @return _value 32 byte storage slot value.
-     */
-    function _getContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-        returns (
-            bytes32 _value
-        )
-    {
-        _checkContractStorageLoad(_contract, _key);
-        return ovmStateManager.getContractStorage(_contract, _key);
-    }
- 
-    /**
-     * Sets the value of a storage slot.
-     * @param _contract Address of the contract to modify.
-     * @param _key 32 byte key of the storage slot.
-     * @param _value 32 byte storage slot value.
-     */
-    function _putContractStorage(
-        address _contract,
-        bytes32 _key,
-        bytes32 _value
-    )
-        internal
-    {
-        // We don't set storage if the value didn't change. Although this acts as a convenient
-        // optimization, it's also necessary to avoid the case in which a contract with no storage
-        // attempts to store the value "0" at any key. Putting this value (and therefore requiring
-        // that the value be committed into the storage trie after execution) would incorrectly
-        // modify the storage root.
-        Iif (_getContractStorage(_contract, _key) == _value) {
-            return;
-        }
- 
-        _checkContractStorageChange(_contract, _key);
-        ovmStateManager.putContractStorage(_contract, _key, _value);
-    }
- 
-    /**
-     * Validation whenever a contract needs to be loaded. Checks that the account exists, charges
-     * nuisance gas if the account hasn't been loaded before.
-     * @param _address Address of the account to load.
-     */
-    function _checkAccountLoad(
-        address _address
-    )
-        internal
-    {
-        // See `_checkContractStorageLoad` for more information.
-        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
-            _revertWithFlag(RevertFlag.OUT_OF_GAS);
-        }
- 
-        // See `_checkContractStorageLoad` for more information.
-        if (ovmStateManager.hasAccount(_address) == false) {
-            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
-        }
- 
-        // Check whether the account has been loaded before and mark it as loaded if not. We need
-        // this because "nuisance gas" only applies to the first time that an account is loaded.
-        (
-            bool _wasAccountAlreadyLoaded
-        ) = ovmStateManager.testAndSetAccountLoaded(_address);
- 
-        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
-        // on the size of the contract code.
-        if (_wasAccountAlreadyLoaded == false) {
-            _useNuisanceGas(
-                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
-            );
-        }
-    }
- 
-    /**
-     * Validation whenever a contract needs to be changed. Checks that the account exists, charges
-     * nuisance gas if the account hasn't been changed before.
-     * @param _address Address of the account to change.
-     */
-    function _checkAccountChange(
-        address _address
-    )
-        internal
-    {
-        // Start by checking for a load as we only want to charge nuisance gas proportional to
-        // contract size once.
-        _checkAccountLoad(_address);
- 
-        // Check whether the account has been changed before and mark it as changed if not. We need
-        // this because "nuisance gas" only applies to the first time that an account is changed.
-        (
-            bool _wasAccountAlreadyChanged
-        ) = ovmStateManager.testAndSetAccountChanged(_address);
- 
-        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
-        // on the size of the contract code.
-        if (_wasAccountAlreadyChanged == false) {
-            ovmStateManager.incrementTotalUncommittedAccounts();
-            _useNuisanceGas(
-                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
-            );
-        }
-    }
- 
-    /**
-     * Validation whenever a slot needs to be loaded. Checks that the account exists, charges
-     * nuisance gas if the slot hasn't been loaded before.
-     * @param _contract Address of the account to load from.
-     * @param _key 32 byte key to load.
-     */
-    function _checkContractStorageLoad(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-    {
-        // Another case of hidden complexity. If we didn't enforce this requirement, then a
-        // contract could pass in just enough gas to cause the INVALID_STATE_ACCESS check to fail
-        // on L1 but not on L2. A contract could use this behavior to prevent the
-        // OVM_ExecutionManager from detecting an invalid state access. Reverting with OUT_OF_GAS
-        // allows us to also charge for the full message nuisance gas, because you deserve that for
-        // trying to break the contract in this way.
-        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
-            _revertWithFlag(RevertFlag.OUT_OF_GAS);
-        }
- 
-        // We need to make sure that the transaction isn't trying to access storage that hasn't
-        // been provided to the OVM_StateManager. We'll immediately abort if this is the case.
-        // We know that we have enough gas to do this check because of the above test.
-        Iif (ovmStateManager.hasContractStorage(_contract, _key) == false) {
-            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
-        }
- 
-        // Check whether the slot has been loaded before and mark it as loaded if not. We need
-        // this because "nuisance gas" only applies to the first time that a slot is loaded.
-        (
-            bool _wasContractStorageAlreadyLoaded
-        ) = ovmStateManager.testAndSetContractStorageLoaded(_contract, _key);
- 
-        // If we hadn't already loaded the account, then we'll need to charge some fixed amount of
-        // "nuisance gas".
-        if (_wasContractStorageAlreadyLoaded == false) {
-            _useNuisanceGas(NUISANCE_GAS_SLOAD);
-        }
-    }
- 
-    /**
-     * Validation whenever a slot needs to be changed. Checks that the account exists, charges
-     * nuisance gas if the slot hasn't been changed before.
-     * @param _contract Address of the account to change.
-     * @param _key 32 byte key to change.
-     */
-    function _checkContractStorageChange(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-    {
-        // Start by checking for load to make sure we have the storage slot and that we charge the
-        // "nuisance gas" necessary to prove the storage slot state.
-        _checkContractStorageLoad(_contract, _key);
- 
-        // Check whether the slot has been changed before and mark it as changed if not. We need
-        // this because "nuisance gas" only applies to the first time that a slot is changed.
-        (
-            bool _wasContractStorageAlreadyChanged
-        ) = ovmStateManager.testAndSetContractStorageChanged(_contract, _key);
- 
-        // If we hadn't already changed the account, then we'll need to charge some fixed amount of
-        // "nuisance gas".
-        Eif (_wasContractStorageAlreadyChanged == false) {
-            // Changing a storage slot means that we're also going to have to change the
-            // corresponding account, so do an account change check.
-            _checkAccountChange(_contract);
- 
-            ovmStateManager.incrementTotalUncommittedContractStorage();
-            _useNuisanceGas(NUISANCE_GAS_SSTORE);
-        }
-    }
- 
- 
-    /************************************
-     * Internal Functions: Revert Logic *
-     ************************************/
- 
-    /**
-     * Simple encoding for revert data.
-     * @param _flag Flag to revert with.
-     * @param _data Additional user-provided revert data.
-     * @return _revertdata Encoded revert data.
-     */
-    function _encodeRevertData(
-        RevertFlag _flag,
-        bytes memory _data
-    )
-        internal
-        view
-        returns (
-            bytes memory _revertdata
-        )
-    {
-        // Out of gas and create exceptions will fundamentally return no data, so simulating it shouldn't either.
-        Iif (
-            _flag == RevertFlag.OUT_OF_GAS
-        ) {
-            return bytes('');
-        }
- 
-        // INVALID_STATE_ACCESS doesn't need to return any data other than the flag.
-        if (_flag == RevertFlag.INVALID_STATE_ACCESS) {
-            return abi.encode(
-                _flag,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        // Just ABI encode the rest of the parameters.
-        return abi.encode(
-            _flag,
-            messageRecord.nuisanceGasLeft,
-            transactionRecord.ovmGasRefund,
-            _data
-        );
-    }
- 
-    /**
-     * Simple decoding for revert data.
-     * @param _revertdata Revert data to decode.
-     * @return _flag Flag used to revert.
-     * @return _nuisanceGasLeft Amount of nuisance gas unused by the message.
-     * @return _ovmGasRefund Amount of gas refunded during the message.
-     * @return _data Additional user-provided revert data.
-     */
-    function _decodeRevertData(
-        bytes memory _revertdata
-    )
-        internal
-        pure
-        returns (
-            RevertFlag _flag,
-            uint256 _nuisanceGasLeft,
-            uint256 _ovmGasRefund,
-            bytes memory _data
-        )
-    {
-        // A length of zero means the call ran out of gas, just return empty data.
-        if (_revertdata.length == 0) {
-            return (
-                RevertFlag.OUT_OF_GAS,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        // ABI decode the incoming data.
-        return abi.decode(_revertdata, (RevertFlag, uint256, uint256, bytes));
-    }
- 
-    /**
-     * Causes a message to revert or abort.
-     * @param _flag Flag to revert with.
-     * @param _data Additional user-provided data.
-     */
-    function _revertWithFlag(
-        RevertFlag _flag,
-        bytes memory _data
-    )
-        internal
-        view
-    {
-        bytes memory revertdata = _encodeRevertData(
-            _flag,
-            _data
-        );
- 
-        assembly {
-            revert(add(revertdata, 0x20), mload(revertdata))
-        }
-    }
- 
-    /**
-     * Causes a message to revert or abort.
-     * @param _flag Flag to revert with.
-     */
-    function _revertWithFlag(
-        RevertFlag _flag
-    )
-        internal
-    {
-        _revertWithFlag(_flag, bytes(''));
-    }
- 
- 
-    /******************************************
-     * Internal Functions: Nuisance Gas Logic *
-     ******************************************/
- 
-    /**
-     * Computes the nuisance gas limit from the gas limit.
-     * @dev This function is currently using a naive implementation whereby the nuisance gas limit
-     *      is set to exactly equal the lesser of the gas limit or remaining gas. It's likely that
-     *      this implementation is perfectly fine, but we may change this formula later.
-     * @param _gasLimit Gas limit to compute from.
-     * @return _nuisanceGasLimit Computed nuisance gas limit.
-     */
-    function _getNuisanceGasLimit(
-        uint256 _gasLimit
-    )
-        internal
-        view
-        returns (
-            uint256 _nuisanceGasLimit
-        )
-    {
-        return _gasLimit < gasleft() ? _gasLimit : gasleft();
-    }
- 
-    /**
-     * Uses a certain amount of nuisance gas.
-     * @param _amount Amount of nuisance gas to use.
-     */
-    function _useNuisanceGas(
-        uint256 _amount
-    )
-        internal
-    {
-        // Essentially the same as a standard OUT_OF_GAS, except we also retain a record of the gas
-        // refund to be given at the end of the transaction.
-        Iif (messageRecord.nuisanceGasLeft < _amount) {
-            _revertWithFlag(RevertFlag.EXCEEDS_NUISANCE_GAS);
-        }
- 
-        messageRecord.nuisanceGasLeft -= _amount;
-    }
- 
- 
-    /************************************
-     * Internal Functions: Gas Metering *
-     ************************************/
- 
-    /**
-     * Checks whether a transaction needs to start a new epoch and does so if necessary.
-     * @param _timestamp Transaction timestamp.
-     */
-    function _checkNeedsNewEpoch(
-        uint256 _timestamp
-    )
-        internal
-    {
-        if (
-            _timestamp >= (
-                _getGasMetadata(GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP)
-                + gasMeterConfig.secondsPerEpoch
-            )
-        ) {
-            _putGasMetadata(
-                GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP,
-                _timestamp
-            );
- 
-            _putGasMetadata(
-                GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS,
-                _getGasMetadata(
-                    GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS
-                )
-            );
- 
-            _putGasMetadata(
-                GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS,
-                _getGasMetadata(
-                    GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS
-                )
-            );
-        }
-    }
- 
-    /**
-     * Validates the gas limit for a given transaction.
-     * @param _gasLimit Gas limit provided by the transaction.
-     * param _queueOrigin Queue from which the transaction originated.
-     * @return _valid Whether or not the gas limit is valid.
-     */
-    function _isValidGasLimit(
-        uint256 _gasLimit,
-        Lib_OVMCodec.QueueOrigin // _queueOrigin
-    )
-        view
-        internal
-        returns (
-            bool _valid
-        )
-    {
-        // Always have to be below the maximum gas limit.
-        Iif (_gasLimit > gasMeterConfig.maxTransactionGasLimit) {
-            return false;
-        }
- 
-        // Always have to be above the minimum gas limit.
-        Iif (_gasLimit < gasMeterConfig.minTransactionGasLimit) {
-            return false;
-        }
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        return true;
-        // GasMetadataKey cumulativeGasKey;
-        // GasMetadataKey prevEpochGasKey;
-        // if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
-        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
-        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS;
-        // } else {
-        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
-        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS;
-        // }
- 
-        // return (
-        //     (
-        //         _getGasMetadata(cumulativeGasKey)
-        //         - _getGasMetadata(prevEpochGasKey)
-        //         + _gasLimit
-        //     ) < gasMeterConfig.maxGasPerQueuePerEpoch
-        // );
-    }
- 
-    /**
-     * Updates the cumulative gas after a transaction.
-     * @param _gasUsed Gas used by the transaction.
-     * @param _queueOrigin Queue from which the transaction originated.
-     */
-    function _updateCumulativeGas(
-        uint256 _gasUsed,
-        Lib_OVMCodec.QueueOrigin _queueOrigin
-    )
-        internal
-    {
-        GasMetadataKey cumulativeGasKey;
-        if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
-            cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
-        } else {
-            cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
-        }
- 
-        _putGasMetadata(
-            cumulativeGasKey,
-            (
-                _getGasMetadata(cumulativeGasKey)
-                + gasMeterConfig.minTransactionGasLimit
-                + _gasUsed
-                - transactionRecord.ovmGasRefund
-            )
-        );
-    }
- 
-    /**
-     * Retrieves the value of a gas metadata key.
-     * @param _key Gas metadata key to retrieve.
-     * @return _value Value stored at the given key.
-     */
-    function _getGasMetadata(
-        GasMetadataKey _key
-    )
-        internal
-        returns (
-            uint256 _value
-        )
-    {
-        return uint256(_getContractStorage(
-            GAS_METADATA_ADDRESS,
-            bytes32(uint256(_key))
-        ));
-    }
- 
-    /**
-     * Sets the value of a gas metadata key.
-     * @param _key Gas metadata key to set.
-     * @param _value Value to store at the given key.
-     */
-    function _putGasMetadata(
-        GasMetadataKey _key,
-        uint256 _value
-    )
-        internal
-    {
-        _putContractStorage(
-            GAS_METADATA_ADDRESS,
-            bytes32(uint256(_key)),
-            bytes32(uint256(_value))
-        );
-    }
- 
- 
-    /*****************************************
-     * Internal Functions: Execution Context *
-     *****************************************/
- 
-    /**
-     * Swaps over to a new message context.
-     * @param _prevMessageContext Context we're switching from.
-     * @param _nextMessageContext Context we're switching to.
-     */
-    function _switchMessageContext(
-        MessageContext memory _prevMessageContext,
-        MessageContext memory _nextMessageContext
-    )
-        internal
-    {
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.ovmCALLER != _nextMessageContext.ovmCALLER) {
-            messageContext.ovmCALLER = _nextMessageContext.ovmCALLER;
-        }
- 
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.ovmADDRESS != _nextMessageContext.ovmADDRESS) {
-            messageContext.ovmADDRESS = _nextMessageContext.ovmADDRESS;
-        }
- 
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.isStatic != _nextMessageContext.isStatic) {
-            messageContext.isStatic = _nextMessageContext.isStatic;
-        }
-    }
- 
-    /**
-     * Initializes the execution context.
-     * @param _transaction OVM transaction being executed.
-     */
-    function _initContext(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        internal
-    {
-        transactionContext.ovmTIMESTAMP = _transaction.timestamp;
-        transactionContext.ovmNUMBER = _transaction.blockNumber;
-        transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
-        transactionContext.ovmL1QUEUEORIGIN = _transaction.l1QueueOrigin;
-        transactionContext.ovmL1TXORIGIN = _transaction.l1TxOrigin;
-        transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
- 
-        messageRecord.nuisanceGasLeft = _getNuisanceGasLimit(_transaction.gasLimit);
-    }
- 
-    /**
-     * Resets the transaction and message context.
-     */
-    function _resetContext()
-        internal
-    {
-        transactionContext.ovmL1TXORIGIN = address(0);
-        transactionContext.ovmTIMESTAMP = 0;
-        transactionContext.ovmNUMBER = 0;
-        transactionContext.ovmGASLIMIT = 0;
-        transactionContext.ovmTXGASLIMIT = 0;
-        transactionContext.ovmL1QUEUEORIGIN = Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE;
- 
-        transactionRecord.ovmGasRefund = 0;
- 
-        messageContext.ovmCALLER = address(0);
-        messageContext.ovmADDRESS = address(0);
-        messageContext.isStatic = false;
- 
-        messageRecord.nuisanceGasLeft = 0;
-    }
- 
-    /*****************************
-     * L2-only Helper Functions *
-     *****************************/
- 
-    /**
-     * Unreachable helper function for simulating eth_calls with an OVM message context.
-     * This function will throw an exception in all cases other than when used as a custom entrypoint in L2 Geth to simulate eth_call.
-     * @param _transaction the message transaction to simulate.
-     * @param _from the OVM account the simulated call should be from.
-     */
-    function simulateMessage(
-        Lib_OVMCodec.Transaction memory _transaction,
-        address _from,
-        iOVM_StateManager _ovmStateManager
-    )
-        external
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        // Prevent this call from having any effect unless in a custom-set VM frame
-        require(msg.sender == address(0));
- 
-        ovmStateManager = _ovmStateManager;
-        _initContext(_transaction);
-        messageRecord.nuisanceGasLeft = uint(-1);
- 
-        messageContext.ovmADDRESS = _from;
- 
-        bool isCreate = _transaction.entrypoint == address(0);
-        if (isCreate) {
-            (address created, bytes memory revertData) = ovmCREATE(_transaction.data);
-            if (created == address(0)) {
-                return (false, revertData);
-            } else {
-                // The eth_call RPC endpoint for to = undefined will return the deployed bytecode 
-                // in the success case, differing from standard create messages.
-                return (true, Lib_EthUtils.getCode(created));
-            }
-        } else {
-            return ovmCALL(
-                _transaction.gasLimit,
-                _transaction.entrypoint,
-                _transaction.data
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html deleted file mode 100644 index 90baa02d9..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html +++ /dev/null @@ -1,509 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/execution/ OVM_SafetyChecker.sol -

-
-
- 100% - Statements - 8/8 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 10/10 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -277× -  -  -  -  -  -  -  -  -  -  -277× -  -277× -  -277× -  -277× -277× -277× -  -  -277× -277× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -152× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
- 
-/**
- * @title OVM_SafetyChecker
- * @dev  The Safety Checker verifies that contracts deployed on L2 do not contain any
- * "unsafe" operations. An operation is considered unsafe if it would access state variables which
- * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used
- * to "escape the sandbox" of the OVM, resulting in non-deterministic fraud proofs. 
- * That is, an attacker would be able to "prove fraud" on an honestly applied transaction.
- * Note that a "safe" contract requires opcodes to appear in a particular pattern;
- * omission of "unsafe" opcodes is necessary, but not sufficient.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_SafetyChecker is iOVM_SafetyChecker {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Returns whether or not all of the provided bytecode is safe.
-     * @param _bytecode The bytecode to safety check.
-     * @return `true` if the bytecode is safe, `false` otherwise.
-     */
-    function isBytecodeSafe(
-        bytes memory _bytecode
-    )
-        override
-        external
-        pure
-        returns (
-            bool
-        )
-    {
-        // autogenerated by gen_safety_checker_constants.py
-        // number of bytes to skip for each opcode
-        uint256[8] memory opcodeSkippableBytes = [
-            uint256(0x0001010101010101010101010000000001010101010101010101010101010000),
-            uint256(0x0100000000000000000000000000000000000000010101010101000000010100),
-            uint256(0x0000000000000000000000000000000001010101000000010101010100000000),
-            uint256(0x0203040500000000000000000000000000000000000000000000000000000000),
-            uint256(0x0101010101010101010101010101010101010101010101010101010101010101),
-            uint256(0x0101010101000000000000000000000000000000000000000000000000000000),
-            uint256(0x0000000000000000000000000000000000000000000000000000000000000000),
-            uint256(0x0000000000000000000000000000000000000000000000000000000000000000)
-        ];
-        // Mask to gate opcode specific cases
-        uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);
-        // Halting opcodes
-        uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);
-        // PUSH opcodes
-        uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);
- 
-        uint256 codeLength;
-        uint256 _pc;
-        assembly {
-            _pc := add(_bytecode, 0x20)
-        }
-        codeLength = _pc + _bytecode.length;
-        do {
-            // current opcode: 0x00...0xff
-            uint256 opNum;
- 
-            // inline assembly removes the extra add + bounds check
-            assembly {
-                let word := mload(_pc) //load the next 32 bytes at pc into word
- 
-                // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord
-                // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4
-                // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).
-                // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,
-                // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.
-                let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                _pc := add(_pc, indexInWord)
- 
-                opNum := byte(indexInWord, word)
-            }
- 
-            // + push opcodes
-            // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]
-            // + caller opcode CALLER(0x33)
-            // + blacklisted opcodes
-            uint256 opBit = 1 << opNum;
-            if (opBit & opcodeGateMask == 0) {
-                if (opBit & opcodePushMask == 0) {
-                    // all pushes are valid opcodes
-                    // subsequent bytes are not opcodes. Skip them.
-                    _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to
-                    // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)
-                    continue;
-                } else if (opBit & opcodeHaltingMask == 0) {
-                    // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)
-                    // We are now inside unreachable code until we hit a JUMPDEST!
-                    do {
-                        _pc++;
-                        assembly {
-                            opNum := byte(0, mload(_pc))
-                        }
-                        // encountered a JUMPDEST
-                        if (opNum == 0x5b) break;
-                        // skip PUSHed bytes
-                        if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)
-                    } while (_pc < codeLength);
-                    // opNum is 0x5b, so we don't continue here since the pc++ is fine
-                } else if (opNum == 0x33) { // Caller opcode
-                    uint256 firstOps; // next 32 bytes of bytecode
-                    uint256 secondOps; // following 32 bytes of bytecode
- 
-                    assembly {
-                        firstOps := mload(_pc)
-                        // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits
-                        secondOps := shr(216, mload(add(_pc, 0x20)))
-                    }
- 
-                    // Call identity precompile
-                    // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL
-                    // 32 - 8 bytes = 24 bytes = 192
-                    if ((firstOps >> 192) == 0x3350600060045af1) {
-                        _pc += 8;
-                    // Call EM and abort execution if instructed
-                    // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST 
-                    } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {
-                        _pc += 37;
-                    } else {
-                        return false;
-                    }
-                    continue;
-                } else {
-                    // encountered a non-whitelisted opcode!
-                    return false;
-                }
-            }
-            _pc++;
-        } while (_pc < codeLength);
-        return true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html deleted file mode 100644 index 35ac577fa..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html +++ /dev/null @@ -1,2279 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/OVM_StateManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/execution/ OVM_StateManager.sol -

-
-
- 79.69% - Statements - 51/64 -
-
- 100% - Branches - 12/12 -
-
- 80% - Functions - 28/35 -
-
- 80% - Lines - 52/65 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -348× -  -  -  -  -  -  -  -  -  -  -  -  -  -1041× -  -  -  -1040× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -58× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -33× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -35× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -62× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -371× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -32× -32× -32× -32× -32× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -19× -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -543× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -66× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -73× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -38× -  -  -  -  -  -  -38× -23× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -62× -  -  -  - -  -  -  -55× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -77× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -74× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -33× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -616× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -107× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -707× -  -707× -282× -  -  -707× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
- 
-/**
- * @title OVM_StateManager
- * @dev The State Manager contract holds all storage values for contracts in the OVM. It can only be written to by the
- * the Execution Manager and State Transitioner. It runs on L1 during the setup and execution of a fraud proof.
- * The same logic runs on L2, but has been implemented as a precompile in the L2 go-ethereum client
- * (see https://github.com/ethereum-optimism/go-ethereum/blob/master/core/vm/ovm_state_manager.go).
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateManager is iOVM_StateManager {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 constant internal EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
-    bytes32 constant internal EMPTY_ACCOUNT_CODE_HASH =    0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
-    bytes32 constant internal STORAGE_XOR_VALUE =          0xFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEF;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    address override public owner;
-    address override public ovmExecutionManager;
-    mapping (address => Lib_OVMCodec.Account) internal accounts;
-    mapping (address => mapping (bytes32 => bytes32)) internal contractStorage;
-    mapping (address => mapping (bytes32 => bool)) internal verifiedContractStorage;
-    mapping (bytes32 => ItemState) internal itemStates;
-    uint256 internal totalUncommittedAccounts;
-    uint256 internal totalUncommittedContractStorage;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _owner Address of the owner of this contract.
-     */
-    constructor(
-        address _owner
-    )
-    {
-        owner = _owner;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Simple authentication, this contract should only be accessible to the owner (which is expected to be the State Transitioner during `PRE_EXECUTION` 
-     * or the OVM_ExecutionManager during transaction execution.
-     */
-    modifier authenticated() {
-        // owner is the State Transitioner
-        require(
-            msg.sender == owner || msg.sender == ovmExecutionManager,
-            "Function can only be called by authenticated addresses"
-        );
-        _;
-    }
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Checks whether a given address is allowed to modify this contract.
-     * @param _address Address to check.
-     * @return Whether or not the address can modify this contract.
-     */
-    function isAuthenticated(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return (_address == owner || _address == ovmExecutionManager);
-    }
- 
-    /**
-     * Sets the address of the OVM_ExecutionManager.
-     * @param _ovmExecutionManager Address of the OVM_ExecutionManager.
-     */
-    function setExecutionManager(
-        address _ovmExecutionManager
-    )
-        override
-        public
-        authenticated
-    {
-        ovmExecutionManager = _ovmExecutionManager;
-    }
- 
-    /**
-     * Inserts an account into the state.
-     * @param _address Address of the account to insert.
-     * @param _account Account to insert for the given address.
-     */
-    function putAccount(
-        address _address,
-        Lib_OVMCodec.Account memory _account
-    )
-        override
-        public
-        authenticated
-    {
-        accounts[_address] = _account;
-    }
- 
-    /**
-     * Marks an account as empty.
-     * @param _address Address of the account to mark.
-     */
-    function putEmptyAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
-        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
-    }
- 
-    /**
-     * Retrieves an account from the state.
-     * @param _address Address of the account to retrieve.
-     * @return Account for the given address.
-     */
-    function getAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.Account memory
-        )
-    {
-        return accounts[_address];
-    }
- 
-    /**
-     * Checks whether the state has a given account.
-     * @param _address Address of the account to check.
-     * @return Whether or not the state has the account.
-     */
-    function hasAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return accounts[_address].codeHash != bytes32(0);
-    }
- 
-    /**
-     * Checks whether the state has a given known empty account.
-     * @param _address Address of the account to check.
-     * @return Whether or not the state has the empty account.
-     */
-    function hasEmptyAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return (
-            accounts[_address].codeHash == EMPTY_ACCOUNT_CODE_HASH
-            && accounts[_address].nonce == 0
-        );
-    }
- 
-    /**
-     * Sets the nonce of an account.
-     * @param _address Address of the account to modify.
-     * @param _nonce New account nonce.
-     */
-    function setAccountNonce(
-        address _address,
-        uint256 _nonce
-    )
-        override
-        public
-        authenticated
-    {
-        accounts[_address].nonce = _nonce;
-    }
- 
-    /**
-     * Gets the nonce of an account.
-     * @param _address Address of the account to access.
-     * @return Nonce of the account.
-     */
-    function getAccountNonce(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return accounts[_address].nonce;
-    }
- 
-    /**
-     * Retrieves the Ethereum address of an account.
-     * @param _address Address of the account to access.
-     * @return Corresponding Ethereum address.
-     */
-    function getAccountEthAddress(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            address
-        )
-    {
-        return accounts[_address].ethAddress;
-    }
- 
-    /**
-     * Retrieves the storage root of an account.
-     * @param _address Address of the account to access.
-     * @return Corresponding storage root.
-     */
-    function getAccountStorageRoot(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        return accounts[_address].storageRoot;
-    }
- 
-    /**
-     * Initializes a pending account (during CREATE or CREATE2) with the default values.
-     * @param _address Address of the account to initialize.
-     */
-    function initPendingAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.nonce = 1;
-        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
-        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
-        account.isFresh = true;
-    }
- 
-    /**
-     * Finalizes the creation of a pending account (during CREATE or CREATE2).
-     * @param _address Address of the account to finalize.
-     * @param _ethAddress Address of the account's associated contract on Ethereum.
-     * @param _codeHash Hash of the account's code.
-     */
-    function commitPendingAccount(
-        address _address,
-        address _ethAddress,
-        bytes32 _codeHash
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.ethAddress = _ethAddress;
-        account.codeHash = _codeHash;
-    }
- 
-    /**
-     * Checks whether an account has already been retrieved, and marks it as retrieved if not.
-     * @param _address Address of the account to check.
-     * @return Whether or not the account was already loaded.
-     */
-    function testAndSetAccountLoaded(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_address),
-            ItemState.ITEM_LOADED
-        );
-    }
- 
-    /**
-     * Checks whether an account has already been modified, and marks it as modified if not.
-     * @param _address Address of the account to check.
-     * @return Whether or not the account was already modified.
-     */
-    function testAndSetAccountChanged(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_address),
-            ItemState.ITEM_CHANGED
-        );
-    }
- 
-    /**
-     * Attempts to mark an account as committed.
-     * @param _address Address of the account to commit.
-     * @return Whether or not the account was committed.
-     */
-    function commitAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        if (itemStates[item] != ItemState.ITEM_CHANGED) {
-            return false;
-        }
- 
-        itemStates[item] = ItemState.ITEM_COMMITTED;
-        totalUncommittedAccounts -= 1;
- 
-        return true;
-    }
- 
-    /**
-     * Increments the total number of uncommitted accounts.
-     */
-    function incrementTotalUncommittedAccounts()
-        override
-        public
-        authenticated
-    {
-        totalUncommittedAccounts += 1;
-    }
- 
-    /**
-     * Gets the total number of uncommitted accounts.
-     * @return Total uncommitted accounts.
-     */
-    function getTotalUncommittedAccounts()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return totalUncommittedAccounts;
-    }
- 
-    /**
-     * Checks whether a given account was changed during execution.
-     * @param _address Address to check.
-     * @return Whether or not the account was changed.
-     */
-    function wasAccountChanged(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        return itemStates[item] >= ItemState.ITEM_CHANGED;
-    }
- 
-    /**
-     * Checks whether a given account was committed after execution.
-     * @param _address Address to check.
-     * @return Whether or not the account was committed.
-     */
-    function wasAccountCommitted(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        return itemStates[item] >= ItemState.ITEM_COMMITTED;
-    }
- 
- 
-    /************************************
-     * Public Functions: Storage Access *
-     ************************************/
- 
-    /**
-     * Changes a contract storage slot value.
-     * @param _contract Address of the contract to modify.
-     * @param _key 32 byte storage slot key.
-     * @param _value 32 byte storage slot value.
-     */
-    function putContractStorage(
-        address _contract,
-        bytes32 _key,
-        bytes32 _value
-    )
-        override
-        public
-        authenticated
-    {
-        // A hilarious optimization. `SSTORE`ing a value of `bytes32(0)` is common enough that it's
-        // worth populating this with a non-zero value in advance (during the fraud proof
-        // initialization phase) to cut the execution-time cost down to 5000 gas.
-        contractStorage[_contract][_key] = _value ^ STORAGE_XOR_VALUE;
- 
-        // Only used when initially populating the contract storage. OVM_ExecutionManager will
-        // perform a `hasContractStorage` INVALID_STATE_ACCESS check before putting any contract
-        // storage because writing to zero when the actual value is nonzero causes a gas
-        // discrepancy. Could be moved into a new `putVerifiedContractStorage` function, or
-        // something along those lines.
-        if (verifiedContractStorage[_contract][_key] == false) {
-            verifiedContractStorage[_contract][_key] = true;
-        }
-    }
- 
-    /**
-     * Retrieves a contract storage slot value.
-     * @param _contract Address of the contract to access.
-     * @param _key 32 byte storage slot key.
-     * @return 32 byte storage slot value.
-     */
-    function getContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        // Storage XOR system doesn't work for newly created contracts that haven't set this
-        // storage slot value yet.
-        if (
-            verifiedContractStorage[_contract][_key] == false
-            && accounts[_contract].isFresh
-        ) {
-            return bytes32(0);
-        }
- 
-        // See `putContractStorage` for more information about the XOR here.
-        return contractStorage[_contract][_key] ^ STORAGE_XOR_VALUE;
-    }
- 
-    /**
-     * Checks whether a contract storage slot exists in the state.
-     * @param _contract Address of the contract to access.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the key was set in the state.
-     */
-    function hasContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return verifiedContractStorage[_contract][_key] || accounts[_contract].isFresh;
-    }
- 
-    /**
-     * Checks whether a storage slot has already been retrieved, and marks it as retrieved if not.
-     * @param _contract Address of the contract to check.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the slot was already loaded.
-     */
-    function testAndSetContractStorageLoaded(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_contract, _key),
-            ItemState.ITEM_LOADED
-        );
-    }
- 
-    /**
-     * Checks whether a storage slot has already been modified, and marks it as modified if not.
-     * @param _contract Address of the contract to check.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the slot was already modified.
-     */
-    function testAndSetContractStorageChanged(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_contract, _key),
-            ItemState.ITEM_CHANGED
-        );
-    }
- 
-    /**
-     * Attempts to mark a storage slot as committed.
-     * @param _contract Address of the account to commit.
-     * @param _key 32 byte slot key to commit.
-     * @return Whether or not the slot was committed.
-     */
-    function commitContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        if (itemStates[item] != ItemState.ITEM_CHANGED) {
-            return false;
-        }
- 
-        itemStates[item] = ItemState.ITEM_COMMITTED;
-        totalUncommittedContractStorage -= 1;
- 
-        return true;
-    }
- 
-    /**
-     * Increments the total number of uncommitted storage slots.
-     */
-    function incrementTotalUncommittedContractStorage()
-        override
-        public
-        authenticated
-    {
-        totalUncommittedContractStorage += 1;
-    }
- 
-    /**
-     * Gets the total number of uncommitted storage slots.
-     * @return Total uncommitted storage slots.
-     */
-    function getTotalUncommittedContractStorage()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return totalUncommittedContractStorage;
-    }
- 
-    /**
-     * Checks whether a given storage slot was changed during execution.
-     * @param _contract Address to check.
-     * @param _key Key of the storage slot to check.
-     * @return Whether or not the storage slot was changed.
-     */
-    function wasContractStorageChanged(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        return itemStates[item] >= ItemState.ITEM_CHANGED;
-    }
- 
-    /**
-     * Checks whether a given storage slot was committed after execution.
-     * @param _contract Address to check.
-     * @param _key Key of the storage slot to check.
-     * @return Whether or not the storage slot was committed.
-     */
-    function wasContractStorageCommitted(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        return itemStates[item] >= ItemState.ITEM_COMMITTED;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Generates a unique hash for an address.
-     * @param _address Address to generate a hash for.
-     * @return Unique hash for the given address.
-     */
-    function _getItemHash(
-        address _address
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(abi.encodePacked(_address));
-    }
- 
-    /**
-     * Generates a unique hash for an address/key pair.
-     * @param _contract Address to generate a hash for.
-     * @param _key Key to generate a hash for.
-     * @return Unique hash for the given pair.
-     */
-    function _getItemHash(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(abi.encodePacked(
-            _contract,
-            _key
-        ));
-    }
- 
-    /**
-     * Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets the
-     * item to the provided state if not.
-     * @param _item 32 byte item ID to check.
-     * @param _minItemState Minimum state that must be satisfied by the item.
-     * @return Whether or not the item was already in the state.
-     */
-    function _testAndSetItemState(
-        bytes32 _item,
-        ItemState _minItemState
-    )
-        internal
-        returns (
-            bool
-        )
-    {
-        bool wasItemState = itemStates[_item] >= _minItemState;
- 
-        if (wasItemState == false) {
-            itemStates[_item] = _minItemState;
-        }
- 
-        return wasItemState;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html deleted file mode 100644 index 24ddc0ae5..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/execution/ OVM_StateManagerFactory.sol -

-
-
- 0% - Statements - 0/1 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
- 
-/* Contract Imports */
-import { OVM_StateManager } from "./OVM_StateManager.sol";
- 
-/**
- * @title OVM_StateManagerFactory
- * @dev The State Manager Factory is called by a State Transitioner's init code, to create a new
- * State Manager for use in the Fraud Verification process.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateManagerFactory is iOVM_StateManagerFactory {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Creates a new OVM_StateManager
-     * @param _owner Owner of the created contract.
-     * @return New OVM_StateManager instance.
-     */
-    function create(
-        address _owner
-    )
-        override
-        public
-        returns (
-            iOVM_StateManager
-        )
-    {
-        return new OVM_StateManager(_owner);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/execution/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/execution/index.html deleted file mode 100644 index f8e89be66..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/execution/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/execution/ -

-
-
- 81.88% - Statements - 253/309 -
-
- 72.34% - Branches - 68/94 -
-
- 84.69% - Functions - 83/98 -
-
- 82.39% - Lines - 262/318 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_ExecutionManager.sol
82.2%194/23668.29%56/8288.52%54/6182.64%200/242
OVM_SafetyChecker.sol
100%8/8100%0/0100%1/1100%10/10
OVM_StateManager.sol
79.69%51/64100%12/1280%28/3580%52/65
OVM_StateManagerFactory.sol
0%0/1100%0/00%0/10%0/1
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html deleted file mode 100644 index 510331797..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html +++ /dev/null @@ -1,662 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ ERC1820Registry.sol -

-
-
- 0% - Statements - 0/38 -
-
- 0% - Branches - 0/22 -
-
- 0% - Functions - 0/10 -
-
- 0% - Lines - 0/39 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: CC0-1.0
-/* ERC1820 Pseudo-introspection Registry Contract
- * This standard defines a universal registry smart contract where any address (contract or regular account) can
- * register which interface it supports and which smart contract is responsible for its implementation.
- *
- * Written in 2019 by Jordi Baylina and Jacques Dafflon
- *
- * To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to
- * this software to the public domain worldwide. This software is distributed without any warranty.
- *
- * You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
- * <http://creativecommons.org/publicdomain/zero/1.0/>.
- */
-pragma solidity >0.5.0 <0.8.0;
- 
-/// @dev The interface a contract MUST implement if it is the implementer of
-/// some (other) interface for any address other than itself.
-interface ERC1820ImplementerInterface {
-    /// @notice Indicates whether the contract implements the interface 'interfaceHash' for the address 'addr' or not.
-    /// @param interfaceHash keccak256 hash of the name of the interface
-    /// @param addr Address for which the contract will implement the interface
-    /// @return ERC1820_ACCEPT_MAGIC only if the contract implements 'interfaceHash' for the address 'addr'.
-    function canImplementInterfaceForAddress(bytes32 interfaceHash, address addr) external view returns(bytes32);
-}
- 
-/**
- * @title ERC1820 Pseudo-introspection Registry Contract
- * @author Jordi Baylina and Jacques Dafflon
- * @dev This contract is the official implementation of the ERC1820 Registry 
- * For more details, see https://eips.ethereum.org/EIPS/eip-1820
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract ERC1820Registry {
-    bytes4 constant internal INVALID_ID = 0xffffffff;
-    bytes4 constant internal ERC165ID = 0x01ffc9a7;
-    bytes32 constant internal ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
- 
-    mapping(address => mapping(bytes32 => address)) internal interfaces;
-    mapping(address => address) internal managers;
-    mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
- 
-    /// @notice Indicates a contract is the 'implementer' of 'interfaceHash' for 'addr'.
-    event InterfaceImplementerSet(address indexed addr, bytes32 indexed interfaceHash, address indexed implementer);
-    /// @notice Indicates 'newManager' is the address of the new manager for 'addr'.
-    event ManagerChanged(address indexed addr, address indexed newManager);
- 
-    /// @notice Query if an address implements an interface and through which contract.
-    /// @param _addr Address being queried for the implementer of an interface.
-    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
-    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
-    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
-    /// @return The address of the contract which implements the interface '_interfaceHash' for '_addr'
-    /// or '0' if '_addr' did not register an implementer for this interface.
-    function getInterfaceImplementer(address _addr, bytes32 _interfaceHash) external view returns (address) {
-        address addr = _addr == address(0) ? msg.sender : _addr;
-        if (isERC165Interface(_interfaceHash)) {
-            bytes4 erc165InterfaceHash = bytes4(_interfaceHash);
-            return implementsERC165Interface(addr, erc165InterfaceHash) ? addr : address(0);
-        }
-        return interfaces[addr][_interfaceHash];
-    }
- 
-    /// @notice Sets the contract which implements a specific interface for an address.
-    /// Only the manager defined for that address can set it.
-    /// (Each address is the manager for itself until it sets a new manager.)
-    /// @param _addr Address for which to set the interface.
-    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
-    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
-    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
-    /// @param _implementer Contract address implementing '_interfaceHash' for '_addr'.
-    function setInterfaceImplementer(address _addr, bytes32 _interfaceHash, address _implementer) external {
-        address addr = _addr == address(0) ? msg.sender : _addr;
-        require(getManager(addr) == msg.sender, "Not the manager");
- 
-        require(!isERC165Interface(_interfaceHash), "Must not be an ERC165 hash");
-        if (_implementer != address(0) && _implementer != msg.sender) {
-            require(
-                ERC1820ImplementerInterface(_implementer)
-                    .canImplementInterfaceForAddress(_interfaceHash, addr) == ERC1820_ACCEPT_MAGIC,
-                "Does not implement the interface"
-            );
-        }
-        interfaces[addr][_interfaceHash] = _implementer;
-        emit InterfaceImplementerSet(addr, _interfaceHash, _implementer);
-    }
- 
-    /// @notice Sets '_newManager' as manager for '_addr'.
-    /// The new manager will be able to call 'setInterfaceImplementer' for '_addr'.
-    /// @param _addr Address for which to set the new manager.
-    /// @param _newManager Address of the new manager for 'addr'. (Pass '0x0' to reset the manager to '_addr'.)
-    function setManager(address _addr, address _newManager) external {
-        require(getManager(_addr) == msg.sender, "Not the manager");
-        managers[_addr] = _newManager == _addr ? address(0) : _newManager;
-        emit ManagerChanged(_addr, _newManager);
-    }
- 
-    /// @notice Get the manager of an address.
-    /// @param _addr Address for which to return the manager.
-    /// @return Address of the manager for a given address.
-    function getManager(address _addr) public view returns(address) {
-        // By default the manager of an address is the same address
-        if (managers[_addr] == address(0)) {
-            return _addr;
-        } else {
-            return managers[_addr];
-        }
-    }
- 
-    /// @notice Compute the keccak256 hash of an interface given its name.
-    /// @param _interfaceName Name of the interface.
-    /// @return The keccak256 hash of an interface name.
-    function interfaceHash(string calldata _interfaceName) external pure returns(bytes32) {
-        return keccak256(abi.encodePacked(_interfaceName));
-    }
- 
-    /* --- ERC165 Related Functions --- */
-    /* --- Developed in collaboration with William Entriken. --- */
- 
-    /// @notice Updates the cache with whether the contract implements an ERC165 interface or not.
-    /// @param _contract Address of the contract for which to update the cache.
-    /// @param _interfaceId ERC165 interface for which to update the cache.
-    function updateERC165Cache(address _contract, bytes4 _interfaceId) external {
-        interfaces[_contract][_interfaceId] = implementsERC165InterfaceNoCache(
-            _contract, _interfaceId) ? _contract : address(0);
-        erc165Cached[_contract][_interfaceId] = true;
-    }
- 
-    /// @notice Checks whether a contract implements an ERC165 interface or not.
-    //  If the result is not cached a direct lookup on the contract address is performed.
-    //  If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
-    //  'updateERC165Cache' with the contract address.
-    /// @param _contract Address of the contract to check.
-    /// @param _interfaceId ERC165 interface to check.
-    /// @return True if '_contract' implements '_interfaceId', false otherwise.
-    function implementsERC165Interface(address _contract, bytes4 _interfaceId) public view returns (bool) {
-        if (!erc165Cached[_contract][_interfaceId]) {
-            return implementsERC165InterfaceNoCache(_contract, _interfaceId);
-        }
-        return interfaces[_contract][_interfaceId] == _contract;
-    }
- 
-    /// @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
-    /// @param _contract Address of the contract to check.
-    /// @param _interfaceId ERC165 interface to check.
-    /// @return True if '_contract' implements '_interfaceId', false otherwise.
-    function implementsERC165InterfaceNoCache(address _contract, bytes4 _interfaceId) public view returns (bool) {
-        uint256 success;
-        uint256 result;
- 
-        (success, result) = noThrowCall(_contract, ERC165ID);
-        if (success == 0 || result == 0) {
-            return false;
-        }
- 
-        (success, result) = noThrowCall(_contract, INVALID_ID);
-        if (success == 0 || result != 0) {
-            return false;
-        }
- 
-        (success, result) = noThrowCall(_contract, _interfaceId);
-        if (success == 1 && result == 1) {
-            return true;
-        }
-        return false;
-    }
- 
-    /// @notice Checks whether the hash is a ERC165 interface (ending with 28 zeroes) or not.
-    /// @param _interfaceHash The hash to check.
-    /// @return True if '_interfaceHash' is an ERC165 interface (ending with 28 zeroes), false otherwise.
-    function isERC165Interface(bytes32 _interfaceHash) internal pure returns (bool) {
-        return _interfaceHash & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0;
-    }
- 
-    /// @dev Make a call on a contract without throwing if the function does not exist.
-    function noThrowCall(address _contract, bytes4 _interfaceId)
-        internal view returns (uint256 success, uint256 result)
-    {
-        bytes4 erc165ID = ERC165ID;
- 
-        assembly {
-            let x := mload(0x40)               // Find empty storage location using "free memory pointer"
-            mstore(x, erc165ID)                // Place signature at beginning of empty storage
-            mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
- 
-            success := staticcall(
-                30000,                         // 30k gas
-                _contract,                     // To addr
-                x,                             // Inputs are stored at location x
-                0x24,                          // Inputs are 36 (4 + 32) bytes long
-                x,                             // Store output over input (saves space)
-                0x20                           // Outputs are 32 bytes long
-            )
- 
-            result := mload(x)                 // Load the result
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html deleted file mode 100644 index bf503a6c9..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html +++ /dev/null @@ -1,701 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_DeployerWhitelist.sol -

-
-
- 36.36% - Statements - 8/22 -
-
- 66.67% - Branches - 4/6 -
-
- 12.5% - Functions - 1/8 -
-
- 34.78% - Lines - 8/23 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -29× -25× -  -  - -  -  -  - - -  -  - -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
- 
-/* Interface Imports */
-import { iOVM_DeployerWhitelist } from "../../iOVM/predeploys/iOVM_DeployerWhitelist.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_DeployerWhitelist
- * @dev The Deployer Whitelist is a temporary predeploy used to provide additional safety during the
- * initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts
- * which are allowed to deploy contracts on Layer2. The Execution Manager will only allow an 
- * ovmCREATE or ovmCREATE2 operation to proceed if the deployer's address whitelisted.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_DeployerWhitelist is iOVM_DeployerWhitelist {
- 
-    /**********************
-     * Contract Constants *
-     **********************/
- 
-    bytes32 internal constant KEY_INITIALIZED =                0x0000000000000000000000000000000000000000000000000000000000000010;
-    bytes32 internal constant KEY_OWNER =                      0x0000000000000000000000000000000000000000000000000000000000000011;
-    bytes32 internal constant KEY_ALLOW_ARBITRARY_DEPLOYMENT = 0x0000000000000000000000000000000000000000000000000000000000000012;
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
-    
-    /**
-     * Blocks functions to anyone except the contract owner.
-     */
-    modifier onlyOwner() {
-        address owner = Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                KEY_OWNER
-            )
-        );
- 
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_SafeExecutionManagerWrapper.safeCALLER() == owner,
-            "Function can only be called by the owner of this contract."
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
-    
-    /**
-     * Initializes the whitelist.
-     * @param _owner Address of the owner for this contract.
-     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
-     */
-    function initialize(
-        address _owner,
-        bool _allowArbitraryDeployment
-    )
-        override
-        public
-    {
-        bool initialized = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
-        );
- 
-        if (initialized == true) {
-            return;
-        }
- 
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_INITIALIZED,
-            Lib_Bytes32Utils.fromBool(true)
-        );
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_OWNER,
-            Lib_Bytes32Utils.fromAddress(_owner)
-        );
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
-            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
-        );
-    }
- 
-    /**
-     * Gets the owner of the whitelist.
-     */
-    function getOwner()
-        override
-        public
-        returns(
-            address
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                KEY_OWNER
-            )
-        );
-    }
- 
-    /**
-     * Adds or removes an address from the deployment whitelist.
-     * @param _deployer Address to update permissions for.
-     * @param _isWhitelisted Whether or not the address is whitelisted.
-     */
-    function setWhitelistedDeployer(
-        address _deployer,
-        bool _isWhitelisted
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            Lib_Bytes32Utils.fromAddress(_deployer),
-            Lib_Bytes32Utils.fromBool(_isWhitelisted)
-        );
-    }
- 
-    /**
-     * Updates the owner of this contract.
-     * @param _owner Address of the new owner.
-     */
-    function setOwner(
-        address _owner
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_OWNER,
-            Lib_Bytes32Utils.fromAddress(_owner)
-        );
-    }
- 
-    /**
-     * Updates the arbitrary deployment flag.
-     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
-     */
-    function setAllowArbitraryDeployment(
-        bool _allowArbitraryDeployment
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
-            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
-        );
-    }
- 
-    /**
-     * Permanently enables arbitrary contract deployment and deletes the owner.
-     */
-    function enableArbitraryContractDeployment()
-        override
-        public
-        onlyOwner
-    {
-        setAllowArbitraryDeployment(true);
-        setOwner(address(0));
-    }
- 
-    /**
-     * Checks whether an address is allowed to deploy contracts.
-     * @param _deployer Address to check.
-     * @return _allowed Whether or not the address can deploy contracts.
-     */
-    function isDeployerAllowed(
-        address _deployer
-    )
-        override
-        public
-        returns (
-            bool _allowed
-        )
-    {
-        bool initialized = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
-        );
- 
-        if (initialized == false) {
-            return true;
-        }
- 
-        bool allowArbitraryDeployment = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_ALLOW_ARBITRARY_DEPLOYMENT)
-        );
- 
-        if (allowArbitraryDeployment == true) {
-            return true;
-        }
- 
-        bool isWhitelisted = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                Lib_Bytes32Utils.fromAddress(_deployer)
-            )
-        );
- 
-        return isWhitelisted;        
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html deleted file mode 100644 index 2aaa2721b..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_ETH.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_ETH.sol -

-
-
- 0% - Statements - 0/1 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Contract Imports */
-import { OVM_L2DepositedERC20 } from "../bridge/tokens/OVM_L2DepositedERC20.sol";
- 
-/**
- * @title OVM_ETH
- * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that 
- * unlike on Layer 1, Layer 2 accounts do not have a balance field.
- * 
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract OVM_ETH is OVM_L2DepositedERC20 {
-    constructor(
-        address _l2CrossDomainMessenger,
-        address _l1ETHGateway
-    ) 
-        OVM_L2DepositedERC20(
-            _l2CrossDomainMessenger,
-            "Ether",
-            "ETH"
-        )
-    {
-        init(iOVM_L1TokenGateway(_l1ETHGateway));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html deleted file mode 100644 index cb471696f..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_L1MessageSender.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_L1MessageSender } from "../../iOVM/predeploys/iOVM_L1MessageSender.sol";
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
- 
-/**
- * @title OVM_L1MessageSender
- * @dev The L1MessageSender is a predeploy contract running on L2. During the execution of cross 
- * domain transaction from L1 to L2, it returns the address of the L1 account (either an EOA or
- * contract) which sent the message to L2 via the Canonical Transaction Chain's `enqueue()` 
- * function.
- * 
- * This contract exclusively serves as a getter for the ovmL1TXORIGIN operation. This is necessary 
- * because there is no corresponding operation in the EVM which the the optimistic solidity compiler 
- * can be replaced with a call to the ExecutionManager's ovmL1TXORIGIN() function.
- *
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_L1MessageSender is iOVM_L1MessageSender {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @return _l1MessageSender L1 message sender address (msg.sender).
-     */
-    function getL1MessageSender()
-        override
-        public
-        view
-        returns (
-            address _l1MessageSender
-        )
-    {
-        // Note that on L2 msg.sender (ie. evmCALLER) will always be the Execution Manager 
-        return iOVM_ExecutionManager(msg.sender).ovmL1TXORIGIN();
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html deleted file mode 100644 index 0795787c0..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_L2ToL1MessagePasser.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_L2ToL1MessagePasser } from "../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
- 
-/**
- * @title OVM_L2ToL1MessagePasser
- * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the 
- * of a message on L2. The L1 Cross Domain Messenger performs this proof in its
- * _verifyStorageProof function, which verifies the existence of the transaction hash in this 
- * contract's `sentMessages` mapping.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    mapping (bytes32 => bool) public sentMessages;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Passes a message to L1.
-     * @param _message Message to pass to L1.
-     */
-    function passMessageToL1(
-        bytes memory _message
-    )
-        override
-        public
-    {
-        // Note: although this function is public, only messages sent from the OVM_L2CrossDomainMessenger 
-        // will be relayed by the OVM_L1CrossDomainMessenger. This is enforced by a check in 
-        // OVM_L1CrossDomainMessenger._verifyStorageProof().
-        sentMessages[keccak256(
-            abi.encodePacked(
-                _message,
-                msg.sender
-            )
-        )] = true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html deleted file mode 100644 index e738ae32f..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_ProxySequencerEntrypoint.sol -

-
-
- 100% - Statements - 10/10 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 7/7 -
-
- 100% - Lines - 10/10 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_ProxySequencerEntrypoint 
- * @dev The Proxy Sequencer Entrypoint is a predeployed proxy to the implementation of the 
- * Sequencer Entrypoint. This will enable the Optimism team to upgrade the Sequencer Entrypoint 
- * contract.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ProxySequencerEntrypoint {
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
-            gasleft(),
-            _getImplementation(),
-            msg.data
-        );
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function init(
-        address _implementation,
-        address _owner
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            _getOwner() == address(0),
-            "ProxySequencerEntrypoint has already been inited"
-        );
-        _setOwner(_owner);
-        _setImplementation(_implementation);
-    }
- 
-    function upgrade(
-        address _implementation
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            _getOwner() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
-            "Only owner can upgrade the Entrypoint"
-        );
- 
-        _setImplementation(_implementation);
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _setImplementation(
-        address _implementation
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            bytes32(uint256(0)),
-            bytes32(uint256(uint160(_implementation)))
-        );
-    }
- 
-    function _getImplementation()
-        internal
-        returns (
-            address _implementation
-        )
-    {
-        return address(uint160(uint256(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                bytes32(uint256(0))
-            )
-        )));
-    }
- 
-    function _setOwner(
-        address _owner
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            bytes32(uint256(1)),
-            bytes32(uint256(uint160(_owner)))
-        );
-    }
- 
-    function _getOwner()
-        internal
-        returns (
-            address _owner
-        )
-    {
-        return address(uint160(uint256(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                bytes32(uint256(1))
-            )
-        )));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html deleted file mode 100644 index 3d96f0a5e..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_SequencerEntrypoint.sol -

-
-
- 100% - Statements - 18/18 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 17/17 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - - - -  -  - - -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  - - -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_SequencerEntrypoint
- * @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by 
- * any account. It accepts a more efficient compressed calldata format, which it decompresses and 
- * encodes to the standard EIP155 transaction format.
- * This contract is the implementation referenced by the Proxy Sequencer Entrypoint, thus enabling
- * the Optimism team to upgrade the decompression of calldata from the Sequencer.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_SequencerEntrypoint {
- 
-    /*********
-     * Enums *
-     *********/
-    
-    enum TransactionType {
-        NATIVE_ETH_TRANSACTION,
-        ETH_SIGNED_MESSAGE
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    /**
-     * Uses a custom "compressed" format to save on calldata gas:
-     * calldata[00:01]: transaction type (0 == EIP 155, 2 == Eth Sign Message)
-     * calldata[01:33]: signature "r" parameter
-     * calldata[33:65]: signature "s" parameter
-     * calldata[65:66]: signature "v" parameter
-     * calldata[66:69]: transaction gas limit
-     * calldata[69:72]: transaction gas price
-     * calldata[72:75]: transaction nonce
-     * calldata[75:95]: transaction target address
-     * calldata[95:XX]: transaction data
-     */
-    fallback()
-        external
-    {
-        TransactionType transactionType = _getTransactionType(Lib_BytesUtils.toUint8(msg.data, 0));
- 
-        bytes32 r = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 1, 32));
-        bytes32 s = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 33, 32));
-        uint8 v = Lib_BytesUtils.toUint8(msg.data, 65);
- 
-        // Remainder is the transaction to execute.
-        bytes memory compressedTx = Lib_BytesUtils.slice(msg.data, 66);
-        bool isEthSignedMessage = transactionType == TransactionType.ETH_SIGNED_MESSAGE;
- 
-        // Need to decompress and then re-encode the transaction based on the original encoding.
-        bytes memory encodedTx = Lib_OVMCodec.encodeEIP155Transaction(
-            Lib_OVMCodec.decompressEIP155Transaction(compressedTx),
-            isEthSignedMessage
-        );
- 
-        address target = Lib_ECDSAUtils.recover(
-            encodedTx,
-            isEthSignedMessage,
-            uint8(v),
-            r,
-            s
-        );
- 
-        if (Lib_SafeExecutionManagerWrapper.safeEXTCODESIZE(target) == 0) {
-            // ProxyEOA has not yet been deployed for this EOA.
-            bytes32 messageHash = Lib_ECDSAUtils.getMessageHash(encodedTx, isEthSignedMessage);
-            Lib_SafeExecutionManagerWrapper.safeCREATEEOA(messageHash, uint8(v), r, s);
-        }
- 
-        // ProxyEOA has been deployed for this EOA, continue to CALL.
-        bytes memory callbytes = abi.encodeWithSignature(
-            "execute(bytes,uint8,uint8,bytes32,bytes32)",
-            encodedTx,
-            isEthSignedMessage,
-            uint8(v),
-            r,
-            s
-        );
- 
-        Lib_SafeExecutionManagerWrapper.safeCALL(
-            gasleft(),
-            target,
-            callbytes
-        );
-    }
-    
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Converts a uint256 into a TransactionType enum.
-     * @param _transactionType Transaction type index.
-     * @return _txType Transaction type enum value.
-     */
-    function _getTransactionType(
-        uint8 _transactionType
-    )
-        internal
-        returns (
-            TransactionType _txType
-        )
-    {
-        if (_transactionType == 0) {
-            return TransactionType.NATIVE_ETH_TRANSACTION;
-        } if (_transactionType == 2) {
-            return TransactionType.ETH_SIGNED_MESSAGE;
-        } else {
-            Lib_SafeExecutionManagerWrapper.safeREVERT(
-                "Transaction type must be 0 or 2"
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/index.html deleted file mode 100644 index 82416007a..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/predeploys/index.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/predeploys/ -

-
-
- 41.76% - Statements - 38/91 -
-
- 29.41% - Branches - 10/34 -
-
- 40% - Functions - 12/30 -
-
- 40.22% - Lines - 37/92 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
ERC1820Registry.sol
0%0/380%0/220%0/100%0/39
OVM_DeployerWhitelist.sol
36.36%8/2266.67%4/612.5%1/834.78%8/23
OVM_ETH.sol
0%0/1100%0/00%0/10%0/1
OVM_L1MessageSender.sol
100%1/1100%0/0100%1/1100%1/1
OVM_L2ToL1MessagePasser.sol
100%1/1100%0/0100%1/1100%1/1
OVM_ProxySequencerEntrypoint.sol
100%10/10100%0/0100%7/7100%10/10
OVM_SequencerEntrypoint.sol
100%18/18100%6/6100%2/2100%17/17
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html deleted file mode 100644 index 23684e3af..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ Abs_FraudContributor.sol -

-
-
- 100% - Statements - 3/3 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -14× -14× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/// Minimal contract to be inherited by contracts consumed by users that provide
-/// data for fraud proofs
-abstract contract Abs_FraudContributor is Lib_AddressResolver {
-    /// Decorate your functions with this modifier to store how much total gas was
-    /// consumed by the sender, to reward users fairly
-    modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
-        uint256 startGas = gasleft();
-        _;
-        uint256 gasSpent = startGas - gasleft();
-        iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html deleted file mode 100644 index 1de4a2fa1..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html +++ /dev/null @@ -1,689 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/OVM_BondManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ OVM_BondManager.sol -

-
-
- 100% - Statements - 42/42 -
-
- 86.67% - Branches - 26/30 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 41/41 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -63× -  -  -  -  -  -  -  -  -  -  -46× -46× -  -45× -45× -  -  -  -  -  -13× -12× -  -  -  -11× -  -11× -11× - - - -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -11× -  -  -  -  - -  -  -  -10× -  -  -  -  -  -18× -  -  -  -  -  -18× -  -  -  -  - - - -  - - -  -  -  -  - -  - -  -  -  - -  -  - - -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  - - -  -  - -  -  -  - -  -  - -  -  - -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_BondManager, Errors, ERC20 } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
- 
-/**
- * @title OVM_BondManager
- * @dev The Bond Manager contract handles deposits in the form of an ERC20 token from bonded 
- * Proposers. It also handles the accounting of gas costs spent by a Verifier during the course of a
- * fraud proof. In the event of a successful fraud proof, the fraudulent Proposer's bond is slashed, 
- * and the Verifier's gas costs are refunded.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
- 
-    /****************************
-     * Constants and Parameters *
-     ****************************/
- 
-    /// The period to find the earliest fraud proof for a publisher
-    uint256 public constant multiFraudProofPeriod = 7 days;
- 
-    /// The dispute period
-    uint256 public constant disputePeriodSeconds = 7 days;
- 
-    /// The minimum collateral a sequencer must post
-    uint256 public constant requiredCollateral = 1 ether;
- 
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    /// The bond token
-    ERC20 immutable public token;
- 
- 
-    /********************************************
-     * Contract Variables: Internal Accounting  *
-     *******************************************/
- 
-    /// The bonds posted by each proposer
-    mapping(address => Bond) public bonds;
- 
-    /// For each pre-state root, there's an array of witnessProviders that must be rewarded
-    /// for posting witnesses
-    mapping(bytes32 => Rewards) public witnessProviders;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /// Initializes with a ERC20 token to be used for the fidelity bonds
-    /// and with the Address Manager
-    constructor(
-        ERC20 _token,
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        token = _token;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /// Adds `who` to the list of witnessProviders for the provided `preStateRoot`.
-    function recordGasSpent(bytes32 _preStateRoot, bytes32 _txHash, address who, uint256 gasSpent) override public {
-        // The sender must be the transitioner that corresponds to the claimed pre-state root
-        address transitioner = address(iOVM_FraudVerifier(resolve("OVM_FraudVerifier")).getStateTransitioner(_preStateRoot, _txHash));
-        require(transitioner == msg.sender, Errors.ONLY_TRANSITIONER);
- 
-        witnessProviders[_preStateRoot].total += gasSpent;
-        witnessProviders[_preStateRoot].gasSpent[who] += gasSpent;
-    }
- 
-    /// Slashes + distributes rewards or frees up the sequencer's bond, only called by
-    /// `FraudVerifier.finalizeFraudVerification`
-    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) override public {
-        require(msg.sender == resolve("OVM_FraudVerifier"), Errors.ONLY_FRAUD_VERIFIER);
-        require(witnessProviders[_preStateRoot].canClaim == false, Errors.ALREADY_FINALIZED);
- 
-        // allow users to claim from that state root's
-        // pool of collateral (effectively slashing the sequencer)
-        witnessProviders[_preStateRoot].canClaim = true;
- 
-        Bond storage bond = bonds[publisher];
-        if (bond.firstDisputeAt == 0) {
-            bond.firstDisputeAt = block.timestamp;
-            bond.earliestDisputedStateRoot = _preStateRoot;
-            bond.earliestTimestamp = timestamp;
-        } else if (
-            // only update the disputed state root for the publisher if it's within
-            // the dispute period _and_ if it's before the previous one
-            block.timestamp < bond.firstDisputeAt + multiFraudProofPeriod &&
-            timestamp < bond.earliestTimestamp
-        ) {
-            bond.earliestDisputedStateRoot = _preStateRoot;
-            bond.earliestTimestamp = timestamp;
-        }
- 
-        // if the fraud proof's dispute period does not intersect with the 
-        // withdrawal's timestamp, then the user should not be slashed
-        // e.g if a user at day 10 submits a withdrawal, and a fraud proof
-        // from day 1 gets published, the user won't be slashed since day 8 (1d + 7d)
-        // is before the user started their withdrawal. on the contrary, if the user
-        // had started their withdrawal at, say, day 6, they would be slashed
-        if (
-            bond.withdrawalTimestamp != 0 && 
-            uint256(bond.withdrawalTimestamp) > timestamp + disputePeriodSeconds &&
-            bond.state == State.WITHDRAWING
-        ) {
-            return;
-        }
- 
-        // slash!
-        bond.state = State.NOT_COLLATERALIZED;
-    }
- 
-    /// Sequencers call this function to post collateral which will be used for
-    /// the `appendBatch` call
-    function deposit() override public {
-        Erequire(
-            token.transferFrom(msg.sender, address(this), requiredCollateral),
-            Errors.ERC20_ERR
-        );
- 
-        // This cannot overflow
-        bonds[msg.sender].state = State.COLLATERALIZED;
-    }
- 
-    /// Starts the withdrawal for a publisher
-    function startWithdrawal() override public {
-        Bond storage bond = bonds[msg.sender];
-        Erequire(bond.withdrawalTimestamp == 0, Errors.WITHDRAWAL_PENDING);
-        require(bond.state == State.COLLATERALIZED, Errors.WRONG_STATE);
- 
-        bond.state = State.WITHDRAWING;
-        bond.withdrawalTimestamp = uint32(block.timestamp);
-    }
- 
-    /// Finalizes a pending withdrawal from a publisher
-    function finalizeWithdrawal() override public {
-        Bond storage bond = bonds[msg.sender];
- 
-        require(
-            block.timestamp >= uint256(bond.withdrawalTimestamp) + disputePeriodSeconds, 
-            Errors.TOO_EARLY
-        );
-        require(bond.state == State.WITHDRAWING, Errors.SLASHED);
-        
-        // refunds!
-        bond.state = State.NOT_COLLATERALIZED;
-        bond.withdrawalTimestamp = 0;
-        
-        Erequire(
-            token.transfer(msg.sender, requiredCollateral),
-            Errors.ERC20_ERR
-        );
-    }
- 
-    /// Claims the user's reward for the witnesses they provided for the earliest
-    /// disputed state root of the designated publisher
-    function claim(address who) override public {
-        Bond storage bond = bonds[who];
-        require(
-            block.timestamp >= bond.firstDisputeAt + multiFraudProofPeriod,
-            Errors.WAIT_FOR_DISPUTES
-        );
- 
-        // reward the earliest state root for this publisher
-        bytes32 _preStateRoot = bond.earliestDisputedStateRoot;
-        Rewards storage rewards = witnessProviders[_preStateRoot];
- 
-        // only allow claiming if fraud was proven in `finalize`
-        require(rewards.canClaim, Errors.CANNOT_CLAIM);
- 
-        // proportional allocation - only reward 50% (rest gets locked in the
-        // contract forever
-        uint256 amount = (requiredCollateral * rewards.gasSpent[msg.sender]) / (2 * rewards.total);
- 
-        // reset the user's spent gas so they cannot double claim
-        rewards.gasSpent[msg.sender] = 0;
- 
-        // transfer
-        Erequire(token.transfer(msg.sender, amount), Errors.ERC20_ERR);
-    }
- 
-    /// Checks if the user is collateralized
-    function isCollateralized(address who) override public view returns (bool) {
-        return bonds[who].state == State.COLLATERALIZED;
-    }
- 
-    /// Gets how many witnesses the user has provided for the state root
-    function getGasSpent(bytes32 preStateRoot, address who) override public view returns (uint256) {
-        return witnessProviders[preStateRoot].gasSpent[who];
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html deleted file mode 100644 index d513958f4..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html +++ /dev/null @@ -1,953 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ OVM_FraudVerifier.sol -

-
-
- 96.43% - Statements - 27/28 -
-
- 94.44% - Branches - 17/18 -
-
- 100% - Functions - 7/7 -
-
- 96.43% - Lines - 27/28 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -12× -  -  -  -12× -12× -  -12× -  -  -  -  -  -  -  -  -11× -  -  -  -  -  -  -  -  -  -10× -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - -  -  -  -  - -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
- 
-/* Contract Imports */
-import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
- 
- 
- 
-/**
- * @title OVM_FraudVerifier
- * @dev The Fraud Verifier contract coordinates the entire fraud proof verification process. 
- * If the fraud proof was successful it prunes any state batches from State Commitment Chain
- * which were published after the fraudulent state root.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_FraudVerifier is Lib_AddressResolver, Abs_FraudContributor, iOVM_FraudVerifier {
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    mapping (bytes32 => iOVM_StateTransitioner) internal transitioners;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
- 
-    /***************************************
-     * Public Functions: Transition Status *
-     ***************************************/
- 
-    /**
-     * Retrieves the state transitioner for a given root.
-     * @param _preStateRoot State root to query a transitioner for.
-     * @return _transitioner Corresponding state transitioner contract.
-     */
-    function getStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        override
-        public
-        view
-        returns (
-            iOVM_StateTransitioner _transitioner
-        )
-    {
-        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
-    }
- 
- 
-    /****************************************
-     * Public Functions: Fraud Verification *
-     ****************************************/
- 
-    /**
-     * Begins the fraud verification process.
-     * @param _preStateRoot State root before the fraudulent transaction.
-     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
-     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
-     * @param _transaction OVM transaction claimed to be fraudulent.
-     * @param _txChainElement OVM transaction chain element.
-     * @param _transactionBatchHeader Batch header for the provided transaction.
-     * @param _transactionProof Inclusion proof for the provided transaction.
-     */
-    function initializeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _transactionBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _transactionProof
-    )
-        override
-        public
-        contributesToFraudProof(_preStateRoot, Lib_OVMCodec.hashTransaction(_transaction))
-    {
-        bytes32 _txHash = Lib_OVMCodec.hashTransaction(_transaction);
- 
-        Iif (_hasStateTransitioner(_preStateRoot, _txHash)) {
-            return;
-        }
- 
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
-        iOVM_CanonicalTransactionChain ovmCanonicalTransactionChain = iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain"));
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _preStateRoot,
-                _preStateRootBatchHeader,
-                _preStateRootProof
-            ),
-            "Invalid pre-state root inclusion proof."
-        );
- 
-        require(
-            ovmCanonicalTransactionChain.verifyTransaction(
-                _transaction,
-                _txChainElement,
-                _transactionBatchHeader,
-                _transactionProof
-            ),
-            "Invalid transaction inclusion proof."
-        );
- 
-        require (
-            _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1 == _transactionBatchHeader.prevTotalElements + _transactionProof.index,
-            "Pre-state root global index must equal to the transaction root global index."
-        );
- 
-        _deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index);
- 
-        emit FraudProofInitialized(
-            _preStateRoot,
-            _preStateRootProof.index,
-            _txHash,
-            msg.sender
-        );
-    }
- 
-    /**
-     * Finalizes the fraud verification process.
-     * @param _preStateRoot State root before the fraudulent transaction.
-     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
-     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
-     * @param _txHash The transaction for the state root
-     * @param _postStateRoot State root after the fraudulent transaction.
-     * @param _postStateRootBatchHeader Batch header for the provided post-state root.
-     * @param _postStateRootProof Inclusion proof for the provided post-state root.
-     */
-    function finalizeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
-        bytes32 _txHash,
-        bytes32 _postStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _postStateRootProof
-    )
-        override
-        public
-        contributesToFraudProof(_preStateRoot, _txHash)
-    {
-        iOVM_StateTransitioner transitioner = getStateTransitioner(_preStateRoot, _txHash);
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
- 
-        require(
-            transitioner.isComplete() == true,
-            "State transition process must be completed prior to finalization."
-        );
- 
-        require (
-            _postStateRootBatchHeader.prevTotalElements + _postStateRootProof.index == _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1,
-            "Post-state root global index must equal to the pre state root global index plus one."
-        );
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _preStateRoot,
-                _preStateRootBatchHeader,
-                _preStateRootProof
-            ),
-            "Invalid pre-state root inclusion proof."
-        );
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _postStateRoot,
-                _postStateRootBatchHeader,
-                _postStateRootProof
-            ),
-            "Invalid post-state root inclusion proof."
-        );
- 
-        // If the post state root did not match, then there was fraud and we should delete the batch
-        require(
-            _postStateRoot != transitioner.getPostStateRoot(),
-            "State transition has not been proven fraudulent."
-        );
-        
-        _cancelStateTransition(_postStateRootBatchHeader, _preStateRoot);
- 
-        // TEMPORARY: Remove the transitioner; for minnet.
-        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitioner(0x0000000000000000000000000000000000000000);
- 
-        emit FraudProofFinalized(
-            _preStateRoot,
-            _preStateRootProof.index,
-            _txHash,
-            msg.sender
-        );
-    }
- 
- 
-    /************************************
-     * Internal Functions: Verification *
-     ************************************/
- 
-    /**
-     * Checks whether a transitioner already exists for a given pre-state root.
-     * @param _preStateRoot Pre-state root to check.
-     * @return _exists Whether or not we already have a transitioner for the root.
-     */
-    function _hasStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        internal
-        view
-        returns (
-            bool _exists
-        )
-    {
-        return address(getStateTransitioner(_preStateRoot, _txHash)) != address(0);
-    }
- 
-    /**
-     * Deploys a new state transitioner.
-     * @param _preStateRoot Pre-state root to initialize the transitioner with.
-     * @param _txHash Hash of the transaction this transitioner will execute.
-     * @param _stateTransitionIndex Index of the transaction in the chain.
-     */
-    function _deployTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        uint256 _stateTransitionIndex
-    )
-        internal
-    {
-        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitionerFactory(
-            resolve("OVM_StateTransitionerFactory")
-        ).create(
-            address(libAddressManager),
-            _stateTransitionIndex,
-            _preStateRoot,
-            _txHash
-        );
-    }
- 
-    /**
-     * Removes a state transition from the state commitment chain.
-     * @param _postStateRootBatchHeader Header for the post-state root.
-     * @param _preStateRoot Pre-state root hash.
-     */
-    function _cancelStateTransition(
-        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
-        bytes32 _preStateRoot
-    )
-        internal
-    {
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
-        iOVM_BondManager ovmBondManager = iOVM_BondManager(resolve("OVM_BondManager"));
- 
-        // Delete the state batch.
-        ovmStateCommitmentChain.deleteStateBatch(
-            _postStateRootBatchHeader
-        );
- 
-        // Get the timestamp and publisher for that block.
-        (uint256 timestamp, address publisher) = abi.decode(_postStateRootBatchHeader.extraData, (uint256, address));
- 
-        // Slash the bonds at the bond manager.
-        ovmBondManager.finalize(
-            _preStateRoot,
-            publisher,
-            timestamp
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html deleted file mode 100644 index fe900da65..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html +++ /dev/null @@ -1,1484 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ OVM_StateTransitioner.sol -

-
-
- 80% - Statements - 40/50 -
-
- 62.5% - Branches - 20/32 -
-
- 90.91% - Functions - 10/11 -
-
- 80.39% - Lines - 41/51 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -42× -42× -  -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  - -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
-import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
-import { Lib_SecureMerkleTrie } from "../../libraries/trie/Lib_SecureMerkleTrie.sol";
-import { Lib_RLPWriter } from "../../libraries/rlp/Lib_RLPWriter.sol";
-import { Lib_RLPReader } from "../../libraries/rlp/Lib_RLPReader.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
- 
-/* Contract Imports */
-import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
- 
-/**
- * @title OVM_StateTransitioner
- * @dev The State Transitioner coordinates the execution of a state transition during the evaluation of a
- * fraud proof. It feeds verified input to the Execution Manager's run(), and controls a State Manager (which is
- * uniquely created for each fraud proof).
- * Once a fraud proof has been initialized, this contract is provided with the pre-state root and verifies
- * that the OVM storage slots committed to the State Mangager are contained in that state
- * This contract controls the State Manager and Execution Manager, and uses them to calculate the
- * post-state root by applying the transaction. The Fraud Verifier can then check for fraud by comparing
- * the calculated post-state root with the proposed post-state root.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateTransitioner is Lib_AddressResolver, Abs_FraudContributor, iOVM_StateTransitioner {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum TransitionPhase {
-        PRE_EXECUTION,
-        POST_EXECUTION,
-        COMPLETE
-    }
- 
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    iOVM_StateManager public ovmStateManager;
- 
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    bytes32 internal preStateRoot;
-    bytes32 internal postStateRoot;
-    TransitionPhase public phase;
-    uint256 internal stateTransitionIndex;
-    bytes32 internal transactionHash;
- 
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 internal constant EMPTY_ACCOUNT_CODE_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
-    bytes32 internal constant EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _stateTransitionIndex Index of the state transition being verified.
-     * @param _preStateRoot State root before the transition was executed.
-     * @param _transactionHash Hash of the executed transaction.
-     */
-    constructor(
-        address _libAddressManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        stateTransitionIndex = _stateTransitionIndex;
-        preStateRoot = _preStateRoot;
-        postStateRoot = _preStateRoot;
-        transactionHash = _transactionHash;
- 
-        ovmStateManager = iOVM_StateManagerFactory(resolve("OVM_StateManagerFactory")).create(address(this));
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Checks that a function is only run during a specific phase.
-     * @param _phase Phase the function must run within.
-     */
-    modifier onlyDuringPhase(
-        TransitionPhase _phase
-    ) {
-        Erequire(
-            phase == _phase,
-            "Function must be called during the correct phase."
-        );
-        _;
-    }
- 
- 
-    /**********************************
-     * Public Functions: State Access *
-     **********************************/
- 
-    /**
-     * Retrieves the state root before execution.
-     * @return _preStateRoot State root before execution.
-     */
-    function getPreStateRoot()
-        override
-        public
-        view
-        returns (
-            bytes32 _preStateRoot
-        )
-    {
-        return preStateRoot;
-    }
- 
-    /**
-     * Retrieves the state root after execution.
-     * @return _postStateRoot State root after execution.
-     */
-    function getPostStateRoot()
-        override
-        public
-        view
-        returns (
-            bytes32 _postStateRoot
-        )
-    {
-        return postStateRoot;
-    }
- 
-    /**
-     * Checks whether the transitioner is complete.
-     * @return _complete Whether or not the transition process is finished.
-     */
-    function isComplete()
-        override
-        public
-        view
-        returns (
-            bool _complete
-        )
-    {
-        return phase == TransitionPhase.COMPLETE;
-    }
-    
- 
-    /***********************************
-     * Public Functions: Pre-Execution *
-     ***********************************/
- 
-    /**
-     * Allows a user to prove the initial state of a contract.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _ethContractAddress Address of the corresponding contract on L1.
-     * @param _stateTrieWitness Proof of the account state.
-     */
-    function proveContractState(
-        address _ovmContractAddress,
-        address _ethContractAddress,
-        bytes memory _stateTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        // Exit quickly to avoid unnecessary work.
-        Erequire(
-            (
-                ovmStateManager.hasAccount(_ovmContractAddress) == false
-                && ovmStateManager.hasEmptyAccount(_ovmContractAddress) == false
-            ),
-            "Account state has already been proven."
-        );
- 
-        // Function will fail if the proof is not a valid inclusion or exclusion proof.
-        (
-            bool exists,
-            bytes memory encodedAccount
-        ) = Lib_SecureMerkleTrie.get(
-            abi.encodePacked(_ovmContractAddress),
-            _stateTrieWitness,
-            preStateRoot
-        );
- 
-        Eif (exists == true) {
-            // Account exists, this was an inclusion proof.
-            Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
-                encodedAccount
-            );
- 
-            address ethContractAddress = _ethContractAddress;
-            Iif (account.codeHash == EMPTY_ACCOUNT_CODE_HASH) {
-                // Use a known empty contract to prevent an attack in which a user provides a
-                // contract address here and then later deploys code to it.
-                ethContractAddress = 0x0000000000000000000000000000000000000000;
-            } else {
-                // Otherwise, make sure that the code at the provided eth address matches the hash
-                // of the code stored on L2.
-                Erequire(
-                    Lib_EthUtils.getCodeHash(ethContractAddress) == account.codeHash,
-                    "OVM_StateTransitioner: Provided L1 contract code hash does not match L2 contract code hash."
-                );
-            }
- 
-            ovmStateManager.putAccount(
-                _ovmContractAddress,
-                Lib_OVMCodec.Account({
-                    nonce: account.nonce,
-                    balance: account.balance,
-                    storageRoot: account.storageRoot,
-                    codeHash: account.codeHash,
-                    ethAddress: ethContractAddress,
-                    isFresh: false
-                })
-            );
-        } else {
-            // Account does not exist, this was an exclusion proof.
-            ovmStateManager.putEmptyAccount(_ovmContractAddress);
-        }
-    }
- 
-    /**
-     * Allows a user to prove the initial state of a contract storage slot.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _key Claimed account slot key.
-     * @param _storageTrieWitness Proof of the storage slot.
-     */
-    function proveStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes memory _storageTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        // Exit quickly to avoid unnecessary work.
-        Erequire(
-            ovmStateManager.hasContractStorage(_ovmContractAddress, _key) == false,
-            "Storage slot has already been proven."
-        );
- 
-        require(
-            ovmStateManager.hasAccount(_ovmContractAddress) == true,
-            "Contract must be verified before proving a storage slot."
-        );
- 
-        bytes32 storageRoot = ovmStateManager.getAccountStorageRoot(_ovmContractAddress);
-        bytes32 value;
- 
-        Iif (storageRoot == EMPTY_ACCOUNT_STORAGE_ROOT) {
-            // Storage trie was empty, so the user is always allowed to insert zero-byte values.
-            value = bytes32(0);
-        } else {
-            // Function will fail if the proof is not a valid inclusion or exclusion proof.
-            (
-                bool exists,
-                bytes memory encodedValue
-            ) = Lib_SecureMerkleTrie.get(
-                abi.encodePacked(_key),
-                _storageTrieWitness,
-                storageRoot
-            );
- 
-            Eif (exists == true) {
-                // Inclusion proof.
-                // Stored values are RLP encoded, with leading zeros removed.
-                value = Lib_BytesUtils.toBytes32PadLeft(
-                    Lib_RLPReader.readBytes(encodedValue)
-                );
-            } else {
-                // Exclusion proof, can only be zero bytes.
-                value = bytes32(0);
-            }
-        }
- 
-        ovmStateManager.putContractStorage(
-            _ovmContractAddress,
-            _key,
-            value
-        );
-    }
- 
- 
-    /*******************************
-     * Public Functions: Execution *
-     *******************************/
- 
-    /**
-     * Executes the state transition.
-     * @param _transaction OVM transaction to execute.
-     */
-    function applyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        Irequire(
-            Lib_OVMCodec.hashTransaction(_transaction) == transactionHash,
-            "Invalid transaction provided."
-        );
- 
-        // We require gas to complete the logic here in run() before/after execution,
-        // But must ensure the full _tx.gasLimit can be given to the ovmCALL (determinism)
-        // This includes 1/64 of the gas getting lost because of EIP-150 (lost twice--first 
-        // going into EM, then going into the code contract).
-        require(
-            gasleft() >= 100000 + _transaction.gasLimit * 1032 / 1000, // 1032/1000 = 1.032 = (64/63)^2 rounded up
-            "Not enough gas to execute transaction deterministically."
-        );
- 
-        iOVM_ExecutionManager ovmExecutionManager = iOVM_ExecutionManager(resolve("OVM_ExecutionManager"));
- 
-        // We call `setExecutionManager` right before `run` (and not earlier) just in case the
-        // OVM_ExecutionManager address was updated between the time when this contract was created
-        // and when `applyTransaction` was called.
-        ovmStateManager.setExecutionManager(address(ovmExecutionManager));
- 
-        // `run` always succeeds *unless* the user hasn't provided enough gas to `applyTransaction`
-        // or an INVALID_STATE_ACCESS flag was triggered. Either way, we won't get beyond this line
-        // if that's the case.
-        ovmExecutionManager.run(_transaction, address(ovmStateManager));
- 
-        phase = TransitionPhase.POST_EXECUTION;
-    }
- 
- 
-    /************************************
-     * Public Functions: Post-Execution *
-     ************************************/
- 
-    /**
-     * Allows a user to commit the final state of a contract.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _stateTrieWitness Proof of the account state.
-     */
-    function commitContractState(
-        address _ovmContractAddress,
-        bytes memory _stateTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        Erequire(
-            ovmStateManager.getTotalUncommittedContractStorage() == 0,
-            "All storage must be committed before committing account states."
-        );
- 
-        require (
-            ovmStateManager.commitAccount(_ovmContractAddress) == true,
-            "Account state wasn't changed or has already been committed."
-        );
- 
-        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
- 
-        postStateRoot = Lib_SecureMerkleTrie.update(
-            abi.encodePacked(_ovmContractAddress),
-            Lib_OVMCodec.encodeEVMAccount(
-                Lib_OVMCodec.toEVMAccount(account)
-            ),
-            _stateTrieWitness,
-            postStateRoot
-        );
- 
-        // Emit an event to help clients figure out the proof ordering.
-        emit AccountCommitted(
-            _ovmContractAddress
-        );
-    }
- 
-    /**
-     * Allows a user to commit the final state of a contract storage slot.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _key Claimed account slot key.
-     * @param _storageTrieWitness Proof of the storage slot.
-     */
-    function commitStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes memory _storageTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        require(
-            ovmStateManager.commitContractStorage(_ovmContractAddress, _key) == true,
-            "Storage slot value wasn't changed or has already been committed."
-        );
- 
-        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
-        bytes32 value = ovmStateManager.getContractStorage(_ovmContractAddress, _key);
- 
-        account.storageRoot = Lib_SecureMerkleTrie.update(
-            abi.encodePacked(_key),
-            Lib_RLPWriter.writeBytes(
-                Lib_Bytes32Utils.removeLeadingZeros(value)
-            ),
-            _storageTrieWitness,
-            account.storageRoot
-        );
- 
-        ovmStateManager.putAccount(_ovmContractAddress, account);
- 
-        // Emit an event to help clients figure out the proof ordering.
-        emit ContractStorageCommitted(
-            _ovmContractAddress,
-            _key
-        );
-    }
- 
- 
-    /**********************************
-     * Public Functions: Finalization *
-     **********************************/
- 
-    /**
-     * Finalizes the transition process.
-     */
-    function completeTransition()
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-    {
-        require(
-            ovmStateManager.getTotalUncommittedAccounts() == 0,
-            "All accounts must be committed before completing a transition."
-        );
- 
-        require(
-            ovmStateManager.getTotalUncommittedContractStorage() == 0,
-            "All storage must be committed before completing a transition."
-        );
- 
-        phase = TransitionPhase.COMPLETE;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html deleted file mode 100644 index 6072bb685..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ OVM_StateTransitionerFactory.sol -

-
-
- 50% - Statements - 1/2 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 2/2 -
-
- 50% - Lines - 1/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
- 
-/* Contract Imports */
-import { OVM_StateTransitioner } from "./OVM_StateTransitioner.sol";
- 
-/**
- * @title OVM_StateTransitionerFactory
- * @dev The State Transitioner Factory is used by the Fraud Verifier to create a new State 
- * Transitioner during the initialization of a fraud proof.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateTransitionerFactory is iOVM_StateTransitionerFactory, Lib_AddressResolver {
- 
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    /**
-     * Creates a new OVM_StateTransitioner
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _stateTransitionIndex Index of the state transition being verified.
-     * @param _preStateRoot State root before the transition was executed.
-     * @param _transactionHash Hash of the executed transaction.
-     * @return _ovmStateTransitioner New OVM_StateTransitioner instance.
-     */
-    function create(
-        address _libAddressManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        override
-        public
-        returns (
-            iOVM_StateTransitioner _ovmStateTransitioner
-        )
-    {
-        Irequire(
-            msg.sender == resolve("OVM_FraudVerifier"),
-            "Create can only be done by the OVM_FraudVerifier."
-        );
-        return new OVM_StateTransitioner(
-            _libAddressManager,
-            _stateTransitionIndex,
-            _preStateRoot,
-            _transactionHash
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/OVM/verification/index.html b/coverage/lcov-report/optimistic-ethereum/OVM/verification/index.html deleted file mode 100644 index e160dcf28..000000000 --- a/coverage/lcov-report/optimistic-ethereum/OVM/verification/index.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/verification/ -

-
-
- 90.4% - Statements - 113/125 -
-
- 78.05% - Branches - 64/82 -
-
- 96.67% - Functions - 29/30 -
-
- 90.48% - Lines - 114/126 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_FraudContributor.sol
100%3/3100%0/0100%1/1100%4/4
OVM_BondManager.sol
100%42/4286.67%26/30100%9/9100%41/41
OVM_FraudVerifier.sol
96.43%27/2894.44%17/18100%7/796.43%27/28
OVM_StateTransitioner.sol
80%40/5062.5%20/3290.91%10/1180.39%41/51
OVM_StateTransitionerFactory.sol
50%1/250%1/2100%2/250%1/2
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html deleted file mode 100644 index cb0d9f22a..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/accounts/ iOVM_ECDSAContractAccount.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_ECDSAContractAccount
- */
-interface iOVM_ECDSAContractAccount {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    ) external returns (bool _success, bytes memory _returndata);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/index.html deleted file mode 100644 index ef910e5b5..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/accounts/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/accounts/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/accounts/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_ECDSAContractAccount.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html deleted file mode 100644 index f21d38c1a..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/messaging/ iAbs_BaseCrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iAbs_BaseCrossDomainMessenger
- */
-interface iAbs_BaseCrossDomainMessenger {
- 
-    /**********
-     * Events *
-     **********/
-    event SentMessage(bytes message);
-    event RelayedMessage(bytes32 msgHash);
- 
-    /**********************
-     * Contract Variables *
-     **********************/
-    function xDomainMessageSender() external view returns (address);
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sends a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _message Message to send to the target.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function sendMessage(
-        address _target,
-        bytes calldata _message,
-        uint32 _gasLimit
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html deleted file mode 100644 index da13fd02b..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L1CrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title iOVM_L1CrossDomainMessenger
- */
-interface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    struct L2MessageInclusionProof {
-        bytes32 stateRoot;
-        Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;
-        Lib_OVMCodec.ChainInclusionProof stateRootProof;
-        bytes stateTrieWitness;
-        bytes storageTrieWitness;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @param _proof Inclusion proof for the given message.
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        L2MessageInclusionProof memory _proof
-    ) external;
- 
-    /**
-     * Replays a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _sender Original sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function replayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        uint32 _gasLimit
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html deleted file mode 100644 index bb37bbe09..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L1MultiMessageRelayer.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-interface iOVM_L1MultiMessageRelayer {
- 
-    struct L2ToL1Message {
-        address target;
-        address sender;
-        bytes message;
-        uint256 messageNonce;
-        iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;
-    }
- 
-    function batchRelayMessages(L2ToL1Message[] calldata _messages) external; 
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html deleted file mode 100644 index 10a409698..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L2CrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title iOVM_L2CrossDomainMessenger
- */
-interface iOVM_L2CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/index.html deleted file mode 100644 index 3d8e3efae..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/messaging/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/bridge/messaging/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iAbs_BaseCrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MultiMessageRelayer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html deleted file mode 100644 index 8f52453eb..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L1ETHGateway.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L1ETHGateway
- */
-interface iOVM_L1ETHGateway {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event DepositInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
- 
-    event WithdrawalFinalized(
-        address indexed _to,
-        uint256 _amount
-    );
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function deposit()
-        external
-        payable;
- 
-    function depositTo(
-        address _to
-    )
-        external
-        payable;
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external;
- 
-    function getFinalizeDepositL2Gas()
-        external
-        view
-        returns(
-            uint32
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html deleted file mode 100644 index 4de6d7385..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L1TokenGateway.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L1TokenGateway
- */
-interface iOVM_L1TokenGateway {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event DepositInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
-  
-    event WithdrawalFinalized(
-        address indexed _to,
-        uint256 _amount
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function deposit(
-        uint _amount
-    )
-        external;
- 
-    function depositTo(
-        address _to,
-        uint _amount
-    )
-        external;
- 
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html deleted file mode 100644 index 0b3777f82..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L2DepositedToken.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L2DepositedToken
- */
-interface iOVM_L2DepositedToken {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event WithdrawalInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
- 
-    event DepositFinalized(
-        address indexed _to,
-        uint256 _amount
-    );    
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function withdraw(
-        uint _amount
-    )
-        external;
- 
-    function withdrawTo(
-        address _to,
-        uint _amount
-    )
-        external;
- 
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/index.html deleted file mode 100644 index 60ef990a9..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/bridge/tokens/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/bridge/tokens/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_L1ETHGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1TokenGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2DepositedToken.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html deleted file mode 100644 index 719bb7c7e..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html +++ /dev/null @@ -1,782 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/chain/ iOVM_CanonicalTransactionChain.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_ChainStorageContainer } from "./iOVM_ChainStorageContainer.sol";
- 
-/**
- * @title iOVM_CanonicalTransactionChain
- */
-interface iOVM_CanonicalTransactionChain {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event TransactionEnqueued(
-        address _l1TxOrigin,
-        address _target,
-        uint256 _gasLimit,
-        bytes _data,
-        uint256 _queueIndex,
-        uint256 _timestamp
-    );
- 
-    event QueueBatchAppended(
-        uint256 _startingQueueIndex,
-        uint256 _numQueueElements,
-        uint256 _totalElements
-    );
- 
-    event SequencerBatchAppended(
-        uint256 _startingQueueIndex,
-        uint256 _numQueueElements,
-        uint256 _totalElements
-    );
- 
-    event TransactionBatchAppended(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot,
-        uint256 _batchSize,
-        uint256 _prevTotalElements,
-        bytes _extraData
-    );
- 
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct BatchContext {
-        uint256 numSequencedTransactions;
-        uint256 numSubsequentQueueTransactions;
-        uint256 timestamp;
-        uint256 blockNumber;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        external
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        );
- 
-    /**
-     * Accesses the queue storage container.
-     * @return Reference to the queue storage container.
-     */
-    function queue()
-        external
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        );
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        external
-        view
-        returns (
-            uint256 _totalElements
-        );
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        external
-        view
-        returns (
-            uint256 _totalBatches
-        );
- 
-    /**
-     * Returns the index of the next element to be enqueued.
-     * @return Index for the next queue element.
-     */
-    function getNextQueueIndex()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function getQueueElement(
-        uint256 _index
-    )
-        external
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        );
- 
-    /**
-     * Returns the timestamp of the last transaction.
-     * @return Timestamp for the last transaction.
-     */
-    function getLastTimestamp()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Returns the blocknumber of the last transaction.
-     * @return Blocknumber for the last transaction.
-     */
-    function getLastBlockNumber()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Get the number of queue elements which have not yet been included.
-     * @return Number of pending queue elements.
-     */
-    function getNumPendingQueueElements()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Retrieves the length of the queue, including
-     * both pending and canonical transactions.
-     * @return Length of the queue.
-     */
-    function getQueueLength()
-        external
-        view
-        returns (
-            uint40
-        );
- 
- 
-    /**
-     * Adds a transaction to the queue.
-     * @param _target Target contract to send the transaction to.
-     * @param _gasLimit Gas limit for the given transaction.
-     * @param _data Transaction data.
-     */
-    function enqueue(
-        address _target,
-        uint256 _gasLimit,
-        bytes memory _data
-    )
-        external;
- 
-    /**
-     * Appends a given number of queued transactions as a single batch.
-     * @param _numQueuedTransactions Number of transactions to append.
-     */
-    function appendQueueBatch(
-        uint256 _numQueuedTransactions
-    )
-        external;
- 
-    /**
-     * Allows the sequencer to append a batch of transactions.
-     * @dev This function uses a custom encoding scheme for efficiency reasons.
-     * .param _shouldStartAtElement Specific batch we expect to start appending to.
-     * .param _totalElementsToAppend Total number of batch elements we expect to append.
-     * .param _contexts Array of batch contexts.
-     * .param _transactionDataFields Array of raw transaction data.
-     */
-    function appendSequencerBatch(
-        // uint40 _shouldStartAtElement,
-        // uint24 _totalElementsToAppend,
-        // BatchContext[] _contexts,
-        // bytes[] _transactionDataFields
-    )
-        external;
- 
-    /**
-     * Verifies whether a transaction is included in the chain.
-     * @param _transaction Transaction to verify.
-     * @param _txChainElement Transaction chain element corresponding to the transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
-     * @return True if the transaction exists in the CTC, false if not.
-     */
-    function verifyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        external
-        view
-        returns (
-            bool
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html deleted file mode 100644 index 2a6ce20dc..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/chain/ iOVM_ChainStorageContainer.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_ChainStorageContainer
- */
-interface iOVM_ChainStorageContainer {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sets the container's global metadata field. We're using `bytes27` here because we use five
-     * bytes to maintain the length of the underlying data structure, meaning we have an extra
-     * 27 bytes to store arbitrary data.
-     * @param _globalMetadata New global metadata to set.
-     */
-    function setGlobalMetadata(
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Retrieves the container's global metadata field.
-     * @return Container global metadata field.
-     */
-    function getGlobalMetadata()
-        external
-        view
-        returns (
-            bytes27
-        );
- 
-    /**
-     * Retrieves the number of objects stored in the container.
-     * @return Number of objects in the container.
-     */
-    function length()
-        external
-        view
-        returns (
-            uint256
-        );
- 
-    /**
-     * Pushes an object into the container.
-     * @param _object A 32 byte value to insert into the container.
-     */
-    function push(
-        bytes32 _object
-    )
-        external;
- 
-    /**
-     * Pushes an object into the container. Function allows setting the global metadata since
-     * we'll need to touch the "length" storage slot anyway, which also contains the global
-     * metadata (it's an optimization).
-     * @param _object A 32 byte value to insert into the container.
-     * @param _globalMetadata New global metadata for the container.
-     */
-    function push(
-        bytes32 _object,
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Retrieves an object from the container.
-     * @param _index Index of the particular object to access.
-     * @return 32 byte object value.
-     */
-    function get(
-        uint256 _index
-    )
-        external
-        view
-        returns (
-            bytes32
-        );
- 
-    /**
-     * Removes all objects after and including a given index.
-     * @param _index Object index to delete from.
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index
-    )
-        external;
- 
-    /**
-     * Removes all objects after and including a given index. Also allows setting the global
-     * metadata field.
-     * @param _index Object index to delete from.
-     * @param _globalMetadata New global metadata for the container.
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index,
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Marks an index as overwritable, meaing the underlying buffer can start to write values over
-     * any objects before and including the given index.
-     */
-    function setNextOverwritableIndex(
-        uint256 _index
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html deleted file mode 100644 index a65b5ceef..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/chain/ iOVM_StateCommitmentChain.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateCommitmentChain
- */
-interface iOVM_StateCommitmentChain {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event StateBatchAppended(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot,
-        uint256 _batchSize,
-        uint256 _prevTotalElements,
-        bytes _extraData
-    );
- 
-    event StateBatchDeleted(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        external
-        view
-        returns (
-            uint256 _totalElements
-        );
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        external
-        view
-        returns (
-            uint256 _totalBatches
-        );
- 
-    /**
-     * Retrieves the timestamp of the last batch submitted by the sequencer.
-     * @return _lastSequencerTimestamp Last sequencer batch timestamp.
-     */
-    function getLastSequencerTimestamp()
-        external
-        view
-        returns (
-            uint256 _lastSequencerTimestamp
-        );
- 
-    /**
-     * Appends a batch of state roots to the chain.
-     * @param _batch Batch of state roots.
-     * @param _shouldStartAtElement Index of the element at which this batch should start.
-     */
-    function appendStateBatch(
-        bytes32[] calldata _batch,
-        uint256 _shouldStartAtElement
-    )
-        external;
- 
-    /**
-     * Deletes all state roots after (and including) a given batch.
-     * @param _batchHeader Header of the batch to start deleting from.
-     */
-    function deleteStateBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        external;
- 
-    /**
-     * Verifies a batch inclusion proof.
-     * @param _element Hash of the element to verify a proof for.
-     * @param _batchHeader Header of the batch in which the element was included.
-     * @param _proof Merkle inclusion proof for the element.
-     */
-    function verifyStateCommitment(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        external
-        view
-        returns (
-            bool _verified
-        );
- 
-    /**
-     * Checks whether a given batch is still inside its fraud proof window.
-     * @param _batchHeader Header of the batch to check.
-     * @return _inside Whether or not the batch is inside the fraud proof window.
-     */
-    function insideFraudProofWindow(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        external
-        view
-        returns (
-            bool _inside
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/chain/index.html deleted file mode 100644 index 79692cb03..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/chain/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/chain/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/chain/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_CanonicalTransactionChain.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ChainStorageContainer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateCommitmentChain.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html deleted file mode 100644 index caae9773f..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html +++ /dev/null @@ -1,533 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/execution/ iOVM_ExecutionManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-interface iOVM_ExecutionManager {
-    /**********
-     * Enums *
-     *********/
- 
-    enum RevertFlag {
-        OUT_OF_GAS,
-        INTENTIONAL_REVERT,
-        EXCEEDS_NUISANCE_GAS,
-        INVALID_STATE_ACCESS,
-        UNSAFE_BYTECODE,
-        CREATE_COLLISION,
-        STATIC_VIOLATION,
-        CREATOR_NOT_ALLOWED
-    }
- 
-    enum GasMetadataKey {
-        CURRENT_EPOCH_START_TIMESTAMP,
-        CUMULATIVE_SEQUENCER_QUEUE_GAS,
-        CUMULATIVE_L1TOL2_QUEUE_GAS,
-        PREV_EPOCH_SEQUENCER_QUEUE_GAS,
-        PREV_EPOCH_L1TOL2_QUEUE_GAS
-    }
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct GasMeterConfig {
-        uint256 minTransactionGasLimit;
-        uint256 maxTransactionGasLimit;
-        uint256 maxGasPerQueuePerEpoch;
-        uint256 secondsPerEpoch;
-    }
- 
-    struct GlobalContext {
-        uint256 ovmCHAINID;
-    }
- 
-    struct TransactionContext {
-        Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;
-        uint256 ovmTIMESTAMP;
-        uint256 ovmNUMBER;
-        uint256 ovmGASLIMIT;
-        uint256 ovmTXGASLIMIT;
-        address ovmL1TXORIGIN;
-    }
- 
-    struct TransactionRecord {
-        uint256 ovmGasRefund;
-    }
- 
-    struct MessageContext {
-        address ovmCALLER;
-        address ovmADDRESS;
-        bool isStatic;
-    }
- 
-    struct MessageRecord {
-        uint256 nuisanceGasLeft;
-    }
- 
- 
-    /************************************
-     * Transaction Execution Entrypoint *
-     ************************************/
- 
-    function run(
-        Lib_OVMCodec.Transaction calldata _transaction,
-        address _txStateManager
-    ) external;
- 
- 
-    /*******************
-     * Context Opcodes *
-     *******************/
- 
-    function ovmCALLER() external view returns (address _caller);
-    function ovmADDRESS() external view returns (address _address);
-    function ovmTIMESTAMP() external view returns (uint256 _timestamp);
-    function ovmNUMBER() external view returns (uint256 _number);
-    function ovmGASLIMIT() external view returns (uint256 _gasLimit);
-    function ovmCHAINID() external view returns (uint256 _chainId);
- 
- 
-    /**********************
-     * L2 Context Opcodes *
-     **********************/
- 
-    function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
-    function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
- 
- 
-    /*******************
-     * Halting Opcodes *
-     *******************/
- 
-    function ovmREVERT(bytes memory _data) external;
- 
- 
-    /*****************************
-     * Contract Creation Opcodes *
-     *****************************/
- 
-    function ovmCREATE(bytes memory _bytecode) external returns (address _contract, bytes memory _revertdata);
-    function ovmCREATE2(bytes memory _bytecode, bytes32 _salt) external returns (address _contract, bytes memory _revertdata);
- 
- 
-    /*******************************
-     * Account Abstraction Opcodes *
-     ******************************/
- 
-    function ovmGETNONCE() external returns (uint256 _nonce);
-    function ovmSETNONCE(uint256 _nonce) external;
-    function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
- 
- 
-    /****************************
-     * Contract Calling Opcodes *
-     ****************************/
- 
-    function ovmCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
-    function ovmSTATICCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
-    function ovmDELEGATECALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
- 
- 
-    /****************************
-     * Contract Storage Opcodes *
-     ****************************/
- 
-    function ovmSLOAD(bytes32 _key) external returns (bytes32 _value);
-    function ovmSSTORE(bytes32 _key, bytes32 _value) external;
- 
- 
-    /*************************
-     * Contract Code Opcodes *
-     *************************/
- 
-    function ovmEXTCODECOPY(address _contract, uint256 _offset, uint256 _length) external returns (bytes memory _code);
-    function ovmEXTCODESIZE(address _contract) external returns (uint256 _size);
-    function ovmEXTCODEHASH(address _contract) external returns (bytes32 _hash);
- 
- 
-    /***************************************
-     * Public Functions: Execution Context *
-     ***************************************/
- 
-    function getMaxTransactionGasLimit() external view returns (uint _maxTransactionGasLimit);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html deleted file mode 100644 index 2879de4b0..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/execution/ iOVM_SafetyChecker.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_SafetyChecker
- */
-interface iOVM_SafetyChecker {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html deleted file mode 100644 index d50f8d0b1..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/execution/ iOVM_StateManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateManager
- */
-interface iOVM_StateManager {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum ItemState {
-        ITEM_UNTOUCHED,
-        ITEM_LOADED,
-        ITEM_CHANGED,
-        ITEM_COMMITTED
-    }
- 
-    /***************************
-     * Public Functions: Misc *
-     ***************************/
- 
-    function isAuthenticated(address _address) external view returns (bool);
- 
-    /***************************
-     * Public Functions: Setup *
-     ***************************/
- 
-    function owner() external view returns (address _owner);
-    function ovmExecutionManager() external view returns (address _ovmExecutionManager);
-    function setExecutionManager(address _ovmExecutionManager) external;
- 
- 
-    /************************************
-     * Public Functions: Account Access *
-     ************************************/
- 
-    function putAccount(address _address, Lib_OVMCodec.Account memory _account) external;
-    function putEmptyAccount(address _address) external;
-    function getAccount(address _address) external view returns (Lib_OVMCodec.Account memory _account);
-    function hasAccount(address _address) external view returns (bool _exists);
-    function hasEmptyAccount(address _address) external view returns (bool _exists);
-    function setAccountNonce(address _address, uint256 _nonce) external;
-    function getAccountNonce(address _address) external view returns (uint256 _nonce);
-    function getAccountEthAddress(address _address) external view returns (address _ethAddress);
-    function getAccountStorageRoot(address _address) external view returns (bytes32 _storageRoot);
-    function initPendingAccount(address _address) external;
-    function commitPendingAccount(address _address, address _ethAddress, bytes32 _codeHash) external;
-    function testAndSetAccountLoaded(address _address) external returns (bool _wasAccountAlreadyLoaded);
-    function testAndSetAccountChanged(address _address) external returns (bool _wasAccountAlreadyChanged);
-    function commitAccount(address _address) external returns (bool _wasAccountCommitted);
-    function incrementTotalUncommittedAccounts() external;
-    function getTotalUncommittedAccounts() external view returns (uint256 _total);
-    function wasAccountChanged(address _address) external view returns (bool);
-    function wasAccountCommitted(address _address) external view returns (bool);
- 
- 
-    /************************************
-     * Public Functions: Storage Access *
-     ************************************/
- 
-    function putContractStorage(address _contract, bytes32 _key, bytes32 _value) external;
-    function getContractStorage(address _contract, bytes32 _key) external view returns (bytes32 _value);
-    function hasContractStorage(address _contract, bytes32 _key) external view returns (bool _exists);
-    function testAndSetContractStorageLoaded(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyLoaded);
-    function testAndSetContractStorageChanged(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyChanged);
-    function commitContractStorage(address _contract, bytes32 _key) external returns (bool _wasContractStorageCommitted);
-    function incrementTotalUncommittedContractStorage() external;
-    function getTotalUncommittedContractStorage() external view returns (uint256 _total);
-    function wasContractStorageChanged(address _contract, bytes32 _key) external view returns (bool);
-    function wasContractStorageCommitted(address _contract, bytes32 _key) external view returns (bool);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html deleted file mode 100644 index ad5e6f218..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/execution/ iOVM_StateManagerFactory.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { iOVM_StateManager } from "./iOVM_StateManager.sol";
- 
-/**
- * @title iOVM_StateManagerFactory
- */
-interface iOVM_StateManagerFactory {
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    function create(
-        address _owner
-    )
-        external
-        returns (
-            iOVM_StateManager _ovmStateManager
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/execution/index.html deleted file mode 100644 index 05e6abd73..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/execution/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/execution/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_ExecutionManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_SafetyChecker.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManagerFactory.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html deleted file mode 100644 index eea280b9e..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/predeploys/ iOVM_DeployerWhitelist.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_DeployerWhitelist
- */
-interface iOVM_DeployerWhitelist {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function initialize(address _owner, bool _allowArbitraryDeployment) external;
-    function getOwner() external returns (address _owner);
-    function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;
-    function setOwner(address _newOwner) external;
-    function setAllowArbitraryDeployment(bool _allowArbitraryDeployment) external;
-    function enableArbitraryContractDeployment() external;
-    function isDeployerAllowed(address _deployer) external returns (bool _allowed);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html deleted file mode 100644 index 4015dddbb..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/predeploys/ iOVM_ERC20.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_ERC20
- */
-interface iOVM_ERC20 {
-    /* This is a slight change to the ERC20 base standard.
-    function totalSupply() constant returns (uint256 supply);
-    is replaced with:
-    uint256 public totalSupply;
-    This automatically creates a getter function for the totalSupply.
-    This is moved to the base contract since public getter functions are not
-    currently recognised as an implementation of the matching abstract
-    function by the compiler.
-    */
-    /// total amount of tokens
-    function totalSupply() external view returns (uint256);
- 
-    /// @param _owner The address from which the balance will be retrieved
-    /// @return balance The balance
-    function balanceOf(address _owner) external view returns (uint256 balance);
- 
-    /// @notice send `_value` token to `_to` from `msg.sender`
-    /// @param _to The address of the recipient
-    /// @param _value The amount of token to be transferred
-    /// @return success Whether the transfer was successful or not
-    function transfer(address _to, uint256 _value) external returns (bool success);
- 
-    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
-    /// @param _from The address of the sender
-    /// @param _to The address of the recipient
-    /// @param _value The amount of token to be transferred
-    /// @return success Whether the transfer was successful or not
-    function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
- 
-    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
-    /// @param _spender The address of the account able to transfer the tokens
-    /// @param _value The amount of tokens to be approved for transfer
-    /// @return success Whether the approval was successful or not
-    function approve(address _spender, uint256 _value) external returns (bool success);
- 
-    /// @param _owner The address of the account owning tokens
-    /// @param _spender The address of the account able to transfer the tokens
-    /// @return remaining Amount of remaining tokens allowed to spent
-    function allowance(address _owner, address _spender) external view returns (uint256 remaining);
- 
-    // solhint-disable-next-line no-simple-event-func-name
-    event Transfer(address indexed _from, address indexed _to, uint256 _value);
-    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
-    event Mint(address indexed _account, uint256 _amount);
-    event Burn(address indexed _account, uint256 _amount);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html deleted file mode 100644 index 2ee6275c9..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/predeploys/ iOVM_L1MessageSender.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_L1MessageSender
- */
-interface iOVM_L1MessageSender {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function getL1MessageSender() external view returns (address _l1MessageSender);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html deleted file mode 100644 index 3fbedd282..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/predeploys/ iOVM_L2ToL1MessagePasser.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_L2ToL1MessagePasser
- */
-interface iOVM_L2ToL1MessagePasser {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event L2ToL1Message(
-        uint256 _nonce,
-        address _sender,
-        bytes _data
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function passMessageToL1(bytes calldata _message) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/index.html deleted file mode 100644 index fc65f5166..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/predeploys/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/predeploys/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_DeployerWhitelist.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ERC20.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MessageSender.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2ToL1MessagePasser.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html deleted file mode 100644 index 736e664e0..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/verification/ iOVM_BondManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-interface ERC20 {
-    function transfer(address, uint256) external returns (bool);
-    function transferFrom(address, address, uint256) external returns (bool);
-}
- 
-/// All the errors which may be encountered on the bond manager
-library Errors {
-    string constant ERC20_ERR = "BondManager: Could not post bond";
-    string constant ALREADY_FINALIZED = "BondManager: Fraud proof for this pre-state root has already been finalized";
-    string constant SLASHED = "BondManager: Cannot finalize withdrawal, you probably got slashed";
-    string constant WRONG_STATE = "BondManager: Wrong bond state for proposer";
-    string constant CANNOT_CLAIM = "BondManager: Cannot claim yet. Dispute must be finalized first";
- 
-    string constant WITHDRAWAL_PENDING = "BondManager: Withdrawal already pending";
-    string constant TOO_EARLY = "BondManager: Too early to finalize your withdrawal";
- 
-    string constant ONLY_TRANSITIONER = "BondManager: Only the transitioner for this pre-state root may call this function";
-    string constant ONLY_FRAUD_VERIFIER = "BondManager: Only the fraud verifier may call this function";
-    string constant ONLY_STATE_COMMITMENT_CHAIN = "BondManager: Only the state commitment chain may call this function";
-    string constant WAIT_FOR_DISPUTES = "BondManager: Wait for other potential disputes";
-}
- 
-/**
- * @title iOVM_BondManager
- */
-interface iOVM_BondManager {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    /// The lifecycle of a proposer's bond
-    enum State {
-        // Before depositing or after getting slashed, a user is uncollateralized
-        NOT_COLLATERALIZED,
-        // After depositing, a user is collateralized
-        COLLATERALIZED,
-        // After a user has initiated a withdrawal
-        WITHDRAWING
-    }
- 
-    /// A bond posted by a proposer
-    struct Bond {
-        // The user's state
-        State state;
-        // The timestamp at which a proposer issued their withdrawal request
-        uint32 withdrawalTimestamp;
-        // The time when the first disputed was initiated for this bond
-        uint256 firstDisputeAt;
-        // The earliest observed state root for this bond which has had fraud
-        bytes32 earliestDisputedStateRoot;
-        // The state root's timestamp
-        uint256 earliestTimestamp;
-    }
- 
-    // Per pre-state root, store the number of state provisions that were made
-    // and how many of these calls were made by each user. Payouts will then be
-    // claimed by users proportionally for that dispute.
-    struct Rewards {
-        // Flag to check if rewards for a fraud proof are claimable
-        bool canClaim;
-        // Total number of `recordGasSpent` calls made
-        uint256 total;
-        // The gas spent by each user to provide witness data. The sum of all
-        // values inside this map MUST be equal to the value of `total`
-        mapping(address => uint256) gasSpent;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function recordGasSpent(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        address _who,
-        uint256 _gasSpent
-    ) external;
- 
-    function finalize(
-        bytes32 _preStateRoot,
-        address _publisher,
-        uint256 _timestamp
-    ) external;
- 
-    function deposit() external;
- 
-    function startWithdrawal() external;
- 
-    function finalizeWithdrawal() external;
- 
-    function claim(
-        address _who
-    ) external;
- 
-    function isCollateralized(
-        address _who
-    ) external view returns (bool);
- 
-    function getGasSpent(
-        bytes32 _preStateRoot,
-        address _who
-    ) external view returns (uint256);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html deleted file mode 100644 index 6a84d41e2..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/verification/ iOVM_FraudVerifier.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
- 
-/**
- * @title iOVM_FraudVerifier
- */
-interface iOVM_FraudVerifier {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event FraudProofInitialized(
-        bytes32 _preStateRoot,
-        uint256 _preStateRootIndex,
-        bytes32 _transactionHash,
-        address _who
-    );
- 
-    event FraudProofFinalized(
-        bytes32 _preStateRoot,
-        uint256 _preStateRootIndex,
-        bytes32 _transactionHash,
-        address _who
-    );
- 
- 
-    /***************************************
-     * Public Functions: Transition Status *
-     ***************************************/
- 
-    function getStateTransitioner(bytes32 _preStateRoot, bytes32 _txHash) external view returns (iOVM_StateTransitioner _transitioner);
- 
- 
-    /****************************************
-     * Public Functions: Fraud Verification *
-     ****************************************/
- 
-    function initializeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
-        Lib_OVMCodec.Transaction calldata _transaction,
-        Lib_OVMCodec.TransactionChainElement calldata _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader calldata _transactionBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _transactionProof
-    ) external;
- 
-    function finalizeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
-        bytes32 _txHash,
-        bytes32 _postStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _postStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _postStateRootProof
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html deleted file mode 100644 index 7bf0a4555..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/verification/ iOVM_StateTransitioner.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateTransitioner
- */
-interface iOVM_StateTransitioner {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event AccountCommitted(
-        address _address
-    );
- 
-    event ContractStorageCommitted(
-        address _address,
-        bytes32 _key
-    );
- 
- 
-    /**********************************
-     * Public Functions: State Access *
-     **********************************/
- 
-    function getPreStateRoot() external view returns (bytes32 _preStateRoot);
-    function getPostStateRoot() external view returns (bytes32 _postStateRoot);
-    function isComplete() external view returns (bool _complete);
- 
- 
-    /***********************************
-     * Public Functions: Pre-Execution *
-     ***********************************/
- 
-    function proveContractState(
-        address _ovmContractAddress,
-        address _ethContractAddress,
-        bytes calldata _stateTrieWitness
-    ) external;
- 
-    function proveStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes calldata _storageTrieWitness
-    ) external;
- 
- 
-    /*******************************
-     * Public Functions: Execution *
-     *******************************/
- 
-    function applyTransaction(
-        Lib_OVMCodec.Transaction calldata _transaction
-    ) external;
- 
- 
-    /************************************
-     * Public Functions: Post-Execution *
-     ************************************/
- 
-    function commitContractState(
-        address _ovmContractAddress,
-        bytes calldata _stateTrieWitness
-    ) external;
- 
-    function commitStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes calldata _storageTrieWitness
-    ) external;
- 
- 
-    /**********************************
-     * Public Functions: Finalization *
-     **********************************/
- 
-    function completeTransition() external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html deleted file mode 100644 index 29124d9c6..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/verification/ iOVM_StateTransitionerFactory.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
- 
-/**
- * @title iOVM_StateTransitionerFactory
- */
-interface iOVM_StateTransitionerFactory {
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    function create(
-        address _proxyManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        external
-        returns (
-            iOVM_StateTransitioner _ovmStateTransitioner
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/index.html b/coverage/lcov-report/optimistic-ethereum/iOVM/verification/index.html deleted file mode 100644 index 4655a37c6..000000000 --- a/coverage/lcov-report/optimistic-ethereum/iOVM/verification/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/verification/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_BondManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_FraudVerifier.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitioner.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitionerFactory.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html deleted file mode 100644 index 38cfe2666..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/bridge/ OVM_CrossDomainEnabled.sol -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 4/4 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 6/6 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -78× -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_CrossDomainEnabled
- * @dev Helper contract for contracts performing cross-domain communications
- *
- * Compiler used: defined by inheriting contract
- * Runtime target: defined by inheriting contract
- */
-contract OVM_CrossDomainEnabled {
-    // Messenger contract used to send and recieve messages from the other domain.
-    address public messenger;
- 
-    /***************
-     * Constructor *
-     ***************/    
-    constructor(
-        address _messenger
-    ) {
-        messenger = _messenger;
-    }
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * @notice Enforces that the modified function is only callable by a specific cross-domain account.
-     * @param _sourceDomainAccount The only account on the originating domain which is authenticated to call this function.
-     */
-    modifier onlyFromCrossDomainAccount(
-        address _sourceDomainAccount
-    ) {
-        require(
-            msg.sender == address(getCrossDomainMessenger()),
-            "OVM_XCHAIN: messenger contract unauthenticated"
-        );
- 
-        require(
-            getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,
-            "OVM_XCHAIN: wrong sender of cross-domain message"
-        );
- 
-        _;
-    }
-    
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Gets the messenger, usually from storage.  This function is exposed in case a child contract needs to override.
-     * @return The address of the cross-domain messenger contract which should be used. 
-     */
-    function getCrossDomainMessenger()
-        internal
-        virtual
-        returns(
-            iAbs_BaseCrossDomainMessenger
-        )
-    {
-        return iAbs_BaseCrossDomainMessenger(messenger);
-    }
- 
-    /**
-     * @notice Sends a message to an account on another domain
-     * @param _crossDomainTarget The intended recipient on the destination domain
-     * @param _data The data to send to the target (usually calldata to a function with `onlyFromCrossDomainAccount()`)
-     * @param _gasLimit The gasLimit for the receipt of the message on the target domain.
-     */
-    function sendCrossDomainMessage(
-        address _crossDomainTarget,
-        bytes memory _data,
-        uint32 _gasLimit
-    ) internal {
-        getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/bridge/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/bridge/index.html deleted file mode 100644 index 53b785d67..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/bridge/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/bridge/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/bridge/ -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 4/4 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 6/6 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_CrossDomainEnabled.sol
100%5/5100%4/4100%4/4100%6/6
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html deleted file mode 100644 index d903ad31e..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html +++ /dev/null @@ -1,1178 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/codec/ Lib_OVMCodec.sol -

-
-
- 100% - Statements - 33/33 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 33/33 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  - -  - - - - - -  - -  - - - - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -113× -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
-import { Lib_Bytes32Utils } from "../utils/Lib_Bytes32Utils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title Lib_OVMCodec
- */
-library Lib_OVMCodec {
- 
-    /*********
-     * Enums *
-     *********/
- 
-    enum EOASignatureType {
-        EIP155_TRANSACTON,
-        ETH_SIGNED_MESSAGE
-    }
- 
-    enum QueueOrigin {
-        SEQUENCER_QUEUE,
-        L1TOL2_QUEUE
-    }
- 
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct Account {
-        uint256 nonce;
-        uint256 balance;
-        bytes32 storageRoot;
-        bytes32 codeHash;
-        address ethAddress;
-        bool isFresh;
-    }
- 
-    struct EVMAccount {
-        uint256 nonce;
-        uint256 balance;
-        bytes32 storageRoot;
-        bytes32 codeHash;
-    }
- 
-    struct ChainBatchHeader {
-        uint256 batchIndex;
-        bytes32 batchRoot;
-        uint256 batchSize;
-        uint256 prevTotalElements;
-        bytes extraData;
-    }
- 
-    struct ChainInclusionProof {
-        uint256 index;
-        bytes32[] siblings;
-    }
- 
-    struct Transaction {
-        uint256 timestamp;
-        uint256 blockNumber;
-        QueueOrigin l1QueueOrigin;
-        address l1TxOrigin;
-        address entrypoint;
-        uint256 gasLimit;
-        bytes data;
-    }
- 
-    struct TransactionChainElement {
-        bool isSequenced;
-        uint256 queueIndex;  // QUEUED TX ONLY
-        uint256 timestamp;   // SEQUENCER TX ONLY
-        uint256 blockNumber; // SEQUENCER TX ONLY
-        bytes txData;        // SEQUENCER TX ONLY
-    }
- 
-    struct QueueElement {
-        bytes32 transactionHash;
-        uint40 timestamp;
-        uint40 blockNumber;
-    }
- 
-    struct EIP155Transaction {
-        uint256 nonce;
-        uint256 gasPrice;
-        uint256 gasLimit;
-        address to;
-        uint256 value;
-        bytes data;
-        uint256 chainId;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Decodes an EOA transaction (i.e., native Ethereum RLP encoding).
-     * @param _transaction Encoded EOA transaction.
-     * @return Transaction decoded into a struct.
-     */
-    function decodeEIP155Transaction(
-        bytes memory _transaction,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (
-            EIP155Transaction memory
-        )
-    {
-        if (_isEthSignedMessage) {
-            (
-                uint256 _nonce,
-                uint256 _gasLimit,
-                uint256 _gasPrice,
-                uint256 _chainId,
-                address _to,
-                bytes memory _data
-            ) = abi.decode(
-                _transaction,
-                (uint256, uint256, uint256, uint256, address ,bytes)
-            );
-            return EIP155Transaction({
-                nonce: _nonce,
-                gasPrice: _gasPrice,
-                gasLimit: _gasLimit,
-                to: _to,
-                value: 0,
-                data: _data,
-                chainId: _chainId
-            });
-        } else {
-            Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);
- 
-            return EIP155Transaction({
-                nonce: Lib_RLPReader.readUint256(decoded[0]),
-                gasPrice: Lib_RLPReader.readUint256(decoded[1]),
-                gasLimit: Lib_RLPReader.readUint256(decoded[2]),
-                to: Lib_RLPReader.readAddress(decoded[3]),
-                value: Lib_RLPReader.readUint256(decoded[4]),
-                data: Lib_RLPReader.readBytes(decoded[5]),
-                chainId:  Lib_RLPReader.readUint256(decoded[6])
-            });
-        }
-    }
- 
-    /**
-     * Decompresses a compressed EIP155 transaction.
-     * @param _transaction Compressed EIP155 transaction bytes.
-     * @return Transaction parsed into a struct.
-     */
-    function decompressEIP155Transaction(
-        bytes memory _transaction
-    )
-        internal
-        returns (
-            EIP155Transaction memory
-        )
-    {
-        return EIP155Transaction({
-            gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),
-            gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,
-            nonce: Lib_BytesUtils.toUint24(_transaction, 6),
-            to: Lib_BytesUtils.toAddress(_transaction, 9),
-            data: Lib_BytesUtils.slice(_transaction, 29),
-            chainId: Lib_SafeExecutionManagerWrapper.safeCHAINID(),
-            value: 0
-        });
-    }
- 
-    /**
-     * Encodes an EOA transaction back into the original transaction.
-     * @param _transaction EIP155transaction to encode.
-     * @param _isEthSignedMessage Whether or not this was an eth signed message.
-     * @return Encoded transaction.
-     */
-    function encodeEIP155Transaction(
-        EIP155Transaction memory _transaction,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        if (_isEthSignedMessage) {
-            return abi.encode(
-                _transaction.nonce,
-                _transaction.gasLimit,
-                _transaction.gasPrice,
-                _transaction.chainId,
-                _transaction.to,
-                _transaction.data
-            );
-        } else {
-            bytes[] memory raw = new bytes[](9);
- 
-            raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
-            raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
-            raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
-            if (_transaction.to == address(0)) {
-                raw[3] = Lib_RLPWriter.writeBytes('');
-            } else {
-                raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
-            }
-            raw[4] = Lib_RLPWriter.writeUint(0);
-            raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
-            raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
-            raw[7] = Lib_RLPWriter.writeBytes(bytes(''));
-            raw[8] = Lib_RLPWriter.writeBytes(bytes(''));
- 
-            return Lib_RLPWriter.writeList(raw);
-        }
-    }
- 
-    /**
-     * Encodes a standard OVM transaction.
-     * @param _transaction OVM transaction to encode.
-     * @return Encoded transaction bytes.
-     */
-    function encodeTransaction(
-        Transaction memory _transaction
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodePacked(
-            _transaction.timestamp,
-            _transaction.blockNumber,
-            _transaction.l1QueueOrigin,
-            _transaction.l1TxOrigin,
-            _transaction.entrypoint,
-            _transaction.gasLimit,
-            _transaction.data
-        );
-    }
- 
-    /**
-     * Hashes a standard OVM transaction.
-     * @param _transaction OVM transaction to encode.
-     * @return Hashed transaction
-     */
-    function hashTransaction(
-        Transaction memory _transaction
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(encodeTransaction(_transaction));
-    }
- 
-    /**
-     * Converts an OVM account to an EVM account.
-     * @param _in OVM account to convert.
-     * @return Converted EVM account.
-     */
-    function toEVMAccount(
-        Account memory _in
-    )
-        internal
-        pure
-        returns (
-            EVMAccount memory
-        )
-    {
-        return EVMAccount({
-            nonce: _in.nonce,
-            balance: _in.balance,
-            storageRoot: _in.storageRoot,
-            codeHash: _in.codeHash
-        });
-    }
- 
-    /**
-     * @notice RLP-encodes an account state struct.
-     * @param _account Account state struct.
-     * @return RLP-encoded account state.
-     */
-    function encodeEVMAccount(
-        EVMAccount memory _account
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes[] memory raw = new bytes[](4);
- 
-        // Unfortunately we can't create this array outright because
-        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning
-        // index-by-index circumvents this issue.
-        raw[0] = Lib_RLPWriter.writeBytes(
-            Lib_Bytes32Utils.removeLeadingZeros(
-                bytes32(_account.nonce)
-            )
-        );
-        raw[1] = Lib_RLPWriter.writeBytes(
-            Lib_Bytes32Utils.removeLeadingZeros(
-                bytes32(_account.balance)
-            )
-        );
-        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));
-        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));
- 
-        return Lib_RLPWriter.writeList(raw);
-    }
- 
-    /**
-     * @notice Decodes an RLP-encoded account state into a useful struct.
-     * @param _encoded RLP-encoded account state.
-     * @return Account state struct.
-     */
-    function decodeEVMAccount(
-        bytes memory _encoded
-    )
-        internal
-        pure
-        returns (
-            EVMAccount memory
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);
- 
-        return EVMAccount({
-            nonce: Lib_RLPReader.readUint256(accountState[0]),
-            balance: Lib_RLPReader.readUint256(accountState[1]),
-            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),
-            codeHash: Lib_RLPReader.readBytes32(accountState[3])
-        });
-    }
- 
-    /**
-     * Calculates a hash for a given batch header.
-     * @param _batchHeader Header to hash.
-     * @return Hash of the header.
-     */
-    function hashBatchHeader(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(
-            abi.encode(
-                _batchHeader.batchRoot,
-                _batchHeader.batchSize,
-                _batchHeader.prevTotalElements,
-                _batchHeader.extraData
-            )
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/codec/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/codec/index.html deleted file mode 100644 index 9d8deae87..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/codec/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/codec/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/codec/ -

-
-
- 100% - Statements - 33/33 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 33/33 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_OVMCodec.sol
100%33/33100%6/6100%9/9100%33/33
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html deleted file mode 100644 index 39482864f..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/resolver/ Lib_AddressManager.sol -

-
-
- 100% - Statements - 4/4 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -390× -390× -  -  -  -  -  -  -  -  -  -2164× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2554× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { Ownable } from "./Lib_Ownable.sol";
- 
-/**
- * @title Lib_AddressManager
- */
-contract Lib_AddressManager is Ownable {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event AddressSet(
-        string _name,
-        address _newAddress
-    );
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    mapping (bytes32 => address) private addresses;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function setAddress(
-        string memory _name,
-        address _address
-    )
-        public
-        onlyOwner
-    {
-        emit AddressSet(_name, _address);
-        addresses[_getNameHash(_name)] = _address;
-    }
- 
-    function getAddress(
-        string memory _name
-    )
-        public
-        view
-        returns (address)
-    {
-        return addresses[_getNameHash(_name)];
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _getNameHash(
-        string memory _name
-    )
-        internal
-        pure
-        returns (
-            bytes32 _hash
-        )
-    {
-        return keccak256(abi.encodePacked(_name));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html deleted file mode 100644 index 648b9c25f..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/resolver/ Lib_AddressResolver.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1062× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2133× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressManager } from "./Lib_AddressManager.sol";
- 
-/**
- * @title Lib_AddressResolver
- */
-abstract contract Lib_AddressResolver {
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    Lib_AddressManager internal libAddressManager;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Lib_AddressManager.
-     */
-    constructor(
-        address _libAddressManager
-    )  {
-        libAddressManager = Lib_AddressManager(_libAddressManager);
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function resolve(
-        string memory _name
-    )
-        public
-        view
-        returns (
-            address _contract
-        )
-    {
-        return libAddressManager.getAddress(_name);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html deleted file mode 100644 index b25d23d2e..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/Lib_Ownable.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/resolver/ Lib_Ownable.sol -

-
-
- 37.5% - Statements - 3/8 -
-
- 25% - Branches - 1/4 -
-
- 50% - Functions - 2/4 -
-
- 44.44% - Lines - 4/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -126× -126× -  -  -  -  -  -  -  -  -390× -  -  -  -390× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Ownable
- * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
- */
-abstract contract Ownable {
- 
-    /*************
-     * Variables *
-     *************/
- 
-    address public owner;
- 
- 
-    /**********
-     * Events *
-     **********/
- 
-    event OwnershipTransferred(
-        address indexed previousOwner,
-        address indexed newOwner
-    );
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    constructor() {
-        owner = msg.sender;
-        emit OwnershipTransferred(address(0), owner);
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyOwner() {
-        Erequire(
-            owner == msg.sender,
-            "Ownable: caller is not the owner"
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function renounceOwnership()
-        public
-        virtual
-        onlyOwner
-    {
-        emit OwnershipTransferred(owner, address(0));
-        owner = address(0);
-    }
- 
-    function transferOwnership(address _newOwner)
-        public
-        virtual
-        onlyOwner
-    {
-        require(
-            _newOwner != address(0),
-            "Ownable: new owner cannot be the zero address"
-        );
- 
-        emit OwnershipTransferred(owner, _newOwner);
-        owner = _newOwner;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html deleted file mode 100644 index 5d72132f0..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/resolver/ Lib_ResolvedDelegateProxy.sol -

-
-
- 100% - Statements - 6/6 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 8/8 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -36× -36× -  -  -  -  -  -  -  -  -  -  -31× -31× -  -  -  -  -31× -  -31× -22× -  -  -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressManager } from "./Lib_AddressManager.sol";
- 
-/**
- * @title Lib_ResolvedDelegateProxy
- */
-contract Lib_ResolvedDelegateProxy {
- 
-    /*************
-     * Variables *
-     *************/
- 
- 
-    // Using mappings to store fields to avoid overwriting storage slots in the
-    // implementation contract. For example, instead of storing these fields at
-    // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.
-    // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html
-    // NOTE: Do not use this code in your own contract system. 
-    //      There is a known flaw in this contract, and we will remove it from the repository
-    //      in the near future. Due to the very limited way that we are using it, this flaw is
-    //      not an issue in our system. 
-    mapping(address=>string) private implementationName;
-    mapping(address=>Lib_AddressManager) private addressManager;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Lib_AddressManager.
-     * @param _implementationName implementationName of the contract to proxy to.
-     */
-    constructor(
-        address _libAddressManager,
-        string memory _implementationName
-    )
-    {
-        addressManager[address(this)] = Lib_AddressManager(_libAddressManager);
-        implementationName[address(this)] = _implementationName;
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        address target = addressManager[address(this)].getAddress((implementationName[address(this)]));
-        Erequire(
-            target != address(0),
-            "Target address must be initialized."
-        );
- 
-        (bool success, bytes memory returndata) = target.delegatecall(msg.data);
- 
-        if (success == true) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/resolver/index.html deleted file mode 100644 index db7272d11..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/resolver/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/resolver/ -

-
-
- 75% - Statements - 15/20 -
-
- 50% - Branches - 4/8 -
-
- 81.82% - Functions - 9/11 -
-
- 78.26% - Lines - 18/23 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_AddressManager.sol
100%4/4100%0/0100%3/3100%4/4
Lib_AddressResolver.sol
100%2/2100%0/0100%2/2100%2/2
Lib_Ownable.sol
37.5%3/825%1/450%2/444.44%4/9
Lib_ResolvedDelegateProxy.sol
100%6/675%3/4100%2/2100%8/8
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html deleted file mode 100644 index 4e8f16658..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html +++ /dev/null @@ -1,1925 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/rlp/ Lib_RLPReader.sol -

-
-
- 98.68% - Statements - 75/76 -
-
- 67.5% - Branches - 27/40 -
-
- 94.74% - Functions - 18/19 -
-
- 98.8% - Lines - 82/83 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -512× -512× -  -  -  -512× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -450× -  -  -  -  -  -446× -  -  -  -  -  -  -  -  -446× -  -446× -446× -446× -4230× -  -  -  -  -4230× -  -  -  -  -  -  -  -4230× -  -  -  -  -4230× -4230× -  -  -  -446× -  -  -  -446× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -450× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -651× -  -  -  -  -  -651× -  -  -  -  -651× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -68× -  -  -  -  -68× -  -  -  -  -  -68× -  -  -  -  -68× -68× -68× -  -  -  -  -  -  -  -  -68× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -56× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - - - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -776× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -5399× -  -  -  -  -5395× -5395× -5395× -  -  -  -5395× -  -  -33× -  -  -  -4334× -  -4334× -  -  -  -  -4334× -  -  -536× -  -536× -  -  -  -  -536× -536× -  -  -  -  -  -  -  -536× -  -  -  -  -536× -  -  -89× -  -89× -  -  -  -  -89× -  -  -403× -  -403× -  -  -  -  -403× -403× -  -  -  -  -  -  -  -403× -  -  -  -  -403× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1427× -1427× - -  -  -1426× -1426× -1426× -  -  -  -  -1426× -2634× -  -  -  -2634× -2634× -  -  -  -1426× -1426× -  -  -  -  -  -  -  -  -  -1426× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -776× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_RLPReader
- * @dev Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).
- */
-library Lib_RLPReader {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 constant internal MAX_LIST_LENGTH = 32;
- 
- 
-    /*********
-     * Enums *
-     *********/
- 
-    enum RLPItemType {
-        DATA_ITEM,
-        LIST_ITEM
-    }
- 
-    
-    /***********
-     * Structs *
-     ***********/
- 
-    struct RLPItem {
-        uint256 length;
-        uint256 ptr;
-    }
-    
- 
-    /**********************
-     * Internal Functions *
-     **********************/
-    
-    /**
-     * Converts bytes to a reference to memory position and length.
-     * @param _in Input bytes to convert.
-     * @return Output memory reference.
-     */
-    function toRLPItem(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem memory
-        )
-    {
-        uint256 ptr;
-        assembly {
-            ptr := add(_in, 32)
-        }
- 
-        return RLPItem({
-            length: _in.length,
-            ptr: ptr
-        });
-    }
- 
-    /**
-     * Reads an RLP list value into a list of RLP items.
-     * @param _in RLP list value.
-     * @return Decoded RLP list items.
-     */
-    function readList(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem[] memory
-        )
-    {
-        (
-            uint256 listOffset,
-            ,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.LIST_ITEM,
-            "Invalid RLP list value."
-        );
- 
-        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by
-        // writing to the length. Since we can't know the number of RLP items without looping over
-        // the entire input, we'd have to loop twice to accurately size this array. It's easier to
-        // simply set a reasonable maximum list length and decrease the size before we finish.
-        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);
- 
-        uint256 itemCount = 0;
-        uint256 offset = listOffset;
-        while (offset < _in.length) {
-            Erequire(
-                itemCount < MAX_LIST_LENGTH,
-                "Provided RLP list exceeds max list length."
-            );
- 
-            (
-                uint256 itemOffset,
-                uint256 itemLength,
-            ) = _decodeLength(RLPItem({
-                length: _in.length - offset,
-                ptr: _in.ptr + offset
-            }));
- 
-            out[itemCount] = RLPItem({
-                length: itemLength + itemOffset,
-                ptr: _in.ptr + offset
-            });
- 
-            itemCount += 1;
-            offset += itemOffset + itemLength;
-        }
- 
-        // Decrease the array size to match the actual item count.
-        assembly {
-            mstore(out, itemCount)
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Reads an RLP list value into a list of RLP items.
-     * @param _in RLP list value.
-     * @return Decoded RLP list items.
-     */
-    function readList(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem[] memory
-        )
-    {
-        return readList(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bytes value into bytes.
-     * @param _in RLP bytes value.
-     * @return Decoded bytes.
-     */
-    function readBytes(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        (
-            uint256 itemOffset,
-            uint256 itemLength,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.DATA_ITEM,
-            "Invalid RLP bytes value."
-        );
- 
-        return _copy(_in.ptr, itemOffset, itemLength);
-    }
- 
-    /**
-     * Reads an RLP bytes value into bytes.
-     * @param _in RLP bytes value.
-     * @return Decoded bytes.
-     */
-    function readBytes(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return readBytes(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP string value into a string.
-     * @param _in RLP string value.
-     * @return Decoded string.
-     */
-    function readString(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            string memory
-        )
-    {
-        return string(readBytes(_in));
-    }
- 
-    /**
-     * Reads an RLP string value into a string.
-     * @param _in RLP string value.
-     * @return Decoded string.
-     */
-    function readString(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            string memory
-        )
-    {
-        return readString(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bytes32 value into a bytes32.
-     * @param _in RLP bytes32 value.
-     * @return Decoded bytes32.
-     */
-    function readBytes32(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        Erequire(
-            _in.length <= 33,
-            "Invalid RLP bytes32 value."
-        );
- 
-        (
-            uint256 itemOffset,
-            uint256 itemLength,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.DATA_ITEM,
-            "Invalid RLP bytes32 value."
-        );
- 
-        uint256 ptr = _in.ptr + itemOffset;
-        bytes32 out;
-        assembly {
-            out := mload(ptr)
- 
-            // Shift the bytes over to match the item size.
-            if lt(itemLength, 32) {
-                out := div(out, exp(256, sub(32, itemLength)))
-            }
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Reads an RLP bytes32 value into a bytes32.
-     * @param _in RLP bytes32 value.
-     * @return Decoded bytes32.
-     */
-    function readBytes32(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return readBytes32(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP uint256 value into a uint256.
-     * @param _in RLP uint256 value.
-     * @return Decoded uint256.
-     */
-    function readUint256(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        return uint256(readBytes32(_in));
-    }
- 
-    /**
-     * Reads an RLP uint256 value into a uint256.
-     * @param _in RLP uint256 value.
-     * @return Decoded uint256.
-     */
-    function readUint256(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        return readUint256(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bool value into a bool.
-     * @param _in RLP bool value.
-     * @return Decoded bool.
-     */
-    function readBool(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        Erequire(
-            _in.length == 1,
-            "Invalid RLP boolean value."
-        );
- 
-        uint256 ptr = _in.ptr;
-        uint256 out;
-        assembly {
-            out := byte(0, mload(ptr))
-        }
- 
-        return out != 0;
-    }
- 
-    /**
-     * Reads an RLP bool value into a bool.
-     * @param _in RLP bool value.
-     * @return Decoded bool.
-     */
-    function readBool(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        return readBool(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP address value into a address.
-     * @param _in RLP address value.
-     * @return Decoded address.
-     */
-    function readAddress(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        if (_in.length == 1) {
-            return address(0);
-        }
- 
-        Erequire(
-            _in.length == 21,
-            "Invalid RLP address value."
-        );
- 
-        return address(readUint256(_in));
-    }
- 
-    /**
-     * Reads an RLP address value into a address.
-     * @param _in RLP address value.
-     * @return Decoded address.
-     */
-    function readAddress(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        return readAddress(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads the raw bytes of an RLP item.
-     * @param _in RLP item to read.
-     * @return Raw RLP bytes.
-     */
-    function readRawBytes(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return _copy(_in);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Decodes the length of an RLP item.
-     * @param _in RLP item to decode.
-     * @return Offset of the encoded data.
-     * @return Length of the encoded data.
-     * @return RLP item type (LIST_ITEM or DATA_ITEM).
-     */
-    function _decodeLength(
-        RLPItem memory _in
-    )
-        private
-        pure
-        returns (
-            uint256,
-            uint256,
-            RLPItemType
-        )
-    {
-        require(
-            _in.length > 0,
-            "RLP item cannot be null."
-        );
- 
-        uint256 ptr = _in.ptr;
-        uint256 prefix;
-        assembly {
-            prefix := byte(0, mload(ptr))
-        }
- 
-        if (prefix <= 0x7f) {
-            // Single byte.
- 
-            return (0, 1, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xb7) {
-            // Short string.
- 
-            uint256 strLen = prefix - 0x80;
-            
-            Erequire(
-                _in.length > strLen,
-                "Invalid RLP short string."
-            );
- 
-            return (1, strLen, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xbf) {
-            // Long string.
-            uint256 lenOfStrLen = prefix - 0xb7;
- 
-            Erequire(
-                _in.length > lenOfStrLen,
-                "Invalid RLP long string length."
-            );
- 
-            uint256 strLen;
-            assembly {
-                // Pick out the string length.
-                strLen := div(
-                    mload(add(ptr, 1)),
-                    exp(256, sub(32, lenOfStrLen))
-                )
-            }
- 
-            Erequire(
-                _in.length > lenOfStrLen + strLen,
-                "Invalid RLP long string."
-            );
- 
-            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xf7) {
-            // Short list.
-            uint256 listLen = prefix - 0xc0;
- 
-            Erequire(
-                _in.length > listLen,
-                "Invalid RLP short list."
-            );
- 
-            return (1, listLen, RLPItemType.LIST_ITEM);
-        } else {
-            // Long list.
-            uint256 lenOfListLen = prefix - 0xf7;
- 
-            Erequire(
-                _in.length > lenOfListLen,
-                "Invalid RLP long list length."
-            );
- 
-            uint256 listLen;
-            assembly {
-                // Pick out the list length.
-                listLen := div(
-                    mload(add(ptr, 1)),
-                    exp(256, sub(32, lenOfListLen))
-                )
-            }
- 
-            Erequire(
-                _in.length > lenOfListLen + listLen,
-                "Invalid RLP long list."
-            );
- 
-            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);
-        }
-    }
- 
-    /**
-     * Copies the bytes from a memory location.
-     * @param _src Pointer to the location to read from.
-     * @param _offset Offset to start reading from.
-     * @param _length Number of bytes to read.
-     * @return Copied bytes.
-     */
-    function _copy(
-        uint256 _src,
-        uint256 _offset,
-        uint256 _length
-    )
-        private
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes memory out = new bytes(_length);
-        if (out.length == 0) {
-            return out;
-        }
- 
-        uint256 src = _src + _offset;
-        uint256 dest;
-        assembly {
-            dest := add(out, 32)
-        }
- 
-        // Copy over as many complete words as we can.
-        for (uint256 i = 0; i < _length / 32; i++) {
-            assembly {
-                mstore(dest, mload(src))
-            }
- 
-            src += 32;
-            dest += 32;
-        }
- 
-        // Pick out the remaining bytes.
-        uint256 mask = 256 ** (32 - (_length % 32)) - 1;
-        assembly {
-            mstore(
-                dest,
-                or(
-                    and(mload(src), not(mask)),
-                    and(mload(dest), mask)
-                )
-            )
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Copies an RLP item into bytes.
-     * @param _in RLP item to copy.
-     * @return Copied bytes.
-     */
-    function _copy(
-        RLPItem memory _in
-    )
-        private
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return _copy(_in.ptr, 0, _in.length);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html deleted file mode 100644 index 03e613a85..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html +++ /dev/null @@ -1,911 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/rlp/ Lib_RLPWriter.sol -

-
-
- 94.55% - Statements - 52/55 -
-
- 100% - Branches - 8/8 -
-
- 90% - Functions - 9/10 -
-
- 95.08% - Lines - 58/61 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -324× -  -324× -16× -  -308× -  -  -324× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -157× -157× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -139× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -465× -  -465× -415× -415× -  -50× -50× -50× -72× -72× -  -  -50× -50× -50× -72× -  -  -  -465× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -  -52× -52× -1643× -24× -  -  -  -52× -52× -45× -  -  -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1030× -1030× -1030× -  -1030× -420× -  -  -420× -420× -  -  -1030× -1030× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -157× - -  -  -149× -149× -149× -1030× -  -  -149× -149× -149× -  -149× -1030× -  -1030× -1030× -  -1030× -1030× -  -  -149× -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
- 
-/**
- * @title Lib_RLPWriter
- * @author Bakaoh (with modifications)
- */
-library Lib_RLPWriter {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * RLP encodes a byte string.
-     * @param _in The byte string to encode.
-     * @return _out The RLP encoded string in bytes.
-     */
-    function writeBytes(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory encoded;
- 
-        if (_in.length == 1 && uint8(_in[0]) < 128) {
-            encoded = _in;
-        } else {
-            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);
-        }
- 
-        return encoded;
-    }
- 
-    /**
-     * RLP encodes a list of RLP encoded byte byte strings.
-     * @param _in The list of RLP encoded byte strings.
-     * @return _out The RLP encoded list of items in bytes.
-     */
-    function writeList(
-        bytes[] memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory list = _flatten(_in);
-        return abi.encodePacked(_writeLength(list.length, 192), list);
-    }
- 
-    /**
-     * RLP encodes a string.
-     * @param _in The string to encode.
-     * @return _out The RLP encoded string in bytes.
-     */
-    function writeString(
-        string memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(bytes(_in));
-    }
- 
-    /**
-     * RLP encodes an address.
-     * @param _in The address to encode.
-     * @return _out The RLP encoded address in bytes.
-     */
-    function writeAddress(
-        address _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(abi.encodePacked(_in));
-    }
- 
-    /**
-     * RLP encodes a uint.
-     * @param _in The uint256 to encode.
-     * @return _out The RLP encoded uint256 in bytes.
-     */
-    function writeUint(
-        uint256 _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(_toBinary(_in));
-    }
- 
-    /**
-     * RLP encodes a bool.
-     * @param _in The bool to encode.
-     * @return _out The RLP encoded bool in bytes.
-     */
-    function writeBool(
-        bool _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory encoded = new bytes(1);
-        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));
-        return encoded;
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.
-     * @param _len The length of the string or the payload.
-     * @param _offset 128 if item is string, 192 if item is list.
-     * @return _encoded RLP encoded bytes.
-     */
-    function _writeLength(
-        uint256 _len,
-        uint256 _offset
-    )
-        private
-        pure
-        returns (
-            bytes memory _encoded
-        )
-    {
-        bytes memory encoded;
- 
-        if (_len < 56) {
-            encoded = new bytes(1);
-            encoded[0] = byte(uint8(_len) + uint8(_offset));
-        } else {
-            uint256 lenLen;
-            uint256 i = 1;
-            while (_len / i != 0) {
-                lenLen++;
-                i *= 256;
-            }
- 
-            encoded = new bytes(lenLen + 1);
-            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);
-            for(i = 1; i <= lenLen; i++) {
-                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));
-            }
-        }
- 
-        return encoded;
-    }
- 
-    /**
-     * Encode integer in big endian binary form with no leading zeroes.
-     * @notice TODO: This should be optimized with assembly to save gas costs.
-     * @param _x The integer to encode.
-     * @return _binary RLP encoded bytes.
-     */
-    function _toBinary(
-        uint256 _x
-    )
-        private
-        pure
-        returns (
-            bytes memory _binary
-        )
-    {
-        bytes memory b = abi.encodePacked(_x);
- 
-        uint256 i = 0;
-        for (; i < 32; i++) {
-            if (b[i] != 0) {
-                break;
-            }
-        }
- 
-        bytes memory res = new bytes(32 - i);
-        for (uint256 j = 0; j < res.length; j++) {
-            res[j] = b[i++];
-        }
- 
-        return res;
-    }
- 
-    /**
-     * Copies a piece of memory to another location.
-     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.
-     * @param _dest Destination location.
-     * @param _src Source location.
-     * @param _len Length of memory to copy.
-     */
-    function _memcpy(
-        uint256 _dest,
-        uint256 _src,
-        uint256 _len
-    )
-        private
-        pure
-    {
-        uint256 dest = _dest;
-        uint256 src = _src;
-        uint256 len = _len;
- 
-        for(; len >= 32; len -= 32) {
-            assembly {
-                mstore(dest, mload(src))
-            }
-            dest += 32;
-            src += 32;
-        }
- 
-        uint256 mask = 256 ** (32 - len) - 1;
-        assembly {
-            let srcpart := and(mload(src), not(mask))
-            let destpart := and(mload(dest), mask)
-            mstore(dest, or(destpart, srcpart))
-        }
-    }
- 
-    /**
-     * Flattens a list of byte strings into one byte string.
-     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.
-     * @param _list List of byte strings to flatten.
-     * @return _flattened The flattened byte string.
-     */
-    function _flatten(
-        bytes[] memory _list
-    )
-        private
-        pure
-        returns (
-            bytes memory _flattened
-        )
-    {
-        if (_list.length == 0) {
-            return new bytes(0);
-        }
- 
-        uint256 len;
-        uint256 i = 0;
-        for (; i < _list.length; i++) {
-            len += _list[i].length;
-        }
- 
-        bytes memory flattened = new bytes(len);
-        uint256 flattenedPtr;
-        assembly { flattenedPtr := add(flattened, 0x20) }
- 
-        for(i = 0; i < _list.length; i++) {
-            bytes memory item = _list[i];
- 
-            uint256 listPtr;
-            assembly { listPtr := add(item, 0x20)}
- 
-            _memcpy(flattenedPtr, listPtr, item.length);
-            flattenedPtr += _list[i].length;
-        }
- 
-        return flattened;
-    }
-}
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/rlp/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/rlp/index.html deleted file mode 100644 index a6477149e..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/rlp/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/rlp/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/rlp/ -

-
-
- 96.95% - Statements - 127/131 -
-
- 72.92% - Branches - 35/48 -
-
- 93.1% - Functions - 27/29 -
-
- 97.22% - Lines - 140/144 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_RLPReader.sol
98.68%75/7667.5%27/4094.74%18/1998.8%82/83
Lib_RLPWriter.sol
94.55%52/55100%8/890%9/1095.08%58/61
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html deleted file mode 100644 index c7a07cece..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/standards/ IUniswapV2ERC20.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-interface IUniswapV2ERC20 {
-    event Approval(address indexed owner, address indexed spender, uint value);
-    event Transfer(address indexed from, address indexed to, uint value);
- 
-    function name() external view returns (string memory);
-    function symbol() external view returns (string memory);
-    function decimals() external view returns (uint8);
-    function totalSupply() external view returns (uint);
-    function balanceOf(address owner) external view returns (uint);
-    function allowance(address owner, address spender) external view returns (uint);
- 
-    function approve(address spender, uint value) external returns (bool);
-    function transfer(address to, uint value) external returns (bool);
-    function transferFrom(address from, address to, uint value) external returns (bool);
- 
-    function DOMAIN_SEPARATOR() external view returns (bytes32);
-    function PERMIT_TYPEHASH() external pure returns (bytes32);
-    function nonces(address owner) external view returns (uint);
- 
-    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html deleted file mode 100644 index fca77d0f2..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/standards/UniSafeMath.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/standards/ UniSafeMath.sol -

-
-
- 66.67% - Statements - 2/3 -
-
- 33.33% - Branches - 2/6 -
-
- 66.67% - Functions - 2/3 -
-
- 66.67% - Lines - 2/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  - -  -  -  -10× -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
- 
-library UniSafeMath {
-    function add(uint x, uint y) internal pure returns (uint z) {
-        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
-    }
- 
-    function sub(uint x, uint y) internal pure returns (uint z) {
-        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
-    }
- 
-    function mul(uint x, uint y) internal pure returns (uint z) {
-        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html deleted file mode 100644 index 17a1f4209..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/standards/ UniswapV2ERC20.sol -

-
-
- 82.14% - Statements - 23/28 -
-
- 16.67% - Branches - 1/6 -
-
- 88.89% - Functions - 8/9 -
-
- 82.76% - Lines - 24/29 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -39× -39× -  -39× -39× -  -  -39× -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  - - - -  -  -  - - -  -  -  - - - -  -  -  - - -  -  -  - - -  -  -  - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-import './IUniswapV2ERC20.sol';
-import './UniSafeMath.sol';
- 
-contract UniswapV2ERC20 is IUniswapV2ERC20 {
-    using UniSafeMath for uint;
- 
-    string public override name;
-    string public override symbol;
-    uint8 public constant override decimals = 18;
-    uint public override totalSupply;
-    mapping(address => uint) public override balanceOf;
-    mapping(address => mapping(address => uint)) public override allowance;
- 
-    bytes32 public override DOMAIN_SEPARATOR;
-    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
-    bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
-    mapping(address => uint) public override nonces;
- 
-    constructor(
-    string memory _name,
-        string memory _symbol
-    ) {
-        name = _name;
-        symbol = _symbol;
- 
-        uint chainId;
-        assembly {
-            chainId := chainid()
-        }
-        DOMAIN_SEPARATOR = keccak256(
-            abi.encode(
-                keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
-                keccak256(bytes(name)),
-                keccak256(bytes('1')),
-                chainId,
-                address(this)
-            )
-        );
-    }
- 
-    function _mint(address to, uint value) internal {
-        totalSupply = totalSupply.add(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(address(0), to, value);
-    }
- 
-    function _burn(address from, uint value) internal {
-        balanceOf[from] = balanceOf[from].sub(value);
-        totalSupply = totalSupply.sub(value);
-        emit Transfer(from, address(0), value);
-    }
- 
-    function _approve(address owner, address spender, uint value) private {
-        allowance[owner][spender] = value;
-        emit Approval(owner, spender, value);
-    }
- 
-    function _transfer(address from, address to, uint value) private {
-        balanceOf[from] = balanceOf[from].sub(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(from, to, value);
-    }
- 
-    function approve(address spender, uint value) external override returns (bool) {
-        _approve(msg.sender, spender, value);
-        return true;
-    }
- 
-    function transfer(address to, uint value) external override returns (bool) {
-        _transfer(msg.sender, to, value);
-        return true;
-    }
- 
-    function transferFrom(address from, address to, uint value) external override returns (bool) {
-        Eif (allowance[from][msg.sender] != uint(-1)) {
-            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
-        }
-        _transfer(from, to, value);
-        return true;
-    }
- 
-    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override {
-        require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
-        bytes32 digest = keccak256(
-            abi.encodePacked(
-                '\x19\x01',
-                DOMAIN_SEPARATOR,
-                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
-            )
-        );
-        address recoveredAddress = ecrecover(digest, v, r, s);
-        require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
-        _approve(owner, spender, value);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/standards/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/standards/index.html deleted file mode 100644 index a7881423d..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/standards/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/standards/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/standards/ -

-
-
- 80.65% - Statements - 25/31 -
-
- 25% - Branches - 3/12 -
-
- 83.33% - Functions - 10/12 -
-
- 81.25% - Lines - 26/32 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
IUniswapV2ERC20.sol
100%0/0100%0/0100%0/0100%0/0
UniSafeMath.sol
66.67%2/333.33%2/666.67%2/366.67%2/3
UniswapV2ERC20.sol
82.14%23/2816.67%1/688.89%8/982.76%24/29
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html deleted file mode 100644 index 873c10410..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html +++ /dev/null @@ -1,2945 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/trie/ Lib_MerkleTrie.sol -

-
-
- 72.45% - Statements - 142/196 -
-
- 55.88% - Branches - 38/68 -
-
- 84.62% - Functions - 22/26 -
-
- 72.02% - Lines - 139/193 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -22× -22× -22× -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -77× -73× -  -58× -  -58× -  -  -  -  -58× -  -58× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -95× -95× -  -95× -95× -95× -95× -  -  -95× -243× -243× -  -  -  -243× -  -243× -  -95× -  -  -  -  -  -148× -  -  -  -  -  -  -  -  -  -  -  -229× -147× -  -  -  -  -  -147× -147× -147× -147× -147× -  -  -82× -82× -82× -82× -82× -82× -  -82× -80× -  -  -  -  -  -73× -  -  -  -80× -80× -  - -  -  -  -  -  -  -  - - - -  -  - -  -  -  -  -  -  -  -80× -80× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -22× -  -  -  -  -  -22× -22× -  -22× -  -  -22× -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -22× -22× -  -  -22× -  -65× -65× -  -65× -  -  -22× -22× -  -  - - -  -  -  - -  - -  -  -  -  -42× -  -42× -42× -42× -  -  -  -  -65× -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -99× -95× -  -95× -265× -265× -  -  -  -  -  -95× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -148× -  -148× -  -  -  -  -148× -  -  -148× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -172× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -45× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -51× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -65× -  -  -65× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -87× -42× -  -45× -45× -  -45× -44× -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -82× -82× -4991× -  -82× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -65× -  -65× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -714× -  -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -22× -22× -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -23× -23× -23× -23× -23× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -45× -26× -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -43× -  -  -  -22× -22× -  -  -22× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
-import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
- 
-/**
- * @title Lib_MerkleTrie
- */
-library Lib_MerkleTrie {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum NodeType {
-        BranchNode,
-        ExtensionNode,
-        LeafNode
-    }
- 
-    struct TrieNode {
-        bytes encoded;
-        Lib_RLPReader.RLPItem[] decoded;
-    }
- 
- 
-    /**********************
-     * Contract Constants *
-     **********************/
- 
-    // TREE_RADIX determines the number of elements per branch node.
-    uint256 constant TREE_RADIX = 16;
-    // Branch nodes have TREE_RADIX elements plus an additional `value` slot.
-    uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;
-    // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.
-    uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;
- 
-    // Prefixes are prepended to the `path` within a leaf or extension node and
-    // allow us to differentiate between the two node types. `ODD` or `EVEN` is
-    // determined by the number of nibbles within the unprefixed `path`. If the
-    // number of nibbles if even, we need to insert an extra padding nibble so
-    // the resulting prefixed `path` has an even number of nibbles.
-    uint8 constant PREFIX_EXTENSION_EVEN = 0;
-    uint8 constant PREFIX_EXTENSION_ODD = 1;
-    uint8 constant PREFIX_LEAF_EVEN = 2;
-    uint8 constant PREFIX_LEAF_ODD = 3;
- 
-    // Just a utility constant. RLP represents `NULL` as 0x80.
-    bytes1 constant RLP_NULL = bytes1(0x80);
-    bytes constant RLP_NULL_BYTES = hex'80';
-    bytes32 constant internal KECCAK256_RLP_NULL_BYTES = keccak256(RLP_NULL_BYTES);
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Verifies a proof that a given key/value pair is present in the
-     * Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _value Value of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
-     * traditional Merkle trees, this proof is executed top-down and consists
-     * of a list of RLP-encoded nodes that make a path down to the target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
-     */
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        (
-            bool exists,
-            bytes memory value
-        ) = get(_key, _proof, _root);
- 
-        return (
-            exists && Lib_BytesUtils.equal(_value, value)
-        );
-    }
- 
-    /**
-     * @notice Verifies a proof that a given key is *not* present in
-     * the Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the key is absent in the trie, `false` otherwise.
-     */
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        (
-            bool exists,
-        ) = get(_key, _proof, _root);
- 
-        return exists == false;
-    }
- 
-    /**
-     * @notice Updates a Merkle trie and returns a new root hash.
-     * @param _key Key of the node to update, as a hex string.
-     * @param _value Value of the node to update, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node. If the key exists, we can simply update the value.
-     * Otherwise, we need to modify the trie to handle the new k/v pair.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _updatedRoot Root hash of the newly constructed trie.
-     */
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        // Special case when inserting the very first node.
-        Iif (_root == KECCAK256_RLP_NULL_BYTES) {
-            return getSingleNodeRootHash(_key, _value);
-        }
- 
-        TrieNode[] memory proof = _parseProof(_proof);
-        (uint256 pathLength, bytes memory keyRemainder, ) = _walkNodePath(proof, _key, _root);
-        TrieNode[] memory newPath = _getNewPath(proof, pathLength, keyRemainder, _value);
- 
-        return _getUpdatedTrieRoot(newPath, _key);
-    }
- 
-    /**
-     * @notice Retrieves the value associated with a given key.
-     * @param _key Key to search for, as hex bytes.
-     * @param _proof Merkle trie inclusion proof for the key.
-     * @param _root Known root of the Merkle trie.
-     * @return _exists Whether or not the key exists.
-     * @return _value Value of the key if it exists.
-     */
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _exists,
-            bytes memory _value
-        )
-    {
-        TrieNode[] memory proof = _parseProof(_proof);
-        (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(proof, _key, _root);
- 
-        bool exists = keyRemainder.length == 0;
- 
-        Erequire(
-            exists || isFinalNode,
-            "Provided proof is invalid."
-        );
- 
-        bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes('');
- 
-        return (
-            exists,
-            value
-        );
-    }
- 
-    /**
-     * Computes the root hash for a trie with a single node.
-     * @param _key Key for the single node.
-     * @param _value Value for the single node.
-     * @return _updatedRoot Hash of the trie.
-     */
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        return keccak256(_makeLeafNode(
-            Lib_BytesUtils.toNibbles(_key),
-            _value
-        ).encoded);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * @notice Walks through a proof using a provided key.
-     * @param _proof Inclusion proof to walk through.
-     * @param _key Key to use for the walk.
-     * @param _root Known root of the trie.
-     * @return _pathLength Length of the final path
-     * @return _keyRemainder Portion of the key remaining after the walk.
-     * @return _isFinalNode Whether or not we've hit a dead end.
-     */
-    function _walkNodePath(
-        TrieNode[] memory _proof,
-        bytes memory _key,
-        bytes32 _root
-    )
-        private
-        pure
-        returns (
-            uint256 _pathLength,
-            bytes memory _keyRemainder,
-            bool _isFinalNode
-        )
-    {
-        uint256 pathLength = 0;
-        bytes memory key = Lib_BytesUtils.toNibbles(_key);
- 
-        bytes32 currentNodeID = _root;
-        uint256 currentKeyIndex = 0;
-        uint256 currentKeyIncrement = 0;
-        TrieNode memory currentNode;
- 
-        // Proof is top-down, so we start at the first element (root).
-        for (uint256 i = 0; i < _proof.length; i++) {
-            currentNode = _proof[i];
-            currentKeyIndex += currentKeyIncrement;
- 
-            // Keep track of the proof elements we actually need.
-            // It's expensive to resize arrays, so this simply reduces gas costs.
-            pathLength += 1;
- 
-            if (currentKeyIndex == 0) {
-                // First proof element is always the root node.
-                require(
-                    keccak256(currentNode.encoded) == currentNodeID,
-                    "Invalid root hash"
-                );
-            } else Eif (currentNode.encoded.length >= 32) {
-                // Nodes 32 bytes or larger are hashed inside branch nodes.
-                require(
-                    keccak256(currentNode.encoded) == currentNodeID,
-                    "Invalid large internal hash"
-                );
-            } else {
-                // Nodes smaller than 31 bytes aren't hashed.
-                require(
-                    Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
-                    "Invalid internal node hash"
-                );
-            }
- 
-            if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {
-                Iif (currentKeyIndex == key.length) {
-                    // We've hit the end of the key, meaning the value should be within this branch node.
-                    break;
-                } else {
-                    // We're not at the end of the key yet.
-                    // Figure out what the next node ID should be and continue.
-                    uint8 branchKey = uint8(key[currentKeyIndex]);
-                    Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
-                    currentNodeID = _getNodeID(nextNode);
-                    currentKeyIncrement = 1;
-                    continue;
-                }
-            } else Eif (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
-                bytes memory path = _getNodePath(currentNode);
-                uint8 prefix = uint8(path[0]);
-                uint8 offset = 2 - prefix % 2;
-                bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);
-                bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);
-                uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
- 
-                if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
-                    if (
-                        pathRemainder.length == sharedNibbleLength &&
-                        keyRemainder.length == sharedNibbleLength
-                    ) {
-                        // The key within this leaf matches our key exactly.
-                        // Increment the key index to reflect that we have no remainder.
-                        currentKeyIndex += sharedNibbleLength;
-                    }
- 
-                    // We've hit a leaf node, so our next node should be NULL.
-                    currentNodeID = bytes32(RLP_NULL);
-                    break;
-                } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
-                    Iif (sharedNibbleLength == 0) {
-                        // Our extension node doesn't share any part of our key.
-                        // We've hit the end of this path, updates will need to modify this extension.
-                        currentNodeID = bytes32(RLP_NULL);
-                        break;
-                    } else {
-                        // Our extension shares some nibbles.
-                        // Carry on to the next node.
-                        currentNodeID = _getNodeID(currentNode.decoded[1]);
-                        currentKeyIncrement = sharedNibbleLength;
-                        continue;
-                    }
-                } else {
-                    revert("Received a node with an unknown prefix");
-                }
-            } else {
-                revert("Received an unparseable node.");
-            }
-        }
- 
-        // If our node ID is NULL, then we're at a dead end.
-        bool isFinalNode = currentNodeID == bytes32(RLP_NULL);
-        return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);
-    }
- 
-    /**
-     * @notice Creates new nodes to support a k/v pair insertion into a given
-     * Merkle trie path.
-     * @param _path Path to the node nearest the k/v pair.
-     * @param _pathLength Length of the path. Necessary because the provided
-     * path may include additional nodes (e.g., it comes directly from a proof)
-     * and we can't resize in-memory arrays without costly duplication.
-     * @param _keyRemainder Portion of the initial key that must be inserted
-     * into the trie.
-     * @param _value Value to insert at the given key.
-     * @return _newPath A new path with the inserted k/v pair and extra supporting nodes.
-     */
-    function _getNewPath(
-        TrieNode[] memory _path,
-        uint256 _pathLength,
-        bytes memory _keyRemainder,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _newPath
-        )
-    {
-        bytes memory keyRemainder = _keyRemainder;
- 
-        // Most of our logic depends on the status of the last node in the path.
-        TrieNode memory lastNode = _path[_pathLength - 1];
-        NodeType lastNodeType = _getNodeType(lastNode);
- 
-        // Create an array for newly created nodes.
-        // We need up to three new nodes, depending on the contents of the last node.
-        // Since array resizing is expensive, we'll keep track of the size manually.
-        // We're using an explicit `totalNewNodes += 1` after insertions for clarity.
-        TrieNode[] memory newNodes = new TrieNode[](3);
-        uint256 totalNewNodes = 0;
- 
-        Eif (keyRemainder.length == 0 && lastNodeType == NodeType.LeafNode) {
-            // We've found a leaf node with the given key.
-            // Simply need to update the value of the node to match.
-            newNodes[totalNewNodes] = _makeLeafNode(_getNodeKey(lastNode), _value);
-            totalNewNodes += 1;
-        } else if (lastNodeType == NodeType.BranchNode) {
-            if (keyRemainder.length == 0) {
-                // We've found a branch node with the given key.
-                // Simply need to update the value of the node to match.
-                newNodes[totalNewNodes] = _editBranchValue(lastNode, _value);
-                totalNewNodes += 1;
-            } else {
-                // We've found a branch node, but it doesn't contain our key.
-                // Reinsert the old branch for now.
-                newNodes[totalNewNodes] = lastNode;
-                totalNewNodes += 1;
-                // Create a new leaf node, slicing our remainder since the first byte points
-                // to our branch node.
-                newNodes[totalNewNodes] = _makeLeafNode(Lib_BytesUtils.slice(keyRemainder, 1), _value);
-                totalNewNodes += 1;
-            }
-        } else {
-            // Our last node is either an extension node or a leaf node with a different key.
-            bytes memory lastNodeKey = _getNodeKey(lastNode);
-            uint256 sharedNibbleLength = _getSharedNibbleLength(lastNodeKey, keyRemainder);
- 
-            if (sharedNibbleLength != 0) {
-                // We've got some shared nibbles between the last node and our key remainder.
-                // We'll need to insert an extension node that covers these shared nibbles.
-                bytes memory nextNodeKey = Lib_BytesUtils.slice(lastNodeKey, 0, sharedNibbleLength);
-                newNodes[totalNewNodes] = _makeExtensionNode(nextNodeKey, _getNodeHash(_value));
-                totalNewNodes += 1;
- 
-                // Cut down the keys since we've just covered these shared nibbles.
-                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, sharedNibbleLength);
-                keyRemainder = Lib_BytesUtils.slice(keyRemainder, sharedNibbleLength);
-            }
- 
-            // Create an empty branch to fill in.
-            TrieNode memory newBranch = _makeEmptyBranchNode();
- 
-            if (lastNodeKey.length == 0) {
-                // Key remainder was larger than the key for our last node.
-                // The value within our last node is therefore going to be shifted into
-                // a branch value slot.
-                newBranch = _editBranchValue(newBranch, _getNodeValue(lastNode));
-            } else {
-                // Last node key was larger than the key remainder.
-                // We're going to modify some index of our branch.
-                uint8 branchKey = uint8(lastNodeKey[0]);
-                // Move on to the next nibble.
-                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, 1);
- 
-                if (lastNodeType == NodeType.LeafNode) {
-                    // We're dealing with a leaf node.
-                    // We'll modify the key and insert the old leaf node into the branch index.
-                    TrieNode memory modifiedLastNode = _makeLeafNode(lastNodeKey, _getNodeValue(lastNode));
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
-                } else if (lastNodeKey.length != 0) {
-                    // We're dealing with a shrinking extension node.
-                    // We need to modify the node to decrease the size of the key.
-                    TrieNode memory modifiedLastNode = _makeExtensionNode(lastNodeKey, _getNodeValue(lastNode));
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
-                } else {
-                    // We're dealing with an unnecessary extension node.
-                    // We're going to delete the node entirely.
-                    // Simply insert its current value into the branch index.
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeValue(lastNode));
-                }
-            }
- 
-            if (keyRemainder.length == 0) {
-                // We've got nothing left in the key remainder.
-                // Simply insert the value into the branch value slot.
-                newBranch = _editBranchValue(newBranch, _value);
-                // Push the branch into the list of new nodes.
-                newNodes[totalNewNodes] = newBranch;
-                totalNewNodes += 1;
-            } else {
-                // We've got some key remainder to work with.
-                // We'll be inserting a leaf node into the trie.
-                // First, move on to the next nibble.
-                keyRemainder = Lib_BytesUtils.slice(keyRemainder, 1);
-                // Push the branch into the list of new nodes.
-                newNodes[totalNewNodes] = newBranch;
-                totalNewNodes += 1;
-                // Push a new leaf node for our k/v pair.
-                newNodes[totalNewNodes] = _makeLeafNode(keyRemainder, _value);
-                totalNewNodes += 1;
-            }
-        }
- 
-        // Finally, join the old path with our newly created nodes.
-        // Since we're overwriting the last node in the path, we use `_pathLength - 1`.
-        return _joinNodeArrays(_path, _pathLength - 1, newNodes, totalNewNodes);
-    }
- 
-    /**
-     * @notice Computes the trie root from a given path.
-     * @param _nodes Path to some k/v pair.
-     * @param _key Key for the k/v pair.
-     * @return _updatedRoot Root hash for the updated trie.
-     */
-    function _getUpdatedTrieRoot(
-        TrieNode[] memory _nodes,
-        bytes memory _key
-    )
-        private
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = Lib_BytesUtils.toNibbles(_key);
- 
-        // Some variables to keep track of during iteration.
-        TrieNode memory currentNode;
-        NodeType currentNodeType;
-        bytes memory previousNodeHash;
- 
-        // Run through the path backwards to rebuild our root hash.
-        for (uint256 i = _nodes.length; i > 0; i--) {
-            // Pick out the current node.
-            currentNode = _nodes[i - 1];
-            currentNodeType = _getNodeType(currentNode);
- 
-            if (currentNodeType == NodeType.LeafNode) {
-                // Leaf nodes are already correctly encoded.
-                // Shift the key over to account for the nodes key.
-                bytes memory nodeKey = _getNodeKey(currentNode);
-                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
-            } else if (currentNodeType == NodeType.ExtensionNode) {
-                // Shift the key over to account for the nodes key.
-                bytes memory nodeKey = _getNodeKey(currentNode);
-                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
- 
-                // If this node is the last element in the path, it'll be correctly encoded
-                // and we can skip this part.
-                Eif (previousNodeHash.length > 0) {
-                    // Re-encode the node based on the previous node.
-                    currentNode = _makeExtensionNode(nodeKey, previousNodeHash);
-                }
-            } else Eif (currentNodeType == NodeType.BranchNode) {
-                // If this node is the last element in the path, it'll be correctly encoded
-                // and we can skip this part.
-                Eif (previousNodeHash.length > 0) {
-                    // Re-encode the node based on the previous node.
-                    uint8 branchKey = uint8(key[key.length - 1]);
-                    key = Lib_BytesUtils.slice(key, 0, key.length - 1);
-                    currentNode = _editBranchIndex(currentNode, branchKey, previousNodeHash);
-                }
-            }
- 
-            // Compute the node hash for the next iteration.
-            previousNodeHash = _getNodeHash(currentNode.encoded);
-        }
- 
-        // Current node should be the root at this point.
-        // Simply return the hash of its encoding.
-        return keccak256(currentNode.encoded);
-    }
- 
-    /**
-     * @notice Parses an RLP-encoded proof into something more useful.
-     * @param _proof RLP-encoded proof to parse.
-     * @return _parsed Proof parsed into easily accessible structs.
-     */
-    function _parseProof(
-        bytes memory _proof
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _parsed
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);
-        TrieNode[] memory proof = new TrieNode[](nodes.length);
- 
-        for (uint256 i = 0; i < nodes.length; i++) {
-            bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);
-            proof[i] = TrieNode({
-                encoded: encoded,
-                decoded: Lib_RLPReader.readList(encoded)
-            });
-        }
- 
-        return proof;
-    }
- 
-    /**
-     * @notice Picks out the ID for a node. Node ID is referred to as the
-     * "hash" within the specification, but nodes < 32 bytes are not actually
-     * hashed.
-     * @param _node Node to pull an ID for.
-     * @return _nodeID ID for the node, depending on the size of its contents.
-     */
-    function _getNodeID(
-        Lib_RLPReader.RLPItem memory _node
-    )
-        private
-        pure
-        returns (
-            bytes32 _nodeID
-        )
-    {
-        bytes memory nodeID;
- 
-        Iif (_node.length < 32) {
-            // Nodes smaller than 32 bytes are RLP encoded.
-            nodeID = Lib_RLPReader.readRawBytes(_node);
-        } else {
-            // Nodes 32 bytes or larger are hashed.
-            nodeID = Lib_RLPReader.readBytes(_node);
-        }
- 
-        return Lib_BytesUtils.toBytes32(nodeID);
-    }
- 
-    /**
-     * @notice Gets the path for a leaf or extension node.
-     * @param _node Node to get a path for.
-     * @return _path Node path, converted to an array of nibbles.
-     */
-    function _getNodePath(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _path
-        )
-    {
-        return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));
-    }
- 
-    /**
-     * @notice Gets the key for a leaf or extension node. Keys are essentially
-     * just paths without any prefix.
-     * @param _node Node to get a key for.
-     * @return _key Node key, converted to an array of nibbles.
-     */
-    function _getNodeKey(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _key
-        )
-    {
-        return _removeHexPrefix(_getNodePath(_node));
-    }
- 
-    /**
-     * @notice Gets the path for a node.
-     * @param _node Node to get a value for.
-     * @return _value Node value, as hex bytes.
-     */
-    function _getNodeValue(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _value
-        )
-    {
-        return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
-    }
- 
-    /**
-     * @notice Computes the node hash for an encoded node. Nodes < 32 bytes
-     * are not hashed, all others are keccak256 hashed.
-     * @param _encoded Encoded node to hash.
-     * @return _hash Hash of the encoded node. Simply the input if < 32 bytes.
-     */
-    function _getNodeHash(
-        bytes memory _encoded
-    )
-        private
-        pure
-        returns (
-            bytes memory _hash
-        )
-    {
-        Iif (_encoded.length < 32) {
-            return _encoded;
-        } else {
-            return abi.encodePacked(keccak256(_encoded));
-        }
-    }
- 
-    /**
-     * @notice Determines the type for a given node.
-     * @param _node Node to determine a type for.
-     * @return _type Type of the node; BranchNode/ExtensionNode/LeafNode.
-     */
-    function _getNodeType(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            NodeType _type
-        )
-    {
-        if (_node.decoded.length == BRANCH_NODE_LENGTH) {
-            return NodeType.BranchNode;
-        } else Eif (_node.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
-            bytes memory path = _getNodePath(_node);
-            uint8 prefix = uint8(path[0]);
- 
-            if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
-                return NodeType.LeafNode;
-            } else Eif (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
-                return NodeType.ExtensionNode;
-            }
-        }
- 
-        revert("Invalid node type");
-    }
- 
-    /**
-     * @notice Utility; determines the number of nibbles shared between two
-     * nibble arrays.
-     * @param _a First nibble array.
-     * @param _b Second nibble array.
-     * @return _shared Number of shared nibbles.
-     */
-    function _getSharedNibbleLength(
-        bytes memory _a,
-        bytes memory _b
-    )
-        private
-        pure
-        returns (
-            uint256 _shared
-        )
-    {
-        uint256 i = 0;
-        while (_a.length > i && _b.length > i && _a[i] == _b[i]) {
-            i++;
-        }
-        return i;
-    }
- 
-    /**
-     * @notice Utility; converts an RLP-encoded node into our nice struct.
-     * @param _raw RLP-encoded node to convert.
-     * @return _node Node as a TrieNode struct.
-     */
-    function _makeNode(
-        bytes[] memory _raw
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes memory encoded = Lib_RLPWriter.writeList(_raw);
- 
-        return TrieNode({
-            encoded: encoded,
-            decoded: Lib_RLPReader.readList(encoded)
-        });
-    }
- 
-    /**
-     * @notice Utility; converts an RLP-decoded node into our nice struct.
-     * @param _items RLP-decoded node to convert.
-     * @return _node Node as a TrieNode struct.
-     */
-    function _makeNode(
-        Lib_RLPReader.RLPItem[] memory _items
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](_items.length);
-        for (uint256 i = 0; i < _items.length; i++) {
-            raw[i] = Lib_RLPReader.readRawBytes(_items[i]);
-        }
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates a new extension node.
-     * @param _key Key for the extension node, unprefixed.
-     * @param _value Value for the extension node.
-     * @return _node New extension node with the given k/v pair.
-     */
-    function _makeExtensionNode(
-        bytes memory _key,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](2);
-        bytes memory key = _addHexPrefix(_key, false);
-        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
-        raw[1] = Lib_RLPWriter.writeBytes(_value);
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates a new leaf node.
-     * @dev This function is essentially identical to `_makeExtensionNode`.
-     * Although we could route both to a single method with a flag, it's
-     * more gas efficient to keep them separate and duplicate the logic.
-     * @param _key Key for the leaf node, unprefixed.
-     * @param _value Value for the leaf node.
-     * @return _node New leaf node with the given k/v pair.
-     */
-    function _makeLeafNode(
-        bytes memory _key,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](2);
-        bytes memory key = _addHexPrefix(_key, true);
-        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
-        raw[1] = Lib_RLPWriter.writeBytes(_value);
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates an empty branch node.
-     * @return _node Empty branch node as a TrieNode struct.
-     */
-    function _makeEmptyBranchNode()
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](BRANCH_NODE_LENGTH);
-        for (uint256 i = 0; i < raw.length; i++) {
-            raw[i] = RLP_NULL_BYTES;
-        }
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Modifies the value slot for a given branch.
-     * @param _branch Branch node to modify.
-     * @param _value Value to insert into the branch.
-     * @return _updatedNode Modified branch node.
-     */
-    function _editBranchValue(
-        TrieNode memory _branch,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _updatedNode
-        )
-    {
-        bytes memory encoded = Lib_RLPWriter.writeBytes(_value);
-        _branch.decoded[_branch.decoded.length - 1] = Lib_RLPReader.toRLPItem(encoded);
-        return _makeNode(_branch.decoded);
-    }
- 
-    /**
-     * @notice Modifies a slot at an index for a given branch.
-     * @param _branch Branch node to modify.
-     * @param _index Slot index to modify.
-     * @param _value Value to insert into the slot.
-     * @return _updatedNode Modified branch node.
-     */
-    function _editBranchIndex(
-        TrieNode memory _branch,
-        uint8 _index,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _updatedNode
-        )
-    {
-        bytes memory encoded = _value.length < 32 ? _value : Lib_RLPWriter.writeBytes(_value);
-        _branch.decoded[_index] = Lib_RLPReader.toRLPItem(encoded);
-        return _makeNode(_branch.decoded);
-    }
- 
-    /**
-     * @notice Utility; adds a prefix to a key.
-     * @param _key Key to prefix.
-     * @param _isLeaf Whether or not the key belongs to a leaf.
-     * @return _prefixedKey Prefixed key.
-     */
-    function _addHexPrefix(
-        bytes memory _key,
-        bool _isLeaf
-    )
-        private
-        pure
-        returns (
-            bytes memory _prefixedKey
-        )
-    {
-        uint8 prefix = _isLeaf ? uint8(0x02) : uint8(0x00);
-        uint8 offset = uint8(_key.length % 2);
-        bytes memory prefixed = new bytes(2 - offset);
-        prefixed[0] = bytes1(prefix + offset);
-        return abi.encodePacked(prefixed, _key);
-    }
- 
-    /**
-     * @notice Utility; removes a prefix from a path.
-     * @param _path Path to remove the prefix from.
-     * @return _unprefixedKey Unprefixed key.
-     */
-    function _removeHexPrefix(
-        bytes memory _path
-    )
-        private
-        pure
-        returns (
-            bytes memory _unprefixedKey
-        )
-    {
-        if (uint8(_path[0]) % 2 == 0) {
-            return Lib_BytesUtils.slice(_path, 2);
-        } else {
-            return Lib_BytesUtils.slice(_path, 1);
-        }
-    }
- 
-    /**
-     * @notice Utility; combines two node arrays. Array lengths are required
-     * because the actual lengths may be longer than the filled lengths.
-     * Array resizing is extremely costly and should be avoided.
-     * @param _a First array to join.
-     * @param _aLength Length of the first array.
-     * @param _b Second array to join.
-     * @param _bLength Length of the second array.
-     * @return _joined Combined node array.
-     */
-    function _joinNodeArrays(
-        TrieNode[] memory _a,
-        uint256 _aLength,
-        TrieNode[] memory _b,
-        uint256 _bLength
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _joined
-        )
-    {
-        TrieNode[] memory ret = new TrieNode[](_aLength + _bLength);
- 
-        // Copy elements from the first array.
-        for (uint256 i = 0; i < _aLength; i++) {
-            ret[i] = _a[i];
-        }
- 
-        // Copy elements from the second array.
-        for (uint256 i = 0; i < _bLength; i++) {
-            ret[i + _aLength] = _b[i];
-        }
- 
-        return ret;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html deleted file mode 100644 index 1e999e7d4..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html +++ /dev/null @@ -1,548 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/trie/ Lib_SecureMerkleTrie.sol -

-
-
- 63.64% - Statements - 7/11 -
-
- 100% - Branches - 0/0 -
-
- 66.67% - Functions - 4/6 -
-
- 63.64% - Lines - 7/11 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -20× -20× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -47× -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_MerkleTrie } from "./Lib_MerkleTrie.sol";
- 
-/**
- * @title Lib_SecureMerkleTrie
- */
-library Lib_SecureMerkleTrie {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Verifies a proof that a given key/value pair is present in the
-     * Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _value Value of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
-     * traditional Merkle trees, this proof is executed top-down and consists
-     * of a list of RLP-encoded nodes that make a path down to the target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
-     */
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
-    }
- 
-    /**
-     * @notice Verifies a proof that a given key is *not* present in
-     * the Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the key is not present in the trie, `false` otherwise.
-     */
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.verifyExclusionProof(key, _proof, _root);
-    }
- 
-    /**
-     * @notice Updates a Merkle trie and returns a new root hash.
-     * @param _key Key of the node to update, as a hex string.
-     * @param _value Value of the node to update, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node. If the key exists, we can simply update the value.
-     * Otherwise, we need to modify the trie to handle the new k/v pair.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _updatedRoot Root hash of the newly constructed trie.
-     */
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.update(key, _value, _proof, _root);
-    }
- 
-    /**
-     * @notice Retrieves the value associated with a given key.
-     * @param _key Key to search for, as hex bytes.
-     * @param _proof Merkle trie inclusion proof for the key.
-     * @param _root Known root of the Merkle trie.
-     * @return _exists Whether or not the key exists.
-     * @return _value Value of the key if it exists.
-     */
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _exists,
-            bytes memory _value
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.get(key, _proof, _root);
-    }
- 
-    /**
-     * Computes the root hash for a trie with a single node.
-     * @param _key Key for the single node.
-     * @param _value Value for the single node.
-     * @return _updatedRoot Hash of the trie.
-     */
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.getSingleNodeRootHash(key, _value);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Computes the secure counterpart to a key.
-     * @param _key Key to get a secure key from.
-     * @return _secureKey Secure version of the key.
-     */
-    function _getSecureKey(
-        bytes memory _key
-    )
-        private
-        pure
-        returns (
-            bytes memory _secureKey
-        )
-    {
-        return abi.encodePacked(keccak256(_key));
-    }
-}
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/trie/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/trie/index.html deleted file mode 100644 index 8aa2158f9..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/trie/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/trie/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/trie/ -

-
-
- 71.98% - Statements - 149/207 -
-
- 55.88% - Branches - 38/68 -
-
- 81.25% - Functions - 26/32 -
-
- 71.57% - Lines - 146/204 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_MerkleTrie.sol
72.45%142/19655.88%38/6884.62%22/2672.02%139/193
Lib_SecureMerkleTrie.sol
63.64%7/11100%0/066.67%4/663.64%7/11
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html deleted file mode 100644 index 2faa1790a..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_Bytes32Utils.sol -

-
-
- 100% - Statements - 6/6 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 5/5 -
-
- 100% - Lines - 7/7 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -40× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_Byte32Utils
- */
-library Lib_Bytes32Utils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to "true."
-     * @param _in Input bytes32 value.
-     * @return Bytes32 as a boolean.
-     */
-    function toBool(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        return _in != 0;
-    }
- 
-    /**
-     * Converts a boolean to a bytes32 value.
-     * @param _in Input boolean value.
-     * @return Boolean as a bytes32.
-     */
-    function fromBool(
-        bool _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return bytes32(uint256(_in ? 1 : 0));
-    }
- 
-    /**
-     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.
-     * @param _in Input bytes32 value.
-     * @return Bytes32 as an address.
-     */
-    function toAddress(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        return address(uint160(uint256(_in)));
-    }
- 
-    /**
-     * Converts an address to a bytes32.
-     * @param _in Input address value.
-     * @return Address as a bytes32.
-     */
-    function fromAddress(
-        address _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return bytes32(uint256(_in));
-    }
- 
-    /**
-     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.
-     * @param _in Input bytes32 value.
-     * @return Bytes32 without any leading zeros.
-     */
-    function removeLeadingZeros(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes memory out;
- 
-        assembly {
-            // Figure out how many leading zero bytes to remove.
-            let shift := 0
-            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {
-                shift := add(shift, 1)
-            }
- 
-            // Reserve some space for our output and fix the free memory pointer.
-            out := mload(0x40)
-            mstore(0x40, add(out, 0x40))
- 
-            // Shift the value and store it into the output bytes.
-            mstore(add(out, 0x20), shl(mul(shift, 8), _in))
- 
-            // Store the new size (with leading zero bytes removed) in the output byte size.
-            mstore(out, sub(32, shift))
-        }
- 
-        return out;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html deleted file mode 100644 index b1d79bba0..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html +++ /dev/null @@ -1,728 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_BytesUtils.sol -

-
-
- 100% - Statements - 38/38 -
-
- 63.64% - Branches - 14/22 -
-
- 100% - Functions - 11/11 -
-
- 100% - Lines - 44/44 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -311× -311× -311× -  -308× -  -308× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -308× -  -  -  -  -  -  -  -  -  -  -299× -73× -  -  -226× -  -  -  -  -  -  -  -  -  - - - -  -  - -  -  -  -  -  -  -  -  -  -164× - - -  -  - -  -  -162× -  -  -  -  -  -  -  -  -  - -  -  -  -15× -15× -15× -  -15× -  -  -  -15× -  -  -  -12× -12× -12× -  -12× -  -  -  -12× -  -  -  - - - -  - -  -  -  - -  -  -  -  -  -  -  -  -  -292× -  -292× -9144× -9144× -  -  -292× -  -  -  -  -  -  -  -  -  -26× -  -26× -708× -  -  -26× -  -  -  -  -  -  -  -  -  -  -26× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_BytesUtils
- */
-library Lib_BytesUtils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start,
-        uint256 _length
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        Erequire(_length + 31 >= _length, "slice_overflow");
-        Erequire(_start + _length >= _start, "slice_overflow");
-        require(_bytes.length >= _start + _length, "slice_outOfBounds");
- 
-        bytes memory tempBytes;
- 
-        assembly {
-            switch iszero(_length)
-            case 0 {
-                // Get a location of some free memory and store it in tempBytes as
-                // Solidity does for memory variables.
-                tempBytes := mload(0x40)
- 
-                // The first word of the slice result is potentially a partial
-                // word read from the original array. To read it, we calculate
-                // the length of that partial word and start copying that many
-                // bytes into the array. The first word we copy will start with
-                // data we don't care about, but the last `lengthmod` bytes will
-                // land at the beginning of the contents of the new array. When
-                // we're done copying, we overwrite the full first word with
-                // the actual length of the slice.
-                let lengthmod := and(_length, 31)
- 
-                // The multiplication in the next line is necessary
-                // because when slicing multiples of 32 bytes (lengthmod == 0)
-                // the following copy loop was copying the origin's length
-                // and then ending prematurely not copying everything it should.
-                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
-                let end := add(mc, _length)
- 
-                for {
-                    // The multiplication in the next line has the same exact purpose
-                    // as the one above.
-                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
-                } lt(mc, end) {
-                    mc := add(mc, 0x20)
-                    cc := add(cc, 0x20)
-                } {
-                    mstore(mc, mload(cc))
-                }
- 
-                mstore(tempBytes, _length)
- 
-                //update free-memory pointer
-                //allocating the array padded to 32 bytes like the compiler does now
-                mstore(0x40, and(add(mc, 31), not(31)))
-            }
-            //if we want a zero-length slice let's just return a zero-length array
-            default {
-                tempBytes := mload(0x40)
- 
-                //zero out the 32 bytes slice we are about to return
-                //we need to do it because Solidity does not garbage collect
-                mstore(tempBytes, 0)
- 
-                mstore(0x40, add(tempBytes, 0x20))
-            }
-        }
- 
-        return tempBytes;
-    }
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        if (_bytes.length - _start == 0) {
-            return bytes('');
-        }
- 
-        return slice(_bytes, _start, _bytes.length - _start);
-    }
- 
-    function toBytes32PadLeft(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes32)
-    {
-        bytes32 ret;
-        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;
-        assembly {
-            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))
-        }
-        return ret;
-    }
- 
-    function toBytes32(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes32)
-    {
-        if (_bytes.length < 32) {
-            bytes32 ret;
-            assembly {
-                ret := mload(add(_bytes, 32))
-            }
-            return ret;
-        }
- 
-        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes
-    }
- 
-    function toUint256(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (uint256)
-    {
-        return uint256(toBytes32(_bytes));
-    }
- 
-    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
-        Erequire(_start + 3 >= _start, "toUint24_overflow");
-        Erequire(_bytes.length >= _start + 3 , "toUint24_outOfBounds");
-        uint24 tempUint;
- 
-        assembly {
-            tempUint := mload(add(add(_bytes, 0x3), _start))
-        }
- 
-        return tempUint;
-    }
- 
-    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
-        Erequire(_start + 1 >= _start, "toUint8_overflow");
-        Erequire(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
-        uint8 tempUint;
- 
-        assembly {
-            tempUint := mload(add(add(_bytes, 0x1), _start))
-        }
- 
-        return tempUint;
-    }
- 
-    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
-        Erequire(_start + 20 >= _start, "toAddress_overflow");
-        Erequire(_bytes.length >= _start + 20, "toAddress_outOfBounds");
-        address tempAddress;
- 
-        assembly {
-            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
-        }
- 
-        return tempAddress;
-    }
- 
-    function toNibbles(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        bytes memory nibbles = new bytes(_bytes.length * 2);
- 
-        for (uint256 i = 0; i < _bytes.length; i++) {
-            nibbles[i * 2] = _bytes[i] >> 4;
-            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);
-        }
- 
-        return nibbles;
-    }
- 
-    function fromNibbles(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        bytes memory ret = new bytes(_bytes.length / 2);
- 
-        for (uint256 i = 0; i < ret.length; i++) {
-            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);
-        }
- 
-        return ret;
-    }
- 
-    function equal(
-        bytes memory _bytes,
-        bytes memory _other
-    )
-        internal
-        pure
-        returns (bool)
-    {
-        return keccak256(_bytes) == keccak256(_other);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html deleted file mode 100644 index 8e0c02eee..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_ECDSAUtils.sol -

-
-
- 100% - Statements - 9/9 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 9/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× - -  -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_ECDSAUtils
- */
-library Lib_ECDSAUtils {
- 
-    /**************************************
-     * Internal Functions: ECDSA Recovery *
-     **************************************/
- 
-    /**
-     * Recovers a signed address given a message and signature.
-     * @param _message Message that was originally signed.
-     * @param _isEthSignedMessage Whether or not the user used the `Ethereum Signed Message` prefix.
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     * @return _sender Signer address.
-     */
-    function recover(
-        bytes memory _message,
-        bool _isEthSignedMessage,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        internal
-        pure
-        returns (
-            address _sender
-        )
-    {
-        bytes32 messageHash = getMessageHash(_message, _isEthSignedMessage);
- 
-        return ecrecover(
-            messageHash,
-            _v + 27,
-            _r,
-            _s
-        );
-    }
- 
-    function getMessageHash(
-        bytes memory _message,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (bytes32) {
-        if (_isEthSignedMessage) {
-            return getEthSignedMessageHash(_message);
-        }
-        return getNativeMessageHash(_message);
-    }
- 
- 
-    /*************************************
-     * Private Functions: ECDSA Recovery *
-     *************************************/
- 
-    /**
-     * Gets the native message hash (simple keccak256) for a message.
-     * @param _message Message to hash.
-     * @return _messageHash Native message hash.
-     */
-    function getNativeMessageHash(
-        bytes memory _message
-    )
-        private
-        pure
-        returns (
-            bytes32 _messageHash
-        )
-    {
-        return keccak256(_message);
-    }
- 
-    /**
-     * Gets the hash of a message with the `Ethereum Signed Message` prefix.
-     * @param _message Message to hash.
-     * @return _messageHash Prefixed message hash.
-     */
-    function getEthSignedMessageHash(
-        bytes memory _message
-    )
-        private
-        pure
-        returns (
-            bytes32 _messageHash
-        )
-    {
-        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
-        bytes32 messageHash = keccak256(_message);
-        return keccak256(abi.encodePacked(prefix, messageHash));
-    }
-}
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html deleted file mode 100644 index 5be2cd548..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_ErrorUtils.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title Lib_ErrorUtils
- */
-library Lib_ErrorUtils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Encodes an error string into raw solidity-style revert data.
-     * (i.e. ascii bytes, prefixed with bytes4(keccak("Error(string))"))
-     * Ref: https://docs.soliditylang.org/en/v0.8.2/control-structures.html?highlight=Error(string)#panic-via-assert-and-error-via-require
-     * @param _reason Reason for the reversion.
-     * @return Standard solidity revert data for the given reason.
-     */
-    function encodeRevertString(
-        string memory _reason
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodeWithSignature(
-            "Error(string)",
-            _reason
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html deleted file mode 100644 index 578273032..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_EthUtils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_EthUtils.sol -

-
-
- 83.33% - Statements - 10/12 -
-
- 100% - Branches - 0/0 -
-
- 85.71% - Functions - 6/7 -
-
- 87.5% - Lines - 14/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -34× -  -  -  -  -  -  -34× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -212× -  -  -  -212× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -27× -27× -  -27× -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
-import { Lib_Bytes32Utils } from "./Lib_Bytes32Utils.sol";
- 
-/**
- * @title Lib_EthUtils
- */
-library Lib_EthUtils {
- 
-    /***********************************
-     * Internal Functions: Code Access *
-     ***********************************/
- 
-    /**
-     * Gets the code for a given address.
-     * @param _address Address to get code for.
-     * @param _offset Offset to start reading from.
-     * @param _length Number of bytes to read.
-     * @return _code Code read from the contract.
-     */
-    function getCode(
-        address _address,
-        uint256 _offset,
-        uint256 _length
-    )
-        internal
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        assembly {
-            _code := mload(0x40)
-            mstore(0x40, add(_code, add(_length, 0x20)))
-            mstore(_code, _length)
-            extcodecopy(_address, add(_code, 0x20), _offset, _length)
-        }
- 
-        return _code;
-    }
- 
-    /**
-     * Gets the full code for a given address.
-     * @param _address Address to get code for.
-     * @return _code Full code of the contract.
-     */
-    function getCode(
-        address _address
-    )
-        internal
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        return getCode(
-            _address,
-            0,
-            getCodeSize(_address)
-        );
-    }
- 
-    /**
-     * Gets the size of a contract's code in bytes.
-     * @param _address Address to get code size for.
-     * @return _codeSize Size of the contract's code in bytes.
-     */
-    function getCodeSize(
-        address _address
-    )
-        internal
-        view
-        returns (
-            uint256 _codeSize
-        )
-    {
-        assembly {
-            _codeSize := extcodesize(_address)
-        }
- 
-        return _codeSize;
-    }
- 
-    /**
-     * Gets the hash of a contract's code.
-     * @param _address Address to get a code hash for.
-     * @return _codeHash Hash of the contract's code.
-     */
-    function getCodeHash(
-        address _address
-    )
-        internal
-        view
-        returns (
-            bytes32 _codeHash
-        )
-    {
-        assembly {
-            _codeHash := extcodehash(_address)
-        }
- 
-        return _codeHash;
-    }
- 
- 
-    /*****************************************
-     * Internal Functions: Contract Creation *
-     *****************************************/
- 
-    /**
-     * Creates a contract with some given initialization code.
-     * @param _code Contract initialization code.
-     * @return _created Address of the created contract.
-     */
-    function createContract(
-        bytes memory _code
-    )
-        internal
-        returns (
-            address _created
-        )
-    {
-        assembly {
-            _created := create(
-                0,
-                add(_code, 0x20),
-                mload(_code)
-            )
-        }
- 
-        return _created;
-    }
- 
-    /**
-     * Computes the address that would be generated by CREATE.
-     * @param _creator Address creating the contract.
-     * @param _nonce Creator's nonce.
-     * @return _address Address to be generated by CREATE.
-     */
-    function getAddressForCREATE(
-        address _creator,
-        uint256 _nonce
-    )
-        internal
-        pure
-        returns (
-            address _address
-        )
-    {
-        bytes[] memory encoded = new bytes[](2);
-        encoded[0] = Lib_RLPWriter.writeAddress(_creator);
-        encoded[1] = Lib_RLPWriter.writeUint(_nonce);
- 
-        bytes memory encodedList = Lib_RLPWriter.writeList(encoded);
-        return Lib_Bytes32Utils.toAddress(keccak256(encodedList));
-    }
- 
-    /**
-     * Computes the address that would be generated by CREATE2.
-     * @param _creator Address creating the contract.
-     * @param _bytecode Bytecode of the contract to be created.
-     * @param _salt 32 byte salt value mixed into the hash.
-     * @return _address Address to be generated by CREATE2.
-     */
-    function getAddressForCREATE2(
-        address _creator,
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        internal
-        pure
-        returns (address _address)
-    {
-        bytes32 hashedData = keccak256(abi.encodePacked(
-            byte(0xff),
-            _creator,
-            _salt,
-            keccak256(_bytecode)
-        ));
- 
-        return Lib_Bytes32Utils.toAddress(hashedData);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Math.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Math.sol.html deleted file mode 100644 index ff97d943c..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_Math.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_Math.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_Math.sol -

-
-
- 0% - Statements - 0/3 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_Math
- */
-library Lib_Math {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Calculates the minumum of two numbers.
-     * @param _x First number to compare.
-     * @param _y Second number to compare.
-     * @return Lesser of the two numbers.
-     */
-    function min(
-        uint256 _x,
-        uint256 _y
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        if (_x < _y) {
-            return _x;
-        }
- 
-        return _y;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html deleted file mode 100644 index 60fb172ca..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html +++ /dev/null @@ -1,725 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_MerkleTree.sol -

-
-
- 97.83% - Statements - 45/46 -
-
- 90.91% - Branches - 20/22 -
-
- 100% - Functions - 3/3 -
-
- 97.96% - Lines - 48/49 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -124× -  -  -  -  -123× -  -  -  -123× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -123× -  -  -123× -123× -  -  -123× -  -  -123× -  -  -123× -123× -  -123× -321× -321× -  -321× -5814× -5814× -5814× -  -  -  -  -5814× -  -  -321× -45× -45× -45× -  -  -  -  -45× -  -  -321× -321× -  -  -123× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -102× -  -  -  -  -101× -  -  -  -  -100× -  -  -  -  -99× -  -99× -653× -146× -  -  -  -  -  -  -507× -  -  -  -  -  -  -  -653× -  -  -99× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -  -  -  -  -100× - -  -  -  -  -97× -97× -97× -776× -206× -206× -  -  -  -  -97× -70× -  -  -97× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_MerkleTree
- * @author River Keefer
- */
-library Lib_MerkleTree {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Calculates a merkle root for a list of 32-byte leaf hashes.  WARNING: If the number
-     * of leaves passed in is not a power of two, it pads out the tree with zero hashes.
-     * If you do not know the original length of elements for the tree you are verifying,
-     * then this may allow empty leaves past _elements.length to pass a verification check down the line.
-     * Note that the _elements argument is modified, therefore it must not be used again afterwards
-     * @param _elements Array of hashes from which to generate a merkle root.
-     * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).
-     */
-    function getMerkleRoot(
-        bytes32[] memory _elements
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        require(
-            _elements.length > 0,
-            "Lib_MerkleTree: Must provide at least one leaf hash."
-        );
- 
-        Iif (_elements.length == 0) {
-            return _elements[0];
-        }
- 
-        uint256[16] memory defaults = [
-            0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,
-            0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,
-            0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,
-            0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,
-            0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,
-            0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,
-            0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,
-            0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,
-            0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,
-            0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,
-            0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,
-            0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,
-            0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,
-            0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,
-            0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,
-            0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10
-        ];
- 
-        // Reserve memory space for our hashes.
-        bytes memory buf = new bytes(64);
- 
-        // We'll need to keep track of left and right siblings.
-        bytes32 leftSibling;
-        bytes32 rightSibling;
- 
-        // Number of non-empty nodes at the current depth.
-        uint256 rowSize = _elements.length;
- 
-        // Current depth, counting from 0 at the leaves
-        uint256 depth = 0;
- 
-        // Common sub-expressions
-        uint256 halfRowSize;         // rowSize / 2
-        bool rowSizeIsOdd;           // rowSize % 2 == 1
- 
-        while (rowSize > 1) {
-            halfRowSize = rowSize / 2;
-            rowSizeIsOdd = rowSize % 2 == 1;
- 
-            for (uint256 i = 0; i < halfRowSize; i++) {
-                leftSibling  = _elements[(2 * i)    ];
-                rightSibling = _elements[(2 * i) + 1];
-                assembly {
-                    mstore(add(buf, 32), leftSibling )
-                    mstore(add(buf, 64), rightSibling)
-                }
- 
-                _elements[i] = keccak256(buf);
-            }
- 
-            if (rowSizeIsOdd) {
-                leftSibling  = _elements[rowSize - 1];
-                rightSibling = bytes32(defaults[depth]);
-                assembly {
-                    mstore(add(buf, 32), leftSibling)
-                    mstore(add(buf, 64), rightSibling)
-                }
- 
-                _elements[halfRowSize] = keccak256(buf);
-            }
- 
-            rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);
-            depth++;
-        }
- 
-        return _elements[0];
-    }
- 
-    /**
-     * Verifies a merkle branch for the given leaf hash.  Assumes the original length
-     * of leaves generated is a known, correct input, and does not return true for indices
-     * extending past that index (even if _siblings would be otherwise valid.)
-     * @param _root The Merkle root to verify against.
-     * @param _leaf The leaf hash to verify inclusion of.
-     * @param _index The index in the tree of this leaf.
-     * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
-     * @param _totalLeaves The total number of leaves originally passed into.
-     * @return Whether or not the merkle branch and leaf passes verification.
-     */
-    function verify(
-        bytes32 _root,
-        bytes32 _leaf,
-        uint256 _index,
-        bytes32[] memory _siblings,
-        uint256 _totalLeaves
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        require(
-            _totalLeaves > 0,
-            "Lib_MerkleTree: Total leaves must be greater than zero."
-        );
- 
-        require(
-            _index < _totalLeaves,
-            "Lib_MerkleTree: Index out of bounds."
-        );
- 
-        require(
-            _siblings.length == _ceilLog2(_totalLeaves),
-            "Lib_MerkleTree: Total siblings does not correctly correspond to total leaves."
-        );
- 
-        bytes32 computedRoot = _leaf;
- 
-        for (uint256 i = 0; i < _siblings.length; i++) {
-            if ((_index & 1) == 1) {
-                computedRoot = keccak256(
-                    abi.encodePacked(
-                        _siblings[i],
-                        computedRoot
-                    )
-                );
-            } else {
-                computedRoot = keccak256(
-                    abi.encodePacked(
-                        computedRoot,
-                        _siblings[i]
-                    )
-                );
-            }
- 
-            _index >>= 1;
-        }
- 
-        return _root == computedRoot;
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Calculates the integer ceiling of the log base 2 of an input.
-     * @param _in Unsigned input to calculate the log.
-     * @return ceil(log_base_2(_in))
-     */
-    function _ceilLog2(
-        uint256 _in
-    )
-        private
-        pure
-        returns (
-            uint256
-        )
-    {
-        Erequire(
-            _in > 0,
-            "Lib_MerkleTree: Cannot compute ceil(log_2) of 0."
-        );
- 
-        if (_in == 1) {
-            return 0;
-        }
- 
-        // Find the highest set bit (will be floor(log_2)).
-        // Borrowed with <3 from https://github.com/ethereum/solidity-examples
-        uint256 val = _in;
-        uint256 highest = 0;
-        for (uint8 i = 128; i >= 1; i >>= 1) {
-            if (val & (uint(1) << i) - 1 << i != 0) {
-                highest += i;
-                val >>= i;
-            }
-        }
- 
-        // Increment by one if this is not a perfect logarithm.
-        if ((uint(1) << highest) != _in) {
-            highest += 1;
-        }
- 
-        return highest;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html deleted file mode 100644 index 1ccf21bdd..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_ReentrancyGuard.sol -

-
-
- 100% - Statements - 4/4 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 5/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -54× -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -14× -  -14× -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @dev Contract module that helps prevent reentrant calls to a function.
- *
- * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
- * available, which can be applied to functions to make sure there are no nested
- * (reentrant) calls to them.
- *
- * Note that because there is a single `nonReentrant` guard, functions marked as
- * `nonReentrant` may not call one another. This can be worked around by making
- * those functions `private`, and then adding `external` `nonReentrant` entry
- * points to them.
- *
- * TIP: If you would like to learn more about reentrancy and alternative ways
- * to protect against it, check out our blog post
- * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
- */
-abstract contract Lib_ReentrancyGuard {
-    // Booleans are more expensive than uint256 or any type that takes up a full
-    // word because each write operation emits an extra SLOAD to first read the
-    // slot's contents, replace the bits taken up by the boolean, and then write
-    // back. This is the compiler's defense against contract upgrades and
-    // pointer aliasing, and it cannot be disabled.
- 
-    // The values being non-zero value makes deployment a bit more expensive,
-    // but in exchange the refund on every call to nonReentrant will be lower in
-    // amount. Since refunds are capped to a percentage of the total
-    // transaction's gas, it is best to keep them low in cases like this one, to
-    // increase the likelihood of the full refund coming into effect.
-    uint256 private constant _NOT_ENTERED = 1;
-    uint256 private constant _ENTERED = 2;
- 
-    uint256 private _status;
- 
-    constructor () {
-        _status = _NOT_ENTERED;
-    }
- 
-    /**
-     * @dev Prevents a contract from calling itself, directly or indirectly.
-     * Calling a `nonReentrant` function from another `nonReentrant`
-     * function is not supported. It is possible to prevent this from happening
-     * by making the `nonReentrant` function external, and make it call a
-     * `private` function that does the actual work.
-     */
-    modifier nonReentrant() {
-        // On the first call to nonReentrant, _notEntered will be true
-        Erequire(_status != _ENTERED, "ReentrancyGuard: reentrant call");
- 
-        // Any calls to nonReentrant after this point will fail
-        _status = _ENTERED;
- 
-        _;
- 
-        // By storing the original value once again, a refund is triggered (see
-        // https://eips.ethereum.org/EIPS/eip-2200)
-        _status = _NOT_ENTERED;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html deleted file mode 100644 index 57d0143ce..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html +++ /dev/null @@ -1,1193 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_RingBuffer.sol -

-
-
- 78.13% - Statements - 50/64 -
-
- 54.17% - Branches - 13/24 -
-
- 81.82% - Functions - 9/11 -
-
- 77.46% - Lines - 55/71 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -578× -578× -  -  -578× -140× -  -  -  -578× -11× -  -  -  -  -  -  -  -  -  -  -11× -  -  -  -  -578× -578× -  -  -578× -578× -578× -  -  -  -  -  -  -  -  -  -  -  -  -  -470× -  -470× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -538× -  -  -  -  -535× -535× -  -535× -  -  -535× -  -  -535× -  -  -  -  -535× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  - -  -  -  -  -  -  -  -  - - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -453× -453× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -580× -580× -  -  -  -  -  -  -  -  -  -  -  -  -  -579× -579× -  -579× -579× -579× -  -  -  -  -579× -579× -579× -579× -  -  -  -  -  -579× -579× -  -  -579× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2620× -2620× -  -2620× -2620× -2620× -  -  -  -  -2620× -2620× -2620× -2620× -  -  -  -  -  -2620× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1648× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-library Lib_RingBuffer {
-    using Lib_RingBuffer for RingBuffer;
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct Buffer {
-        uint256 length;
-        mapping (uint256 => bytes32) buf;
-    }
- 
-    struct RingBuffer {
-        bytes32 contextA;
-        bytes32 contextB;
-        Buffer bufferA;
-        Buffer bufferB;
-        uint256 nextOverwritableIndex;
-    }
- 
-    struct RingBufferContext {
-        // contextA
-        uint40 globalIndex;
-        bytes27 extraData;
- 
-        // contextB
-        uint64 currBufferIndex;
-        uint40 prevResetIndex;
-        uint40 currResetIndex;
-    }
- 
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 constant MIN_CAPACITY = 16;
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Pushes a single element to the buffer.
-     * @param _self Buffer to access.
-     * @param _value Value to push to the buffer.
-     * @param _extraData Optional global extra data.
-     */
-    function push(
-        RingBuffer storage _self,
-        bytes32 _value,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
- 
-        // Set a minimum capacity.
-        if (currBuffer.length == 0) {
-            currBuffer.length = MIN_CAPACITY;
-        }
- 
-        // Check if we need to expand the buffer.
-        if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {
-            Iif (ctx.currResetIndex < _self.nextOverwritableIndex) {
-                // We're going to overwrite the inactive buffer.
-                // Bump the buffer index, reset the delete offset, and set our reset indices.
-                ctx.currBufferIndex++;
-                ctx.prevResetIndex = ctx.currResetIndex;
-                ctx.currResetIndex = ctx.globalIndex;
- 
-                // Swap over to the next buffer.
-                currBuffer = _self.getBuffer(ctx.currBufferIndex);
-            } else {
-                // We're not overwriting yet, double the length of the current buffer.
-                currBuffer.length *= 2;
-            }
-        }
- 
-        // Index to write to is the difference of the global and reset indices.
-        uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;
-        currBuffer.buf[writeHead] = _value;
- 
-        // Bump the global index and insert our extra data, then save the context.
-        ctx.globalIndex++;
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Pushes a single element to the buffer.
-     * @param _self Buffer to access.
-     * @param _value Value to push to the buffer.
-     */
-    function push(
-        RingBuffer storage _self,
-        bytes32 _value
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        
-        _self.push(
-            _value,
-            ctx.extraData
-        );
-    }
- 
-    /**
-     * Retrieves an element from the buffer.
-     * @param _self Buffer to access.
-     * @param _index Element index to retrieve.
-     * @return Value of the element at the given index.
-     */
-    function get(
-        RingBuffer storage _self,
-        uint256 _index
-    )
-        internal
-        view
-        returns (
-            bytes32    
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
- 
-        require(
-            _index < ctx.globalIndex,
-            "Index out of bounds."
-        );
- 
-        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
-        Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);
- 
-        Eif (_index >= ctx.currResetIndex) {
-            // We're trying to load an element from the current buffer.
-            // Relative index is just the difference from the reset index.
-            uint256 relativeIndex = _index - ctx.currResetIndex;
- 
-            // Shouldn't happen but why not check.
-            Erequire(
-                relativeIndex < currBuffer.length,
-                "Index out of bounds."
-            );
- 
-            return currBuffer.buf[relativeIndex];
-        } else {
-            // We're trying to load an element from the previous buffer.
-            // Relative index is the difference from the reset index in the other direction.
-            uint256 relativeIndex = ctx.currResetIndex - _index;
- 
-            // Condition only fails in the case that we deleted and flipped buffers.
-            require(
-                ctx.currResetIndex > ctx.prevResetIndex,
-                "Index out of bounds."
-            );
- 
-            // Make sure we're not trying to read beyond the array.
-            require(
-                relativeIndex <= prevBuffer.length,
-                "Index out of bounds."
-            );
- 
-            return prevBuffer.buf[prevBuffer.length - relativeIndex];
-        }
-    }
- 
-    /**
-     * Deletes all elements after (and including) a given index.
-     * @param _self Buffer to access.
-     * @param _index Index of the element to delete from (inclusive).
-     * @param _extraData Optional global extra data.
-     */
-    function deleteElementsAfterInclusive(
-        RingBuffer storage _self,
-        uint40 _index,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
- 
-        Erequire(
-            _index < ctx.globalIndex && _index >= ctx.prevResetIndex,
-            "Index out of bounds."
-        );
- 
-        Iif (_index < ctx.currResetIndex) {
-            // We're switching back to the previous buffer.
-            // Reduce the buffer index, set the current reset index back to match the previous one.
-            // We use the equality of these two values to prevent reading beyond this buffer.
-            ctx.currBufferIndex--;
-            ctx.currResetIndex = ctx.prevResetIndex;
-        }
- 
-        // Set our global index and extra data, save the context.
-        ctx.globalIndex = _index;
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Deletes all elements after (and including) a given index.
-     * @param _self Buffer to access.
-     * @param _index Index of the element to delete from (inclusive).
-     */
-    function deleteElementsAfterInclusive(
-        RingBuffer storage _self,
-        uint40 _index
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        _self.deleteElementsAfterInclusive(
-            _index,
-            ctx.extraData
-        );
-    }
- 
-    /**
-     * Retrieves the current global index.
-     * @param _self Buffer to access.
-     * @return Current global index.
-     */
-    function getLength(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        return ctx.globalIndex;
-    }
- 
-    /**
-     * Changes current global extra data.
-     * @param _self Buffer to access.
-     * @param _extraData New global extra data.
-     */
-    function setExtraData(
-        RingBuffer storage _self,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Retrieves the current global extra data.
-     * @param _self Buffer to access.
-     * @return Current global extra data.
-     */
-    function getExtraData(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            bytes27
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        return ctx.extraData;
-    }
- 
-    /**
-     * Sets the current ring buffer context.
-     * @param _self Buffer to access.
-     * @param _ctx Current ring buffer context.
-     */
-    function setContext(
-        RingBuffer storage _self,
-        RingBufferContext memory _ctx
-    )
-        internal
-    {
-        bytes32 contextA;
-        bytes32 contextB;
- 
-        uint40 globalIndex = _ctx.globalIndex;
-        bytes27 extraData = _ctx.extraData;
-        assembly {
-            contextA := globalIndex
-            contextA := or(contextA, extraData)
-        }
- 
-        uint64 currBufferIndex = _ctx.currBufferIndex;
-        uint40 prevResetIndex = _ctx.prevResetIndex;
-        uint40 currResetIndex = _ctx.currResetIndex;
-        assembly {
-            contextB := currBufferIndex
-            contextB := or(contextB, shl(64, prevResetIndex))
-            contextB := or(contextB, shl(104, currResetIndex))
-        }
- 
-        Eif (_self.contextA != contextA) {
-            _self.contextA = contextA;
-        }
- 
-        Iif (_self.contextB != contextB) {
-            _self.contextB = contextB;
-        }
-    }
- 
-    /**
-     * Retrieves the current ring buffer context.
-     * @param _self Buffer to access.
-     * @return Current ring buffer context.
-     */
-    function getContext(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            RingBufferContext memory
-        )
-    {
-        bytes32 contextA = _self.contextA;
-        bytes32 contextB = _self.contextB;
- 
-        uint40 globalIndex;
-        bytes27 extraData;
-        assembly {
-            globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            extraData   := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)
-        }
- 
-        uint64 currBufferIndex;
-        uint40 prevResetIndex;
-        uint40 currResetIndex;
-        assembly {
-            currBufferIndex :=          and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)
-            prevResetIndex  := shr(64,  and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))
-            currResetIndex  := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))
-        }
- 
-        return RingBufferContext({
-            globalIndex: globalIndex,
-            extraData: extraData,
-            currBufferIndex: currBufferIndex,
-            prevResetIndex: prevResetIndex,
-            currResetIndex: currResetIndex
-        });
-    }
- 
-    /**
-     * Retrieves the a buffer from the ring buffer by index.
-     * @param _self Buffer to access.
-     * @param _which Index of the sub buffer to access.
-     * @return Sub buffer for the index.
-     */
-    function getBuffer(
-        RingBuffer storage _self,
-        uint256 _which
-    )
-        internal
-        view
-        returns (
-            Buffer storage
-        )
-    {
-        return _which % 2 == 0 ? _self.bufferA : _self.bufferB;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/utils/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/utils/index.html deleted file mode 100644 index a87d86505..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/utils/index.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/utils/ -

-
-
- 89.07% - Statements - 163/183 -
-
- 67.57% - Branches - 50/74 -
-
- 91.11% - Functions - 41/45 -
-
- 89.27% - Lines - 183/205 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_Bytes32Utils.sol
100%6/6100%0/0100%5/5100%7/7
Lib_BytesUtils.sol
100%38/3863.64%14/22100%11/11100%44/44
Lib_ECDSAUtils.sol
100%9/9100%2/2100%4/4100%9/9
Lib_ErrorUtils.sol
100%1/1100%0/0100%1/1100%1/1
Lib_EthUtils.sol
83.33%10/12100%0/085.71%6/787.5%14/16
Lib_Math.sol
0%0/30%0/20%0/10%0/3
Lib_MerkleTree.sol
97.83%45/4690.91%20/22100%3/397.96%48/49
Lib_ReentrancyGuard.sol
100%4/450%1/2100%2/2100%5/5
Lib_RingBuffer.sol
78.13%50/6454.17%13/2481.82%9/1177.46%55/71
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html deleted file mode 100644 index 864775242..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html +++ /dev/null @@ -1,1205 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/wrappers/ Lib_SafeExecutionManagerWrapper.sol -

-
-
- 100% - Statements - 30/30 -
-
- 83.33% - Branches - 5/6 -
-
- 100% - Functions - 16/16 -
-
- 96.77% - Lines - 30/31 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -11× -  -  -  -  -  -11× -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -41× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -43× -  -  -  -  -  -  -43× -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -146× -146× -  -  -  -  -146× - -  -  -  -  -  -  -  -144× -  -  -  -  -  -  -  -  -  -  -  -145× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_ErrorUtils } from "../utils/Lib_ErrorUtils.sol";
- 
-/**
- * @title Lib_SafeExecutionManagerWrapper
- * @dev The Safe Execution Manager Wrapper provides functions which facilitate writing OVM safe 
- * code using the standard solidity compiler, by routing all its operations through the Execution 
- * Manager.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-library Lib_SafeExecutionManagerWrapper {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Performs a safe ovmCALL.
-     * @param _gasLimit Gas limit for the call.
-     * @param _target Address to call.
-     * @param _calldata Data to send to the call.
-     * @return _success Whether or not the call reverted.
-     * @return _returndata Data returned by the call.
-     */
-    function safeCALL(
-        uint256 _gasLimit,
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCALL(uint256,address,bytes)",
-                _gasLimit,
-                _target,
-                _calldata
-            )
-        );
- 
-        return abi.decode(returndata, (bool, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmDELEGATECALL.
-     * @param _gasLimit Gas limit for the call.
-     * @param _target Address to call.
-     * @param _calldata Data to send to the call.
-     * @return _success Whether or not the call reverted.
-     * @return _returndata Data returned by the call.
-     */
-    function safeDELEGATECALL(
-        uint256 _gasLimit,
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmDELEGATECALL(uint256,address,bytes)",
-                _gasLimit,
-                _target,
-                _calldata
-            )
-        );
- 
-        return abi.decode(returndata, (bool, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmCREATE call.
-     * @param _gasLimit Gas limit for the creation.
-     * @param _bytecode Code for the new contract.
-     * @return _contract Address of the created contract.
-     */
-    function safeCREATE(
-        uint256 _gasLimit,
-        bytes memory _bytecode
-    )
-        internal
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            _gasLimit,
-            abi.encodeWithSignature(
-                "ovmCREATE(bytes)",
-                _bytecode
-            )
-        );
- 
-        return abi.decode(returndata, (address, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmEXTCODESIZE call.
-     * @param _contract Address of the contract to query the size of.
-     * @return _EXTCODESIZE Size of the requested contract in bytes.
-     */
-    function safeEXTCODESIZE(
-        address _contract
-    )
-        internal
-        returns (
-            uint256 _EXTCODESIZE
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmEXTCODESIZE(address)",
-                _contract
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmCHAINID call.
-     * @return _CHAINID Result of calling ovmCHAINID.
-     */
-    function safeCHAINID()
-        internal
-        returns (
-            uint256 _CHAINID
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCHAINID()"
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmCALLER call.
-     * @return _CALLER Result of calling ovmCALLER.
-     */
-    function safeCALLER()
-        internal
-        returns (
-            address _CALLER
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCALLER()"
-            )
-        );
- 
-        return abi.decode(returndata, (address));
-    }
- 
-    /**
-     * Performs a safe ovmADDRESS call.
-     * @return _ADDRESS Result of calling ovmADDRESS.
-     */
-    function safeADDRESS()
-        internal
-        returns (
-            address _ADDRESS
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmADDRESS()"
-            )
-        );
- 
-        return abi.decode(returndata, (address));
-    }
- 
-    /**
-     * Performs a safe ovmGETNONCE call.
-     * @return _nonce Result of calling ovmGETNONCE.
-     */
-    function safeGETNONCE()
-        internal
-        returns (
-            uint256 _nonce
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmGETNONCE()"
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmSETNONCE call.
-     * @param _nonce New account nonce.
-     */
-    function safeSETNONCE(
-        uint256 _nonce
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSETNONCE(uint256)",
-                _nonce
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe ovmCREATEEOA call.
-     * @param _messageHash Message hash which was signed by EOA
-     * @param _v v value of signature (0 or 1)
-     * @param _r r value of signature
-     * @param _s s value of signature
-     */
-    function safeCREATEEOA(
-        bytes32 _messageHash,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCREATEEOA(bytes32,uint8,bytes32,bytes32)",
-                _messageHash,
-                _v,
-                _r,
-                _s
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe REVERT.
-     * @param _reason String revert reason to pass along with the REVERT.
-     */
-    function safeREVERT(
-        string memory _reason
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmREVERT(bytes)",
-                Lib_ErrorUtils.encodeRevertString(
-                    _reason
-                )
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe "require".
-     * @param _condition Boolean condition that must be true or will revert.
-     * @param _reason String revert reason to pass along with the REVERT.
-     */
-    function safeREQUIRE(
-        bool _condition,
-        string memory _reason
-    )
-        internal
-    {
-        if (!_condition) {
-            safeREVERT(
-                _reason
-            );
-        }
-    }
- 
-    /**
-     * Performs a safe ovmSLOAD call.
-     */
-    function safeSLOAD(
-        bytes32 _key
-    )
-        internal
-        returns (
-            bytes32
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSLOAD(bytes32)",
-                _key
-            )
-        );
- 
-        return abi.decode(returndata, (bytes32));
-    }
- 
-    /**
-     * Performs a safe ovmSSTORE call.
-     */
-    function safeSSTORE(
-        bytes32 _key,
-        bytes32 _value
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSSTORE(bytes32,bytes32)",
-                _key,
-                _value
-            )
-        );
-    }
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Performs an ovm interaction and the necessary safety checks.
-     * @param _gasLimit Gas limit for the interaction.
-     * @param _calldata Data to send to the OVM_ExecutionManager (encoded with sighash).
-     * @return _returndata Data sent back by the OVM_ExecutionManager.
-     */
-    function _safeExecutionManagerInteraction(
-        uint256 _gasLimit,
-        bytes memory _calldata
-    )
-        private
-        returns (
-            bytes memory _returndata
-        )
-    {
-        address ovmExecutionManager = msg.sender;
-        (
-            bool success,
-            bytes memory returndata
-        ) = ovmExecutionManager.call{gas: _gasLimit}(_calldata);
- 
-        if (success == false) {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        } else Iif (returndata.length == 1) {
-            assembly {
-                return(0, 1)
-            }
-        } else {
-            return returndata;
-        }
-    }
- 
-    function _safeExecutionManagerInteraction(
-        bytes memory _calldata
-    )
-        private
-        returns (
-            bytes memory _returndata
-        )
-    {
-        return _safeExecutionManagerInteraction(
-            gasleft(),
-            _calldata
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html b/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html deleted file mode 100644 index 5389cca3c..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/wrappers/ Lib_SafeMathWrapper.sol -

-
-
- 21.05% - Statements - 4/19 -
-
- 50% - Branches - 1/2 -
-
- 12.5% - Functions - 1/8 -
-
- 21.05% - Lines - 4/19 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// Pulled from @openzeppelin/contracts/math/SafeMath.sol
-// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_SafeExecutionManagerWrapper } from "./Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title Lib_SafeMathWrapper
- */
- 
-/**
- * @dev Wrappers over Solidity's arithmetic operations with added overflow
- * checks.
- *
- * Arithmetic operations in Solidity wrap on overflow. This can easily result
- * in bugs, because programmers usually assume that an overflow raises an
- * error, which is the standard behavior in high level programming languages.
- * `SafeMath` restores this intuition by reverting the transaction when an
- * operation overflows.
- *
- * Using this library instead of the unchecked operations eliminates an entire
- * class of bugs, so it's recommended to use it always.
- */
- 
-library Lib_SafeMathWrapper {
-    /**
-     * @dev Returns the addition of two unsigned integers, reverting on
-     * overflow.
-     *
-     * Counterpart to Solidity's `+` operator.
-     *
-     * Requirements:
-     *
-     * - Addition cannot overflow.
-     */
-    function add(uint256 a, uint256 b) internal returns (uint256) {
-        uint256 c = a + b;
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c >= a, "Lib_SafeMathWrapper: addition overflow");
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the subtraction of two unsigned integers, reverting on
-     * overflow (when the result is negative).
-     *
-     * Counterpart to Solidity's `-` operator.
-     *
-     * Requirements:
-     *
-     * - Subtraction cannot overflow.
-     */
-    function sub(uint256 a, uint256 b) internal returns (uint256) {
-        return sub(a, b, "Lib_SafeMathWrapper: subtraction overflow");
-    }
- 
-    /**
-     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
-     * overflow (when the result is negative).
-     *
-     * Counterpart to Solidity's `-` operator.
-     *
-     * Requirements:
-     *
-     * - Subtraction cannot overflow.
-     */
-    function sub(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b <= a, errorMessage);
-        uint256 c = a - b;
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the multiplication of two unsigned integers, reverting on
-     * overflow.
-     *
-     * Counterpart to Solidity's `*` operator.
-     *
-     * Requirements:
-     *
-     * - Multiplication cannot overflow.
-     */
-    function mul(uint256 a, uint256 b) internal returns (uint256) {
-        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
-        // benefit is lost if 'b' is also tested.
-        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
-        Iif (a == 0) {
-            return 0;
-        }
- 
-        uint256 c = a * b;
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c / a == b, "Lib_SafeMathWrapper: multiplication overflow");
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the integer division of two unsigned integers. Reverts on
-     * division by zero. The result is rounded towards zero.
-     *
-     * Counterpart to Solidity's `/` operator. Note: this function uses a
-     * `revert` opcode (which leaves remaining gas untouched) while Solidity
-     * uses an invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function div(uint256 a, uint256 b) internal returns (uint256) {
-        return div(a, b, "Lib_SafeMathWrapper: division by zero");
-    }
- 
-    /**
-     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
-     * division by zero. The result is rounded towards zero.
-     *
-     * Counterpart to Solidity's `/` operator. Note: this function uses a
-     * `revert` opcode (which leaves remaining gas untouched) while Solidity
-     * uses an invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function div(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b > 0, errorMessage);
-        uint256 c = a / b;
-        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
-     * Reverts when dividing by zero.
-     *
-     * Counterpart to Solidity's `%` operator. This function uses a `revert`
-     * opcode (which leaves remaining gas untouched) while Solidity uses an
-     * invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function mod(uint256 a, uint256 b) internal returns (uint256) {
-        return mod(a, b, "Lib_SafeMathWrapper: modulo by zero");
-    }
- 
-    /**
-     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
-     * Reverts with custom message when dividing by zero.
-     *
-     * Counterpart to Solidity's `%` operator. This function uses a `revert`
-     * opcode (which leaves remaining gas untouched) while Solidity uses an
-     * invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function mod(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b != 0, errorMessage);
-        return a % b;
-    }
-}
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/index.html b/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/index.html deleted file mode 100644 index 4855727ba..000000000 --- a/coverage/lcov-report/optimistic-ethereum/libraries/wrappers/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/wrappers/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/wrappers/ -

-
-
- 69.39% - Statements - 34/49 -
-
- 75% - Branches - 6/8 -
-
- 70.83% - Functions - 17/24 -
-
- 68% - Lines - 34/50 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_SafeExecutionManagerWrapper.sol
100%30/3083.33%5/6100%16/1696.77%30/31
Lib_SafeMathWrapper.sol
21.05%4/1950%1/212.5%1/821.05%4/19
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/index.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/index.html deleted file mode 100644 index d48d74930..000000000 --- a/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/accounts/ - - - - - - - -
-
-

- all files optimistic-ethereum/mockOVM/accounts/ -

-
-
- 0% - Statements - 0/9 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/2 -
-
- 0% - Lines - 0/9 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
mockOVM_ECDSAContractAccount.sol
0%0/90%0/20%0/20%0/9
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html deleted file mode 100644 index 41a520f12..000000000 --- a/coverage/lcov-report/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/mockOVM/accounts/ mockOVM_ECDSAContractAccount.sol -

-
-
- 0% - Statements - 0/9 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/2 -
-
- 0% - Lines - 0/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title mockOVM_ECDSAContractAccount
- */
-contract mockOVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Executes a signed transaction.
-     * @param _transaction Signed EOA transaction.
-     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
-     * param _v Signature `v` parameter.
-     * param _r Signature `r` parameter.
-     * param _s Signature `s` parameter.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8, // _v,
-        bytes32, // _r,
-        bytes32 // _s
-    )
-        override
-        public
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
-        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
- 
-        // Need to make sure that the transaction nonce is right.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
-            "Transaction nonce does not match the expected nonce."
-        );
- 
-        // Contract creations are signalled by sending a transaction to the zero address.
-        if (decodedTx.to == address(0)) {
-            (address created, ) = Lib_SafeExecutionManagerWrapper.safeCREATE(
-                decodedTx.gasLimit,
-                decodedTx.data
-            );
- 
-            // If the created address is the ZERO_ADDRESS then we know the deployment failed, though not why
-            return (created != address(0), abi.encode(created));
-        } else {
-            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
-            // the nonce of the calling account. Normally an EOA would bump the nonce for both
-            // cases, but since this is a contract we'd end up bumping the nonce twice.
-            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
- 
-            return Lib_SafeExecutionManagerWrapper.safeCALL(
-                decodedTx.gasLimit,
-                decodedTx.to,
-                decodedTx.data
-            );
-        }
-    }
- 
-    function qall(
-        uint256 _gasLimit,
-        address _to,
-        bytes memory _data
-    )
-        public
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        return Lib_SafeExecutionManagerWrapper.safeCALL(
-            _gasLimit,
-            _to,
-            _data
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/index.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/index.html deleted file mode 100644 index d1417a522..000000000 --- a/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/bridge/ - - - - - - - -
-
-

- all files optimistic-ethereum/mockOVM/bridge/ -

-
-
- 0% - Statements - 0/19 -
-
- 0% - Branches - 0/8 -
-
- 0% - Functions - 0/8 -
-
- 0% - Lines - 0/19 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
mockOVM_CrossDomainMessenger.sol
0%0/140%0/60%0/60%0/14
mockOVM_GenericCrossDomainMessenger.sol
0%0/50%0/20%0/20%0/5
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html deleted file mode 100644 index 47e36cc0a..000000000 --- a/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html +++ /dev/null @@ -1,500 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/mockOVM/bridge/ mockOVM_CrossDomainMessenger.sol -

-
-
- 0% - Statements - 0/14 -
-
- 0% - Branches - 0/6 -
-
- 0% - Functions - 0/6 -
-
- 0% - Lines - 0/14 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Contract Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title mockOVM_CrossDomainMessenger
- */
-contract mockOVM_CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct ReceivedMessage {
-        uint256 timestamp;
-        address target;
-        address sender;
-        bytes message;
-        uint256 messageNonce;
-        uint32 gasLimit;
-    }
- 
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    ReceivedMessage[] internal fullReceivedMessages;
-    address internal targetMessengerAddress;
-    uint256 internal lastRelayedMessage;
-    uint256 internal delay;
-    uint256 public messageNonce;
-    address override public xDomainMessageSender;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _delay Time in seconds before a message can be relayed.
-     */
-    constructor(
-        uint256 _delay
-    )
-    {
-        delay = _delay;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sets the target messenger address.
-     * @dev Currently, this function is public and therefore allows anyone to modify the target
-     *      messenger for a given xdomain messenger contract. Obviously this shouldn't be allowed,
-     *      but we still need to determine an adequate mechanism for updating this address.
-     * @param _targetMessengerAddress New messenger address.
-     */
-    function setTargetMessengerAddress(
-        address _targetMessengerAddress
-    )
-        public
-    {
-        targetMessengerAddress = _targetMessengerAddress;
-    }
- 
-    /**
-     * Sends a message to another mock xdomain messenger.
-     * @param _target Target for the message.
-     * @param _message Message to send.
-     * @param _gasLimit Amount of gas to send with the call.
-     */
-    function sendMessage(
-        address _target,
-        bytes memory _message,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        mockOVM_CrossDomainMessenger targetMessenger = mockOVM_CrossDomainMessenger(
-            targetMessengerAddress
-        );
- 
-        // Just send it over!
-        targetMessenger.receiveMessage(ReceivedMessage({
-            timestamp: block.timestamp,
-            target: _target,
-            sender: msg.sender,
-            message: _message,
-            messageNonce: messageNonce,
-            gasLimit: _gasLimit
-        }));
- 
-        messageNonce += 1;
-    }
- 
-    /**
-     * Receives a message to be sent later.
-     * @param _message Message to send later.
-     */
-    function receiveMessage(
-        ReceivedMessage memory _message
-    )
-        public
-    {
-        fullReceivedMessages.push(_message);
-    }
- 
-    /**
-     * Checks whether we have messages to relay.
-     * @param _exists Whether or not we have more messages to relay.
-     */
-    function hasNextMessage()
-        public
-        view
-        returns (
-            bool _exists
-        )
-    {
-        return fullReceivedMessages.length > lastRelayedMessage;
-    }
- 
-    /**
-     * Relays the last received message not yet relayed.
-     */
-    function relayNextMessage()
-        public
-    {
-        require(hasNextMessage(), "No pending messages to relay");
-        ReceivedMessage memory nextMessage = fullReceivedMessages[lastRelayedMessage];
-        require(nextMessage.timestamp + delay < block.timestamp, "Message is not ready to be relayed. The delay period is not up yet!");
- 
-        xDomainMessageSender = nextMessage.sender;
-        (bool success,) = nextMessage.target.call{gas: nextMessage.gasLimit}(nextMessage.message);
-        require(success, "Cross-domain message call reverted. Did you set your gas limit high enough?");
-        lastRelayedMessage += 1;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html deleted file mode 100644 index a584a996b..000000000 --- a/coverage/lcov-report/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/mockOVM/bridge/ mockOVM_GenericCrossDomainMessenger.sol -

-
-
- 0% - Statements - 0/5 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/2 -
-
- 0% - Lines - 0/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title mockOVM_GenericCrossDomainMessenger
- * @dev An experimental alternative mock for local testing.
- */
-contract mockOVM_GenericCrossDomainMessenger {
-    address public xDomainMessageSender;
- 
-    event SentMessage(
-        address _sender,
-        address _target,
-        bytes _message,
-        uint256 _gasLimit
-    );
- 
-    function sendMessage(
-        address _target,
-        bytes memory _message,
-        uint32 _gasLimit
-    )
-        public
-    {
-        emit SentMessage(
-            msg.sender,
-            _target,
-            _message,
-            _gasLimit
-        );
-    }
- 
-    function relayMessage(
-        address _sender,
-        address _target,
-        bytes memory _message,
-        uint256 _gasLimit
-    )
-        public
-    {
-        xDomainMessageSender = _sender;
-        (bool success, ) = _target.call{gas: _gasLimit}(_message);
-        require(success, "Cross-domain message call reverted. Did you set your gas limit high enough?");
-        xDomainMessageSender = address(0);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/index.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/index.html deleted file mode 100644 index f2db23491..000000000 --- a/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/verification/ - - - - - - - -
-
-

- all files optimistic-ethereum/mockOVM/verification/ -

-
-
- 50% - Statements - 1/2 -
-
- 100% - Branches - 0/0 -
-
- 22.22% - Functions - 2/9 -
-
- 50% - Lines - 1/2 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
mockOVM_BondManager.sol
50%1/2100%0/022.22%2/950%1/2
-
-
- - - - - - - diff --git a/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html b/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html deleted file mode 100644 index e66f2c6fa..000000000 --- a/coverage/lcov-report/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/mockOVM/verification/ mockOVM_BondManager.sol -

-
-
- 50% - Statements - 1/2 -
-
- 100% - Branches - 0/0 -
-
- 22.22% - Functions - 2/9 -
-
- 50% - Lines - 1/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
- 
-/* Contract Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/**
- * @title mockOVM_BondManager
- */
-contract mockOVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    function recordGasSpent(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        address _who,
-        uint256 _gasSpent
-    )
-        override
-        public
-    {}
- 
-    function finalize(
-        bytes32 _preStateRoot,
-        address _publisher,
-        uint256 _timestamp
-    )
-        override
-        public
-    {}
- 
-    function deposit()
-        override
-        public
-    {}
- 
-    function startWithdrawal()
-        override
-        public
-    {}
- 
-    function finalizeWithdrawal()
-        override
-        public
-    {}
- 
-    function claim(
-        address _who
-    )
-        override
-        public
-    {}
- 
-    function isCollateralized(
-        address _who
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        // Only authenticate sequencer to submit state root batches.
-        return _who == resolve("OVM_Proposer");
-    }
- 
-    function getGasSpent(
-        bytes32, // _preStateRoot,
-        address // _who
-    )
-        override
-        public
-        pure 
-        returns (
-            uint256
-        )
-    {
-        return 0;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7cda..000000000 --- a/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js deleted file mode 100644 index ef51e0386..000000000 --- a/coverage/lcov-report/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/lcov-report/sort-arrow-sprite.png b/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 03f704a609c6fd0dbfdac63466a7d7c958b5cbf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/coverage/lcov-report/test-helpers/Helper_GasMeasurer.sol.html b/coverage/lcov-report/test-helpers/Helper_GasMeasurer.sol.html deleted file mode 100644 index e33773a59..000000000 --- a/coverage/lcov-report/test-helpers/Helper_GasMeasurer.sol.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_GasMeasurer.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_GasMeasurer.sol -

-
-
- 100% - Statements - 7/7 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 9/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34  -  -  -  -  -  -  -  -  -  -  -  -47× -47× -  -47× -47× -47× -  -  -  -  -47× -47× -  -  -  -  -47× -  -47× -  -  - 
// SPDX-License-Identifier: UNLICENSED
-// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-contract Helper_GasMeasurer {
-    function measureCallGas(
-        address _target,
-        bytes memory _data
-    )
-        public
-        returns ( uint256 )
-    {
-        uint256 gasBefore;
-        uint256 gasAfter;
- 
-        uint256 calldataStart;
-        uint256 calldataLength;
-        assembly {
-            calldataStart := add(_data,0x20)
-            calldataLength := mload(_data)
-        }
- 
-        bool success;
-        assembly {
-            gasBefore := gas()
-            success := call(gas(), _target, 0, calldataStart, calldataLength, 0, 0)
-            gasAfter := gas()
-        }
-        Erequire(success, "Call failed, but calls we want to measure gas for should succeed!");
- 
-        return gasBefore - gasAfter;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-helpers/Helper_ModifiableStorage.sol.html b/coverage/lcov-report/test-helpers/Helper_ModifiableStorage.sol.html deleted file mode 100644 index f0c0291b2..000000000 --- a/coverage/lcov-report/test-helpers/Helper_ModifiableStorage.sol.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_ModifiableStorage.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_ModifiableStorage.sol -

-
-
- 0% - Statements - 0/5 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/4 -
-
- 0% - Lines - 0/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-contract Helper_ModifiableStorage {
-    mapping (address => address) private target;
- 
-    constructor(
-        address _target
-    )
-    {
-        target[address(this)] = _target;
-    }
- 
-    fallback()
-        external
-    {
-        (bool success, bytes memory returndata) = target[address(this)].delegatecall(msg.data);
- 
-        if (success) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
- 
-    function __setStorageSlot(
-        bytes32 _key,
-        bytes32 _value
-    )
-        public
-    {
-        assembly {
-            sstore(_key, _value)
-        }
-    }
- 
-    function __getStorageSlot(
-        bytes32 _key
-    )
-        public
-        view
-        returns (
-            bytes32 _value
-        )
-    {
-        bytes32 value;
-        assembly {
-            value := sload(_key)
-        }
-        return value;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-helpers/Helper_PrecompileCaller.sol.html b/coverage/lcov-report/test-helpers/Helper_PrecompileCaller.sol.html deleted file mode 100644 index 1c17c6868..000000000 --- a/coverage/lcov-report/test-helpers/Helper_PrecompileCaller.sol.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_PrecompileCaller.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_PrecompileCaller.sol -

-
-
- 75% - Statements - 9/12 -
-
- 50% - Branches - 3/6 -
-
- 100% - Functions - 3/3 -
-
- 75% - Lines - 9/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54  -  -  -  -  -  -  -  -  -  -  -  -54× -54× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-import { Helper_SimpleProxy } from "./Helper_SimpleProxy.sol";
- 
-contract Helper_PredeployCaller is Helper_SimpleProxy {
-    function callPredeploy(
-        address _predeploy,
-        bytes memory _data
-    )
-        public
-    {
-        Eif (msg.sender == owner) {
-            makeExternalCall(_predeploy, _data);
-        } else {
-            makeExternalCall(target, msg.data);
-        }
-    }
- 
-    function callPredeployAbi(
-        address _predeploy,
-        bytes memory _data
-    )
-        public
-        returns (
-            bytes memory
-        )
-    {
- 
-        bool success;
-        bytes memory returndata;
-        Eif (msg.sender == owner) {
-            (success, returndata) = _predeploy.call(_data);
-        } else {
-            (success, returndata) = target.call(msg.data);
-        }
-        Erequire(success, "Predeploy call reverted");
-        return returndata;
-    }
- 
-    function getL1MessageSender(
-        address _predeploy,
-        bytes memory _data
-    )
-        public
-        returns (
-            address
-        )
-    {
-        callPredeploy(_predeploy, _data);
-        return address(0); // unused: silence compiler
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-helpers/Helper_SimpleProxy.sol.html b/coverage/lcov-report/test-helpers/Helper_SimpleProxy.sol.html deleted file mode 100644 index 431c71e0b..000000000 --- a/coverage/lcov-report/test-helpers/Helper_SimpleProxy.sol.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_SimpleProxy.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_SimpleProxy.sol -

-
-
- 85.71% - Statements - 6/7 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 4/4 -
-
- 88.89% - Lines - 8/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50  -  -  -  -  -  -  -  -  -69× -  -  -  -  -  -271× -  -  -  -  -  -  -  -23× -23× -  -  -  -  -  -  -  -  -  -  -  -325× -  -325× -321× -  -  -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-contract Helper_SimpleProxy {
-    address internal owner;
-    address internal target;
- 
-    constructor()
-    {
-        owner = msg.sender;
-    }
- 
-    fallback()
-        external
-    {
-        makeExternalCall(target, msg.data);
-    }
- 
-    function setTarget(
-        address _target
-    )
-        public
-    {
-        Eif (msg.sender == owner) {
-            target = _target;
-        } else {
-            makeExternalCall(target, msg.data);
-        }
-    }
- 
-    function makeExternalCall(
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-    {
-        (bool success, bytes memory returndata) = _target.call(_calldata);
- 
-        if (success) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-helpers/Helper_TestRunner.sol.html b/coverage/lcov-report/test-helpers/Helper_TestRunner.sol.html deleted file mode 100644 index 4034ff256..000000000 --- a/coverage/lcov-report/test-helpers/Helper_TestRunner.sol.html +++ /dev/null @@ -1,647 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_TestRunner.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_TestRunner.sol -

-
-
- 30.3% - Statements - 20/66 -
-
- 66.67% - Branches - 16/24 -
-
- 80% - Functions - 4/5 -
-
- 33.8% - Lines - 24/71 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -161× -161× -  -  -  -  -  -161× - - -  -  -  -159× - -  -  -  -  -156× -  -156× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -156× - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -156× -17× -  -  -  -  -  -  -  -  -  -  -83× -87× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -  -  -  -  -  -  -14× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -18× -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Logging */
-import { console } from "hardhat/console.sol";
- 
-/**
- * @title Helper_TestRunner
- */
-contract Helper_TestRunner {
-    struct TestStep {
-        string functionName;
-        bytes functionData;
-        bool expectedReturnStatus;
-        bytes expectedReturnData;
-        bool onlyValidateFlag;
-    }
- 
-    function runSingleTestStep(
-        TestStep memory _step
-    )
-        public
-    {
-        bytes32 namehash = keccak256(abi.encodePacked(_step.functionName));
-        Iif (namehash == keccak256("evmRETURN")) {
-            bytes memory functionData = _step.functionData;
-            assembly {
-                return(add(functionData, 0x20), mload(functionData))
-            }
-        }
-        if (namehash == keccak256("evmREVERT")) {
-            bytes memory functionData = _step.functionData;
-            assembly {
-                revert(add(functionData, 0x20), mload(functionData))
-            }
-        }
-        if (namehash == keccak256("evmINVALID")) {
-            assembly {
-                invalid()
-            }
-        }
- 
-        (bool success, bytes memory returndata) = address(msg.sender).call(_step.functionData);
- 
-        Iif (success != _step.expectedReturnStatus) {
-            if (success == true) {
-                console.log("ERROR: Expected function to revert, but function returned successfully");
-                console.log("Offending Step: %s", _step.functionName);
-                console.log("Return Data:");
-                console.logBytes(returndata);
-                console.log("");
-            } else {
-                (
-                    uint256 _flag,
-                    uint256 _nuisanceGasLeft,
-                    uint256 _ovmGasRefund,
-                    bytes memory _data
-                ) = _decodeRevertData(returndata);
- 
-                console.log("ERROR: Expected function to return successfully, but function reverted");
-                console.log("Offending Step: %s", _step.functionName);
-                console.log("Flag: %s", _flag);
-                console.log("Nuisance Gas Left: %s", _nuisanceGasLeft);
-                console.log("OVM Gas Refund: %s", _ovmGasRefund);
-                console.log("Extra Data:");
-                console.logBytes(_data);
-                console.log("");
-            }
- 
-            _failStep();
-        }
- 
-        if (keccak256(returndata) != keccak256(_step.expectedReturnData)) {
-            Iif (success == true) {
-                console.log("ERROR: Actual return data does not match expected return data");
-                console.log("Offending Step: %s", _step.functionName);
-                console.log("Expected:");
-                console.logBytes(_step.expectedReturnData);
-                console.log("Actual:");
-                console.logBytes(returndata);
-                console.log("");
- 
-                _failStep();
-            } else {
-                (
-                    uint256 _expectedFlag,
-                    uint256 _expectedNuisanceGasLeft,
-                    uint256 _expectedOvmGasRefund,
-                    bytes memory _expectedData
-                ) = _decodeRevertData(_step.expectedReturnData);
- 
-                (
-                    uint256 _flag,
-                    uint256 _nuisanceGasLeft,
-                    uint256 _ovmGasRefund,
-                    bytes memory _data
-                ) = _decodeRevertData(returndata);
- 
-                Eif (
-                    _step.onlyValidateFlag
-                ) {
-                    Iif (
-                        _expectedFlag != _flag
-                    ) {
-                        console.log("ERROR: Actual revert flag does not match expected revert flag data");
-                        console.log("Offending Step: %s", _step.functionName);
-                        console.log("Expected Flag: %s", _expectedFlag);
-                        console.log("Actual Flag: %s", _flag);
-                        _failStep();
-                    }
-                } else {
-                    console.log("ERROR: Actual revert flag data does not match expected revert flag data");
-                    console.log("Offending Step: %s", _step.functionName);
-                    console.log("Expected Flag: %s", _expectedFlag);
-                    console.log("Actual Flag: %s", _flag);
-                    console.log("Expected Nuisance Gas Left: %s", _expectedNuisanceGasLeft);
-                    console.log("Actual Nuisance Gas Left: %s", _nuisanceGasLeft);
-                    console.log("Expected OVM Gas Refund: %s", _expectedOvmGasRefund);
-                    console.log("Actual OVM Gas Refund: %s", _ovmGasRefund);
-                    console.log("Expected Extra Data:");
-                    console.logBytes(_expectedData);
-                    console.log("Actual Extra Data:");
-                    console.logBytes(_data);
-                    console.log("");
-                    _failStep();
-                }
-            }
-        }
- 
-        if (success == false) {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
- 
-    function runMultipleTestSteps(
-        TestStep[] memory _steps
-    )
-        public
-    {
-        for (uint256 i = 0; i < _steps.length; i++) {
-            runSingleTestStep(_steps[i]);
-        }
-    }
- 
-    function _decodeRevertData(
-        bytes memory _revertdata
-    )
-        internal
-        pure
-        returns (
-            uint256 _flag,
-            uint256 _nuisanceGasLeft,
-            uint256 _ovmGasRefund,
-            bytes memory _data
-        )
-    {
-        Iif (_revertdata.length == 0) {
-            return (
-                0,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        return abi.decode(_revertdata, (uint256, uint256, uint256, bytes));
-    }
- 
-    function _failStep()
-        internal
-        pure
-    {
-        revert("Test step failed.");
-    }
-}
- 
-contract Helper_TestRunner_CREATE is Helper_TestRunner {
-    constructor(
-        bytes memory _bytecode,
-        TestStep[] memory _steps
-    )
-    {
-        if (_steps.length > 0) {
-            runMultipleTestSteps(_steps);
-        } else {
-            assembly {
-                return(add(_bytecode, 0x20), mload(_bytecode))
-            }
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-helpers/Mock_FraudVerifier.sol.html b/coverage/lcov-report/test-helpers/Mock_FraudVerifier.sol.html deleted file mode 100644 index 414282eb3..000000000 --- a/coverage/lcov-report/test-helpers/Mock_FraudVerifier.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for test-helpers/Mock_FraudVerifier.sol - - - - - - - -
-
-

- all files / test-helpers/ Mock_FraudVerifier.sol -

-
-
- 100% - Statements - 4/4 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -46× -  -  -  -12× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-import { OVM_BondManager } from "./../optimistic-ethereum/OVM/verification/OVM_BondManager.sol";
- 
-contract Mock_FraudVerifier {
-    OVM_BondManager bondManager;
- 
-    mapping (bytes32 => address) transitioners;
- 
-    function setBondManager(OVM_BondManager _bondManager) public {
-        bondManager = _bondManager;
-    }
- 
-    function setStateTransitioner(bytes32 preStateRoot, bytes32 txHash, address addr) public {
-        transitioners[keccak256(abi.encodePacked(preStateRoot, txHash))] = addr;
-    }
- 
-    function getStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        public
-        view
-        returns (
-            address
-        )
-    {
-        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
-    }
- 
-    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) public {
-        bondManager.finalize(_preStateRoot, publisher, timestamp);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-helpers/TestERC20.sol.html b/coverage/lcov-report/test-helpers/TestERC20.sol.html deleted file mode 100644 index 8aac61ec3..000000000 --- a/coverage/lcov-report/test-helpers/TestERC20.sol.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - Code coverage report for test-helpers/TestERC20.sol - - - - - - - -
-
-

- all files / test-helpers/ TestERC20.sol -

-
-
- 89.47% - Statements - 17/19 -
-
- 37.5% - Branches - 3/8 -
-
- 90% - Functions - 9/10 -
-
- 89.47% - Lines - 17/19 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -21× -21× -  -  -  -18× -18× -  -  -  -25× -25× -25× -  -  -  -18× -18× -  -  -  - - -  -  -  -18× -  -  -18× -18× -  -  -  -  -  -67× -  -  -  -25× -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-// a test ERC20 token with an open mint function
-contract TestERC20 {
-    using SafeMath for uint;
- 
-    string public constant name = 'Test';
-    string public constant symbol = 'TST';
-    uint8 public constant decimals = 18;
-    uint256  public totalSupply;
-    mapping(address => uint) public balanceOf;
-    mapping(address => mapping(address => uint)) public allowance;
- 
-    event Approval(address indexed owner, address indexed spender, uint256 value);
-    event Transfer(address indexed from, address indexed to, uint256 value);
- 
-    constructor() {}
- 
-    function mint(address to, uint256 value) public {
-        totalSupply = totalSupply.add(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(address(0), to, value);
-    }
- 
-    function _approve(address owner, address spender, uint256 value) private {
-        allowance[owner][spender] = value;
-        emit Approval(owner, spender, value);
-    }
- 
-    function _transfer(address from, address to, uint256 value) private {
-        balanceOf[from] = balanceOf[from].sub(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(from, to, value);
-    }
- 
-    function approve(address spender, uint256 value) external returns (bool) {
-        _approve(msg.sender, spender, value);
-        return true;
-    }
- 
-    function transfer(address to, uint256 value) external returns (bool) {
-        _transfer(msg.sender, to, value);
-        return true;
-    }
- 
-    function transferFrom(address from, address to, uint256 value) external returns (bool) {
-        Iif (allowance[from][msg.sender] != uint(-1)) {
-            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
-        }
-        _transfer(from, to, value);
-        return true;
-    }
-}
- 
-library SafeMath {
-    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
-        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
-    }
- 
-    function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
-        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
-    }
- 
-    function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
-        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-helpers/index.html b/coverage/lcov-report/test-helpers/index.html deleted file mode 100644 index d957a052c..000000000 --- a/coverage/lcov-report/test-helpers/index.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - Code coverage report for test-helpers/ - - - - - - - -
-
-

- all files test-helpers/ -

-
-
- 52.5% - Statements - 63/120 -
-
- 56.52% - Branches - 26/46 -
-
- 80.65% - Functions - 25/31 -
-
- 53.38% - Lines - 71/133 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Helper_GasMeasurer.sol
100%7/750%1/2100%1/1100%9/9
Helper_ModifiableStorage.sol
0%0/50%0/20%0/40%0/9
Helper_PrecompileCaller.sol
75%9/1250%3/6100%3/375%9/12
Helper_SimpleProxy.sol
85.71%6/775%3/4100%4/488.89%8/9
Helper_TestRunner.sol
30.3%20/6666.67%16/2480%4/533.8%24/71
Mock_FraudVerifier.sol
100%4/4100%0/0100%4/4100%4/4
TestERC20.sol
89.47%17/1937.5%3/890%9/1089.47%17/19
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/codec/TestLib_OVMCodec.sol.html b/coverage/lcov-report/test-libraries/codec/TestLib_OVMCodec.sol.html deleted file mode 100644 index 3c1930eb7..000000000 --- a/coverage/lcov-report/test-libraries/codec/TestLib_OVMCodec.sol.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - Code coverage report for test-libraries/codec/TestLib_OVMCodec.sol - - - - - - - -
-
-

- all files / test-libraries/codec/ TestLib_OVMCodec.sol -

-
-
- 0% - Statements - 0/4 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/4 -
-
- 0% - Lines - 0/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title TestLib_OVMCodec
- */
-contract TestLib_OVMCodec {
- 
-    function decodeEIP155Transaction(
-        bytes memory _transaction,
-        bool _isEthSignedMessage
-    )
-        public
-        pure
-        returns (
-            Lib_OVMCodec.EIP155Transaction memory _decoded
-        )
-    {
-        return Lib_OVMCodec.decodeEIP155Transaction(_transaction, _isEthSignedMessage);
-    }
- 
-    function encodeTransaction(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        public
-        pure
-        returns (
-            bytes memory _encoded
-        )
-    {
-        return Lib_OVMCodec.encodeTransaction(_transaction);
-    }
- 
-    function hashTransaction(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        public
-        pure
-        returns (
-            bytes32 _hash
-        )
-    {
-        return Lib_OVMCodec.hashTransaction(_transaction);
-    }
- 
-    function decompressEIP155Transaction(
-        bytes memory _transaction
-    )
-        public
-        returns (
-            Lib_OVMCodec.EIP155Transaction memory _decompressed
-        )
-    {
-        return Lib_OVMCodec.decompressEIP155Transaction(_transaction);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/codec/index.html b/coverage/lcov-report/test-libraries/codec/index.html deleted file mode 100644 index 513c5a78e..000000000 --- a/coverage/lcov-report/test-libraries/codec/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for test-libraries/codec/ - - - - - - - -
-
-

- all files test-libraries/codec/ -

-
-
- 0% - Statements - 0/4 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/4 -
-
- 0% - Lines - 0/4 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
TestLib_OVMCodec.sol
0%0/4100%0/00%0/40%0/4
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/rlp/TestLib_RLPReader.sol.html b/coverage/lcov-report/test-libraries/rlp/TestLib_RLPReader.sol.html deleted file mode 100644 index 946105c3c..000000000 --- a/coverage/lcov-report/test-libraries/rlp/TestLib_RLPReader.sol.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - Code coverage report for test-libraries/rlp/TestLib_RLPReader.sol - - - - - - - -
-
-

- all files / test-libraries/rlp/ TestLib_RLPReader.sol -

-
-
- 90.91% - Statements - 10/11 -
-
- 100% - Branches - 0/0 -
-
- 85.71% - Functions - 6/7 -
-
- 90.91% - Lines - 10/11 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -62× -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPReader } from "../../optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol";
- 
-/**
- * @title TestLib_RLPReader
- */
-contract TestLib_RLPReader {
- 
-    function readList(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bytes[] memory
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_in);
-        bytes[] memory out = new bytes[](decoded.length);
-        for (uint256 i = 0; i < out.length; i++) {
-            out[i] = Lib_RLPReader.readRawBytes(decoded[i]);
-        }
-        return out;
-    }
- 
-    function readString(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            string memory
-        )
-    {
-        return Lib_RLPReader.readString(_in);
-    }
- 
-    function readBytes(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return Lib_RLPReader.readBytes(_in);
-    }
- 
-    function readBytes32(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_RLPReader.readBytes32(_in);
-    }
- 
-    function readUint256(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            uint256
-        )
-    {
-        return Lib_RLPReader.readUint256(_in);
-    }
- 
-    function readBool(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_RLPReader.readBool(_in);
-    }
- 
-    function readAddress(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            address
-        )
-    {
-        return Lib_RLPReader.readAddress(_in);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/rlp/TestLib_RLPWriter.sol.html b/coverage/lcov-report/test-libraries/rlp/TestLib_RLPWriter.sol.html deleted file mode 100644 index 1a3ca073f..000000000 --- a/coverage/lcov-report/test-libraries/rlp/TestLib_RLPWriter.sol.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - Code coverage report for test-libraries/rlp/TestLib_RLPWriter.sol - - - - - - - -
-
-

- all files / test-libraries/rlp/ TestLib_RLPWriter.sol -

-
-
- 62.5% - Statements - 5/8 -
-
- 100% - Branches - 0/0 -
-
- 57.14% - Functions - 4/7 -
-
- 62.5% - Lines - 5/8 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -61× -  -  -  -  -  -  -  -  -  -  -  -139× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPWriter } from "../../optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol";
-import { TestERC20 } from "../../test-helpers/TestERC20.sol";
- 
-/**
- * @title TestLib_RLPWriter
- */
-contract TestLib_RLPWriter {
- 
-    function writeBytes(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeBytes(_in);
-    }
- 
-    function writeList(
-        bytes[] memory _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeList(_in);
-    }
- 
-    function writeString(
-        string memory _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeString(_in);
-    }
- 
-    function writeAddress(
-        address _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeAddress(_in);
-    }
- 
-    function writeUint(
-        uint256 _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeUint(_in);
-    }
- 
-    function writeBool(
-        bool _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeBool(_in);
-    }
- 
-    function writeAddressWithTaintedMemory(
-        address _in
-    )
-        public
-        returns (
-            bytes memory _out
-        )
-    {
-        new TestERC20();
-        return Lib_RLPWriter.writeAddress(_in);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/rlp/index.html b/coverage/lcov-report/test-libraries/rlp/index.html deleted file mode 100644 index 23f40f43d..000000000 --- a/coverage/lcov-report/test-libraries/rlp/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for test-libraries/rlp/ - - - - - - - -
-
-

- all files test-libraries/rlp/ -

-
-
- 78.95% - Statements - 15/19 -
-
- 100% - Branches - 0/0 -
-
- 71.43% - Functions - 10/14 -
-
- 78.95% - Lines - 15/19 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
TestLib_RLPReader.sol
90.91%10/11100%0/085.71%6/790.91%10/11
TestLib_RLPWriter.sol
62.5%5/8100%0/057.14%4/762.5%5/8
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/trie/TestLib_MerkleTrie.sol.html b/coverage/lcov-report/test-libraries/trie/TestLib_MerkleTrie.sol.html deleted file mode 100644 index 5ba93e048..000000000 --- a/coverage/lcov-report/test-libraries/trie/TestLib_MerkleTrie.sol.html +++ /dev/null @@ -1,377 +0,0 @@ - - - - Code coverage report for test-libraries/trie/TestLib_MerkleTrie.sol - - - - - - - -
-
-

- all files / test-libraries/trie/ TestLib_MerkleTrie.sol -

-
-
- 60% - Statements - 3/5 -
-
- 100% - Branches - 0/0 -
-
- 60% - Functions - 3/5 -
-
- 60% - Lines - 3/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -32× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_MerkleTrie } from "../../optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol";
- 
-/**
- * @title TestLib_MerkleTrie
- */
-contract TestLib_MerkleTrie {
- 
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_MerkleTrie.verifyInclusionProof(
-            _key,
-            _value,
-            _proof,
-            _root
-        );
-    }
- 
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_MerkleTrie.verifyExclusionProof(
-            _key,
-            _proof,
-            _root
-        );
-    }
- 
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_MerkleTrie.update(
-            _key,
-            _value,
-            _proof,
-            _root
-        );
-    }
- 
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        return Lib_MerkleTrie.get(
-            _key,
-            _proof,
-            _root
-        );
-    }
- 
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_MerkleTrie.getSingleNodeRootHash(
-            _key,
-            _value
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html b/coverage/lcov-report/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html deleted file mode 100644 index 1735f3dbc..000000000 --- a/coverage/lcov-report/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - Code coverage report for test-libraries/trie/TestLib_SecureMerkleTrie.sol - - - - - - - -
-
-

- all files / test-libraries/trie/ TestLib_SecureMerkleTrie.sol -

-
-
- 60% - Statements - 3/5 -
-
- 100% - Branches - 0/0 -
-
- 60% - Functions - 3/5 -
-
- 60% - Lines - 3/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_SecureMerkleTrie } from "../../optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol";
- 
-/**
- * @title TestLib_SecureMerkleTrie
- */
-contract TestLib_SecureMerkleTrie {
- 
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_SecureMerkleTrie.verifyInclusionProof(
-            _key,
-            _value,
-            _proof,
-            _root
-        );
-    }
- 
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_SecureMerkleTrie.verifyExclusionProof(
-            _key,
-            _proof,
-            _root
-        );
-    }
- 
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_SecureMerkleTrie.update(
-            _key,
-            _value,
-            _proof,
-            _root
-        );
-    }
- 
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        return Lib_SecureMerkleTrie.get(
-            _key,
-            _proof,
-            _root
-        );
-    }
- 
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_SecureMerkleTrie.getSingleNodeRootHash(
-            _key,
-            _value
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/trie/index.html b/coverage/lcov-report/test-libraries/trie/index.html deleted file mode 100644 index 156eb46c8..000000000 --- a/coverage/lcov-report/test-libraries/trie/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for test-libraries/trie/ - - - - - - - -
-
-

- all files test-libraries/trie/ -

-
-
- 60% - Statements - 6/10 -
-
- 100% - Branches - 0/0 -
-
- 60% - Functions - 6/10 -
-
- 60% - Lines - 6/10 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
TestLib_MerkleTrie.sol
60%3/5100%0/060%3/560%3/5
TestLib_SecureMerkleTrie.sol
60%3/5100%0/060%3/560%3/5
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_Bytes32Utils.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_Bytes32Utils.sol.html deleted file mode 100644 index d74a5946d..000000000 --- a/coverage/lcov-report/test-libraries/utils/TestLib_Bytes32Utils.sol.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_Bytes32Utils.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_Bytes32Utils.sol -

-
-
- 100% - Statements - 4/4 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol";
- 
-/**
- * @title TestLib_Byte32Utils
- */
-contract TestLib_Bytes32Utils {
- 
-    function toBool(
-        bytes32 _in
-    )
-        public
-        pure
-        returns (
-            bool _out
-        )
-    {
-        return Lib_Bytes32Utils.toBool(_in);
-    }
- 
-    function fromBool(
-        bool _in
-    )
-        public
-        pure
-        returns (
-            bytes32 _out
-        )
-    {
-        return Lib_Bytes32Utils.fromBool(_in);
-    }
- 
-    function toAddress(
-        bytes32 _in
-    )
-        public
-        pure
-        returns (
-            address _out
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(_in);
-    }
- 
-    function fromAddress(
-        address _in
-    )
-        public
-        pure
-        returns (
-            bytes32 _out
-        )
-    {
-        return Lib_Bytes32Utils.fromAddress(_in);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_BytesUtils.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_BytesUtils.sol.html deleted file mode 100644 index 1da9a7b70..000000000 --- a/coverage/lcov-report/test-libraries/utils/TestLib_BytesUtils.sol.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_BytesUtils.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_BytesUtils.sol -

-
-
- 88.89% - Statements - 8/9 -
-
- 100% - Branches - 0/0 -
-
- 87.5% - Functions - 7/8 -
-
- 88.89% - Lines - 8/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../../optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol";
-import { TestERC20 } from "../../test-helpers/TestERC20.sol";
- 
-/**
- * @title TestLib_BytesUtils
- */
-contract TestLib_BytesUtils {
- 
-    function concat(
-        bytes memory _preBytes,
-        bytes memory _postBytes
-    )
-        public
-        pure
-        returns (bytes memory)
-    {
-        return abi.encodePacked(
-            _preBytes,
-            _postBytes
-        );
-    }
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start,
-        uint256 _length
-    )
-        public
-        pure
-        returns (bytes memory)
-    {
-        return Lib_BytesUtils.slice(
-            _bytes,
-            _start,
-            _length
-        );
-    }
- 
-    function toBytes32(
-        bytes memory _bytes
-    )
-        public
-        pure
-        returns (bytes32)
-    {
-        return Lib_BytesUtils.toBytes32(
-            _bytes
-        );
-    }
- 
-    function toUint256(
-        bytes memory _bytes
-    )
-        public
-        pure
-        returns (uint256)
-    {
-        return Lib_BytesUtils.toUint256(
-            _bytes
-        );
-    }
- 
-    function toNibbles(
-        bytes memory _bytes
-    )
-        public
-        pure
-        returns (bytes memory)
-    {
-        return Lib_BytesUtils.toNibbles(
-            _bytes
-        );
-    }
- 
-    function fromNibbles(
-        bytes memory _bytes
-    )
-        public
-        pure
-        returns (bytes memory)
-    {
-        return Lib_BytesUtils.fromNibbles(
-            _bytes
-        );
-    }
- 
-    function equal(
-        bytes memory _bytes,
-        bytes memory _other
-    )
-        public
-        pure
-        returns (bool)
-    {
-        return Lib_BytesUtils.equal(
-            _bytes,
-            _other
-        );
-    }
- 
-    function sliceWithTaintedMemory(
-        bytes memory _bytes,
-        uint256 _start,
-        uint256 _length
-    )
-        public
-        returns (bytes memory)
-    {
-        new TestERC20();
-        return Lib_BytesUtils.slice(
-            _bytes,
-            _start,
-            _length
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_ECDSAUtils.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_ECDSAUtils.sol.html deleted file mode 100644 index 9327fbbb2..000000000 --- a/coverage/lcov-report/test-libraries/utils/TestLib_ECDSAUtils.sol.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_ECDSAUtils.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_ECDSAUtils.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_ECDSAUtils } from "../../optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol";
- 
-/**
- * @title TestLib_ECDSAUtils
- */
-contract TestLib_ECDSAUtils {
- 
-    function recover(
-        bytes memory _message,
-        bool _isEthSignedMessage,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        public
-        pure
-        returns (
-            address _sender
-        )
-    {
-        return Lib_ECDSAUtils.recover(
-            _message,
-            _isEthSignedMessage,
-            _v,
-            _r,
-            _s
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_EthUtils.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_EthUtils.sol.html deleted file mode 100644 index 2bf8a5405..000000000 --- a/coverage/lcov-report/test-libraries/utils/TestLib_EthUtils.sol.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_EthUtils.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_EthUtils.sol -

-
-
- 14.29% - Statements - 1/7 -
-
- 100% - Branches - 0/0 -
-
- 14.29% - Functions - 1/7 -
-
- 14.29% - Lines - 1/7 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_EthUtils } from "../../optimistic-ethereum/libraries/utils/Lib_EthUtils.sol";
- 
-/**
- * @title TestLib_EthUtils
- */
-contract TestLib_EthUtils {
- 
-    function getCode(
-        address _address,
-        uint256 _offset,
-        uint256 _length
-    )
-        public
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        return Lib_EthUtils.getCode(
-            _address,
-            _offset,
-            _length
-        );
-    }
- 
-    function getCode(
-        address _address
-    )
-        public
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        return Lib_EthUtils.getCode(
-            _address
-        );
-    }
- 
-    function getCodeSize(
-        address _address
-    )
-        public
-        view
-        returns (
-            uint256 _codeSize
-        )
-    {
-        return Lib_EthUtils.getCodeSize(
-            _address
-        );
-    }
- 
-    function getCodeHash(
-        address _address
-    )
-        public
-        view
-        returns (
-            bytes32 _codeHash
-        )
-    {
-        return Lib_EthUtils.getCodeHash(
-            _address
-        );
-    }
- 
-    function createContract(
-        bytes memory _code
-    )
-        public
-        returns (
-            address _created
-        )
-    {
-        return Lib_EthUtils.createContract(
-            _code
-        );
-    }
- 
-    function getAddressForCREATE(
-        address _creator,
-        uint256 _nonce
-    )
-        public
-        pure
-        returns (
-            address _address
-        )
-    {
-        return Lib_EthUtils.getAddressForCREATE(
-            _creator,
-            _nonce
-        );
-    }
- 
-    function getAddressForCREATE2(
-        address _creator,
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        public
-        pure
-        returns (address _address)
-    {
-        return Lib_EthUtils.getAddressForCREATE2(
-            _creator,
-            _bytecode,
-            _salt
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_MerkleTree.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_MerkleTree.sol.html deleted file mode 100644 index 0e685493b..000000000 --- a/coverage/lcov-report/test-libraries/utils/TestLib_MerkleTree.sol.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_MerkleTree.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_MerkleTree.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -16× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_MerkleTree } from "../../optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol";
- 
-/**
- * @title TestLib_MerkleTree
- */
-contract TestLib_MerkleTree {
- 
-    function getMerkleRoot(
-        bytes32[] memory _elements
-    )
-        public
-       pure 
-        returns (
-            bytes32
-        )
-    {
-        return Lib_MerkleTree.getMerkleRoot(
-            _elements
-        );
-    }
- 
-    function verify(
-        bytes32 _root,
-        bytes32 _leaf,
-        uint256 _index,
-        bytes32[] memory _siblings,
-        uint256 _totalLeaves
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_MerkleTree.verify(
-            _root,
-            _leaf,
-            _index,
-            _siblings,
-            _totalLeaves
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/utils/TestLib_RingBuffer.sol.html b/coverage/lcov-report/test-libraries/utils/TestLib_RingBuffer.sol.html deleted file mode 100644 index a958378e1..000000000 --- a/coverage/lcov-report/test-libraries/utils/TestLib_RingBuffer.sol.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_RingBuffer.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_RingBuffer.sol -

-
-
- 0% - Statements - 0/5 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/5 -
-
- 0% - Lines - 0/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RingBuffer } from "../../optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol";
- 
-/**
- * @title TestLib_RingBuffer
- */
-contract TestLib_RingBuffer {
-    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
-    
-    Lib_RingBuffer.RingBuffer internal buf;
- 
-    function push(
-        bytes32 _value,
-        bytes27 _extraData
-    )
-        public
-    {
-        buf.push(
-            _value,
-            _extraData
-        );
-    }
- 
-    function get(
-        uint256 _index
-    )
-        public
-        view
-        returns (
-            bytes32    
-        )
-    {
-        return buf.get(_index);
-    }
- 
-    function deleteElementsAfterInclusive(
-        uint40 _index,
-        bytes27 _extraData
-    )
-        internal
-    {
-        return buf.deleteElementsAfterInclusive(
-            _index,
-            _extraData
-        );
-    }
- 
-    function getLength()
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        return buf.getLength();
-    }
- 
-    function getExtraData()
-        internal
-        view
-        returns (
-            bytes27
-        )
-    {
-        return buf.getExtraData();
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/test-libraries/utils/index.html b/coverage/lcov-report/test-libraries/utils/index.html deleted file mode 100644 index 9a77798b4..000000000 --- a/coverage/lcov-report/test-libraries/utils/index.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - Code coverage report for test-libraries/utils/ - - - - - - - -
-
-

- all files test-libraries/utils/ -

-
-
- 57.14% - Statements - 16/28 -
-
- 100% - Branches - 0/0 -
-
- 55.56% - Functions - 15/27 -
-
- 57.14% - Lines - 16/28 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
TestLib_Bytes32Utils.sol
100%4/4100%0/0100%4/4100%4/4
TestLib_BytesUtils.sol
88.89%8/9100%0/087.5%7/888.89%8/9
TestLib_ECDSAUtils.sol
100%1/1100%0/0100%1/1100%1/1
TestLib_EthUtils.sol
14.29%1/7100%0/014.29%1/714.29%1/7
TestLib_MerkleTree.sol
100%2/2100%0/0100%2/2100%2/2
TestLib_RingBuffer.sol
0%0/5100%0/00%0/50%0/5
-
-
- - - - - - - diff --git a/coverage/lcov.info b/coverage/lcov.info deleted file mode 100644 index 136ee6d87..000000000 --- a/coverage/lcov.info +++ /dev/null @@ -1,3736 +0,0 @@ -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol -FN:20,constructor -FN:34,onlyFromCrossDomainAccount -FN:58,getCrossDomainMessenger -FN:74,sendCrossDomainMessage -FNF:4 -FNH:4 -FNDA:78,constructor -FNDA:9,onlyFromCrossDomainAccount -FNDA:22,getCrossDomainMessenger -FNDA:7,sendCrossDomainMessage -DA:23,78 -DA:37,9 -DA:42,6 -DA:47,3 -DA:65,22 -DA:79,7 -LF:6 -LH:6 -BRDA:37,1,0,6 -BRDA:37,1,1,3 -BRDA:42,2,0,3 -BRDA:42,2,1,3 -BRF:4 -BRH:4 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol -FN:109,decodeEIP155Transaction -FN:160,decompressEIP155Transaction -FN:185,encodeEIP155Transaction -FN:230,encodeTransaction -FN:255,hashTransaction -FN:272,toEVMAccount -FN:294,encodeEVMAccount -FN:329,decodeEVMAccount -FN:353,hashBatchHeader -FNF:9 -FNH:9 -FNDA:7,decodeEIP155Transaction -FNDA:5,decompressEIP155Transaction -FNDA:5,encodeEIP155Transaction -FNDA:25,encodeTransaction -FNDA:25,hashTransaction -FNDA:1,toEVMAccount -FNDA:1,encodeEVMAccount -FNDA:6,decodeEVMAccount -FNDA:107,hashBatchHeader -DA:119,7 -DA:120,1 -DA:131,1 -DA:141,6 -DA:143,6 -DA:168,5 -DA:195,5 -DA:196,2 -DA:205,3 -DA:207,3 -DA:208,3 -DA:209,3 -DA:210,3 -DA:211,1 -DA:213,2 -DA:215,3 -DA:216,3 -DA:217,3 -DA:218,3 -DA:219,3 -DA:221,3 -DA:239,25 -DA:264,25 -DA:281,1 -DA:303,1 -DA:308,1 -DA:313,1 -DA:318,1 -DA:319,1 -DA:321,1 -DA:338,6 -DA:340,6 -DA:362,107 -LF:33 -LH:33 -BRDA:119,1,0,1 -BRDA:119,1,1,6 -BRDA:195,2,0,2 -BRDA:195,2,1,3 -BRDA:210,3,0,1 -BRDA:210,3,1,2 -BRF:6 -BRH:6 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol -FN:37,setAddress -FN:43,getAddress -FN:58,_getNameHash -FNF:3 -FNH:3 -FNDA:379,setAddress -FNDA:2107,getAddress -FNDA:2486,_getNameHash -DA:39,379 -DA:40,379 -DA:50,2107 -DA:67,2486 -LF:4 -LH:4 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol -FN:26,constructor -FN:37,resolve -FNF:2 -FNH:2 -FNDA:1041,constructor -FNDA:2076,resolve -DA:29,1041 -DA:46,2076 -LF:2 -LH:2 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol -FN:31,constructor -FN:41,onlyOwner -FN:57,renounceOwnership -FN:66,transferOwnership -FNF:4 -FNH:2 -FNDA:120,constructor -FNDA:379,onlyOwner -FNDA:0,renounceOwnership -FNDA:0,transferOwnership -DA:32,120 -DA:33,120 -DA:42,379 -DA:46,379 -DA:59,0 -DA:60,0 -DA:68,0 -DA:73,0 -DA:74,0 -LF:9 -LH:4 -BRDA:42,1,0,379 -BRDA:42,1,1,0 -BRDA:68,2,0,0 -BRDA:68,2,1,0 -BRF:4 -BRH:1 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol -FN:37,constructor -FN:51, -FNF:2 -FNH:2 -FNDA:36,constructor -FNDA:31, -DA:42,36 -DA:43,36 -DA:54,31 -DA:55,31 -DA:60,31 -DA:62,31 -DA:63,22 -DA:67,9 -LF:8 -LH:8 -BRDA:55,1,0,31 -BRDA:55,1,1,0 -BRDA:62,2,0,22 -BRDA:62,2,1,9 -BRF:4 -BRH:3 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol -FN:46,toRLPItem -FN:71,readList -FN:135,readList -FN:154,readBytes -FN:182,readBytes -FN:201,readString -FN:218,readString -FN:237,readBytes32 -FN:281,readBytes32 -FN:300,readUint256 -FN:317,readUint256 -FN:336,readBool -FN:364,readBool -FN:383,readAddress -FN:409,readAddress -FN:428,readRawBytes -FN:452,_decodeLength -FN:557,_copy -FN:609,_copy -FNF:19 -FNH:18 -FNDA:512,toRLPItem -FNDA:450,readList -FNDA:450,readList -FNDA:651,readBytes -FNDA:4,readBytes -FNDA:5,readString -FNDA:5,readString -FNDA:68,readBytes32 -FNDA:0,readBytes32 -FNDA:56,readUint256 -FNDA:8,readUint256 -FNDA:2,readBool -FNDA:2,readBool -FNDA:7,readAddress -FNDA:1,readAddress -FNDA:776,readRawBytes -FNDA:5399,_decodeLength -FNDA:1427,_copy -FNDA:776,_copy -DA:55,512 -DA:56,512 -DA:60,512 -DA:80,450 -DA:86,446 -DA:95,446 -DA:97,446 -DA:98,446 -DA:99,446 -DA:100,4230 -DA:105,4230 -DA:113,4230 -DA:118,4230 -DA:119,4230 -DA:123,446 -DA:127,446 -DA:144,450 -DA:163,651 -DA:169,651 -DA:174,651 -DA:191,4 -DA:210,5 -DA:227,5 -DA:246,68 -DA:251,68 -DA:257,68 -DA:262,68 -DA:263,68 -DA:264,68 -DA:273,68 -DA:290,0 -DA:309,56 -DA:326,8 -DA:345,2 -DA:350,2 -DA:351,2 -DA:352,2 -DA:356,2 -DA:373,2 -DA:392,7 -DA:393,1 -DA:396,6 -DA:401,6 -DA:418,1 -DA:437,776 -DA:463,5399 -DA:468,5395 -DA:469,5395 -DA:470,5395 -DA:474,5395 -DA:477,33 -DA:481,4334 -DA:483,4334 -DA:488,4334 -DA:491,536 -DA:493,536 -DA:498,536 -DA:499,536 -DA:507,536 -DA:512,536 -DA:515,89 -DA:517,89 -DA:522,89 -DA:525,403 -DA:527,403 -DA:532,403 -DA:533,403 -DA:541,403 -DA:546,403 -DA:568,1427 -DA:569,1427 -DA:570,1 -DA:573,1426 -DA:574,1426 -DA:575,1426 -DA:580,1426 -DA:581,2634 -DA:585,2634 -DA:586,2634 -DA:590,1426 -DA:591,1426 -DA:601,1426 -DA:618,776 -LF:83 -LH:82 -BRDA:86,1,0,446 -BRDA:86,1,1,0 -BRDA:100,2,0,4230 -BRDA:100,2,1,0 -BRDA:169,3,0,651 -BRDA:169,3,1,0 -BRDA:246,4,0,68 -BRDA:246,4,1,0 -BRDA:257,5,0,68 -BRDA:257,5,1,0 -BRDA:345,6,0,2 -BRDA:345,6,1,0 -BRDA:392,7,0,1 -BRDA:392,7,1,6 -BRDA:396,8,0,6 -BRDA:396,8,1,0 -BRDA:463,9,0,5395 -BRDA:463,9,1,4 -BRDA:474,10,0,33 -BRDA:474,10,1,5362 -BRDA:478,11,0,4334 -BRDA:478,11,1,1028 -BRDA:483,12,0,4334 -BRDA:483,12,1,0 -BRDA:489,13,0,536 -BRDA:489,13,1,492 -BRDA:493,14,0,536 -BRDA:493,14,1,0 -BRDA:507,15,0,536 -BRDA:507,15,1,0 -BRDA:513,16,0,89 -BRDA:513,16,1,403 -BRDA:517,17,0,89 -BRDA:517,17,1,0 -BRDA:527,18,0,403 -BRDA:527,18,1,0 -BRDA:541,19,0,403 -BRDA:541,19,1,0 -BRDA:569,20,0,1 -BRDA:569,20,1,1426 -BRF:40 -BRH:27 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol -FN:23,writeBytes -FN:48,writeList -FN:66,writeString -FN:83,writeAddress -FN:100,writeUint -FN:117,writeBool -FN:142,_writeLength -FN:181,_toBinary -FN:214,_memcpy -FN:248,_flatten -FNF:10 -FNH:9 -FNDA:324,writeBytes -FNDA:157,writeList -FNDA:139,writeString -FNDA:30,writeAddress -FNDA:52,writeUint -FNDA:0,writeBool -FNDA:465,_writeLength -FNDA:52,_toBinary -FNDA:1030,_memcpy -FNDA:157,_flatten -DA:32,324 -DA:34,324 -DA:35,16 -DA:37,308 -DA:40,324 -DA:57,157 -DA:58,157 -DA:75,139 -DA:92,30 -DA:109,52 -DA:126,0 -DA:127,0 -DA:128,0 -DA:152,465 -DA:154,465 -DA:155,415 -DA:156,415 -DA:158,50 -DA:159,50 -DA:160,50 -DA:161,72 -DA:162,72 -DA:165,50 -DA:166,50 -DA:167,50 -DA:168,72 -DA:172,465 -DA:190,52 -DA:192,52 -DA:193,52 -DA:194,1643 -DA:195,24 -DA:199,52 -DA:200,52 -DA:201,45 -DA:204,52 -DA:222,1030 -DA:223,1030 -DA:224,1030 -DA:226,1030 -DA:227,420 -DA:230,420 -DA:231,420 -DA:234,1030 -DA:235,1030 -DA:257,157 -DA:258,8 -DA:261,149 -DA:262,149 -DA:263,149 -DA:264,1030 -DA:267,149 -DA:268,149 -DA:269,149 -DA:271,149 -DA:272,1030 -DA:274,1030 -DA:275,1030 -DA:277,1030 -DA:278,1030 -DA:281,149 -LF:61 -LH:58 -BRDA:34,1,0,16 -BRDA:34,1,1,308 -BRDA:154,2,0,415 -BRDA:154,2,1,50 -BRDA:194,3,0,24 -BRDA:194,3,1,1619 -BRDA:257,4,0,8 -BRDA:257,4,1,149 -BRF:8 -BRH:8 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol -FNF:0 -FNH:0 -LF:0 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniSafeMath.sol -FN:7,add -FN:11,sub -FN:15,mul -FNF:3 -FNH:2 -FNDA:6,add -FNDA:10,sub -FNDA:0,mul -DA:8,6 -DA:12,10 -DA:16,0 -LF:3 -LH:2 -BRDA:8,1,0,6 -BRDA:8,1,1,0 -BRDA:12,2,0,10 -BRDA:12,2,1,0 -BRDA:16,3,0,0 -BRDA:16,3,1,0 -BRF:6 -BRH:2 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol -FN:22,constructor -FN:44,_mint -FN:50,_burn -FN:56,_approve -FN:61,_transfer -FN:67,approve -FN:72,transfer -FN:77,transferFrom -FN:85,permit -FNF:9 -FNH:8 -FNDA:39,constructor -FNDA:1,_mint -FNDA:2,_burn -FNDA:2,_approve -FNDA:4,_transfer -FNDA:2,approve -FNDA:2,transfer -FNDA:2,transferFrom -FNDA:0,permit -DA:26,39 -DA:27,39 -DA:29,39 -DA:30,39 -DA:33,39 -DA:45,1 -DA:46,1 -DA:47,1 -DA:51,2 -DA:52,2 -DA:53,2 -DA:57,2 -DA:58,2 -DA:62,4 -DA:63,4 -DA:64,4 -DA:68,2 -DA:69,2 -DA:73,2 -DA:74,2 -DA:78,2 -DA:79,2 -DA:81,2 -DA:82,2 -DA:86,0 -DA:87,0 -DA:94,0 -DA:95,0 -DA:96,0 -LF:29 -LH:24 -BRDA:78,1,0,2 -BRDA:78,1,1,0 -BRDA:86,2,0,0 -BRDA:86,2,1,0 -BRDA:95,3,0,0 -BRDA:95,3,1,0 -BRF:6 -BRH:1 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol -FN:73,verifyInclusionProof -FN:105,verifyExclusionProof -FN:134,update -FN:166,get -FN:202,getSingleNodeRootHash -FN:232,_walkNodePath -FN:354,_getNewPath -FN:482,_getUpdatedTrieRoot -FN:546,_parseProof -FN:576,_getNodeID -FN:603,_getNodePath -FN:621,_getNodeKey -FN:638,_getNodeValue -FN:656,_getNodeHash -FN:677,_getNodeType -FN:709,_getSharedNibbleLength -FN:731,_makeNode -FN:753,_makeNode -FN:775,_makeExtensionNode -FN:801,_makeLeafNode -FN:822,_makeEmptyBranchNode -FN:842,_editBranchValue -FN:864,_editBranchIndex -FN:886,_addHexPrefix -FN:908,_removeHexPrefix -FN:934,_joinNodeArrays -FNF:26 -FNH:22 -FNDA:25,verifyInclusionProof -FNDA:0,verifyExclusionProof -FNDA:22,update -FNDA:77,get -FNDA:0,getSingleNodeRootHash -FNDA:95,_walkNodePath -FNDA:22,_getNewPath -FNDA:22,_getUpdatedTrieRoot -FNDA:99,_parseProof -FNDA:148,_getNodeID -FNDA:172,_getNodePath -FNDA:45,_getNodeKey -FNDA:51,_getNodeValue -FNDA:65,_getNodeHash -FNDA:87,_getNodeType -FNDA:82,_getSharedNibbleLength -FNDA:65,_makeNode -FNDA:42,_makeNode -FNDA:1,_makeExtensionNode -FNDA:22,_makeLeafNode -FNDA:0,_makeEmptyBranchNode -FNDA:0,_editBranchValue -FNDA:42,_editBranchIndex -FNDA:23,_addHexPrefix -FNDA:45,_removeHexPrefix -FNDA:22,_joinNodeArrays -DA:85,25 -DA:90,24 -DA:116,0 -DA:120,0 -DA:147,22 -DA:148,0 -DA:151,22 -DA:152,22 -DA:153,22 -DA:155,22 -DA:178,77 -DA:179,73 -DA:181,58 -DA:183,58 -DA:188,58 -DA:190,58 -DA:212,0 -DA:245,95 -DA:246,95 -DA:248,95 -DA:249,95 -DA:250,95 -DA:251,95 -DA:254,95 -DA:255,243 -DA:256,243 -DA:260,243 -DA:262,243 -DA:264,95 -DA:270,148 -DA:276,0 -DA:282,229 -DA:283,147 -DA:285,0 -DA:289,147 -DA:290,147 -DA:291,147 -DA:292,147 -DA:293,147 -DA:296,82 -DA:297,82 -DA:298,82 -DA:299,82 -DA:300,82 -DA:301,82 -DA:303,82 -DA:304,80 -DA:310,73 -DA:314,80 -DA:315,80 -DA:317,1 -DA:320,0 -DA:321,0 -DA:325,1 -DA:326,1 -DA:327,1 -DA:330,1 -DA:333,0 -DA:338,80 -DA:339,80 -DA:366,22 -DA:369,22 -DA:370,22 -DA:376,22 -DA:377,22 -DA:379,22 -DA:382,22 -DA:383,22 -DA:385,0 -DA:388,0 -DA:389,0 -DA:393,0 -DA:394,0 -DA:397,0 -DA:398,0 -DA:402,0 -DA:403,0 -DA:405,0 -DA:408,0 -DA:409,0 -DA:410,0 -DA:413,0 -DA:414,0 -DA:418,0 -DA:420,0 -DA:424,0 -DA:428,0 -DA:430,0 -DA:432,0 -DA:435,0 -DA:436,0 -DA:440,0 -DA:441,0 -DA:446,0 -DA:450,0 -DA:453,0 -DA:455,0 -DA:456,0 -DA:461,0 -DA:463,0 -DA:464,0 -DA:466,0 -DA:467,0 -DA:473,22 -DA:492,22 -DA:495,22 -DA:496,22 -DA:497,22 -DA:500,22 -DA:502,65 -DA:503,65 -DA:505,65 -DA:508,22 -DA:509,22 -DA:512,1 -DA:513,1 -DA:517,1 -DA:519,1 -DA:524,42 -DA:526,42 -DA:527,42 -DA:528,42 -DA:533,65 -DA:538,22 -DA:555,99 -DA:556,95 -DA:558,95 -DA:559,265 -DA:560,265 -DA:566,95 -DA:585,148 -DA:587,148 -DA:589,0 -DA:592,148 -DA:595,148 -DA:612,172 -DA:630,45 -DA:647,51 -DA:665,65 -DA:666,0 -DA:668,65 -DA:686,87 -DA:687,42 -DA:689,45 -DA:690,45 -DA:692,45 -DA:693,44 -DA:695,1 -DA:699,0 -DA:719,82 -DA:720,82 -DA:721,4991 -DA:723,82 -DA:740,65 -DA:742,65 -DA:762,42 -DA:763,42 -DA:764,714 -DA:766,42 -DA:785,1 -DA:786,1 -DA:787,1 -DA:788,1 -DA:789,1 -DA:811,22 -DA:812,22 -DA:813,22 -DA:814,22 -DA:815,22 -DA:829,0 -DA:830,0 -DA:831,0 -DA:833,0 -DA:852,0 -DA:853,0 -DA:854,0 -DA:875,42 -DA:876,42 -DA:877,42 -DA:896,23 -DA:897,23 -DA:898,23 -DA:899,23 -DA:900,23 -DA:917,45 -DA:918,26 -DA:920,19 -DA:946,22 -DA:949,22 -DA:950,43 -DA:954,22 -DA:955,22 -DA:958,22 -LF:193 -LH:139 -BRDA:147,1,0,0 -BRDA:147,1,1,22 -BRDA:183,2,0,58 -BRDA:183,2,1,0 -BRDA:262,3,0,95 -BRDA:262,3,1,148 -BRDA:264,4,0,88 -BRDA:264,4,1,7 -BRDA:268,5,0,148 -BRDA:268,5,1,0 -BRDA:270,6,0,141 -BRDA:270,6,1,7 -BRDA:276,7,0,0 -BRDA:276,7,1,0 -BRDA:282,8,0,147 -BRDA:282,8,1,82 -BRDA:283,9,0,0 -BRDA:283,9,1,147 -BRDA:295,10,0,82 -BRDA:295,10,1,0 -BRDA:303,11,0,80 -BRDA:303,11,1,2 -BRDA:304,12,0,73 -BRDA:304,12,1,7 -BRDA:316,13,0,1 -BRDA:316,13,1,1 -BRDA:317,14,0,0 -BRDA:317,14,1,1 -BRDA:379,15,0,22 -BRDA:379,15,1,0 -BRDA:384,16,0,0 -BRDA:384,16,1,0 -BRDA:385,17,0,0 -BRDA:385,17,1,0 -BRDA:405,18,0,0 -BRDA:405,18,1,0 -BRDA:420,19,0,0 -BRDA:420,19,1,0 -BRDA:432,20,0,0 -BRDA:432,20,1,0 -BRDA:437,21,0,0 -BRDA:437,21,1,0 -BRDA:450,22,0,0 -BRDA:450,22,1,0 -BRDA:505,23,0,22 -BRDA:505,23,1,43 -BRDA:510,24,0,1 -BRDA:510,24,1,42 -BRDA:517,25,0,1 -BRDA:517,25,1,0 -BRDA:521,26,0,42 -BRDA:521,26,1,0 -BRDA:524,27,0,42 -BRDA:524,27,1,0 -BRDA:587,28,0,0 -BRDA:587,28,1,148 -BRDA:665,29,0,0 -BRDA:665,29,1,65 -BRDA:686,30,0,42 -BRDA:686,30,1,45 -BRDA:688,31,0,45 -BRDA:688,31,1,0 -BRDA:692,32,0,44 -BRDA:692,32,1,1 -BRDA:694,33,0,1 -BRDA:694,33,1,0 -BRDA:917,34,0,26 -BRDA:917,34,1,19 -BRF:68 -BRH:38 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol -FN:29,verifyInclusionProof -FN:55,verifyExclusionProof -FN:81,update -FN:105,get -FN:127,getSingleNodeRootHash -FN:151,_getSecureKey -FNF:6 -FNH:4 -FNDA:15,verifyInclusionProof -FNDA:0,verifyExclusionProof -FNDA:12,update -FNDA:20,get -FNDA:0,getSingleNodeRootHash -FNDA:47,_getSecureKey -DA:41,15 -DA:42,15 -DA:66,0 -DA:67,0 -DA:93,12 -DA:94,12 -DA:117,20 -DA:118,20 -DA:137,0 -DA:138,0 -DA:160,47 -LF:11 -LH:7 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol -FN:18,toBool -FN:35,fromBool -FN:52,toAddress -FN:69,fromAddress -FN:86,removeLeadingZeros -FNF:5 -FNH:5 -FNDA:40,toBool -FNDA:2,fromBool -FNDA:31,toAddress -FNDA:19,fromAddress -FNDA:3,removeLeadingZeros -DA:27,40 -DA:44,2 -DA:61,31 -DA:78,19 -DA:95,3 -DA:97,3 -DA:115,3 -LF:7 -LH:7 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol -FN:13,slice -FN:84,slice -FN:99,toBytes32PadLeft -FN:114,toBytes32 -FN:132,toUint256 -FN:142,toUint24 -FN:154,toUint8 -FN:166,toAddress -FN:178,toNibbles -FN:195,fromNibbles -FN:211,equal -FNF:11 -FNH:11 -FNDA:311,slice -FNDA:299,slice -FNDA:1,toBytes32PadLeft -FNDA:164,toBytes32 -FNDA:3,toUint256 -FNDA:15,toUint24 -FNDA:12,toUint8 -FNDA:5,toAddress -FNDA:292,toNibbles -FNDA:26,fromNibbles -FNDA:26,equal -DA:22,311 -DA:23,311 -DA:24,311 -DA:26,308 -DA:28,308 -DA:81,308 -DA:92,299 -DA:93,73 -DA:96,226 -DA:106,1 -DA:107,1 -DA:108,1 -DA:111,1 -DA:121,164 -DA:122,2 -DA:123,2 -DA:126,2 -DA:129,162 -DA:139,3 -DA:143,15 -DA:144,15 -DA:145,15 -DA:147,15 -DA:151,15 -DA:155,12 -DA:156,12 -DA:157,12 -DA:159,12 -DA:163,12 -DA:167,5 -DA:168,5 -DA:169,5 -DA:171,5 -DA:175,5 -DA:185,292 -DA:187,292 -DA:188,9144 -DA:189,9144 -DA:192,292 -DA:202,26 -DA:204,26 -DA:205,708 -DA:208,26 -DA:219,26 -LF:44 -LH:44 -BRDA:22,1,0,311 -BRDA:22,1,1,0 -BRDA:23,2,0,311 -BRDA:23,2,1,0 -BRDA:24,3,0,308 -BRDA:24,3,1,3 -BRDA:92,4,0,73 -BRDA:92,4,1,226 -BRDA:121,5,0,2 -BRDA:121,5,1,162 -BRDA:143,6,0,15 -BRDA:143,6,1,0 -BRDA:144,7,0,15 -BRDA:144,7,1,0 -BRDA:155,8,0,12 -BRDA:155,8,1,0 -BRDA:156,9,0,12 -BRDA:156,9,1,0 -BRDA:167,10,0,5 -BRDA:167,10,1,0 -BRDA:168,11,0,5 -BRDA:168,11,1,0 -BRF:22 -BRH:14 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol -FN:22,recover -FN:45,getMessageHash -FN:68,getNativeMessageHash -FN:85,getEthSignedMessageHash -FNF:4 -FNH:4 -FNDA:22,recover -FNDA:24,getMessageHash -FNDA:15,getNativeMessageHash -FNDA:9,getEthSignedMessageHash -DA:35,22 -DA:37,22 -DA:52,24 -DA:53,9 -DA:55,15 -DA:77,15 -DA:94,9 -DA:95,9 -DA:96,9 -LF:9 -LH:9 -BRDA:52,1,0,9 -BRDA:52,1,1,15 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol -FN:21,encodeRevertString -FNF:1 -FNH:1 -FNDA:10,encodeRevertString -DA:30,10 -LF:1 -LH:1 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol -FN:26,getCode -FN:52,getCode -FN:73,getCodeSize -FN:94,getCodeHash -FN:120,createContract -FN:145,getAddressForCREATE -FN:170,getAddressForCREATE2 -FNF:7 -FNH:6 -FNDA:34,getCode -FNDA:18,getCode -FNDA:212,getCodeSize -FNDA:19,getCodeHash -FNDA:27,createContract -FNDA:27,getAddressForCREATE -FNDA:0,getAddressForCREATE2 -DA:37,34 -DA:44,34 -DA:61,18 -DA:82,212 -DA:86,212 -DA:103,19 -DA:107,19 -DA:128,27 -DA:136,27 -DA:155,27 -DA:156,27 -DA:157,27 -DA:159,27 -DA:160,27 -DA:179,0 -DA:186,0 -LF:16 -LH:14 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_Math.sol -FN:19,min -FNF:1 -FNH:0 -FNDA:0,min -DA:29,0 -DA:30,0 -DA:33,0 -LF:3 -LH:0 -BRDA:29,1,0,0 -BRDA:29,1,1,0 -BRF:2 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol -FN:23,getMerkleRoot -FN:121,verify -FN:184,_ceilLog2 -FNF:3 -FNH:3 -FNDA:118,getMerkleRoot -FNDA:102,verify -FNDA:100,_ceilLog2 -DA:32,118 -DA:37,117 -DA:38,0 -DA:41,117 -DA:61,117 -DA:64,117 -DA:65,117 -DA:68,117 -DA:71,117 -DA:74,117 -DA:75,117 -DA:77,117 -DA:78,273 -DA:79,273 -DA:81,273 -DA:82,4620 -DA:83,4620 -DA:84,4620 -DA:89,4620 -DA:92,273 -DA:93,27 -DA:94,27 -DA:95,27 -DA:100,27 -DA:103,273 -DA:104,273 -DA:107,117 -DA:134,102 -DA:139,101 -DA:144,100 -DA:149,99 -DA:151,99 -DA:152,653 -DA:153,146 -DA:160,507 -DA:168,653 -DA:171,99 -DA:193,100 -DA:198,100 -DA:199,3 -DA:204,97 -DA:205,97 -DA:206,97 -DA:207,776 -DA:208,206 -DA:209,206 -DA:214,97 -DA:215,70 -DA:218,97 -LF:49 -LH:48 -BRDA:32,1,0,117 -BRDA:32,1,1,1 -BRDA:37,2,0,0 -BRDA:37,2,1,117 -BRDA:92,3,0,27 -BRDA:92,3,1,246 -BRDA:134,4,0,101 -BRDA:134,4,1,1 -BRDA:139,5,0,100 -BRDA:139,5,1,1 -BRDA:144,6,0,99 -BRDA:144,6,1,1 -BRDA:152,7,0,146 -BRDA:152,7,1,507 -BRDA:193,8,0,100 -BRDA:193,8,1,0 -BRDA:198,9,0,3 -BRDA:198,9,1,97 -BRDA:207,10,0,206 -BRDA:207,10,1,570 -BRDA:214,11,0,70 -BRDA:214,11,1,27 -BRF:22 -BRH:20 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol -FN:37,constructor -FN:48,nonReentrant -FNF:2 -FNH:2 -FNDA:54,constructor -FNDA:14,nonReentrant -DA:38,54 -DA:50,14 -DA:53,14 -DA:55,14 -DA:59,6 -LF:5 -LH:5 -BRDA:50,1,0,14 -BRDA:50,1,1,0 -BRF:2 -BRH:1 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol -FN:53,push -FN:100,push -FN:120,get -FN:179,deleteElementsAfterInclusive -FN:212,deleteElementsAfterInclusive -FN:230,getLength -FN:248,setExtraData -FN:264,getExtraData -FN:282,setContext -FN:321,getContext -FN:364,getBuffer -FNF:11 -FNH:9 -FNDA:572,push -FNDA:470,push -FNDA:538,get -FNDA:1,deleteElementsAfterInclusive -FNDA:0,deleteElementsAfterInclusive -FNDA:441,getLength -FNDA:0,setExtraData -FNDA:550,getExtraData -FNDA:573,setContext -FNDA:2572,getContext -FNDA:1642,getBuffer -DA:60,572 -DA:61,572 -DA:64,572 -DA:65,134 -DA:69,572 -DA:70,11 -DA:73,0 -DA:74,0 -DA:75,0 -DA:78,0 -DA:81,11 -DA:86,572 -DA:87,572 -DA:90,572 -DA:91,572 -DA:92,572 -DA:106,470 -DA:108,470 -DA:130,538 -DA:132,538 -DA:137,535 -DA:138,535 -DA:140,535 -DA:143,535 -DA:146,535 -DA:151,535 -DA:155,0 -DA:158,0 -DA:164,0 -DA:169,0 -DA:186,1 -DA:188,1 -DA:193,1 -DA:197,0 -DA:198,0 -DA:202,1 -DA:203,1 -DA:204,1 -DA:218,0 -DA:219,0 -DA:239,441 -DA:240,441 -DA:254,0 -DA:255,0 -DA:256,0 -DA:273,550 -DA:274,550 -DA:288,573 -DA:289,573 -DA:291,573 -DA:292,573 -DA:293,573 -DA:298,573 -DA:299,573 -DA:300,573 -DA:301,573 -DA:307,573 -DA:308,573 -DA:311,573 -DA:312,0 -DA:330,2572 -DA:331,2572 -DA:333,2572 -DA:334,2572 -DA:335,2572 -DA:340,2572 -DA:341,2572 -DA:342,2572 -DA:343,2572 -DA:349,2572 -DA:374,1642 -LF:71 -LH:55 -BRDA:64,1,0,134 -BRDA:64,1,1,438 -BRDA:69,2,0,11 -BRDA:69,2,1,561 -BRDA:70,3,0,0 -BRDA:70,3,1,11 -BRDA:132,4,0,535 -BRDA:132,4,1,3 -BRDA:140,5,0,535 -BRDA:140,5,1,0 -BRDA:146,6,0,535 -BRDA:146,6,1,0 -BRDA:158,7,0,0 -BRDA:158,7,1,0 -BRDA:164,8,0,0 -BRDA:164,8,1,0 -BRDA:188,9,0,1 -BRDA:188,9,1,0 -BRDA:193,10,0,0 -BRDA:193,10,1,1 -BRDA:307,11,0,573 -BRDA:307,11,1,0 -BRDA:311,12,0,0 -BRDA:311,12,1,573 -BRF:24 -BRH:13 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol -FN:30,safeCALL -FN:61,safeDELEGATECALL -FN:90,safeCREATE -FN:116,safeEXTCODESIZE -FN:138,safeCHAINID -FN:157,safeCALLER -FN:176,safeADDRESS -FN:195,safeGETNONCE -FN:214,safeSETNONCE -FN:234,safeCREATEEOA -FN:257,safeREVERT -FN:277,safeREQUIRE -FN:293,safeSLOAD -FN:314,safeSSTORE -FN:339,_safeExecutionManagerInteraction -FN:367,_safeExecutionManagerInteraction -FNF:16 -FNH:16 -FNDA:18,safeCALL -FNDA:2,safeDELEGATECALL -FNDA:1,safeCREATE -FNDA:5,safeEXTCODESIZE -FNDA:12,safeCHAINID -FNDA:11,safeCALLER -FNDA:9,safeADDRESS -FNDA:7,safeGETNONCE -FNDA:6,safeSETNONCE -FNDA:2,safeCREATEEOA -FNDA:9,safeREVERT -FNDA:41,safeREQUIRE -FNDA:43,safeSLOAD -FNDA:21,safeSSTORE -FNDA:146,_safeExecutionManagerInteraction -FNDA:145,_safeExecutionManagerInteraction -DA:41,18 -DA:50,18 -DA:72,2 -DA:81,2 -DA:100,1 -DA:108,1 -DA:124,5 -DA:131,5 -DA:144,12 -DA:150,12 -DA:163,11 -DA:169,11 -DA:182,9 -DA:188,9 -DA:201,7 -DA:207,7 -DA:219,6 -DA:242,2 -DA:262,9 -DA:283,41 -DA:284,7 -DA:301,43 -DA:308,43 -DA:320,21 -DA:348,146 -DA:349,146 -DA:354,146 -DA:355,2 -DA:359,0 -DA:363,144 -DA:375,145 -LF:31 -LH:30 -BRDA:283,1,0,7 -BRDA:283,1,1,34 -BRDA:354,2,0,2 -BRDA:354,2,1,144 -BRDA:358,3,0,0 -BRDA:358,3,1,144 -BRF:6 -BRH:5 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol -FN:38,add -FN:55,sub -FN:69,sub -FN:86,mul -FN:112,div -FN:128,div -FN:148,mod -FN:164,mod -FNF:8 -FNH:1 -FNDA:0,add -FNDA:0,sub -FNDA:0,sub -FNDA:7,mul -FNDA:0,div -FNDA:0,div -FNDA:0,mod -FNDA:0,mod -DA:39,0 -DA:40,0 -DA:42,0 -DA:56,0 -DA:70,0 -DA:71,0 -DA:73,0 -DA:90,7 -DA:91,0 -DA:94,7 -DA:95,7 -DA:97,7 -DA:113,0 -DA:129,0 -DA:130,0 -DA:133,0 -DA:149,0 -DA:165,0 -DA:166,0 -LF:19 -LH:4 -BRDA:90,1,0,0 -BRDA:90,1,1,7 -BRF:2 -BRH:1 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol -FN:49,execute -FNF:1 -FNH:1 -FNDA:7,execute -DA:63,7 -DA:69,7 -DA:80,7 -DA:83,7 -DA:89,7 -DA:102,7 -DA:103,7 -DA:104,7 -DA:109,7 -DA:115,7 -DA:116,1 -DA:122,1 -DA:123,1 -DA:125,0 -DA:131,6 -DA:133,6 -LF:16 -LH:15 -BRDA:115,1,0,1 -BRDA:115,1,1,6 -BRDA:122,2,0,1 -BRDA:122,2,1,0 -BRF:4 -BRH:3 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol -FN:35,constructor -FN:47, -FN:76,upgrade -FN:93,getImplementation -FN:111,_setImplementation -FNF:5 -FNH:5 -FNDA:13,constructor -FNDA:1, -FNDA:2,upgrade -FNDA:2,getImplementation -FNDA:15,_setImplementation -DA:39,13 -DA:50,1 -DA:56,1 -DA:57,1 -DA:61,0 -DA:81,2 -DA:86,2 -DA:99,2 -DA:116,15 -LF:9 -LH:8 -BRDA:56,1,0,1 -BRDA:56,1,1,0 -BRF:2 -BRH:1 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol -FN:44,constructor -FN:46,xDomainMessageSender -FN:57,sendMessage -FN:91,_getXDomainCalldata -FN:117,_sendXDomainMessage -FNF:5 -FNH:4 -FNDA:54,constructor -FNDA:4,xDomainMessageSender -FNDA:7,sendMessage -FNDA:21,_getXDomainCalldata -FNDA:0,_sendXDomainMessage -DA:47,4 -DA:48,0 -DA:65,7 -DA:72,7 -DA:73,7 -DA:75,7 -DA:76,7 -DA:103,21 -DA:124,0 -LF:9 -LH:7 -BRDA:47,1,0,0 -BRDA:47,1,1,4 -BRF:2 -BRH:1 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol -FN:39,constructor -FN:45,initialize -FN:63,onlyRelayer -FN:93,relayMessage -FN:144,replayMessage -FN:180,_verifyXDomainMessage -FN:201,_verifyStateRootProof -FN:228,_verifyStorageProof -FN:281,_sendXDomainMessage -FNF:9 -FNH:9 -FNDA:36,constructor -FNDA:12,initialize -FNDA:9,onlyRelayer -FNDA:8,relayMessage -FNDA:2,replayMessage -FNDA:8,_verifyXDomainMessage -FNDA:8,_verifyStateRootProof -FNDA:6,_verifyStorageProof -FNDA:5,_sendXDomainMessage -DA:50,12 -DA:51,12 -DA:52,12 -DA:64,9 -DA:65,9 -DA:66,1 -DA:71,8 -DA:95,8 -DA:102,8 -DA:110,4 -DA:112,4 -DA:117,3 -DA:118,3 -DA:119,3 -DA:123,3 -DA:124,3 -DA:125,3 -DA:130,3 -DA:137,3 -DA:154,2 -DA:161,2 -DA:166,1 -DA:190,8 -DA:210,8 -DA:212,8 -DA:238,6 -DA:250,6 -DA:259,5 -DA:264,5 -DA:268,5 -DA:288,5 -LF:31 -LH:31 -BRDA:50,1,0,12 -BRDA:50,1,1,0 -BRDA:65,2,0,1 -BRDA:65,2,1,8 -BRDA:66,3,0,0 -BRDA:66,3,1,1 -BRDA:102,4,0,4 -BRDA:102,4,1,4 -BRDA:112,5,0,3 -BRDA:112,5,1,1 -BRDA:123,6,0,3 -BRDA:123,6,1,0 -BRDA:161,7,0,1 -BRDA:161,7,1,1 -BRDA:259,8,0,5 -BRDA:259,8,1,0 -BRF:16 -BRH:12 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol -FN:30,constructor -FN:37,onlyBatchRelayer -FN:56,batchRelayMessages -FNF:3 -FNH:3 -FNDA:6,constructor -FNDA:2,onlyBatchRelayer -FNDA:1,batchRelayMessages -DA:38,2 -DA:42,1 -DA:58,1 -DA:59,1 -DA:60,3 -DA:61,3 -LF:6 -LH:6 -BRDA:38,1,0,1 -BRDA:38,1,1,1 -BRF:2 -BRH:2 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol -FN:37,constructor -FN:56,relayMessage -FN:110,_verifyXDomainMessage -FN:127,_sendXDomainMessage -FNF:4 -FNH:4 -FNDA:18,constructor -FNDA:5,relayMessage -FNDA:5,_verifyXDomainMessage -FNDA:3,_sendXDomainMessage -DA:59,5 -DA:64,4 -DA:71,4 -DA:73,4 -DA:78,3 -DA:79,3 -DA:80,3 -DA:84,3 -DA:85,3 -DA:86,3 -DA:91,3 -DA:98,3 -DA:117,5 -DA:134,3 -LF:14 -LH:14 -BRDA:59,1,0,4 -BRDA:59,1,1,1 -BRDA:73,2,0,3 -BRDA:73,2,1,1 -BRDA:84,3,0,3 -BRDA:84,3,1,0 -BRF:6 -BRH:5 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol -FN:46,constructor -FN:65,_handleFinalizeWithdrawal -FN:83,_handleInitiateDeposit -FN:100,getFinalizeDepositL2Gas -FN:118,deposit -FN:132,depositTo -FN:150,_initiateDeposit -FN:199,finalizeWithdrawal -FNF:8 -FNH:6 -FNDA:24,constructor -FNDA:0,_handleFinalizeWithdrawal -FNDA:0,_handleInitiateDeposit -FNDA:2,getFinalizeDepositL2Gas -FNDA:1,deposit -FNDA:1,depositTo -FNDA:2,_initiateDeposit -FNDA:1,finalizeWithdrawal -DA:48,24 -DA:72,0 -DA:91,0 -DA:107,2 -DA:124,1 -DA:139,1 -DA:158,2 -DA:165,2 -DA:172,2 -DA:178,2 -DA:202,1 -DA:207,1 -LF:12 -LH:10 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol -FN:48,constructor -FN:59,init -FN:75,onlyInitialized -FN:95,_handleInitiateWithdrawal -FN:112,_handleFinalizeDeposit -FN:128,getFinalizeWithdrawalL1Gas -FN:153,withdraw -FN:169,withdrawTo -FN:180,_initiateWithdrawal -FN:225,finalizeDeposit -FNF:10 -FNH:8 -FNDA:30,constructor -FNDA:8,init -FNDA:5,onlyInitialized -FNDA:0,_handleInitiateWithdrawal -FNDA:0,_handleFinalizeDeposit -FNDA:9,getFinalizeWithdrawalL1Gas -FNDA:1,withdraw -FNDA:1,withdrawTo -FNDA:2,_initiateWithdrawal -FNDA:1,finalizeDeposit -DA:64,8 -DA:66,8 -DA:68,8 -DA:76,5 -DA:77,5 -DA:102,0 -DA:119,0 -DA:136,9 -DA:155,1 -DA:171,1 -DA:187,2 -DA:190,2 -DA:197,2 -DA:203,2 -DA:227,1 -DA:228,1 -LF:16 -LH:14 -BRDA:64,1,0,8 -BRDA:64,1,1,0 -BRDA:76,2,0,5 -BRDA:76,2,1,0 -BRF:4 -BRH:2 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol -FN:49,constructor -FN:67,_handleInitiateDeposit -FN:90,_handleFinalizeWithdrawal -FNF:3 -FNH:3 -FNDA:24,constructor -FNDA:2,_handleInitiateDeposit -FNDA:1,_handleFinalizeWithdrawal -DA:51,24 -DA:76,2 -DA:98,1 -LF:3 -LH:3 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol -FN:48,constructor -FN:68,deposit -FN:80,depositTo -FN:96,_initiateDeposit -FN:138,finalizeWithdrawal -FN:155,_safeTransferETH -FNF:6 -FNH:6 -FNDA:24,constructor -FNDA:2,deposit -FNDA:1,depositTo -FNDA:3,_initiateDeposit -FNDA:1,finalizeWithdrawal -FNDA:1,_safeTransferETH -DA:50,24 -DA:51,24 -DA:62,0 -DA:73,2 -DA:87,1 -DA:103,3 -DA:111,3 -DA:117,3 -DA:140,1 -DA:142,1 -DA:161,1 -DA:162,1 -LF:12 -LH:11 -BRDA:162,1,0,1 -BRDA:162,1,1,0 -BRF:2 -BRH:1 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol -FN:43,constructor -FN:47,_handleInitiateWithdrawal -FN:58,_handleFinalizeDeposit -FNF:3 -FNH:3 -FNDA:30,constructor -FNDA:2,_handleInitiateWithdrawal -FNDA:1,_handleFinalizeDeposit -DA:54,2 -DA:65,1 -LF:2 -LH:2 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol -FN:71,constructor -FN:87,batches -FN:104,queue -FN:121,getTotalElements -FN:137,getTotalBatches -FN:152,getNextQueueIndex -FN:168,getLastTimestamp -FN:184,getLastBlockNumber -FN:201,getQueueElement -FN:221,getNumPendingQueueElements -FN:237,getQueueLength -FN:256,enqueue -FN:337,appendQueueBatch -FN:393,appendSequencerBatch -FN:574,verifyTransaction -FN:614,_getBatchContext -FN:649,_getBatchExtraData -FN:689,_makeBatchExtraData -FN:718,_getQueueLeafHash -FN:743,_getQueueElement -FN:778,_getQueueLength -FN:800,_getSequencerLeafHash -FN:846,_getSequencerLeafHash -FN:891,_appendBatch -FN:934,_validateFirstBatchContext -FN:974,_validateContextBeforeEnqueue -FN:1013,_validateNextBatchContext -FN:1050,_validateFinalBatchContext -FN:1077,_hashTransactionChainElement -FN:1105,_verifySequencerTransaction -FN:1152,_verifyQueueTransaction -FN:1201,_verifyElement -FNF:32 -FNH:27 -FNDA:222,constructor -FNDA:559,batches -FNDA:382,queue -FNDA:291,getTotalElements -FNDA:0,getTotalBatches -FNDA:100,getNextQueueIndex -FNDA:0,getLastTimestamp -FNDA:0,getLastBlockNumber -FNDA:47,getQueueElement -FNDA:0,getNumPendingQueueElements -FNDA:0,getQueueLength -FNDA:239,enqueue -FNDA:1,appendQueueBatch -FNDA:104,appendSequencerBatch -FNDA:2,verifyTransaction -FNDA:232,_getBatchContext -FNDA:476,_getBatchExtraData -FNDA:81,_makeBatchExtraData -FNDA:179,_getQueueLeafHash -FNDA:267,_getQueueElement -FNDA:100,_getQueueLength -FNDA:439,_getSequencerLeafHash -FNDA:1,_getSequencerLeafHash -FNDA:81,_appendBatch -FNDA:100,_validateFirstBatchContext -FNDA:178,_validateContextBeforeEnqueue -FNDA:226,_validateNextBatchContext -FNDA:88,_validateFinalBatchContext -FNDA:179,_hashTransactionChainElement -FNDA:1,_verifySequencerTransaction -FNDA:1,_verifyQueueTransaction -FNDA:2,_verifyElement -DA:73,222 -DA:74,222 -DA:75,222 -DA:95,559 -DA:112,382 -DA:129,291 -DA:130,291 -DA:145,0 -DA:160,100 -DA:161,100 -DA:176,0 -DA:177,0 -DA:192,0 -DA:193,0 -DA:211,47 -DA:229,0 -DA:245,0 -DA:264,239 -DA:269,238 -DA:274,237 -DA:282,236 -DA:283,236 -DA:287,236 -DA:294,235 -DA:295,235 -DA:296,37600 -DA:299,235 -DA:308,235 -DA:309,235 -DA:314,235 -DA:316,235 -DA:317,235 -DA:322,235 -DA:323,235 -DA:345,1 -DA:397,104 -DA:398,104 -DA:399,104 -DA:400,104 -DA:406,104 -DA:411,103 -DA:416,102 -DA:421,101 -DA:426,100 -DA:428,100 -DA:436,100 -DA:437,100 -DA:442,100 -DA:445,100 -DA:448,100 -DA:451,100 -DA:455,100 -DA:457,100 -DA:458,100 -DA:459,232 -DA:461,232 -DA:463,100 -DA:467,226 -DA:475,221 -DA:478,221 -DA:479,439 -DA:480,439 -DA:484,439 -DA:491,439 -DA:492,439 -DA:493,439 -DA:497,221 -DA:498,179 -DA:503,178 -DA:504,178 -DA:505,178 -DA:509,88 -DA:516,82 -DA:521,81 -DA:527,81 -DA:528,81 -DA:529,81 -DA:530,81 -DA:532,39 -DA:533,39 -DA:539,42 -DA:544,42 -DA:545,42 -DA:551,81 -DA:559,81 -DA:587,2 -DA:588,1 -DA:595,1 -DA:623,232 -DA:624,232 -DA:625,232 -DA:626,232 -DA:627,232 -DA:629,232 -DA:636,232 -DA:659,476 -DA:661,476 -DA:662,476 -DA:663,476 -DA:664,476 -DA:665,476 -DA:673,476 -DA:701,81 -DA:702,81 -DA:710,81 -DA:727,179 -DA:756,267 -DA:757,267 -DA:758,265 -DA:760,265 -DA:761,265 -DA:762,265 -DA:767,265 -DA:790,100 -DA:813,439 -DA:814,419 -DA:817,439 -DA:818,439 -DA:820,439 -DA:821,439 -DA:838,439 -DA:855,1 -DA:856,1 -DA:858,1 -DA:859,1 -DA:860,1 -DA:862,1 -DA:863,1 -DA:880,1 -DA:900,81 -DA:901,81 -DA:903,81 -DA:911,81 -DA:919,81 -DA:920,81 -DA:927,81 -DA:942,100 -DA:943,4 -DA:945,4 -DA:950,2 -DA:957,96 -DA:962,95 -DA:982,178 -DA:988,177 -DA:995,176 -DA:1000,174 -DA:1023,226 -DA:1028,225 -DA:1034,224 -DA:1035,175 -DA:1060,88 -DA:1061,3 -DA:1068,85 -DA:1069,83 -DA:1086,179 -DA:1117,1 -DA:1118,1 -DA:1119,1 -DA:1121,1 -DA:1130,1 -DA:1141,1 -DA:1164,1 -DA:1166,1 -DA:1175,1 -DA:1184,1 -DA:1185,1 -DA:1192,1 -DA:1212,2 -DA:1217,2 -DA:1228,2 -LF:170 -LH:163 -BRDA:264,1,0,238 -BRDA:264,1,1,1 -BRDA:269,2,0,237 -BRDA:269,2,1,1 -BRDA:274,3,0,236 -BRDA:274,3,1,1 -BRDA:287,4,0,235 -BRDA:287,4,1,1 -BRDA:406,5,0,103 -BRDA:406,5,1,1 -BRDA:411,6,0,102 -BRDA:411,6,1,1 -BRDA:416,7,0,101 -BRDA:416,7,1,1 -BRDA:421,8,0,100 -BRDA:421,8,1,1 -BRDA:428,9,0,100 -BRDA:428,9,1,0 -BRDA:461,10,0,100 -BRDA:461,10,1,132 -BRDA:498,11,0,178 -BRDA:498,11,1,1 -BRDA:516,12,0,81 -BRDA:516,12,1,1 -BRDA:521,13,0,81 -BRDA:521,13,1,0 -BRDA:530,14,0,39 -BRDA:530,14,1,42 -BRDA:587,15,0,1 -BRDA:587,15,1,1 -BRDA:813,16,0,419 -BRDA:813,16,1,20 -BRDA:942,17,0,4 -BRDA:942,17,1,96 -BRDA:945,18,0,2 -BRDA:945,18,1,2 -BRDA:950,19,0,0 -BRDA:950,19,1,2 -BRDA:957,20,0,95 -BRDA:957,20,1,1 -BRDA:962,21,0,94 -BRDA:962,21,1,1 -BRDA:988,22,0,176 -BRDA:988,22,1,1 -BRDA:995,23,0,174 -BRDA:995,23,1,2 -BRDA:1000,24,0,172 -BRDA:1000,24,1,2 -BRDA:1023,25,0,225 -BRDA:1023,25,1,1 -BRDA:1028,26,0,224 -BRDA:1028,26,1,1 -BRDA:1034,27,0,175 -BRDA:1034,27,1,49 -BRDA:1060,28,0,3 -BRDA:1060,28,1,85 -BRDA:1068,29,0,83 -BRDA:1068,29,1,2 -BRDA:1069,30,0,82 -BRDA:1069,30,1,1 -BRDA:1121,31,0,1 -BRDA:1121,31,1,0 -BRDA:1130,32,0,1 -BRDA:1130,32,1,0 -BRDA:1166,33,0,1 -BRDA:1166,33,1,0 -BRDA:1185,34,0,1 -BRDA:1185,34,1,0 -BRDA:1212,35,0,2 -BRDA:1212,35,1,0 -BRDA:1217,36,0,2 -BRDA:1217,36,1,0 -BRF:72 -BRH:63 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol -FN:54,constructor -FN:64,onlyOwner -FN:85,setGlobalMetadata -FN:93,getGlobalMetadata -FN:107,length -FN:126,push -FN:140,push -FN:148,get -FN:169,deleteElementsAfterInclusive -FN:185,deleteElementsAfterInclusive -FN:201,setNextOverwritableIndex -FNF:11 -FNH:8 -FNDA:504,constructor -FNDA:573,onlyOwner -FNDA:0,setGlobalMetadata -FNDA:550,getGlobalMetadata -FNDA:441,length -FNDA:470,push -FNDA:102,push -FNDA:538,get -FNDA:0,deleteElementsAfterInclusive -FNDA:1,deleteElementsAfterInclusive -FNDA:0,setNextOverwritableIndex -DA:56,504 -DA:65,573 -DA:69,573 -DA:87,0 -DA:101,550 -DA:115,441 -DA:128,470 -DA:142,102 -DA:158,538 -DA:171,0 -DA:187,1 -DA:203,0 -LF:12 -LH:9 -BRDA:65,1,0,573 -BRDA:65,1,1,0 -BRF:2 -BRH:1 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol -FN:52,constructor -FN:67,batches -FN:82,getTotalElements -FN:97,getTotalBatches -FN:111,getLastSequencerTimestamp -FN:126,appendStateBatch -FN:167,deleteStateBatch -FN:194,verifyStateCommitment -FN:228,insideFraudProofWindow -FN:260,_getBatchExtraData -FN:290,_makeBatchExtraData -FN:315,_appendBatch -FN:369,_deleteBatch -FN:403,_isValidBatchHeader -FNF:14 -FNH:12 -FNDA:60,constructor -FNDA:125,batches -FNDA:52,getTotalElements -FNDA:24,getTotalBatches -FNDA:0,getLastSequencerTimestamp -FNDA:25,appendStateBatch -FNDA:4,deleteStateBatch -FNDA:0,verifyStateCommitment -FNDA:1,insideFraudProofWindow -FNDA:74,_getBatchExtraData -FNDA:22,_makeBatchExtraData -FNDA:22,_appendBatch -FNDA:1,_deleteBatch -FNDA:4,_isValidBatchHeader -DA:54,60 -DA:55,60 -DA:74,125 -DA:90,52 -DA:91,52 -DA:105,24 -DA:119,0 -DA:120,0 -DA:135,25 -DA:141,24 -DA:146,24 -DA:151,23 -DA:158,22 -DA:173,4 -DA:178,3 -DA:183,1 -DA:188,1 -DA:206,0 -DA:211,0 -DA:222,0 -DA:238,1 -DA:243,1 -DA:247,1 -DA:268,74 -DA:270,74 -DA:271,74 -DA:272,74 -DA:278,74 -DA:300,22 -DA:301,22 -DA:307,22 -DA:321,22 -DA:322,22 -DA:324,22 -DA:325,20 -DA:331,2 -DA:340,21 -DA:348,21 -DA:356,21 -DA:374,1 -DA:379,1 -DA:384,1 -DA:392,1 -DA:412,4 -LF:44 -LH:39 -BRDA:135,1,0,24 -BRDA:135,1,1,1 -BRDA:141,2,0,24 -BRDA:141,2,1,0 -BRDA:146,3,0,23 -BRDA:146,3,1,1 -BRDA:151,4,0,22 -BRDA:151,4,1,1 -BRDA:173,5,0,3 -BRDA:173,5,1,1 -BRDA:178,6,0,1 -BRDA:178,6,1,2 -BRDA:183,7,0,1 -BRDA:183,7,1,0 -BRDA:206,8,0,0 -BRDA:206,8,1,0 -BRDA:211,9,0,0 -BRDA:211,9,1,0 -BRDA:243,10,0,1 -BRDA:243,10,1,0 -BRDA:324,11,0,20 -BRDA:324,11,1,2 -BRDA:331,12,0,1 -BRDA:331,12,1,1 -BRDA:374,13,0,1 -BRDA:374,13,1,0 -BRDA:379,14,0,1 -BRDA:379,14,1,0 -BRF:28 -BRH:19 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol -FN:83,constructor -FN:101,netGasCost -FN:119,fixedGasDiscount -FN:138,notStatic -FN:155,run -FN:223,ovmCALLER -FN:238,ovmADDRESS -FN:253,ovmTIMESTAMP -FN:268,ovmNUMBER -FN:283,ovmGASLIMIT -FN:298,ovmCHAINID -FN:317,ovmL1QUEUEORIGIN -FN:332,ovmL1TXORIGIN -FN:351,ovmREVERT -FN:377,ovmCREATE -FN:416,ovmCREATE2 -FN:451,ovmGETNONCE -FN:470,ovmSETNONCE -FN:494,ovmCREATEEOA -FN:563,ovmCALL -FN:597,ovmSTATICCALL -FN:632,ovmDELEGATECALL -FN:664,ovmSLOAD -FN:690,ovmSSTORE -FN:714,ovmEXTCODECOPY -FN:744,ovmEXTCODESIZE -FN:763,ovmEXTCODEHASH -FN:781,getMaxTransactionGasLimit -FN:800,_checkDeployerAllowed -FN:830,_createContract -FN:875,_callContract -FN:924,_handleExternalMessage -FN:1035,_handleContractCreation -FN:1127,_hasAccount -FN:1144,_hasEmptyAccount -FN:1161,_setAccountNonce -FN:1176,_getAccountNonce -FN:1193,_getAccountEthAddress -FN:1209,_initPendingAccount -FN:1229,_commitPendingAccount -FN:1250,_getContractStorage -FN:1269,_putContractStorage -FN:1294,_checkAccountLoad -FN:1329,_checkAccountChange -FN:1360,_checkContractStorageLoad -FN:1402,_checkContractStorageChange -FN:1441,_encodeRevertData -FN:1485,_decodeRevertData -FN:1516,_revertWithFlag -FN:1537,_revertWithFlag -FN:1558,_getNuisanceGasLimit -FN:1574,_useNuisanceGas -FN:1597,_checkNeedsNewEpoch -FN:1635,_isValidGasLimit -FN:1681,_updateCumulativeGas -FN:1710,_getGasMetadata -FN:1729,_putGasMetadata -FN:1752,_switchMessageContext -FN:1778,_initContext -FN:1796,_resetContext -FN:1825,simulateMessage -FNF:61 -FNH:51 -FNDA:27,constructor -FNDA:55,netGasCost -FNDA:201,fixedGasDiscount -FNDA:42,notStatic -FNDA:0,run -FNDA:4,ovmCALLER -FNDA:150,ovmADDRESS -FNDA:1,ovmTIMESTAMP -FNDA:1,ovmNUMBER -FNDA:1,ovmGASLIMIT -FNDA:1,ovmCHAINID -FNDA:1,ovmL1QUEUEORIGIN -FNDA:1,ovmL1TXORIGIN -FNDA:6,ovmREVERT -FNDA:28,ovmCREATE -FNDA:1,ovmCREATE2 -FNDA:3,ovmGETNONCE -FNDA:1,ovmSETNONCE -FNDA:1,ovmCREATEEOA -FNDA:154,ovmCALL -FNDA:8,ovmSTATICCALL -FNDA:10,ovmDELEGATECALL -FNDA:48,ovmSLOAD -FNDA:7,ovmSSTORE -FNDA:2,ovmEXTCODECOPY -FNDA:3,ovmEXTCODESIZE -FNDA:2,ovmEXTCODEHASH -FNDA:0,getMaxTransactionGasLimit -FNDA:29,_checkDeployerAllowed -FNDA:27,_createContract -FNDA:172,_callContract -FNDA:196,_handleExternalMessage -FNDA:27,_handleContractCreation -FNDA:0,_hasAccount -FNDA:28,_hasEmptyAccount -FNDA:29,_setAccountNonce -FNDA:57,_getAccountNonce -FNDA:369,_getAccountEthAddress -FNDA:28,_initPendingAccount -FNDA:17,_commitPendingAccount -FNDA:55,_getContractStorage -FNDA:7,_putContractStorage -FNDA:535,_checkAccountLoad -FNDA:53,_checkAccountChange -FNDA:62,_checkContractStorageLoad -FNDA:7,_checkContractStorageChange -FNDA:20,_encodeRevertData -FNDA:23,_decodeRevertData -FNDA:19,_revertWithFlag -FNDA:13,_revertWithFlag -FNDA:196,_getNuisanceGasLimit -FNDA:244,_useNuisanceGas -FNDA:0,_checkNeedsNewEpoch -FNDA:0,_isValidGasLimit -FNDA:0,_updateCumulativeGas -FNDA:0,_getGasMetadata -FNDA:0,_putGasMetadata -FNDA:392,_switchMessageContext -FNDA:0,_initContext -FNDA:27,_resetContext -FNDA:0,simulateMessage -DA:85,27 -DA:86,27 -DA:87,27 -DA:88,27 -DA:104,55 -DA:105,55 -DA:106,55 -DA:109,55 -DA:110,46 -DA:122,201 -DA:123,201 -DA:124,192 -DA:127,192 -DA:128,165 -DA:131,27 -DA:139,42 -DA:140,4 -DA:142,38 -DA:162,0 -DA:165,0 -DA:170,0 -DA:178,0 -DA:186,0 -DA:187,0 -DA:188,0 -DA:196,0 -DA:208,0 -DA:211,0 -DA:231,4 -DA:246,150 -DA:261,1 -DA:276,1 -DA:291,1 -DA:306,1 -DA:325,1 -DA:340,1 -DA:357,6 -DA:384,28 -DA:388,28 -DA:391,27 -DA:396,27 -DA:423,1 -DA:427,1 -DA:430,0 -DA:436,0 -DA:458,3 -DA:472,1 -DA:501,1 -DA:510,1 -DA:511,0 -DA:515,1 -DA:516,0 -DA:520,1 -DA:523,1 -DA:524,1 -DA:528,1 -DA:531,1 -DA:534,1 -DA:540,1 -DA:570,154 -DA:571,154 -DA:572,154 -DA:574,154 -DA:604,8 -DA:605,8 -DA:606,8 -DA:607,8 -DA:609,8 -DA:639,10 -DA:641,10 -DA:670,48 -DA:672,48 -DA:693,7 -DA:695,7 -DA:730,2 -DA:732,2 -DA:753,3 -DA:772,2 -DA:789,0 -DA:807,29 -DA:812,29 -DA:814,29 -DA:815,2 -DA:841,27 -DA:845,27 -DA:846,27 -DA:847,27 -DA:851,27 -DA:860,24 -DA:889,172 -DA:894,1 -DA:898,171 -DA:903,169 -DA:938,196 -DA:939,196 -DA:945,196 -DA:946,196 -DA:947,196 -DA:955,196 -DA:961,196 -DA:965,196 -DA:969,196 -DA:970,23 -DA:980,23 -DA:981,5 -DA:987,18 -DA:993,14 -DA:998,18 -DA:1002,10 -DA:1004,8 -DA:1012,18 -DA:1016,191 -DA:1018,191 -DA:1047,27 -DA:1050,0 -DA:1060,27 -DA:1061,0 -DA:1071,27 -DA:1074,27 -DA:1076,27 -DA:1079,10 -DA:1080,10 -DA:1081,10 -DA:1082,10 -DA:1090,10 -DA:1095,17 -DA:1096,17 -DA:1097,1 -DA:1108,16 -DA:1115,16 -DA:1135,0 -DA:1136,0 -DA:1152,28 -DA:1153,28 -DA:1167,29 -DA:1168,29 -DA:1184,57 -DA:1185,57 -DA:1201,369 -DA:1202,367 -DA:1217,28 -DA:1218,28 -DA:1236,17 -DA:1237,17 -DA:1259,55 -DA:1260,55 -DA:1281,7 -DA:1282,0 -DA:1285,7 -DA:1286,7 -DA:1300,535 -DA:1301,0 -DA:1305,535 -DA:1306,2 -DA:1311,533 -DA:1317,533 -DA:1318,144 -DA:1336,53 -DA:1340,53 -DA:1346,53 -DA:1347,47 -DA:1348,47 -DA:1372,62 -DA:1373,0 -DA:1379,62 -DA:1380,0 -DA:1385,62 -DA:1391,62 -DA:1392,46 -DA:1410,7 -DA:1414,7 -DA:1420,7 -DA:1423,7 -DA:1425,7 -DA:1426,7 -DA:1452,20 -DA:1455,0 -DA:1459,20 -DA:1460,7 -DA:1469,13 -DA:1498,23 -DA:1499,3 -DA:1508,20 -DA:1523,19 -DA:1528,19 -DA:1542,13 -DA:1567,196 -DA:1581,244 -DA:1582,0 -DA:1585,244 -DA:1602,0 -DA:1608,0 -DA:1613,0 -DA:1620,0 -DA:1646,0 -DA:1647,0 -DA:1651,0 -DA:1652,0 -DA:1656,0 -DA:1687,0 -DA:1688,0 -DA:1689,0 -DA:1691,0 -DA:1694,0 -DA:1718,0 -DA:1735,0 -DA:1759,392 -DA:1760,202 -DA:1764,392 -DA:1765,308 -DA:1769,392 -DA:1770,16 -DA:1783,0 -DA:1784,0 -DA:1785,0 -DA:1786,0 -DA:1787,0 -DA:1788,0 -DA:1790,0 -DA:1799,27 -DA:1800,27 -DA:1801,27 -DA:1802,27 -DA:1803,27 -DA:1804,27 -DA:1806,27 -DA:1808,27 -DA:1809,27 -DA:1810,27 -DA:1812,27 -DA:1837,0 -DA:1839,0 -DA:1840,0 -DA:1841,0 -DA:1843,0 -DA:1845,0 -DA:1846,0 -DA:1847,0 -DA:1848,0 -DA:1849,0 -DA:1853,0 -DA:1856,0 -LF:242 -LH:182 -BRDA:109,1,0,46 -BRDA:109,1,1,9 -BRDA:127,2,0,165 -BRDA:127,2,1,27 -BRDA:139,3,0,4 -BRDA:139,3,1,38 -BRDA:162,4,0,0 -BRDA:162,4,1,0 -BRDA:170,5,0,0 -BRDA:170,5,1,0 -BRDA:186,6,0,0 -BRDA:186,6,1,0 -BRDA:510,7,0,0 -BRDA:510,7,1,1 -BRDA:515,8,0,0 -BRDA:515,8,1,1 -BRDA:814,9,0,2 -BRDA:814,9,1,27 -BRDA:889,10,0,1 -BRDA:889,10,1,171 -BRDA:969,11,0,23 -BRDA:969,11,1,173 -BRDA:980,12,0,5 -BRDA:980,12,1,18 -BRDA:987,13,0,14 -BRDA:987,13,1,4 -BRDA:998,14,0,10 -BRDA:998,14,1,8 -BRDA:1047,15,0,0 -BRDA:1047,15,1,27 -BRDA:1060,16,0,0 -BRDA:1060,16,1,27 -BRDA:1076,17,0,10 -BRDA:1076,17,1,17 -BRDA:1096,18,0,1 -BRDA:1096,18,1,16 -BRDA:1281,19,0,0 -BRDA:1281,19,1,7 -BRDA:1300,20,0,0 -BRDA:1300,20,1,535 -BRDA:1305,21,0,2 -BRDA:1305,21,1,533 -BRDA:1317,22,0,144 -BRDA:1317,22,1,389 -BRDA:1346,23,0,47 -BRDA:1346,23,1,6 -BRDA:1372,24,0,0 -BRDA:1372,24,1,62 -BRDA:1379,25,0,0 -BRDA:1379,25,1,62 -BRDA:1391,26,0,46 -BRDA:1391,26,1,16 -BRDA:1420,27,0,7 -BRDA:1420,27,1,0 -BRDA:1452,28,0,0 -BRDA:1452,28,1,20 -BRDA:1459,29,0,7 -BRDA:1459,29,1,13 -BRDA:1498,30,0,3 -BRDA:1498,30,1,20 -BRDA:1581,31,0,0 -BRDA:1581,31,1,244 -BRDA:1602,32,0,0 -BRDA:1602,32,1,0 -BRDA:1646,33,0,0 -BRDA:1646,33,1,0 -BRDA:1651,34,0,0 -BRDA:1651,34,1,0 -BRDA:1688,35,0,0 -BRDA:1688,35,1,0 -BRDA:1759,36,0,202 -BRDA:1759,36,1,190 -BRDA:1764,37,0,308 -BRDA:1764,37,1,84 -BRDA:1769,38,0,16 -BRDA:1769,38,1,376 -BRDA:1837,39,0,0 -BRDA:1837,39,1,0 -BRDA:1846,40,0,0 -BRDA:1846,40,1,0 -BRDA:1848,41,0,0 -BRDA:1848,41,1,0 -BRF:82 -BRH:51 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol -FN:31,isBytecodeSafe -FNF:1 -FNH:1 -FNDA:277,isBytecodeSafe -DA:43,277 -DA:54,277 -DA:56,277 -DA:58,277 -DA:60,277 -DA:61,277 -DA:62,277 -DA:65,277 -DA:66,277 -DA:146,152 -LF:10 -LH:10 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManager.sol -FN:53,constructor -FN:69,authenticated -FN:87,isAuthenticated -FN:109,setExecutionManager -FN:125,putAccount -FN:139,putEmptyAccount -FN:151,getAccount -FN:169,hasAccount -FN:187,hasEmptyAccount -FN:214,setAccountNonce -FN:224,getAccountNonce -FN:242,getAccountEthAddress -FN:260,getAccountStorageRoot -FN:282,initPendingAccount -FN:304,commitPendingAccount -FN:321,testAndSetAccountLoaded -FN:342,testAndSetAccountChanged -FN:363,commitAccount -FN:385,incrementTotalUncommittedAccounts -FN:394,getTotalUncommittedAccounts -FN:410,wasAccountChanged -FN:429,wasAccountCommitted -FN:461,putContractStorage -FN:484,getContractStorage -FN:514,hasContractStorage -FN:540,testAndSetContractStorageLoaded -FN:563,testAndSetContractStorageChanged -FN:586,commitContractStorage -FN:608,incrementTotalUncommittedContractStorage -FN:617,getTotalUncommittedContractStorage -FN:634,wasContractStorageChanged -FN:655,wasContractStorageCommitted -FN:680,_getItemHash -FN:698,_getItemHash -FN:721,_testAndSetItemState -FNF:35 -FNH:28 -FNDA:207,constructor -FNDA:921,authenticated -FNDA:0,isAuthenticated -FNDA:12,setExecutionManager -FNDA:12,putAccount -FNDA:0,putEmptyAccount -FNDA:4,getAccount -FNDA:537,hasAccount -FNDA:31,hasEmptyAccount -FNDA:31,setAccountNonce -FNDA:60,getAccountNonce -FNDA:369,getAccountEthAddress -FNDA:0,getAccountStorageRoot -FNDA:30,initPendingAccount -FNDA:18,commitPendingAccount -FNDA:538,testAndSetAccountLoaded -FNDA:61,testAndSetAccountChanged -FNDA:7,commitAccount -FNDA:70,incrementTotalUncommittedAccounts -FNDA:5,getTotalUncommittedAccounts -FNDA:0,wasAccountChanged -FNDA:0,wasAccountCommitted -FNDA:14,putContractStorage -FNDA:57,getContractStorage -FNDA:74,hasContractStorage -FNDA:69,testAndSetContractStorageLoaded -FNDA:19,testAndSetContractStorageChanged -FNDA:9,commitContractStorage -FNDA:30,incrementTotalUncommittedContractStorage -FNDA:5,getTotalUncommittedContractStorage -FNDA:0,wasContractStorageChanged -FNDA:0,wasContractStorageCommitted -FNDA:606,_getItemHash -FNDA:97,_getItemHash -FNDA:687,_testAndSetItemState -DA:57,207 -DA:71,921 -DA:75,920 -DA:97,0 -DA:111,12 -DA:127,12 -DA:141,0 -DA:142,0 -DA:143,0 -DA:161,4 -DA:179,537 -DA:197,31 -DA:216,31 -DA:234,60 -DA:252,369 -DA:270,0 -DA:284,30 -DA:285,30 -DA:286,30 -DA:287,30 -DA:288,30 -DA:306,18 -DA:307,18 -DA:308,18 -DA:326,538 -DA:347,61 -DA:368,7 -DA:369,7 -DA:370,3 -DA:373,4 -DA:374,4 -DA:376,4 -DA:387,70 -DA:402,5 -DA:420,0 -DA:421,0 -DA:439,0 -DA:440,0 -DA:466,14 -DA:473,14 -DA:474,8 -DA:497,57 -DA:501,6 -DA:505,51 -DA:525,74 -DA:545,69 -DA:568,19 -DA:591,9 -DA:592,9 -DA:593,3 -DA:596,6 -DA:597,6 -DA:599,6 -DA:610,30 -DA:625,5 -DA:645,0 -DA:646,0 -DA:666,0 -DA:667,0 -DA:689,606 -DA:708,97 -DA:730,687 -DA:732,687 -DA:733,268 -DA:736,687 -LF:65 -LH:52 -BRDA:71,1,0,920 -BRDA:71,1,1,1 -BRDA:369,2,0,3 -BRDA:369,2,1,4 -BRDA:473,3,0,8 -BRDA:473,3,1,6 -BRDA:497,4,0,6 -BRDA:497,4,1,51 -BRDA:592,5,0,3 -BRDA:592,5,1,6 -BRDA:732,6,0,268 -BRDA:732,6,1,419 -BRF:12 -BRH:12 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol -FN:30,create -FNF:1 -FNH:0 -FNDA:0,create -DA:39,0 -LF:1 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol -FN:56,getInterfaceImplementer -FN:73,setInterfaceImplementer -FN:93,setManager -FN:102,getManager -FN:114,interfaceHash -FN:124,updateERC165Cache -FN:137,implementsERC165Interface -FN:148,implementsERC165InterfaceNoCache -FN:172,isERC165Interface -FN:177,noThrowCall -FNF:10 -FNH:0 -FNDA:0,getInterfaceImplementer -FNDA:0,setInterfaceImplementer -FNDA:0,setManager -FNDA:0,getManager -FNDA:0,interfaceHash -FNDA:0,updateERC165Cache -FNDA:0,implementsERC165Interface -FNDA:0,implementsERC165InterfaceNoCache -FNDA:0,isERC165Interface -FNDA:0,noThrowCall -DA:57,0 -DA:58,0 -DA:59,0 -DA:60,0 -DA:62,0 -DA:74,0 -DA:75,0 -DA:77,0 -DA:78,0 -DA:79,0 -DA:85,0 -DA:86,0 -DA:94,0 -DA:95,0 -DA:96,0 -DA:104,0 -DA:105,0 -DA:107,0 -DA:115,0 -DA:125,0 -DA:127,0 -DA:138,0 -DA:139,0 -DA:141,0 -DA:149,0 -DA:150,0 -DA:152,0 -DA:153,0 -DA:154,0 -DA:157,0 -DA:158,0 -DA:159,0 -DA:162,0 -DA:163,0 -DA:164,0 -DA:166,0 -DA:173,0 -DA:180,0 -DA:182,0 -LF:39 -LH:0 -BRDA:58,1,0,0 -BRDA:58,1,1,0 -BRDA:75,2,0,0 -BRDA:75,2,1,0 -BRDA:77,3,0,0 -BRDA:77,3,1,0 -BRDA:78,4,0,0 -BRDA:78,4,1,0 -BRDA:79,5,0,0 -BRDA:79,5,1,0 -BRDA:94,6,0,0 -BRDA:94,6,1,0 -BRDA:104,7,0,0 -BRDA:104,7,1,0 -BRDA:138,8,0,0 -BRDA:138,8,1,0 -BRDA:153,9,0,0 -BRDA:153,9,1,0 -BRDA:158,10,0,0 -BRDA:158,10,1,0 -BRDA:163,11,0,0 -BRDA:163,11,1,0 -BRF:22 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol -FN:39,onlyOwner -FN:63,initialize -FN:95,getOwner -FN:120,setWhitelistedDeployer -FN:137,setOwner -FN:154,setAllowArbitraryDeployment -FN:168,enableArbitraryContractDeployment -FN:179,isDeployerAllowed -FNF:8 -FNH:1 -FNDA:0,onlyOwner -FNDA:0,initialize -FNDA:0,getOwner -FNDA:0,setWhitelistedDeployer -FNDA:0,setOwner -FNDA:0,setAllowArbitraryDeployment -FNDA:0,enableArbitraryContractDeployment -FNDA:29,isDeployerAllowed -DA:40,0 -DA:46,0 -DA:50,0 -DA:70,0 -DA:74,0 -DA:75,0 -DA:78,0 -DA:82,0 -DA:86,0 -DA:102,0 -DA:122,0 -DA:139,0 -DA:156,0 -DA:170,0 -DA:171,0 -DA:188,29 -DA:192,29 -DA:193,25 -DA:196,4 -DA:200,4 -DA:201,1 -DA:204,3 -DA:210,3 -LF:23 -LH:8 -BRDA:74,1,0,0 -BRDA:74,1,1,0 -BRDA:192,2,0,25 -BRDA:192,2,1,4 -BRDA:200,3,0,1 -BRDA:200,3,1,3 -BRF:6 -BRH:4 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol -FN:30,constructor -FNF:1 -FNH:0 -FNDA:0,constructor -DA:32,0 -LF:1 -LH:0 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol -FN:32,getL1MessageSender -FNF:1 -FNH:1 -FNDA:1,getL1MessageSender -DA:41,1 -LF:1 -LH:1 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol -FN:34,passMessageToL1 -FNF:1 -FNH:1 -FNDA:31,passMessageToL1 -DA:43,31 -LF:1 -LH:1 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol -FN:22, -FN:37,init -FN:51,upgrade -FN:69,_setImplementation -FN:80,_getImplementation -FN:93,_setOwner -FN:104,_getOwner -FNF:7 -FNH:7 -FNDA:1, -FNDA:2,init -FNDA:2,upgrade -FNDA:4,_setImplementation -FNDA:1,_getImplementation -FNDA:2,_setOwner -FNDA:4,_getOwner -DA:25,1 -DA:43,2 -DA:47,2 -DA:48,2 -DA:56,2 -DA:61,2 -DA:74,4 -DA:86,1 -DA:98,2 -DA:110,4 -LF:10 -LH:10 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol -FN:49, -FN:109,_getTransactionType -FNF:2 -FNH:2 -FNDA:7, -FNDA:7,_getTransactionType -DA:52,7 -DA:54,5 -DA:55,5 -DA:56,5 -DA:59,5 -DA:60,5 -DA:63,5 -DA:68,5 -DA:76,5 -DA:78,2 -DA:79,2 -DA:83,5 -DA:92,5 -DA:117,7 -DA:118,3 -DA:120,2 -DA:122,2 -LF:17 -LH:17 -BRDA:76,1,0,2 -BRDA:76,1,1,3 -BRDA:117,2,0,3 -BRDA:117,2,1,4 -BRDA:119,3,0,2 -BRDA:119,3,1,2 -BRF:6 -BRH:6 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol -FN:12,contributesToFraudProof -FNF:1 -FNH:1 -FNDA:28,contributesToFraudProof -DA:13,28 -DA:14,28 -DA:15,14 -DA:16,14 -LF:4 -LH:4 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_BondManager.sol -FN:67,constructor -FN:78,recordGasSpent -FN:89,finalize -FN:132,deposit -FN:143,startWithdrawal -FN:153,finalizeWithdrawal -FN:174,claim -FN:200,isCollateralized -FN:205,getGasSpent -FNF:9 -FNH:9 -FNDA:63,constructor -FNDA:46,recordGasSpent -FNDA:13,finalize -FNDA:18,deposit -FNDA:7,startWithdrawal -FNDA:5,finalizeWithdrawal -FNDA:6,claim -FNDA:3,isCollateralized -FNDA:2,getGasSpent -DA:69,63 -DA:80,46 -DA:81,46 -DA:83,45 -DA:84,45 -DA:90,13 -DA:91,12 -DA:95,11 -DA:97,11 -DA:98,11 -DA:99,8 -DA:100,8 -DA:101,8 -DA:108,1 -DA:109,1 -DA:118,11 -DA:123,1 -DA:127,10 -DA:133,18 -DA:139,18 -DA:144,7 -DA:145,7 -DA:146,7 -DA:148,6 -DA:149,6 -DA:154,5 -DA:156,5 -DA:160,4 -DA:163,3 -DA:164,3 -DA:166,3 -DA:175,6 -DA:176,6 -DA:182,5 -DA:183,5 -DA:186,5 -DA:190,4 -DA:193,4 -DA:196,4 -DA:201,3 -DA:206,2 -LF:41 -LH:41 -BRDA:81,1,0,45 -BRDA:81,1,1,1 -BRDA:90,2,0,12 -BRDA:90,2,1,1 -BRDA:91,3,0,11 -BRDA:91,3,1,1 -BRDA:98,4,0,8 -BRDA:98,4,1,3 -BRDA:102,5,0,1 -BRDA:102,5,1,2 -BRDA:118,6,0,1 -BRDA:118,6,1,10 -BRDA:133,7,0,18 -BRDA:133,7,1,0 -BRDA:145,8,0,7 -BRDA:145,8,1,0 -BRDA:146,9,0,6 -BRDA:146,9,1,1 -BRDA:156,10,0,4 -BRDA:156,10,1,1 -BRDA:160,11,0,3 -BRDA:160,11,1,1 -BRDA:166,12,0,3 -BRDA:166,12,1,0 -BRDA:176,13,0,5 -BRDA:176,13,1,1 -BRDA:186,14,0,4 -BRDA:186,14,1,1 -BRDA:196,15,0,4 -BRDA:196,15,1,0 -BRF:30 -BRH:26 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol -FN:50,constructor -FN:63,getStateTransitioner -FN:103,initializeFraudVerification -FN:169,finalizeFraudVerification -FN:231,_hasStateTransitioner -FN:250,_deployTransitioner -FN:272,_cancelStateTransition -FNF:7 -FNH:7 -FNDA:33,constructor -FNDA:21,getStateTransitioner -FNDA:12,initializeFraudVerification -FNDA:6,finalizeFraudVerification -FNDA:12,_hasStateTransitioner -FNDA:9,_deployTransitioner -FNDA:1,_cancelStateTransition -DA:74,21 -DA:105,12 -DA:107,12 -DA:108,0 -DA:111,12 -DA:112,12 -DA:114,12 -DA:123,11 -DA:133,10 -DA:138,9 -DA:140,9 -DA:171,6 -DA:172,6 -DA:174,6 -DA:179,5 -DA:184,4 -DA:193,3 -DA:203,2 -DA:208,1 -DA:211,1 -DA:213,1 -DA:241,12 -DA:257,9 -DA:278,1 -DA:279,1 -DA:282,1 -DA:287,1 -DA:290,1 -LF:28 -LH:27 -BRDA:107,1,0,0 -BRDA:107,1,1,12 -BRDA:114,2,0,11 -BRDA:114,2,1,1 -BRDA:123,3,0,10 -BRDA:123,3,1,1 -BRDA:133,4,0,9 -BRDA:133,4,1,1 -BRDA:174,5,0,5 -BRDA:174,5,1,1 -BRDA:179,6,0,4 -BRDA:179,6,1,1 -BRDA:184,7,0,3 -BRDA:184,7,1,1 -BRDA:193,8,0,2 -BRDA:193,8,1,1 -BRDA:203,9,0,1 -BRDA:203,9,1,1 -BRF:18 -BRH:17 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol -FN:95,constructor -FN:114,onlyDuringPhase -FN:133,getPreStateRoot -FN:148,getPostStateRoot -FN:163,isComplete -FN:193,proveContractState -FN:265,proveStorageSlot -FN:329,applyTransaction -FN:377,commitContractState -FN:420,commitStorageSlot -FN:459,completeTransition -FNF:11 -FNH:10 -FNDA:42,constructor -FNDA:13,onlyDuringPhase -FNDA:0,getPreStateRoot -FNDA:1,getPostStateRoot -FNDA:1,isComplete -FNDA:2,proveContractState -FNDA:3,proveStorageSlot -FNDA:1,applyTransaction -FNDA:2,commitContractState -FNDA:2,commitStorageSlot -FNDA:3,completeTransition -DA:97,42 -DA:98,42 -DA:99,42 -DA:100,42 -DA:102,42 -DA:117,13 -DA:121,13 -DA:141,0 -DA:156,1 -DA:171,1 -DA:196,2 -DA:205,2 -DA:214,1 -DA:216,1 -DA:220,1 -DA:221,1 -DA:224,0 -DA:228,1 -DA:234,1 -DA:247,0 -DA:268,3 -DA:273,3 -DA:278,2 -DA:279,2 -DA:281,2 -DA:283,0 -DA:286,2 -DA:295,1 -DA:298,1 -DA:303,0 -DA:307,1 -DA:331,1 -DA:340,0 -DA:345,0 -DA:350,0 -DA:355,0 -DA:357,0 -DA:379,2 -DA:384,2 -DA:389,1 -DA:391,1 -DA:401,1 -DA:422,2 -DA:427,1 -DA:428,1 -DA:430,1 -DA:439,1 -DA:442,1 -DA:461,3 -DA:466,2 -DA:471,1 -LF:51 -LH:41 -BRDA:117,1,0,13 -BRDA:117,1,1,0 -BRDA:196,2,0,2 -BRDA:196,2,1,0 -BRDA:214,3,0,1 -BRDA:214,3,1,0 -BRDA:221,4,0,0 -BRDA:221,4,1,1 -BRDA:228,5,0,1 -BRDA:228,5,1,0 -BRDA:268,6,0,3 -BRDA:268,6,1,0 -BRDA:273,7,0,2 -BRDA:273,7,1,1 -BRDA:281,8,0,0 -BRDA:281,8,1,2 -BRDA:295,9,0,1 -BRDA:295,9,1,0 -BRDA:331,10,0,0 -BRDA:331,10,1,1 -BRDA:340,11,0,0 -BRDA:340,11,1,0 -BRDA:379,12,0,2 -BRDA:379,12,1,0 -BRDA:384,13,0,1 -BRDA:384,13,1,1 -BRDA:422,14,0,1 -BRDA:422,14,1,1 -BRDA:461,15,0,2 -BRDA:461,15,1,1 -BRDA:466,16,0,1 -BRDA:466,16,1,1 -BRF:32 -BRH:20 -end_of_record -TN: -SF:/Users/maurelian/Projects/Optimism/protocol/contracts/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol -FN:29,constructor -FN:44,create -FNF:2 -FNH:2 -FNDA:3,constructor -FNDA:1,create -DA:56,1 -DA:60,0 -LF:2 -LH:1 -BRDA:56,1,0,0 -BRDA:56,1,1,1 -BRF:2 -BRH:1 -end_of_record diff --git a/coverage/libraries/bridge/OVM_CrossDomainEnabled.sol.html b/coverage/libraries/bridge/OVM_CrossDomainEnabled.sol.html deleted file mode 100644 index c4c3bfaff..000000000 --- a/coverage/libraries/bridge/OVM_CrossDomainEnabled.sol.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - Code coverage report for libraries/bridge/OVM_CrossDomainEnabled.sol - - - - - - - -
-
-

- all files / libraries/bridge/ OVM_CrossDomainEnabled.sol -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 4/4 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 6/6 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -78× -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_CrossDomainEnabled
- * @dev Helper contract for contracts performing cross-domain communications
- *
- * Compiler used: defined by inheriting contract
- * Runtime target: defined by inheriting contract
- */
-contract OVM_CrossDomainEnabled {
-    // Messenger contract used to send and recieve messages from the other domain.
-    address public messenger;
- 
-    /***************
-     * Constructor *
-     ***************/    
-    constructor(
-        address _messenger
-    ) {
-        messenger = _messenger;
-    }
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * @notice Enforces that the modified function is only callable by a specific cross-domain account.
-     * @param _sourceDomainAccount The only account on the originating domain which is authenticated to call this function.
-     */
-    modifier onlyFromCrossDomainAccount(
-        address _sourceDomainAccount
-    ) {
-        require(
-            msg.sender == address(getCrossDomainMessenger()),
-            "OVM_XCHAIN: messenger contract unauthenticated"
-        );
- 
-        require(
-            getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,
-            "OVM_XCHAIN: wrong sender of cross-domain message"
-        );
- 
-        _;
-    }
-    
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Gets the messenger, usually from storage.  This function is exposed in case a child contract needs to override.
-     * @return The address of the cross-domain messenger contract which should be used. 
-     */
-    function getCrossDomainMessenger()
-        internal
-        virtual
-        returns(
-            iAbs_BaseCrossDomainMessenger
-        )
-    {
-        return iAbs_BaseCrossDomainMessenger(messenger);
-    }
- 
-    /**
-     * @notice Sends a message to an account on another domain
-     * @param _crossDomainTarget The intended recipient on the destination domain
-     * @param _data The data to send to the target (usually calldata to a function with `onlyFromCrossDomainAccount()`)
-     * @param _gasLimit The gasLimit for the receipt of the message on the target domain.
-     */
-    function sendCrossDomainMessage(
-        address _crossDomainTarget,
-        bytes memory _data,
-        uint32 _gasLimit
-    ) internal {
-        getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/bridge/index.html b/coverage/libraries/bridge/index.html deleted file mode 100644 index 0b17ee495..000000000 --- a/coverage/libraries/bridge/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for libraries/bridge/ - - - - - - - -
-
-

- all files libraries/bridge/ -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 4/4 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 6/6 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_CrossDomainEnabled.sol
100%5/5100%4/4100%4/4100%6/6
-
-
- - - - - - - diff --git a/coverage/libraries/codec/Lib_OVMCodec.sol.html b/coverage/libraries/codec/Lib_OVMCodec.sol.html deleted file mode 100644 index 925baaa05..000000000 --- a/coverage/libraries/codec/Lib_OVMCodec.sol.html +++ /dev/null @@ -1,1178 +0,0 @@ - - - - Code coverage report for libraries/codec/Lib_OVMCodec.sol - - - - - - - -
-
-

- all files / libraries/codec/ Lib_OVMCodec.sol -

-
-
- 100% - Statements - 33/33 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 33/33 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  - -  - - - - - -  - -  - - - - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -107× -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
-import { Lib_Bytes32Utils } from "../utils/Lib_Bytes32Utils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title Lib_OVMCodec
- */
-library Lib_OVMCodec {
- 
-    /*********
-     * Enums *
-     *********/
- 
-    enum EOASignatureType {
-        EIP155_TRANSACTON,
-        ETH_SIGNED_MESSAGE
-    }
- 
-    enum QueueOrigin {
-        SEQUENCER_QUEUE,
-        L1TOL2_QUEUE
-    }
- 
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct Account {
-        uint256 nonce;
-        uint256 balance;
-        bytes32 storageRoot;
-        bytes32 codeHash;
-        address ethAddress;
-        bool isFresh;
-    }
- 
-    struct EVMAccount {
-        uint256 nonce;
-        uint256 balance;
-        bytes32 storageRoot;
-        bytes32 codeHash;
-    }
- 
-    struct ChainBatchHeader {
-        uint256 batchIndex;
-        bytes32 batchRoot;
-        uint256 batchSize;
-        uint256 prevTotalElements;
-        bytes extraData;
-    }
- 
-    struct ChainInclusionProof {
-        uint256 index;
-        bytes32[] siblings;
-    }
- 
-    struct Transaction {
-        uint256 timestamp;
-        uint256 blockNumber;
-        QueueOrigin l1QueueOrigin;
-        address l1TxOrigin;
-        address entrypoint;
-        uint256 gasLimit;
-        bytes data;
-    }
- 
-    struct TransactionChainElement {
-        bool isSequenced;
-        uint256 queueIndex;  // QUEUED TX ONLY
-        uint256 timestamp;   // SEQUENCER TX ONLY
-        uint256 blockNumber; // SEQUENCER TX ONLY
-        bytes txData;        // SEQUENCER TX ONLY
-    }
- 
-    struct QueueElement {
-        bytes32 transactionHash;
-        uint40 timestamp;
-        uint40 blockNumber;
-    }
- 
-    struct EIP155Transaction {
-        uint256 nonce;
-        uint256 gasPrice;
-        uint256 gasLimit;
-        address to;
-        uint256 value;
-        bytes data;
-        uint256 chainId;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Decodes an EOA transaction (i.e., native Ethereum RLP encoding).
-     * @param _transaction Encoded EOA transaction.
-     * @return Transaction decoded into a struct.
-     */
-    function decodeEIP155Transaction(
-        bytes memory _transaction,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (
-            EIP155Transaction memory
-        )
-    {
-        if (_isEthSignedMessage) {
-            (
-                uint256 _nonce,
-                uint256 _gasLimit,
-                uint256 _gasPrice,
-                uint256 _chainId,
-                address _to,
-                bytes memory _data
-            ) = abi.decode(
-                _transaction,
-                (uint256, uint256, uint256, uint256, address ,bytes)
-            );
-            return EIP155Transaction({
-                nonce: _nonce,
-                gasPrice: _gasPrice,
-                gasLimit: _gasLimit,
-                to: _to,
-                value: 0,
-                data: _data,
-                chainId: _chainId
-            });
-        } else {
-            Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);
- 
-            return EIP155Transaction({
-                nonce: Lib_RLPReader.readUint256(decoded[0]),
-                gasPrice: Lib_RLPReader.readUint256(decoded[1]),
-                gasLimit: Lib_RLPReader.readUint256(decoded[2]),
-                to: Lib_RLPReader.readAddress(decoded[3]),
-                value: Lib_RLPReader.readUint256(decoded[4]),
-                data: Lib_RLPReader.readBytes(decoded[5]),
-                chainId:  Lib_RLPReader.readUint256(decoded[6])
-            });
-        }
-    }
- 
-    /**
-     * Decompresses a compressed EIP155 transaction.
-     * @param _transaction Compressed EIP155 transaction bytes.
-     * @return Transaction parsed into a struct.
-     */
-    function decompressEIP155Transaction(
-        bytes memory _transaction
-    )
-        internal
-        returns (
-            EIP155Transaction memory
-        )
-    {
-        return EIP155Transaction({
-            gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),
-            gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,
-            nonce: Lib_BytesUtils.toUint24(_transaction, 6),
-            to: Lib_BytesUtils.toAddress(_transaction, 9),
-            data: Lib_BytesUtils.slice(_transaction, 29),
-            chainId: Lib_SafeExecutionManagerWrapper.safeCHAINID(),
-            value: 0
-        });
-    }
- 
-    /**
-     * Encodes an EOA transaction back into the original transaction.
-     * @param _transaction EIP155transaction to encode.
-     * @param _isEthSignedMessage Whether or not this was an eth signed message.
-     * @return Encoded transaction.
-     */
-    function encodeEIP155Transaction(
-        EIP155Transaction memory _transaction,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        if (_isEthSignedMessage) {
-            return abi.encode(
-                _transaction.nonce,
-                _transaction.gasLimit,
-                _transaction.gasPrice,
-                _transaction.chainId,
-                _transaction.to,
-                _transaction.data
-            );
-        } else {
-            bytes[] memory raw = new bytes[](9);
- 
-            raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
-            raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
-            raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
-            if (_transaction.to == address(0)) {
-                raw[3] = Lib_RLPWriter.writeBytes('');
-            } else {
-                raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
-            }
-            raw[4] = Lib_RLPWriter.writeUint(0);
-            raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
-            raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
-            raw[7] = Lib_RLPWriter.writeBytes(bytes(''));
-            raw[8] = Lib_RLPWriter.writeBytes(bytes(''));
- 
-            return Lib_RLPWriter.writeList(raw);
-        }
-    }
- 
-    /**
-     * Encodes a standard OVM transaction.
-     * @param _transaction OVM transaction to encode.
-     * @return Encoded transaction bytes.
-     */
-    function encodeTransaction(
-        Transaction memory _transaction
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodePacked(
-            _transaction.timestamp,
-            _transaction.blockNumber,
-            _transaction.l1QueueOrigin,
-            _transaction.l1TxOrigin,
-            _transaction.entrypoint,
-            _transaction.gasLimit,
-            _transaction.data
-        );
-    }
- 
-    /**
-     * Hashes a standard OVM transaction.
-     * @param _transaction OVM transaction to encode.
-     * @return Hashed transaction
-     */
-    function hashTransaction(
-        Transaction memory _transaction
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(encodeTransaction(_transaction));
-    }
- 
-    /**
-     * Converts an OVM account to an EVM account.
-     * @param _in OVM account to convert.
-     * @return Converted EVM account.
-     */
-    function toEVMAccount(
-        Account memory _in
-    )
-        internal
-        pure
-        returns (
-            EVMAccount memory
-        )
-    {
-        return EVMAccount({
-            nonce: _in.nonce,
-            balance: _in.balance,
-            storageRoot: _in.storageRoot,
-            codeHash: _in.codeHash
-        });
-    }
- 
-    /**
-     * @notice RLP-encodes an account state struct.
-     * @param _account Account state struct.
-     * @return RLP-encoded account state.
-     */
-    function encodeEVMAccount(
-        EVMAccount memory _account
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes[] memory raw = new bytes[](4);
- 
-        // Unfortunately we can't create this array outright because
-        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning
-        // index-by-index circumvents this issue.
-        raw[0] = Lib_RLPWriter.writeBytes(
-            Lib_Bytes32Utils.removeLeadingZeros(
-                bytes32(_account.nonce)
-            )
-        );
-        raw[1] = Lib_RLPWriter.writeBytes(
-            Lib_Bytes32Utils.removeLeadingZeros(
-                bytes32(_account.balance)
-            )
-        );
-        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));
-        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));
- 
-        return Lib_RLPWriter.writeList(raw);
-    }
- 
-    /**
-     * @notice Decodes an RLP-encoded account state into a useful struct.
-     * @param _encoded RLP-encoded account state.
-     * @return Account state struct.
-     */
-    function decodeEVMAccount(
-        bytes memory _encoded
-    )
-        internal
-        pure
-        returns (
-            EVMAccount memory
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);
- 
-        return EVMAccount({
-            nonce: Lib_RLPReader.readUint256(accountState[0]),
-            balance: Lib_RLPReader.readUint256(accountState[1]),
-            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),
-            codeHash: Lib_RLPReader.readBytes32(accountState[3])
-        });
-    }
- 
-    /**
-     * Calculates a hash for a given batch header.
-     * @param _batchHeader Header to hash.
-     * @return Hash of the header.
-     */
-    function hashBatchHeader(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(
-            abi.encode(
-                _batchHeader.batchRoot,
-                _batchHeader.batchSize,
-                _batchHeader.prevTotalElements,
-                _batchHeader.extraData
-            )
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/codec/index.html b/coverage/libraries/codec/index.html deleted file mode 100644 index 938f11b95..000000000 --- a/coverage/libraries/codec/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for libraries/codec/ - - - - - - - -
-
-

- all files libraries/codec/ -

-
-
- 100% - Statements - 33/33 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 33/33 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_OVMCodec.sol
100%33/33100%6/6100%9/9100%33/33
-
-
- - - - - - - diff --git a/coverage/libraries/resolver/Lib_AddressManager.sol.html b/coverage/libraries/resolver/Lib_AddressManager.sol.html deleted file mode 100644 index 2a868eb60..000000000 --- a/coverage/libraries/resolver/Lib_AddressManager.sol.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - Code coverage report for libraries/resolver/Lib_AddressManager.sol - - - - - - - -
-
-

- all files / libraries/resolver/ Lib_AddressManager.sol -

-
-
- 100% - Statements - 4/4 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -379× -379× -  -  -  -  -  -  -  -  -  -2107× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2486× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { Ownable } from "./Lib_Ownable.sol";
- 
-/**
- * @title Lib_AddressManager
- */
-contract Lib_AddressManager is Ownable {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event AddressSet(
-        string _name,
-        address _newAddress
-    );
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    mapping (bytes32 => address) private addresses;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function setAddress(
-        string memory _name,
-        address _address
-    )
-        public
-        onlyOwner
-    {
-        emit AddressSet(_name, _address);
-        addresses[_getNameHash(_name)] = _address;
-    }
- 
-    function getAddress(
-        string memory _name
-    )
-        public
-        view
-        returns (address)
-    {
-        return addresses[_getNameHash(_name)];
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _getNameHash(
-        string memory _name
-    )
-        internal
-        pure
-        returns (
-            bytes32 _hash
-        )
-    {
-        return keccak256(abi.encodePacked(_name));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/resolver/Lib_AddressResolver.sol.html b/coverage/libraries/resolver/Lib_AddressResolver.sol.html deleted file mode 100644 index c16b6c033..000000000 --- a/coverage/libraries/resolver/Lib_AddressResolver.sol.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - Code coverage report for libraries/resolver/Lib_AddressResolver.sol - - - - - - - -
-
-

- all files / libraries/resolver/ Lib_AddressResolver.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1041× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2076× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressManager } from "./Lib_AddressManager.sol";
- 
-/**
- * @title Lib_AddressResolver
- */
-abstract contract Lib_AddressResolver {
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    Lib_AddressManager internal libAddressManager;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Lib_AddressManager.
-     */
-    constructor(
-        address _libAddressManager
-    )  {
-        libAddressManager = Lib_AddressManager(_libAddressManager);
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function resolve(
-        string memory _name
-    )
-        public
-        view
-        returns (
-            address _contract
-        )
-    {
-        return libAddressManager.getAddress(_name);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/resolver/Lib_Ownable.sol.html b/coverage/libraries/resolver/Lib_Ownable.sol.html deleted file mode 100644 index 8b947582e..000000000 --- a/coverage/libraries/resolver/Lib_Ownable.sol.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - Code coverage report for libraries/resolver/Lib_Ownable.sol - - - - - - - -
-
-

- all files / libraries/resolver/ Lib_Ownable.sol -

-
-
- 37.5% - Statements - 3/8 -
-
- 25% - Branches - 1/4 -
-
- 50% - Functions - 2/4 -
-
- 44.44% - Lines - 4/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -120× -120× -  -  -  -  -  -  -  -  -379× -  -  -  -379× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Ownable
- * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
- */
-abstract contract Ownable {
- 
-    /*************
-     * Variables *
-     *************/
- 
-    address public owner;
- 
- 
-    /**********
-     * Events *
-     **********/
- 
-    event OwnershipTransferred(
-        address indexed previousOwner,
-        address indexed newOwner
-    );
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    constructor() {
-        owner = msg.sender;
-        emit OwnershipTransferred(address(0), owner);
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyOwner() {
-        Erequire(
-            owner == msg.sender,
-            "Ownable: caller is not the owner"
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function renounceOwnership()
-        public
-        virtual
-        onlyOwner
-    {
-        emit OwnershipTransferred(owner, address(0));
-        owner = address(0);
-    }
- 
-    function transferOwnership(address _newOwner)
-        public
-        virtual
-        onlyOwner
-    {
-        require(
-            _newOwner != address(0),
-            "Ownable: new owner cannot be the zero address"
-        );
- 
-        emit OwnershipTransferred(owner, _newOwner);
-        owner = _newOwner;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html b/coverage/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html deleted file mode 100644 index dfa334ef9..000000000 --- a/coverage/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - Code coverage report for libraries/resolver/Lib_ResolvedDelegateProxy.sol - - - - - - - -
-
-

- all files / libraries/resolver/ Lib_ResolvedDelegateProxy.sol -

-
-
- 100% - Statements - 6/6 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 8/8 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -36× -36× -  -  -  -  -  -  -  -  -  -  -31× -31× -  -  -  -  -31× -  -31× -22× -  -  -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressManager } from "./Lib_AddressManager.sol";
- 
-/**
- * @title Lib_ResolvedDelegateProxy
- */
-contract Lib_ResolvedDelegateProxy {
- 
-    /*************
-     * Variables *
-     *************/
- 
- 
-    // Using mappings to store fields to avoid overwriting storage slots in the
-    // implementation contract. For example, instead of storing these fields at
-    // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.
-    // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html
-    // NOTE: Do not use this code in your own contract system. 
-    //      There is a known flaw in this contract, and we will remove it from the repository
-    //      in the near future. Due to the very limited way that we are using it, this flaw is
-    //      not an issue in our system. 
-    mapping(address=>string) private implementationName;
-    mapping(address=>Lib_AddressManager) private addressManager;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Lib_AddressManager.
-     * @param _implementationName implementationName of the contract to proxy to.
-     */
-    constructor(
-        address _libAddressManager,
-        string memory _implementationName
-    )
-    {
-        addressManager[address(this)] = Lib_AddressManager(_libAddressManager);
-        implementationName[address(this)] = _implementationName;
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        address target = addressManager[address(this)].getAddress((implementationName[address(this)]));
-        Erequire(
-            target != address(0),
-            "Target address must be initialized."
-        );
- 
-        (bool success, bytes memory returndata) = target.delegatecall(msg.data);
- 
-        if (success == true) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/resolver/index.html b/coverage/libraries/resolver/index.html deleted file mode 100644 index 0b43123ea..000000000 --- a/coverage/libraries/resolver/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for libraries/resolver/ - - - - - - - -
-
-

- all files libraries/resolver/ -

-
-
- 75% - Statements - 15/20 -
-
- 50% - Branches - 4/8 -
-
- 81.82% - Functions - 9/11 -
-
- 78.26% - Lines - 18/23 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_AddressManager.sol
100%4/4100%0/0100%3/3100%4/4
Lib_AddressResolver.sol
100%2/2100%0/0100%2/2100%2/2
Lib_Ownable.sol
37.5%3/825%1/450%2/444.44%4/9
Lib_ResolvedDelegateProxy.sol
100%6/675%3/4100%2/2100%8/8
-
-
- - - - - - - diff --git a/coverage/libraries/rlp/Lib_RLPReader.sol.html b/coverage/libraries/rlp/Lib_RLPReader.sol.html deleted file mode 100644 index 490fb050e..000000000 --- a/coverage/libraries/rlp/Lib_RLPReader.sol.html +++ /dev/null @@ -1,1925 +0,0 @@ - - - - Code coverage report for libraries/rlp/Lib_RLPReader.sol - - - - - - - -
-
-

- all files / libraries/rlp/ Lib_RLPReader.sol -

-
-
- 98.68% - Statements - 75/76 -
-
- 67.5% - Branches - 27/40 -
-
- 94.74% - Functions - 18/19 -
-
- 98.8% - Lines - 82/83 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -512× -512× -  -  -  -512× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -450× -  -  -  -  -  -446× -  -  -  -  -  -  -  -  -446× -  -446× -446× -446× -4230× -  -  -  -  -4230× -  -  -  -  -  -  -  -4230× -  -  -  -  -4230× -4230× -  -  -  -446× -  -  -  -446× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -450× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -651× -  -  -  -  -  -651× -  -  -  -  -651× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -68× -  -  -  -  -68× -  -  -  -  -  -68× -  -  -  -  -68× -68× -68× -  -  -  -  -  -  -  -  -68× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -56× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - - - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -776× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -5399× -  -  -  -  -5395× -5395× -5395× -  -  -  -5395× -  -  -33× -  -  -  -4334× -  -4334× -  -  -  -  -4334× -  -  -536× -  -536× -  -  -  -  -536× -536× -  -  -  -  -  -  -  -536× -  -  -  -  -536× -  -  -89× -  -89× -  -  -  -  -89× -  -  -403× -  -403× -  -  -  -  -403× -403× -  -  -  -  -  -  -  -403× -  -  -  -  -403× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1427× -1427× - -  -  -1426× -1426× -1426× -  -  -  -  -1426× -2634× -  -  -  -2634× -2634× -  -  -  -1426× -1426× -  -  -  -  -  -  -  -  -  -1426× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -776× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_RLPReader
- * @dev Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).
- */
-library Lib_RLPReader {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 constant internal MAX_LIST_LENGTH = 32;
- 
- 
-    /*********
-     * Enums *
-     *********/
- 
-    enum RLPItemType {
-        DATA_ITEM,
-        LIST_ITEM
-    }
- 
-    
-    /***********
-     * Structs *
-     ***********/
- 
-    struct RLPItem {
-        uint256 length;
-        uint256 ptr;
-    }
-    
- 
-    /**********************
-     * Internal Functions *
-     **********************/
-    
-    /**
-     * Converts bytes to a reference to memory position and length.
-     * @param _in Input bytes to convert.
-     * @return Output memory reference.
-     */
-    function toRLPItem(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem memory
-        )
-    {
-        uint256 ptr;
-        assembly {
-            ptr := add(_in, 32)
-        }
- 
-        return RLPItem({
-            length: _in.length,
-            ptr: ptr
-        });
-    }
- 
-    /**
-     * Reads an RLP list value into a list of RLP items.
-     * @param _in RLP list value.
-     * @return Decoded RLP list items.
-     */
-    function readList(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem[] memory
-        )
-    {
-        (
-            uint256 listOffset,
-            ,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.LIST_ITEM,
-            "Invalid RLP list value."
-        );
- 
-        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by
-        // writing to the length. Since we can't know the number of RLP items without looping over
-        // the entire input, we'd have to loop twice to accurately size this array. It's easier to
-        // simply set a reasonable maximum list length and decrease the size before we finish.
-        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);
- 
-        uint256 itemCount = 0;
-        uint256 offset = listOffset;
-        while (offset < _in.length) {
-            Erequire(
-                itemCount < MAX_LIST_LENGTH,
-                "Provided RLP list exceeds max list length."
-            );
- 
-            (
-                uint256 itemOffset,
-                uint256 itemLength,
-            ) = _decodeLength(RLPItem({
-                length: _in.length - offset,
-                ptr: _in.ptr + offset
-            }));
- 
-            out[itemCount] = RLPItem({
-                length: itemLength + itemOffset,
-                ptr: _in.ptr + offset
-            });
- 
-            itemCount += 1;
-            offset += itemOffset + itemLength;
-        }
- 
-        // Decrease the array size to match the actual item count.
-        assembly {
-            mstore(out, itemCount)
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Reads an RLP list value into a list of RLP items.
-     * @param _in RLP list value.
-     * @return Decoded RLP list items.
-     */
-    function readList(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem[] memory
-        )
-    {
-        return readList(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bytes value into bytes.
-     * @param _in RLP bytes value.
-     * @return Decoded bytes.
-     */
-    function readBytes(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        (
-            uint256 itemOffset,
-            uint256 itemLength,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.DATA_ITEM,
-            "Invalid RLP bytes value."
-        );
- 
-        return _copy(_in.ptr, itemOffset, itemLength);
-    }
- 
-    /**
-     * Reads an RLP bytes value into bytes.
-     * @param _in RLP bytes value.
-     * @return Decoded bytes.
-     */
-    function readBytes(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return readBytes(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP string value into a string.
-     * @param _in RLP string value.
-     * @return Decoded string.
-     */
-    function readString(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            string memory
-        )
-    {
-        return string(readBytes(_in));
-    }
- 
-    /**
-     * Reads an RLP string value into a string.
-     * @param _in RLP string value.
-     * @return Decoded string.
-     */
-    function readString(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            string memory
-        )
-    {
-        return readString(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bytes32 value into a bytes32.
-     * @param _in RLP bytes32 value.
-     * @return Decoded bytes32.
-     */
-    function readBytes32(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        Erequire(
-            _in.length <= 33,
-            "Invalid RLP bytes32 value."
-        );
- 
-        (
-            uint256 itemOffset,
-            uint256 itemLength,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.DATA_ITEM,
-            "Invalid RLP bytes32 value."
-        );
- 
-        uint256 ptr = _in.ptr + itemOffset;
-        bytes32 out;
-        assembly {
-            out := mload(ptr)
- 
-            // Shift the bytes over to match the item size.
-            if lt(itemLength, 32) {
-                out := div(out, exp(256, sub(32, itemLength)))
-            }
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Reads an RLP bytes32 value into a bytes32.
-     * @param _in RLP bytes32 value.
-     * @return Decoded bytes32.
-     */
-    function readBytes32(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return readBytes32(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP uint256 value into a uint256.
-     * @param _in RLP uint256 value.
-     * @return Decoded uint256.
-     */
-    function readUint256(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        return uint256(readBytes32(_in));
-    }
- 
-    /**
-     * Reads an RLP uint256 value into a uint256.
-     * @param _in RLP uint256 value.
-     * @return Decoded uint256.
-     */
-    function readUint256(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        return readUint256(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bool value into a bool.
-     * @param _in RLP bool value.
-     * @return Decoded bool.
-     */
-    function readBool(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        Erequire(
-            _in.length == 1,
-            "Invalid RLP boolean value."
-        );
- 
-        uint256 ptr = _in.ptr;
-        uint256 out;
-        assembly {
-            out := byte(0, mload(ptr))
-        }
- 
-        return out != 0;
-    }
- 
-    /**
-     * Reads an RLP bool value into a bool.
-     * @param _in RLP bool value.
-     * @return Decoded bool.
-     */
-    function readBool(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        return readBool(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP address value into a address.
-     * @param _in RLP address value.
-     * @return Decoded address.
-     */
-    function readAddress(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        if (_in.length == 1) {
-            return address(0);
-        }
- 
-        Erequire(
-            _in.length == 21,
-            "Invalid RLP address value."
-        );
- 
-        return address(readUint256(_in));
-    }
- 
-    /**
-     * Reads an RLP address value into a address.
-     * @param _in RLP address value.
-     * @return Decoded address.
-     */
-    function readAddress(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        return readAddress(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads the raw bytes of an RLP item.
-     * @param _in RLP item to read.
-     * @return Raw RLP bytes.
-     */
-    function readRawBytes(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return _copy(_in);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Decodes the length of an RLP item.
-     * @param _in RLP item to decode.
-     * @return Offset of the encoded data.
-     * @return Length of the encoded data.
-     * @return RLP item type (LIST_ITEM or DATA_ITEM).
-     */
-    function _decodeLength(
-        RLPItem memory _in
-    )
-        private
-        pure
-        returns (
-            uint256,
-            uint256,
-            RLPItemType
-        )
-    {
-        require(
-            _in.length > 0,
-            "RLP item cannot be null."
-        );
- 
-        uint256 ptr = _in.ptr;
-        uint256 prefix;
-        assembly {
-            prefix := byte(0, mload(ptr))
-        }
- 
-        if (prefix <= 0x7f) {
-            // Single byte.
- 
-            return (0, 1, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xb7) {
-            // Short string.
- 
-            uint256 strLen = prefix - 0x80;
-            
-            Erequire(
-                _in.length > strLen,
-                "Invalid RLP short string."
-            );
- 
-            return (1, strLen, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xbf) {
-            // Long string.
-            uint256 lenOfStrLen = prefix - 0xb7;
- 
-            Erequire(
-                _in.length > lenOfStrLen,
-                "Invalid RLP long string length."
-            );
- 
-            uint256 strLen;
-            assembly {
-                // Pick out the string length.
-                strLen := div(
-                    mload(add(ptr, 1)),
-                    exp(256, sub(32, lenOfStrLen))
-                )
-            }
- 
-            Erequire(
-                _in.length > lenOfStrLen + strLen,
-                "Invalid RLP long string."
-            );
- 
-            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xf7) {
-            // Short list.
-            uint256 listLen = prefix - 0xc0;
- 
-            Erequire(
-                _in.length > listLen,
-                "Invalid RLP short list."
-            );
- 
-            return (1, listLen, RLPItemType.LIST_ITEM);
-        } else {
-            // Long list.
-            uint256 lenOfListLen = prefix - 0xf7;
- 
-            Erequire(
-                _in.length > lenOfListLen,
-                "Invalid RLP long list length."
-            );
- 
-            uint256 listLen;
-            assembly {
-                // Pick out the list length.
-                listLen := div(
-                    mload(add(ptr, 1)),
-                    exp(256, sub(32, lenOfListLen))
-                )
-            }
- 
-            Erequire(
-                _in.length > lenOfListLen + listLen,
-                "Invalid RLP long list."
-            );
- 
-            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);
-        }
-    }
- 
-    /**
-     * Copies the bytes from a memory location.
-     * @param _src Pointer to the location to read from.
-     * @param _offset Offset to start reading from.
-     * @param _length Number of bytes to read.
-     * @return Copied bytes.
-     */
-    function _copy(
-        uint256 _src,
-        uint256 _offset,
-        uint256 _length
-    )
-        private
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes memory out = new bytes(_length);
-        if (out.length == 0) {
-            return out;
-        }
- 
-        uint256 src = _src + _offset;
-        uint256 dest;
-        assembly {
-            dest := add(out, 32)
-        }
- 
-        // Copy over as many complete words as we can.
-        for (uint256 i = 0; i < _length / 32; i++) {
-            assembly {
-                mstore(dest, mload(src))
-            }
- 
-            src += 32;
-            dest += 32;
-        }
- 
-        // Pick out the remaining bytes.
-        uint256 mask = 256 ** (32 - (_length % 32)) - 1;
-        assembly {
-            mstore(
-                dest,
-                or(
-                    and(mload(src), not(mask)),
-                    and(mload(dest), mask)
-                )
-            )
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Copies an RLP item into bytes.
-     * @param _in RLP item to copy.
-     * @return Copied bytes.
-     */
-    function _copy(
-        RLPItem memory _in
-    )
-        private
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return _copy(_in.ptr, 0, _in.length);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/rlp/Lib_RLPWriter.sol.html b/coverage/libraries/rlp/Lib_RLPWriter.sol.html deleted file mode 100644 index dee20330d..000000000 --- a/coverage/libraries/rlp/Lib_RLPWriter.sol.html +++ /dev/null @@ -1,911 +0,0 @@ - - - - Code coverage report for libraries/rlp/Lib_RLPWriter.sol - - - - - - - -
-
-

- all files / libraries/rlp/ Lib_RLPWriter.sol -

-
-
- 94.55% - Statements - 52/55 -
-
- 100% - Branches - 8/8 -
-
- 90% - Functions - 9/10 -
-
- 95.08% - Lines - 58/61 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -324× -  -324× -16× -  -308× -  -  -324× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -157× -157× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -139× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -465× -  -465× -415× -415× -  -50× -50× -50× -72× -72× -  -  -50× -50× -50× -72× -  -  -  -465× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -  -52× -52× -1643× -24× -  -  -  -52× -52× -45× -  -  -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1030× -1030× -1030× -  -1030× -420× -  -  -420× -420× -  -  -1030× -1030× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -157× - -  -  -149× -149× -149× -1030× -  -  -149× -149× -149× -  -149× -1030× -  -1030× -1030× -  -1030× -1030× -  -  -149× -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
- 
-/**
- * @title Lib_RLPWriter
- * @author Bakaoh (with modifications)
- */
-library Lib_RLPWriter {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * RLP encodes a byte string.
-     * @param _in The byte string to encode.
-     * @return _out The RLP encoded string in bytes.
-     */
-    function writeBytes(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory encoded;
- 
-        if (_in.length == 1 && uint8(_in[0]) < 128) {
-            encoded = _in;
-        } else {
-            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);
-        }
- 
-        return encoded;
-    }
- 
-    /**
-     * RLP encodes a list of RLP encoded byte byte strings.
-     * @param _in The list of RLP encoded byte strings.
-     * @return _out The RLP encoded list of items in bytes.
-     */
-    function writeList(
-        bytes[] memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory list = _flatten(_in);
-        return abi.encodePacked(_writeLength(list.length, 192), list);
-    }
- 
-    /**
-     * RLP encodes a string.
-     * @param _in The string to encode.
-     * @return _out The RLP encoded string in bytes.
-     */
-    function writeString(
-        string memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(bytes(_in));
-    }
- 
-    /**
-     * RLP encodes an address.
-     * @param _in The address to encode.
-     * @return _out The RLP encoded address in bytes.
-     */
-    function writeAddress(
-        address _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(abi.encodePacked(_in));
-    }
- 
-    /**
-     * RLP encodes a uint.
-     * @param _in The uint256 to encode.
-     * @return _out The RLP encoded uint256 in bytes.
-     */
-    function writeUint(
-        uint256 _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(_toBinary(_in));
-    }
- 
-    /**
-     * RLP encodes a bool.
-     * @param _in The bool to encode.
-     * @return _out The RLP encoded bool in bytes.
-     */
-    function writeBool(
-        bool _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory encoded = new bytes(1);
-        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));
-        return encoded;
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.
-     * @param _len The length of the string or the payload.
-     * @param _offset 128 if item is string, 192 if item is list.
-     * @return _encoded RLP encoded bytes.
-     */
-    function _writeLength(
-        uint256 _len,
-        uint256 _offset
-    )
-        private
-        pure
-        returns (
-            bytes memory _encoded
-        )
-    {
-        bytes memory encoded;
- 
-        if (_len < 56) {
-            encoded = new bytes(1);
-            encoded[0] = byte(uint8(_len) + uint8(_offset));
-        } else {
-            uint256 lenLen;
-            uint256 i = 1;
-            while (_len / i != 0) {
-                lenLen++;
-                i *= 256;
-            }
- 
-            encoded = new bytes(lenLen + 1);
-            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);
-            for(i = 1; i <= lenLen; i++) {
-                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));
-            }
-        }
- 
-        return encoded;
-    }
- 
-    /**
-     * Encode integer in big endian binary form with no leading zeroes.
-     * @notice TODO: This should be optimized with assembly to save gas costs.
-     * @param _x The integer to encode.
-     * @return _binary RLP encoded bytes.
-     */
-    function _toBinary(
-        uint256 _x
-    )
-        private
-        pure
-        returns (
-            bytes memory _binary
-        )
-    {
-        bytes memory b = abi.encodePacked(_x);
- 
-        uint256 i = 0;
-        for (; i < 32; i++) {
-            if (b[i] != 0) {
-                break;
-            }
-        }
- 
-        bytes memory res = new bytes(32 - i);
-        for (uint256 j = 0; j < res.length; j++) {
-            res[j] = b[i++];
-        }
- 
-        return res;
-    }
- 
-    /**
-     * Copies a piece of memory to another location.
-     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.
-     * @param _dest Destination location.
-     * @param _src Source location.
-     * @param _len Length of memory to copy.
-     */
-    function _memcpy(
-        uint256 _dest,
-        uint256 _src,
-        uint256 _len
-    )
-        private
-        pure
-    {
-        uint256 dest = _dest;
-        uint256 src = _src;
-        uint256 len = _len;
- 
-        for(; len >= 32; len -= 32) {
-            assembly {
-                mstore(dest, mload(src))
-            }
-            dest += 32;
-            src += 32;
-        }
- 
-        uint256 mask = 256 ** (32 - len) - 1;
-        assembly {
-            let srcpart := and(mload(src), not(mask))
-            let destpart := and(mload(dest), mask)
-            mstore(dest, or(destpart, srcpart))
-        }
-    }
- 
-    /**
-     * Flattens a list of byte strings into one byte string.
-     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.
-     * @param _list List of byte strings to flatten.
-     * @return _flattened The flattened byte string.
-     */
-    function _flatten(
-        bytes[] memory _list
-    )
-        private
-        pure
-        returns (
-            bytes memory _flattened
-        )
-    {
-        if (_list.length == 0) {
-            return new bytes(0);
-        }
- 
-        uint256 len;
-        uint256 i = 0;
-        for (; i < _list.length; i++) {
-            len += _list[i].length;
-        }
- 
-        bytes memory flattened = new bytes(len);
-        uint256 flattenedPtr;
-        assembly { flattenedPtr := add(flattened, 0x20) }
- 
-        for(i = 0; i < _list.length; i++) {
-            bytes memory item = _list[i];
- 
-            uint256 listPtr;
-            assembly { listPtr := add(item, 0x20)}
- 
-            _memcpy(flattenedPtr, listPtr, item.length);
-            flattenedPtr += _list[i].length;
-        }
- 
-        return flattened;
-    }
-}
-
-
- - - - - - - diff --git a/coverage/libraries/rlp/index.html b/coverage/libraries/rlp/index.html deleted file mode 100644 index bcae97d2c..000000000 --- a/coverage/libraries/rlp/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for libraries/rlp/ - - - - - - - -
-
-

- all files libraries/rlp/ -

-
-
- 96.95% - Statements - 127/131 -
-
- 72.92% - Branches - 35/48 -
-
- 93.1% - Functions - 27/29 -
-
- 97.22% - Lines - 140/144 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_RLPReader.sol
98.68%75/7667.5%27/4094.74%18/1998.8%82/83
Lib_RLPWriter.sol
94.55%52/55100%8/890%9/1095.08%58/61
-
-
- - - - - - - diff --git a/coverage/libraries/standards/IUniswapV2ERC20.sol.html b/coverage/libraries/standards/IUniswapV2ERC20.sol.html deleted file mode 100644 index 76e84e00c..000000000 --- a/coverage/libraries/standards/IUniswapV2ERC20.sol.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - Code coverage report for libraries/standards/IUniswapV2ERC20.sol - - - - - - - -
-
-

- all files / libraries/standards/ IUniswapV2ERC20.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-interface IUniswapV2ERC20 {
-    event Approval(address indexed owner, address indexed spender, uint value);
-    event Transfer(address indexed from, address indexed to, uint value);
- 
-    function name() external view returns (string memory);
-    function symbol() external view returns (string memory);
-    function decimals() external view returns (uint8);
-    function totalSupply() external view returns (uint);
-    function balanceOf(address owner) external view returns (uint);
-    function allowance(address owner, address spender) external view returns (uint);
- 
-    function approve(address spender, uint value) external returns (bool);
-    function transfer(address to, uint value) external returns (bool);
-    function transferFrom(address from, address to, uint value) external returns (bool);
- 
-    function DOMAIN_SEPARATOR() external view returns (bytes32);
-    function PERMIT_TYPEHASH() external pure returns (bytes32);
-    function nonces(address owner) external view returns (uint);
- 
-    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/standards/UniSafeMath.sol.html b/coverage/libraries/standards/UniSafeMath.sol.html deleted file mode 100644 index 72011637e..000000000 --- a/coverage/libraries/standards/UniSafeMath.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for libraries/standards/UniSafeMath.sol - - - - - - - -
-
-

- all files / libraries/standards/ UniSafeMath.sol -

-
-
- 66.67% - Statements - 2/3 -
-
- 33.33% - Branches - 2/6 -
-
- 66.67% - Functions - 2/3 -
-
- 66.67% - Lines - 2/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  - -  -  -  -10× -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
- 
-library UniSafeMath {
-    function add(uint x, uint y) internal pure returns (uint z) {
-        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
-    }
- 
-    function sub(uint x, uint y) internal pure returns (uint z) {
-        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
-    }
- 
-    function mul(uint x, uint y) internal pure returns (uint z) {
-        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/standards/UniswapV2ERC20.sol.html b/coverage/libraries/standards/UniswapV2ERC20.sol.html deleted file mode 100644 index a80601a95..000000000 --- a/coverage/libraries/standards/UniswapV2ERC20.sol.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - Code coverage report for libraries/standards/UniswapV2ERC20.sol - - - - - - - -
-
-

- all files / libraries/standards/ UniswapV2ERC20.sol -

-
-
- 82.14% - Statements - 23/28 -
-
- 16.67% - Branches - 1/6 -
-
- 88.89% - Functions - 8/9 -
-
- 82.76% - Lines - 24/29 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -39× -39× -  -39× -39× -  -  -39× -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  - - - -  -  -  - - -  -  -  - - - -  -  -  - - -  -  -  - - -  -  -  - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-import './IUniswapV2ERC20.sol';
-import './UniSafeMath.sol';
- 
-contract UniswapV2ERC20 is IUniswapV2ERC20 {
-    using UniSafeMath for uint;
- 
-    string public override name;
-    string public override symbol;
-    uint8 public constant override decimals = 18;
-    uint public override totalSupply;
-    mapping(address => uint) public override balanceOf;
-    mapping(address => mapping(address => uint)) public override allowance;
- 
-    bytes32 public override DOMAIN_SEPARATOR;
-    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
-    bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
-    mapping(address => uint) public override nonces;
- 
-    constructor(
-    string memory _name,
-        string memory _symbol
-    ) {
-        name = _name;
-        symbol = _symbol;
- 
-        uint chainId;
-        assembly {
-            chainId := chainid()
-        }
-        DOMAIN_SEPARATOR = keccak256(
-            abi.encode(
-                keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
-                keccak256(bytes(name)),
-                keccak256(bytes('1')),
-                chainId,
-                address(this)
-            )
-        );
-    }
- 
-    function _mint(address to, uint value) internal {
-        totalSupply = totalSupply.add(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(address(0), to, value);
-    }
- 
-    function _burn(address from, uint value) internal {
-        balanceOf[from] = balanceOf[from].sub(value);
-        totalSupply = totalSupply.sub(value);
-        emit Transfer(from, address(0), value);
-    }
- 
-    function _approve(address owner, address spender, uint value) private {
-        allowance[owner][spender] = value;
-        emit Approval(owner, spender, value);
-    }
- 
-    function _transfer(address from, address to, uint value) private {
-        balanceOf[from] = balanceOf[from].sub(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(from, to, value);
-    }
- 
-    function approve(address spender, uint value) external override returns (bool) {
-        _approve(msg.sender, spender, value);
-        return true;
-    }
- 
-    function transfer(address to, uint value) external override returns (bool) {
-        _transfer(msg.sender, to, value);
-        return true;
-    }
- 
-    function transferFrom(address from, address to, uint value) external override returns (bool) {
-        Eif (allowance[from][msg.sender] != uint(-1)) {
-            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
-        }
-        _transfer(from, to, value);
-        return true;
-    }
- 
-    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override {
-        require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
-        bytes32 digest = keccak256(
-            abi.encodePacked(
-                '\x19\x01',
-                DOMAIN_SEPARATOR,
-                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
-            )
-        );
-        address recoveredAddress = ecrecover(digest, v, r, s);
-        require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
-        _approve(owner, spender, value);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/standards/index.html b/coverage/libraries/standards/index.html deleted file mode 100644 index 220cb4426..000000000 --- a/coverage/libraries/standards/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for libraries/standards/ - - - - - - - -
-
-

- all files libraries/standards/ -

-
-
- 80.65% - Statements - 25/31 -
-
- 25% - Branches - 3/12 -
-
- 83.33% - Functions - 10/12 -
-
- 81.25% - Lines - 26/32 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
IUniswapV2ERC20.sol
100%0/0100%0/0100%0/0100%0/0
UniSafeMath.sol
66.67%2/333.33%2/666.67%2/366.67%2/3
UniswapV2ERC20.sol
82.14%23/2816.67%1/688.89%8/982.76%24/29
-
-
- - - - - - - diff --git a/coverage/libraries/trie/Lib_MerkleTrie.sol.html b/coverage/libraries/trie/Lib_MerkleTrie.sol.html deleted file mode 100644 index cfc1241f8..000000000 --- a/coverage/libraries/trie/Lib_MerkleTrie.sol.html +++ /dev/null @@ -1,2945 +0,0 @@ - - - - Code coverage report for libraries/trie/Lib_MerkleTrie.sol - - - - - - - -
-
-

- all files / libraries/trie/ Lib_MerkleTrie.sol -

-
-
- 72.45% - Statements - 142/196 -
-
- 55.88% - Branches - 38/68 -
-
- 84.62% - Functions - 22/26 -
-
- 72.02% - Lines - 139/193 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -22× -22× -22× -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -77× -73× -  -58× -  -58× -  -  -  -  -58× -  -58× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -95× -95× -  -95× -95× -95× -95× -  -  -95× -243× -243× -  -  -  -243× -  -243× -  -95× -  -  -  -  -  -148× -  -  -  -  -  -  -  -  -  -  -  -229× -147× -  -  -  -  -  -147× -147× -147× -147× -147× -  -  -82× -82× -82× -82× -82× -82× -  -82× -80× -  -  -  -  -  -73× -  -  -  -80× -80× -  - -  -  -  -  -  -  -  - - - -  -  - -  -  -  -  -  -  -  -80× -80× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -22× -  -  -  -  -  -22× -22× -  -22× -  -  -22× -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -22× -22× -  -  -22× -  -65× -65× -  -65× -  -  -22× -22× -  -  - - -  -  -  - -  - -  -  -  -  -42× -  -42× -42× -42× -  -  -  -  -65× -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -99× -95× -  -95× -265× -265× -  -  -  -  -  -95× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -148× -  -148× -  -  -  -  -148× -  -  -148× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -172× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -45× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -51× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -65× -  -  -65× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -87× -42× -  -45× -45× -  -45× -44× -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -82× -82× -4991× -  -82× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -65× -  -65× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -714× -  -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -22× -22× -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -23× -23× -23× -23× -23× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -45× -26× -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -43× -  -  -  -22× -22× -  -  -22× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
-import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
- 
-/**
- * @title Lib_MerkleTrie
- */
-library Lib_MerkleTrie {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum NodeType {
-        BranchNode,
-        ExtensionNode,
-        LeafNode
-    }
- 
-    struct TrieNode {
-        bytes encoded;
-        Lib_RLPReader.RLPItem[] decoded;
-    }
- 
- 
-    /**********************
-     * Contract Constants *
-     **********************/
- 
-    // TREE_RADIX determines the number of elements per branch node.
-    uint256 constant TREE_RADIX = 16;
-    // Branch nodes have TREE_RADIX elements plus an additional `value` slot.
-    uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;
-    // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.
-    uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;
- 
-    // Prefixes are prepended to the `path` within a leaf or extension node and
-    // allow us to differentiate between the two node types. `ODD` or `EVEN` is
-    // determined by the number of nibbles within the unprefixed `path`. If the
-    // number of nibbles if even, we need to insert an extra padding nibble so
-    // the resulting prefixed `path` has an even number of nibbles.
-    uint8 constant PREFIX_EXTENSION_EVEN = 0;
-    uint8 constant PREFIX_EXTENSION_ODD = 1;
-    uint8 constant PREFIX_LEAF_EVEN = 2;
-    uint8 constant PREFIX_LEAF_ODD = 3;
- 
-    // Just a utility constant. RLP represents `NULL` as 0x80.
-    bytes1 constant RLP_NULL = bytes1(0x80);
-    bytes constant RLP_NULL_BYTES = hex'80';
-    bytes32 constant internal KECCAK256_RLP_NULL_BYTES = keccak256(RLP_NULL_BYTES);
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Verifies a proof that a given key/value pair is present in the
-     * Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _value Value of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
-     * traditional Merkle trees, this proof is executed top-down and consists
-     * of a list of RLP-encoded nodes that make a path down to the target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
-     */
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        (
-            bool exists,
-            bytes memory value
-        ) = get(_key, _proof, _root);
- 
-        return (
-            exists && Lib_BytesUtils.equal(_value, value)
-        );
-    }
- 
-    /**
-     * @notice Verifies a proof that a given key is *not* present in
-     * the Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the key is absent in the trie, `false` otherwise.
-     */
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        (
-            bool exists,
-        ) = get(_key, _proof, _root);
- 
-        return exists == false;
-    }
- 
-    /**
-     * @notice Updates a Merkle trie and returns a new root hash.
-     * @param _key Key of the node to update, as a hex string.
-     * @param _value Value of the node to update, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node. If the key exists, we can simply update the value.
-     * Otherwise, we need to modify the trie to handle the new k/v pair.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _updatedRoot Root hash of the newly constructed trie.
-     */
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        // Special case when inserting the very first node.
-        Iif (_root == KECCAK256_RLP_NULL_BYTES) {
-            return getSingleNodeRootHash(_key, _value);
-        }
- 
-        TrieNode[] memory proof = _parseProof(_proof);
-        (uint256 pathLength, bytes memory keyRemainder, ) = _walkNodePath(proof, _key, _root);
-        TrieNode[] memory newPath = _getNewPath(proof, pathLength, keyRemainder, _value);
- 
-        return _getUpdatedTrieRoot(newPath, _key);
-    }
- 
-    /**
-     * @notice Retrieves the value associated with a given key.
-     * @param _key Key to search for, as hex bytes.
-     * @param _proof Merkle trie inclusion proof for the key.
-     * @param _root Known root of the Merkle trie.
-     * @return _exists Whether or not the key exists.
-     * @return _value Value of the key if it exists.
-     */
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _exists,
-            bytes memory _value
-        )
-    {
-        TrieNode[] memory proof = _parseProof(_proof);
-        (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(proof, _key, _root);
- 
-        bool exists = keyRemainder.length == 0;
- 
-        Erequire(
-            exists || isFinalNode,
-            "Provided proof is invalid."
-        );
- 
-        bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes('');
- 
-        return (
-            exists,
-            value
-        );
-    }
- 
-    /**
-     * Computes the root hash for a trie with a single node.
-     * @param _key Key for the single node.
-     * @param _value Value for the single node.
-     * @return _updatedRoot Hash of the trie.
-     */
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        return keccak256(_makeLeafNode(
-            Lib_BytesUtils.toNibbles(_key),
-            _value
-        ).encoded);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * @notice Walks through a proof using a provided key.
-     * @param _proof Inclusion proof to walk through.
-     * @param _key Key to use for the walk.
-     * @param _root Known root of the trie.
-     * @return _pathLength Length of the final path
-     * @return _keyRemainder Portion of the key remaining after the walk.
-     * @return _isFinalNode Whether or not we've hit a dead end.
-     */
-    function _walkNodePath(
-        TrieNode[] memory _proof,
-        bytes memory _key,
-        bytes32 _root
-    )
-        private
-        pure
-        returns (
-            uint256 _pathLength,
-            bytes memory _keyRemainder,
-            bool _isFinalNode
-        )
-    {
-        uint256 pathLength = 0;
-        bytes memory key = Lib_BytesUtils.toNibbles(_key);
- 
-        bytes32 currentNodeID = _root;
-        uint256 currentKeyIndex = 0;
-        uint256 currentKeyIncrement = 0;
-        TrieNode memory currentNode;
- 
-        // Proof is top-down, so we start at the first element (root).
-        for (uint256 i = 0; i < _proof.length; i++) {
-            currentNode = _proof[i];
-            currentKeyIndex += currentKeyIncrement;
- 
-            // Keep track of the proof elements we actually need.
-            // It's expensive to resize arrays, so this simply reduces gas costs.
-            pathLength += 1;
- 
-            if (currentKeyIndex == 0) {
-                // First proof element is always the root node.
-                require(
-                    keccak256(currentNode.encoded) == currentNodeID,
-                    "Invalid root hash"
-                );
-            } else Eif (currentNode.encoded.length >= 32) {
-                // Nodes 32 bytes or larger are hashed inside branch nodes.
-                require(
-                    keccak256(currentNode.encoded) == currentNodeID,
-                    "Invalid large internal hash"
-                );
-            } else {
-                // Nodes smaller than 31 bytes aren't hashed.
-                require(
-                    Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
-                    "Invalid internal node hash"
-                );
-            }
- 
-            if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {
-                Iif (currentKeyIndex == key.length) {
-                    // We've hit the end of the key, meaning the value should be within this branch node.
-                    break;
-                } else {
-                    // We're not at the end of the key yet.
-                    // Figure out what the next node ID should be and continue.
-                    uint8 branchKey = uint8(key[currentKeyIndex]);
-                    Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
-                    currentNodeID = _getNodeID(nextNode);
-                    currentKeyIncrement = 1;
-                    continue;
-                }
-            } else Eif (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
-                bytes memory path = _getNodePath(currentNode);
-                uint8 prefix = uint8(path[0]);
-                uint8 offset = 2 - prefix % 2;
-                bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);
-                bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);
-                uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
- 
-                if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
-                    if (
-                        pathRemainder.length == sharedNibbleLength &&
-                        keyRemainder.length == sharedNibbleLength
-                    ) {
-                        // The key within this leaf matches our key exactly.
-                        // Increment the key index to reflect that we have no remainder.
-                        currentKeyIndex += sharedNibbleLength;
-                    }
- 
-                    // We've hit a leaf node, so our next node should be NULL.
-                    currentNodeID = bytes32(RLP_NULL);
-                    break;
-                } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
-                    Iif (sharedNibbleLength == 0) {
-                        // Our extension node doesn't share any part of our key.
-                        // We've hit the end of this path, updates will need to modify this extension.
-                        currentNodeID = bytes32(RLP_NULL);
-                        break;
-                    } else {
-                        // Our extension shares some nibbles.
-                        // Carry on to the next node.
-                        currentNodeID = _getNodeID(currentNode.decoded[1]);
-                        currentKeyIncrement = sharedNibbleLength;
-                        continue;
-                    }
-                } else {
-                    revert("Received a node with an unknown prefix");
-                }
-            } else {
-                revert("Received an unparseable node.");
-            }
-        }
- 
-        // If our node ID is NULL, then we're at a dead end.
-        bool isFinalNode = currentNodeID == bytes32(RLP_NULL);
-        return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);
-    }
- 
-    /**
-     * @notice Creates new nodes to support a k/v pair insertion into a given
-     * Merkle trie path.
-     * @param _path Path to the node nearest the k/v pair.
-     * @param _pathLength Length of the path. Necessary because the provided
-     * path may include additional nodes (e.g., it comes directly from a proof)
-     * and we can't resize in-memory arrays without costly duplication.
-     * @param _keyRemainder Portion of the initial key that must be inserted
-     * into the trie.
-     * @param _value Value to insert at the given key.
-     * @return _newPath A new path with the inserted k/v pair and extra supporting nodes.
-     */
-    function _getNewPath(
-        TrieNode[] memory _path,
-        uint256 _pathLength,
-        bytes memory _keyRemainder,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _newPath
-        )
-    {
-        bytes memory keyRemainder = _keyRemainder;
- 
-        // Most of our logic depends on the status of the last node in the path.
-        TrieNode memory lastNode = _path[_pathLength - 1];
-        NodeType lastNodeType = _getNodeType(lastNode);
- 
-        // Create an array for newly created nodes.
-        // We need up to three new nodes, depending on the contents of the last node.
-        // Since array resizing is expensive, we'll keep track of the size manually.
-        // We're using an explicit `totalNewNodes += 1` after insertions for clarity.
-        TrieNode[] memory newNodes = new TrieNode[](3);
-        uint256 totalNewNodes = 0;
- 
-        Eif (keyRemainder.length == 0 && lastNodeType == NodeType.LeafNode) {
-            // We've found a leaf node with the given key.
-            // Simply need to update the value of the node to match.
-            newNodes[totalNewNodes] = _makeLeafNode(_getNodeKey(lastNode), _value);
-            totalNewNodes += 1;
-        } else if (lastNodeType == NodeType.BranchNode) {
-            if (keyRemainder.length == 0) {
-                // We've found a branch node with the given key.
-                // Simply need to update the value of the node to match.
-                newNodes[totalNewNodes] = _editBranchValue(lastNode, _value);
-                totalNewNodes += 1;
-            } else {
-                // We've found a branch node, but it doesn't contain our key.
-                // Reinsert the old branch for now.
-                newNodes[totalNewNodes] = lastNode;
-                totalNewNodes += 1;
-                // Create a new leaf node, slicing our remainder since the first byte points
-                // to our branch node.
-                newNodes[totalNewNodes] = _makeLeafNode(Lib_BytesUtils.slice(keyRemainder, 1), _value);
-                totalNewNodes += 1;
-            }
-        } else {
-            // Our last node is either an extension node or a leaf node with a different key.
-            bytes memory lastNodeKey = _getNodeKey(lastNode);
-            uint256 sharedNibbleLength = _getSharedNibbleLength(lastNodeKey, keyRemainder);
- 
-            if (sharedNibbleLength != 0) {
-                // We've got some shared nibbles between the last node and our key remainder.
-                // We'll need to insert an extension node that covers these shared nibbles.
-                bytes memory nextNodeKey = Lib_BytesUtils.slice(lastNodeKey, 0, sharedNibbleLength);
-                newNodes[totalNewNodes] = _makeExtensionNode(nextNodeKey, _getNodeHash(_value));
-                totalNewNodes += 1;
- 
-                // Cut down the keys since we've just covered these shared nibbles.
-                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, sharedNibbleLength);
-                keyRemainder = Lib_BytesUtils.slice(keyRemainder, sharedNibbleLength);
-            }
- 
-            // Create an empty branch to fill in.
-            TrieNode memory newBranch = _makeEmptyBranchNode();
- 
-            if (lastNodeKey.length == 0) {
-                // Key remainder was larger than the key for our last node.
-                // The value within our last node is therefore going to be shifted into
-                // a branch value slot.
-                newBranch = _editBranchValue(newBranch, _getNodeValue(lastNode));
-            } else {
-                // Last node key was larger than the key remainder.
-                // We're going to modify some index of our branch.
-                uint8 branchKey = uint8(lastNodeKey[0]);
-                // Move on to the next nibble.
-                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, 1);
- 
-                if (lastNodeType == NodeType.LeafNode) {
-                    // We're dealing with a leaf node.
-                    // We'll modify the key and insert the old leaf node into the branch index.
-                    TrieNode memory modifiedLastNode = _makeLeafNode(lastNodeKey, _getNodeValue(lastNode));
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
-                } else if (lastNodeKey.length != 0) {
-                    // We're dealing with a shrinking extension node.
-                    // We need to modify the node to decrease the size of the key.
-                    TrieNode memory modifiedLastNode = _makeExtensionNode(lastNodeKey, _getNodeValue(lastNode));
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
-                } else {
-                    // We're dealing with an unnecessary extension node.
-                    // We're going to delete the node entirely.
-                    // Simply insert its current value into the branch index.
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeValue(lastNode));
-                }
-            }
- 
-            if (keyRemainder.length == 0) {
-                // We've got nothing left in the key remainder.
-                // Simply insert the value into the branch value slot.
-                newBranch = _editBranchValue(newBranch, _value);
-                // Push the branch into the list of new nodes.
-                newNodes[totalNewNodes] = newBranch;
-                totalNewNodes += 1;
-            } else {
-                // We've got some key remainder to work with.
-                // We'll be inserting a leaf node into the trie.
-                // First, move on to the next nibble.
-                keyRemainder = Lib_BytesUtils.slice(keyRemainder, 1);
-                // Push the branch into the list of new nodes.
-                newNodes[totalNewNodes] = newBranch;
-                totalNewNodes += 1;
-                // Push a new leaf node for our k/v pair.
-                newNodes[totalNewNodes] = _makeLeafNode(keyRemainder, _value);
-                totalNewNodes += 1;
-            }
-        }
- 
-        // Finally, join the old path with our newly created nodes.
-        // Since we're overwriting the last node in the path, we use `_pathLength - 1`.
-        return _joinNodeArrays(_path, _pathLength - 1, newNodes, totalNewNodes);
-    }
- 
-    /**
-     * @notice Computes the trie root from a given path.
-     * @param _nodes Path to some k/v pair.
-     * @param _key Key for the k/v pair.
-     * @return _updatedRoot Root hash for the updated trie.
-     */
-    function _getUpdatedTrieRoot(
-        TrieNode[] memory _nodes,
-        bytes memory _key
-    )
-        private
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = Lib_BytesUtils.toNibbles(_key);
- 
-        // Some variables to keep track of during iteration.
-        TrieNode memory currentNode;
-        NodeType currentNodeType;
-        bytes memory previousNodeHash;
- 
-        // Run through the path backwards to rebuild our root hash.
-        for (uint256 i = _nodes.length; i > 0; i--) {
-            // Pick out the current node.
-            currentNode = _nodes[i - 1];
-            currentNodeType = _getNodeType(currentNode);
- 
-            if (currentNodeType == NodeType.LeafNode) {
-                // Leaf nodes are already correctly encoded.
-                // Shift the key over to account for the nodes key.
-                bytes memory nodeKey = _getNodeKey(currentNode);
-                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
-            } else if (currentNodeType == NodeType.ExtensionNode) {
-                // Shift the key over to account for the nodes key.
-                bytes memory nodeKey = _getNodeKey(currentNode);
-                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
- 
-                // If this node is the last element in the path, it'll be correctly encoded
-                // and we can skip this part.
-                Eif (previousNodeHash.length > 0) {
-                    // Re-encode the node based on the previous node.
-                    currentNode = _makeExtensionNode(nodeKey, previousNodeHash);
-                }
-            } else Eif (currentNodeType == NodeType.BranchNode) {
-                // If this node is the last element in the path, it'll be correctly encoded
-                // and we can skip this part.
-                Eif (previousNodeHash.length > 0) {
-                    // Re-encode the node based on the previous node.
-                    uint8 branchKey = uint8(key[key.length - 1]);
-                    key = Lib_BytesUtils.slice(key, 0, key.length - 1);
-                    currentNode = _editBranchIndex(currentNode, branchKey, previousNodeHash);
-                }
-            }
- 
-            // Compute the node hash for the next iteration.
-            previousNodeHash = _getNodeHash(currentNode.encoded);
-        }
- 
-        // Current node should be the root at this point.
-        // Simply return the hash of its encoding.
-        return keccak256(currentNode.encoded);
-    }
- 
-    /**
-     * @notice Parses an RLP-encoded proof into something more useful.
-     * @param _proof RLP-encoded proof to parse.
-     * @return _parsed Proof parsed into easily accessible structs.
-     */
-    function _parseProof(
-        bytes memory _proof
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _parsed
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);
-        TrieNode[] memory proof = new TrieNode[](nodes.length);
- 
-        for (uint256 i = 0; i < nodes.length; i++) {
-            bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);
-            proof[i] = TrieNode({
-                encoded: encoded,
-                decoded: Lib_RLPReader.readList(encoded)
-            });
-        }
- 
-        return proof;
-    }
- 
-    /**
-     * @notice Picks out the ID for a node. Node ID is referred to as the
-     * "hash" within the specification, but nodes < 32 bytes are not actually
-     * hashed.
-     * @param _node Node to pull an ID for.
-     * @return _nodeID ID for the node, depending on the size of its contents.
-     */
-    function _getNodeID(
-        Lib_RLPReader.RLPItem memory _node
-    )
-        private
-        pure
-        returns (
-            bytes32 _nodeID
-        )
-    {
-        bytes memory nodeID;
- 
-        Iif (_node.length < 32) {
-            // Nodes smaller than 32 bytes are RLP encoded.
-            nodeID = Lib_RLPReader.readRawBytes(_node);
-        } else {
-            // Nodes 32 bytes or larger are hashed.
-            nodeID = Lib_RLPReader.readBytes(_node);
-        }
- 
-        return Lib_BytesUtils.toBytes32(nodeID);
-    }
- 
-    /**
-     * @notice Gets the path for a leaf or extension node.
-     * @param _node Node to get a path for.
-     * @return _path Node path, converted to an array of nibbles.
-     */
-    function _getNodePath(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _path
-        )
-    {
-        return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));
-    }
- 
-    /**
-     * @notice Gets the key for a leaf or extension node. Keys are essentially
-     * just paths without any prefix.
-     * @param _node Node to get a key for.
-     * @return _key Node key, converted to an array of nibbles.
-     */
-    function _getNodeKey(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _key
-        )
-    {
-        return _removeHexPrefix(_getNodePath(_node));
-    }
- 
-    /**
-     * @notice Gets the path for a node.
-     * @param _node Node to get a value for.
-     * @return _value Node value, as hex bytes.
-     */
-    function _getNodeValue(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _value
-        )
-    {
-        return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
-    }
- 
-    /**
-     * @notice Computes the node hash for an encoded node. Nodes < 32 bytes
-     * are not hashed, all others are keccak256 hashed.
-     * @param _encoded Encoded node to hash.
-     * @return _hash Hash of the encoded node. Simply the input if < 32 bytes.
-     */
-    function _getNodeHash(
-        bytes memory _encoded
-    )
-        private
-        pure
-        returns (
-            bytes memory _hash
-        )
-    {
-        Iif (_encoded.length < 32) {
-            return _encoded;
-        } else {
-            return abi.encodePacked(keccak256(_encoded));
-        }
-    }
- 
-    /**
-     * @notice Determines the type for a given node.
-     * @param _node Node to determine a type for.
-     * @return _type Type of the node; BranchNode/ExtensionNode/LeafNode.
-     */
-    function _getNodeType(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            NodeType _type
-        )
-    {
-        if (_node.decoded.length == BRANCH_NODE_LENGTH) {
-            return NodeType.BranchNode;
-        } else Eif (_node.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
-            bytes memory path = _getNodePath(_node);
-            uint8 prefix = uint8(path[0]);
- 
-            if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
-                return NodeType.LeafNode;
-            } else Eif (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
-                return NodeType.ExtensionNode;
-            }
-        }
- 
-        revert("Invalid node type");
-    }
- 
-    /**
-     * @notice Utility; determines the number of nibbles shared between two
-     * nibble arrays.
-     * @param _a First nibble array.
-     * @param _b Second nibble array.
-     * @return _shared Number of shared nibbles.
-     */
-    function _getSharedNibbleLength(
-        bytes memory _a,
-        bytes memory _b
-    )
-        private
-        pure
-        returns (
-            uint256 _shared
-        )
-    {
-        uint256 i = 0;
-        while (_a.length > i && _b.length > i && _a[i] == _b[i]) {
-            i++;
-        }
-        return i;
-    }
- 
-    /**
-     * @notice Utility; converts an RLP-encoded node into our nice struct.
-     * @param _raw RLP-encoded node to convert.
-     * @return _node Node as a TrieNode struct.
-     */
-    function _makeNode(
-        bytes[] memory _raw
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes memory encoded = Lib_RLPWriter.writeList(_raw);
- 
-        return TrieNode({
-            encoded: encoded,
-            decoded: Lib_RLPReader.readList(encoded)
-        });
-    }
- 
-    /**
-     * @notice Utility; converts an RLP-decoded node into our nice struct.
-     * @param _items RLP-decoded node to convert.
-     * @return _node Node as a TrieNode struct.
-     */
-    function _makeNode(
-        Lib_RLPReader.RLPItem[] memory _items
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](_items.length);
-        for (uint256 i = 0; i < _items.length; i++) {
-            raw[i] = Lib_RLPReader.readRawBytes(_items[i]);
-        }
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates a new extension node.
-     * @param _key Key for the extension node, unprefixed.
-     * @param _value Value for the extension node.
-     * @return _node New extension node with the given k/v pair.
-     */
-    function _makeExtensionNode(
-        bytes memory _key,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](2);
-        bytes memory key = _addHexPrefix(_key, false);
-        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
-        raw[1] = Lib_RLPWriter.writeBytes(_value);
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates a new leaf node.
-     * @dev This function is essentially identical to `_makeExtensionNode`.
-     * Although we could route both to a single method with a flag, it's
-     * more gas efficient to keep them separate and duplicate the logic.
-     * @param _key Key for the leaf node, unprefixed.
-     * @param _value Value for the leaf node.
-     * @return _node New leaf node with the given k/v pair.
-     */
-    function _makeLeafNode(
-        bytes memory _key,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](2);
-        bytes memory key = _addHexPrefix(_key, true);
-        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
-        raw[1] = Lib_RLPWriter.writeBytes(_value);
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates an empty branch node.
-     * @return _node Empty branch node as a TrieNode struct.
-     */
-    function _makeEmptyBranchNode()
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](BRANCH_NODE_LENGTH);
-        for (uint256 i = 0; i < raw.length; i++) {
-            raw[i] = RLP_NULL_BYTES;
-        }
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Modifies the value slot for a given branch.
-     * @param _branch Branch node to modify.
-     * @param _value Value to insert into the branch.
-     * @return _updatedNode Modified branch node.
-     */
-    function _editBranchValue(
-        TrieNode memory _branch,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _updatedNode
-        )
-    {
-        bytes memory encoded = Lib_RLPWriter.writeBytes(_value);
-        _branch.decoded[_branch.decoded.length - 1] = Lib_RLPReader.toRLPItem(encoded);
-        return _makeNode(_branch.decoded);
-    }
- 
-    /**
-     * @notice Modifies a slot at an index for a given branch.
-     * @param _branch Branch node to modify.
-     * @param _index Slot index to modify.
-     * @param _value Value to insert into the slot.
-     * @return _updatedNode Modified branch node.
-     */
-    function _editBranchIndex(
-        TrieNode memory _branch,
-        uint8 _index,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _updatedNode
-        )
-    {
-        bytes memory encoded = _value.length < 32 ? _value : Lib_RLPWriter.writeBytes(_value);
-        _branch.decoded[_index] = Lib_RLPReader.toRLPItem(encoded);
-        return _makeNode(_branch.decoded);
-    }
- 
-    /**
-     * @notice Utility; adds a prefix to a key.
-     * @param _key Key to prefix.
-     * @param _isLeaf Whether or not the key belongs to a leaf.
-     * @return _prefixedKey Prefixed key.
-     */
-    function _addHexPrefix(
-        bytes memory _key,
-        bool _isLeaf
-    )
-        private
-        pure
-        returns (
-            bytes memory _prefixedKey
-        )
-    {
-        uint8 prefix = _isLeaf ? uint8(0x02) : uint8(0x00);
-        uint8 offset = uint8(_key.length % 2);
-        bytes memory prefixed = new bytes(2 - offset);
-        prefixed[0] = bytes1(prefix + offset);
-        return abi.encodePacked(prefixed, _key);
-    }
- 
-    /**
-     * @notice Utility; removes a prefix from a path.
-     * @param _path Path to remove the prefix from.
-     * @return _unprefixedKey Unprefixed key.
-     */
-    function _removeHexPrefix(
-        bytes memory _path
-    )
-        private
-        pure
-        returns (
-            bytes memory _unprefixedKey
-        )
-    {
-        if (uint8(_path[0]) % 2 == 0) {
-            return Lib_BytesUtils.slice(_path, 2);
-        } else {
-            return Lib_BytesUtils.slice(_path, 1);
-        }
-    }
- 
-    /**
-     * @notice Utility; combines two node arrays. Array lengths are required
-     * because the actual lengths may be longer than the filled lengths.
-     * Array resizing is extremely costly and should be avoided.
-     * @param _a First array to join.
-     * @param _aLength Length of the first array.
-     * @param _b Second array to join.
-     * @param _bLength Length of the second array.
-     * @return _joined Combined node array.
-     */
-    function _joinNodeArrays(
-        TrieNode[] memory _a,
-        uint256 _aLength,
-        TrieNode[] memory _b,
-        uint256 _bLength
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _joined
-        )
-    {
-        TrieNode[] memory ret = new TrieNode[](_aLength + _bLength);
- 
-        // Copy elements from the first array.
-        for (uint256 i = 0; i < _aLength; i++) {
-            ret[i] = _a[i];
-        }
- 
-        // Copy elements from the second array.
-        for (uint256 i = 0; i < _bLength; i++) {
-            ret[i + _aLength] = _b[i];
-        }
- 
-        return ret;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/trie/Lib_SecureMerkleTrie.sol.html b/coverage/libraries/trie/Lib_SecureMerkleTrie.sol.html deleted file mode 100644 index 14a776a75..000000000 --- a/coverage/libraries/trie/Lib_SecureMerkleTrie.sol.html +++ /dev/null @@ -1,548 +0,0 @@ - - - - Code coverage report for libraries/trie/Lib_SecureMerkleTrie.sol - - - - - - - -
-
-

- all files / libraries/trie/ Lib_SecureMerkleTrie.sol -

-
-
- 63.64% - Statements - 7/11 -
-
- 100% - Branches - 0/0 -
-
- 66.67% - Functions - 4/6 -
-
- 63.64% - Lines - 7/11 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -20× -20× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -47× -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_MerkleTrie } from "./Lib_MerkleTrie.sol";
- 
-/**
- * @title Lib_SecureMerkleTrie
- */
-library Lib_SecureMerkleTrie {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Verifies a proof that a given key/value pair is present in the
-     * Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _value Value of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
-     * traditional Merkle trees, this proof is executed top-down and consists
-     * of a list of RLP-encoded nodes that make a path down to the target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
-     */
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
-    }
- 
-    /**
-     * @notice Verifies a proof that a given key is *not* present in
-     * the Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the key is not present in the trie, `false` otherwise.
-     */
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.verifyExclusionProof(key, _proof, _root);
-    }
- 
-    /**
-     * @notice Updates a Merkle trie and returns a new root hash.
-     * @param _key Key of the node to update, as a hex string.
-     * @param _value Value of the node to update, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node. If the key exists, we can simply update the value.
-     * Otherwise, we need to modify the trie to handle the new k/v pair.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _updatedRoot Root hash of the newly constructed trie.
-     */
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.update(key, _value, _proof, _root);
-    }
- 
-    /**
-     * @notice Retrieves the value associated with a given key.
-     * @param _key Key to search for, as hex bytes.
-     * @param _proof Merkle trie inclusion proof for the key.
-     * @param _root Known root of the Merkle trie.
-     * @return _exists Whether or not the key exists.
-     * @return _value Value of the key if it exists.
-     */
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _exists,
-            bytes memory _value
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.get(key, _proof, _root);
-    }
- 
-    /**
-     * Computes the root hash for a trie with a single node.
-     * @param _key Key for the single node.
-     * @param _value Value for the single node.
-     * @return _updatedRoot Hash of the trie.
-     */
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.getSingleNodeRootHash(key, _value);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Computes the secure counterpart to a key.
-     * @param _key Key to get a secure key from.
-     * @return _secureKey Secure version of the key.
-     */
-    function _getSecureKey(
-        bytes memory _key
-    )
-        private
-        pure
-        returns (
-            bytes memory _secureKey
-        )
-    {
-        return abi.encodePacked(keccak256(_key));
-    }
-}
-
-
- - - - - - - diff --git a/coverage/libraries/trie/index.html b/coverage/libraries/trie/index.html deleted file mode 100644 index 14d44409f..000000000 --- a/coverage/libraries/trie/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for libraries/trie/ - - - - - - - -
-
-

- all files libraries/trie/ -

-
-
- 71.98% - Statements - 149/207 -
-
- 55.88% - Branches - 38/68 -
-
- 81.25% - Functions - 26/32 -
-
- 71.57% - Lines - 146/204 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_MerkleTrie.sol
72.45%142/19655.88%38/6884.62%22/2672.02%139/193
Lib_SecureMerkleTrie.sol
63.64%7/11100%0/066.67%4/663.64%7/11
-
-
- - - - - - - diff --git a/coverage/libraries/utils/Lib_Bytes32Utils.sol.html b/coverage/libraries/utils/Lib_Bytes32Utils.sol.html deleted file mode 100644 index 23b140949..000000000 --- a/coverage/libraries/utils/Lib_Bytes32Utils.sol.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_Bytes32Utils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_Bytes32Utils.sol -

-
-
- 100% - Statements - 6/6 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 5/5 -
-
- 100% - Lines - 7/7 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -40× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_Byte32Utils
- */
-library Lib_Bytes32Utils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to "true."
-     * @param _in Input bytes32 value.
-     * @return Bytes32 as a boolean.
-     */
-    function toBool(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        return _in != 0;
-    }
- 
-    /**
-     * Converts a boolean to a bytes32 value.
-     * @param _in Input boolean value.
-     * @return Boolean as a bytes32.
-     */
-    function fromBool(
-        bool _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return bytes32(uint256(_in ? 1 : 0));
-    }
- 
-    /**
-     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.
-     * @param _in Input bytes32 value.
-     * @return Bytes32 as an address.
-     */
-    function toAddress(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        return address(uint160(uint256(_in)));
-    }
- 
-    /**
-     * Converts an address to a bytes32.
-     * @param _in Input address value.
-     * @return Address as a bytes32.
-     */
-    function fromAddress(
-        address _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return bytes32(uint256(_in));
-    }
- 
-    /**
-     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.
-     * @param _in Input bytes32 value.
-     * @return Bytes32 without any leading zeros.
-     */
-    function removeLeadingZeros(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes memory out;
- 
-        assembly {
-            // Figure out how many leading zero bytes to remove.
-            let shift := 0
-            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {
-                shift := add(shift, 1)
-            }
- 
-            // Reserve some space for our output and fix the free memory pointer.
-            out := mload(0x40)
-            mstore(0x40, add(out, 0x40))
- 
-            // Shift the value and store it into the output bytes.
-            mstore(add(out, 0x20), shl(mul(shift, 8), _in))
- 
-            // Store the new size (with leading zero bytes removed) in the output byte size.
-            mstore(out, sub(32, shift))
-        }
- 
-        return out;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/utils/Lib_BytesUtils.sol.html b/coverage/libraries/utils/Lib_BytesUtils.sol.html deleted file mode 100644 index ebdd55e85..000000000 --- a/coverage/libraries/utils/Lib_BytesUtils.sol.html +++ /dev/null @@ -1,728 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_BytesUtils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_BytesUtils.sol -

-
-
- 100% - Statements - 38/38 -
-
- 63.64% - Branches - 14/22 -
-
- 100% - Functions - 11/11 -
-
- 100% - Lines - 44/44 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -311× -311× -311× -  -308× -  -308× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -308× -  -  -  -  -  -  -  -  -  -  -299× -73× -  -  -226× -  -  -  -  -  -  -  -  -  - - - -  -  - -  -  -  -  -  -  -  -  -  -164× - - -  -  - -  -  -162× -  -  -  -  -  -  -  -  -  - -  -  -  -15× -15× -15× -  -15× -  -  -  -15× -  -  -  -12× -12× -12× -  -12× -  -  -  -12× -  -  -  - - - -  - -  -  -  - -  -  -  -  -  -  -  -  -  -292× -  -292× -9144× -9144× -  -  -292× -  -  -  -  -  -  -  -  -  -26× -  -26× -708× -  -  -26× -  -  -  -  -  -  -  -  -  -  -26× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_BytesUtils
- */
-library Lib_BytesUtils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start,
-        uint256 _length
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        Erequire(_length + 31 >= _length, "slice_overflow");
-        Erequire(_start + _length >= _start, "slice_overflow");
-        require(_bytes.length >= _start + _length, "slice_outOfBounds");
- 
-        bytes memory tempBytes;
- 
-        assembly {
-            switch iszero(_length)
-            case 0 {
-                // Get a location of some free memory and store it in tempBytes as
-                // Solidity does for memory variables.
-                tempBytes := mload(0x40)
- 
-                // The first word of the slice result is potentially a partial
-                // word read from the original array. To read it, we calculate
-                // the length of that partial word and start copying that many
-                // bytes into the array. The first word we copy will start with
-                // data we don't care about, but the last `lengthmod` bytes will
-                // land at the beginning of the contents of the new array. When
-                // we're done copying, we overwrite the full first word with
-                // the actual length of the slice.
-                let lengthmod := and(_length, 31)
- 
-                // The multiplication in the next line is necessary
-                // because when slicing multiples of 32 bytes (lengthmod == 0)
-                // the following copy loop was copying the origin's length
-                // and then ending prematurely not copying everything it should.
-                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
-                let end := add(mc, _length)
- 
-                for {
-                    // The multiplication in the next line has the same exact purpose
-                    // as the one above.
-                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
-                } lt(mc, end) {
-                    mc := add(mc, 0x20)
-                    cc := add(cc, 0x20)
-                } {
-                    mstore(mc, mload(cc))
-                }
- 
-                mstore(tempBytes, _length)
- 
-                //update free-memory pointer
-                //allocating the array padded to 32 bytes like the compiler does now
-                mstore(0x40, and(add(mc, 31), not(31)))
-            }
-            //if we want a zero-length slice let's just return a zero-length array
-            default {
-                tempBytes := mload(0x40)
- 
-                //zero out the 32 bytes slice we are about to return
-                //we need to do it because Solidity does not garbage collect
-                mstore(tempBytes, 0)
- 
-                mstore(0x40, add(tempBytes, 0x20))
-            }
-        }
- 
-        return tempBytes;
-    }
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        if (_bytes.length - _start == 0) {
-            return bytes('');
-        }
- 
-        return slice(_bytes, _start, _bytes.length - _start);
-    }
- 
-    function toBytes32PadLeft(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes32)
-    {
-        bytes32 ret;
-        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;
-        assembly {
-            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))
-        }
-        return ret;
-    }
- 
-    function toBytes32(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes32)
-    {
-        if (_bytes.length < 32) {
-            bytes32 ret;
-            assembly {
-                ret := mload(add(_bytes, 32))
-            }
-            return ret;
-        }
- 
-        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes
-    }
- 
-    function toUint256(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (uint256)
-    {
-        return uint256(toBytes32(_bytes));
-    }
- 
-    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
-        Erequire(_start + 3 >= _start, "toUint24_overflow");
-        Erequire(_bytes.length >= _start + 3 , "toUint24_outOfBounds");
-        uint24 tempUint;
- 
-        assembly {
-            tempUint := mload(add(add(_bytes, 0x3), _start))
-        }
- 
-        return tempUint;
-    }
- 
-    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
-        Erequire(_start + 1 >= _start, "toUint8_overflow");
-        Erequire(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
-        uint8 tempUint;
- 
-        assembly {
-            tempUint := mload(add(add(_bytes, 0x1), _start))
-        }
- 
-        return tempUint;
-    }
- 
-    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
-        Erequire(_start + 20 >= _start, "toAddress_overflow");
-        Erequire(_bytes.length >= _start + 20, "toAddress_outOfBounds");
-        address tempAddress;
- 
-        assembly {
-            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
-        }
- 
-        return tempAddress;
-    }
- 
-    function toNibbles(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        bytes memory nibbles = new bytes(_bytes.length * 2);
- 
-        for (uint256 i = 0; i < _bytes.length; i++) {
-            nibbles[i * 2] = _bytes[i] >> 4;
-            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);
-        }
- 
-        return nibbles;
-    }
- 
-    function fromNibbles(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        bytes memory ret = new bytes(_bytes.length / 2);
- 
-        for (uint256 i = 0; i < ret.length; i++) {
-            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);
-        }
- 
-        return ret;
-    }
- 
-    function equal(
-        bytes memory _bytes,
-        bytes memory _other
-    )
-        internal
-        pure
-        returns (bool)
-    {
-        return keccak256(_bytes) == keccak256(_other);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/utils/Lib_ECDSAUtils.sol.html b/coverage/libraries/utils/Lib_ECDSAUtils.sol.html deleted file mode 100644 index 713191c61..000000000 --- a/coverage/libraries/utils/Lib_ECDSAUtils.sol.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_ECDSAUtils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_ECDSAUtils.sol -

-
-
- 100% - Statements - 9/9 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 9/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× - -  -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_ECDSAUtils
- */
-library Lib_ECDSAUtils {
- 
-    /**************************************
-     * Internal Functions: ECDSA Recovery *
-     **************************************/
- 
-    /**
-     * Recovers a signed address given a message and signature.
-     * @param _message Message that was originally signed.
-     * @param _isEthSignedMessage Whether or not the user used the `Ethereum Signed Message` prefix.
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     * @return _sender Signer address.
-     */
-    function recover(
-        bytes memory _message,
-        bool _isEthSignedMessage,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        internal
-        pure
-        returns (
-            address _sender
-        )
-    {
-        bytes32 messageHash = getMessageHash(_message, _isEthSignedMessage);
- 
-        return ecrecover(
-            messageHash,
-            _v + 27,
-            _r,
-            _s
-        );
-    }
- 
-    function getMessageHash(
-        bytes memory _message,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (bytes32) {
-        if (_isEthSignedMessage) {
-            return getEthSignedMessageHash(_message);
-        }
-        return getNativeMessageHash(_message);
-    }
- 
- 
-    /*************************************
-     * Private Functions: ECDSA Recovery *
-     *************************************/
- 
-    /**
-     * Gets the native message hash (simple keccak256) for a message.
-     * @param _message Message to hash.
-     * @return _messageHash Native message hash.
-     */
-    function getNativeMessageHash(
-        bytes memory _message
-    )
-        private
-        pure
-        returns (
-            bytes32 _messageHash
-        )
-    {
-        return keccak256(_message);
-    }
- 
-    /**
-     * Gets the hash of a message with the `Ethereum Signed Message` prefix.
-     * @param _message Message to hash.
-     * @return _messageHash Prefixed message hash.
-     */
-    function getEthSignedMessageHash(
-        bytes memory _message
-    )
-        private
-        pure
-        returns (
-            bytes32 _messageHash
-        )
-    {
-        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
-        bytes32 messageHash = keccak256(_message);
-        return keccak256(abi.encodePacked(prefix, messageHash));
-    }
-}
-
-
- - - - - - - diff --git a/coverage/libraries/utils/Lib_ErrorUtils.sol.html b/coverage/libraries/utils/Lib_ErrorUtils.sol.html deleted file mode 100644 index 5f34eb479..000000000 --- a/coverage/libraries/utils/Lib_ErrorUtils.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_ErrorUtils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_ErrorUtils.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title Lib_ErrorUtils
- */
-library Lib_ErrorUtils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Encodes an error string into raw solidity-style revert data.
-     * (i.e. ascii bytes, prefixed with bytes4(keccak("Error(string))"))
-     * Ref: https://docs.soliditylang.org/en/v0.8.2/control-structures.html?highlight=Error(string)#panic-via-assert-and-error-via-require
-     * @param _reason Reason for the reversion.
-     * @return Standard solidity revert data for the given reason.
-     */
-    function encodeRevertString(
-        string memory _reason
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodeWithSignature(
-            "Error(string)",
-            _reason
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/utils/Lib_EthUtils.sol.html b/coverage/libraries/utils/Lib_EthUtils.sol.html deleted file mode 100644 index a7d7a6455..000000000 --- a/coverage/libraries/utils/Lib_EthUtils.sol.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_EthUtils.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_EthUtils.sol -

-
-
- 83.33% - Statements - 10/12 -
-
- 100% - Branches - 0/0 -
-
- 85.71% - Functions - 6/7 -
-
- 87.5% - Lines - 14/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -34× -  -  -  -  -  -  -34× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -212× -  -  -  -212× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -27× -27× -  -27× -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
-import { Lib_Bytes32Utils } from "./Lib_Bytes32Utils.sol";
- 
-/**
- * @title Lib_EthUtils
- */
-library Lib_EthUtils {
- 
-    /***********************************
-     * Internal Functions: Code Access *
-     ***********************************/
- 
-    /**
-     * Gets the code for a given address.
-     * @param _address Address to get code for.
-     * @param _offset Offset to start reading from.
-     * @param _length Number of bytes to read.
-     * @return _code Code read from the contract.
-     */
-    function getCode(
-        address _address,
-        uint256 _offset,
-        uint256 _length
-    )
-        internal
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        assembly {
-            _code := mload(0x40)
-            mstore(0x40, add(_code, add(_length, 0x20)))
-            mstore(_code, _length)
-            extcodecopy(_address, add(_code, 0x20), _offset, _length)
-        }
- 
-        return _code;
-    }
- 
-    /**
-     * Gets the full code for a given address.
-     * @param _address Address to get code for.
-     * @return _code Full code of the contract.
-     */
-    function getCode(
-        address _address
-    )
-        internal
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        return getCode(
-            _address,
-            0,
-            getCodeSize(_address)
-        );
-    }
- 
-    /**
-     * Gets the size of a contract's code in bytes.
-     * @param _address Address to get code size for.
-     * @return _codeSize Size of the contract's code in bytes.
-     */
-    function getCodeSize(
-        address _address
-    )
-        internal
-        view
-        returns (
-            uint256 _codeSize
-        )
-    {
-        assembly {
-            _codeSize := extcodesize(_address)
-        }
- 
-        return _codeSize;
-    }
- 
-    /**
-     * Gets the hash of a contract's code.
-     * @param _address Address to get a code hash for.
-     * @return _codeHash Hash of the contract's code.
-     */
-    function getCodeHash(
-        address _address
-    )
-        internal
-        view
-        returns (
-            bytes32 _codeHash
-        )
-    {
-        assembly {
-            _codeHash := extcodehash(_address)
-        }
- 
-        return _codeHash;
-    }
- 
- 
-    /*****************************************
-     * Internal Functions: Contract Creation *
-     *****************************************/
- 
-    /**
-     * Creates a contract with some given initialization code.
-     * @param _code Contract initialization code.
-     * @return _created Address of the created contract.
-     */
-    function createContract(
-        bytes memory _code
-    )
-        internal
-        returns (
-            address _created
-        )
-    {
-        assembly {
-            _created := create(
-                0,
-                add(_code, 0x20),
-                mload(_code)
-            )
-        }
- 
-        return _created;
-    }
- 
-    /**
-     * Computes the address that would be generated by CREATE.
-     * @param _creator Address creating the contract.
-     * @param _nonce Creator's nonce.
-     * @return _address Address to be generated by CREATE.
-     */
-    function getAddressForCREATE(
-        address _creator,
-        uint256 _nonce
-    )
-        internal
-        pure
-        returns (
-            address _address
-        )
-    {
-        bytes[] memory encoded = new bytes[](2);
-        encoded[0] = Lib_RLPWriter.writeAddress(_creator);
-        encoded[1] = Lib_RLPWriter.writeUint(_nonce);
- 
-        bytes memory encodedList = Lib_RLPWriter.writeList(encoded);
-        return Lib_Bytes32Utils.toAddress(keccak256(encodedList));
-    }
- 
-    /**
-     * Computes the address that would be generated by CREATE2.
-     * @param _creator Address creating the contract.
-     * @param _bytecode Bytecode of the contract to be created.
-     * @param _salt 32 byte salt value mixed into the hash.
-     * @return _address Address to be generated by CREATE2.
-     */
-    function getAddressForCREATE2(
-        address _creator,
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        internal
-        pure
-        returns (address _address)
-    {
-        bytes32 hashedData = keccak256(abi.encodePacked(
-            byte(0xff),
-            _creator,
-            _salt,
-            keccak256(_bytecode)
-        ));
- 
-        return Lib_Bytes32Utils.toAddress(hashedData);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/utils/Lib_Math.sol.html b/coverage/libraries/utils/Lib_Math.sol.html deleted file mode 100644 index a1abd31af..000000000 --- a/coverage/libraries/utils/Lib_Math.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_Math.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_Math.sol -

-
-
- 0% - Statements - 0/3 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_Math
- */
-library Lib_Math {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Calculates the minumum of two numbers.
-     * @param _x First number to compare.
-     * @param _y Second number to compare.
-     * @return Lesser of the two numbers.
-     */
-    function min(
-        uint256 _x,
-        uint256 _y
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        if (_x < _y) {
-            return _x;
-        }
- 
-        return _y;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/utils/Lib_MerkleTree.sol.html b/coverage/libraries/utils/Lib_MerkleTree.sol.html deleted file mode 100644 index ddc48113f..000000000 --- a/coverage/libraries/utils/Lib_MerkleTree.sol.html +++ /dev/null @@ -1,725 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_MerkleTree.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_MerkleTree.sol -

-
-
- 97.83% - Statements - 45/46 -
-
- 90.91% - Branches - 20/22 -
-
- 100% - Functions - 3/3 -
-
- 97.96% - Lines - 48/49 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -118× -  -  -  -  -117× -  -  -  -117× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -117× -  -  -117× -117× -  -  -117× -  -  -117× -  -  -117× -117× -  -117× -273× -273× -  -273× -4620× -4620× -4620× -  -  -  -  -4620× -  -  -273× -27× -27× -27× -  -  -  -  -27× -  -  -273× -273× -  -  -117× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -102× -  -  -  -  -101× -  -  -  -  -100× -  -  -  -  -99× -  -99× -653× -146× -  -  -  -  -  -  -507× -  -  -  -  -  -  -  -653× -  -  -99× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -  -  -  -  -100× - -  -  -  -  -97× -97× -97× -776× -206× -206× -  -  -  -  -97× -70× -  -  -97× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_MerkleTree
- * @author River Keefer
- */
-library Lib_MerkleTree {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Calculates a merkle root for a list of 32-byte leaf hashes.  WARNING: If the number
-     * of leaves passed in is not a power of two, it pads out the tree with zero hashes.
-     * If you do not know the original length of elements for the tree you are verifying,
-     * then this may allow empty leaves past _elements.length to pass a verification check down the line.
-     * Note that the _elements argument is modified, therefore it must not be used again afterwards
-     * @param _elements Array of hashes from which to generate a merkle root.
-     * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).
-     */
-    function getMerkleRoot(
-        bytes32[] memory _elements
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        require(
-            _elements.length > 0,
-            "Lib_MerkleTree: Must provide at least one leaf hash."
-        );
- 
-        Iif (_elements.length == 0) {
-            return _elements[0];
-        }
- 
-        uint256[16] memory defaults = [
-            0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,
-            0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,
-            0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,
-            0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,
-            0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,
-            0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,
-            0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,
-            0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,
-            0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,
-            0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,
-            0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,
-            0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,
-            0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,
-            0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,
-            0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,
-            0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10
-        ];
- 
-        // Reserve memory space for our hashes.
-        bytes memory buf = new bytes(64);
- 
-        // We'll need to keep track of left and right siblings.
-        bytes32 leftSibling;
-        bytes32 rightSibling;
- 
-        // Number of non-empty nodes at the current depth.
-        uint256 rowSize = _elements.length;
- 
-        // Current depth, counting from 0 at the leaves
-        uint256 depth = 0;
- 
-        // Common sub-expressions
-        uint256 halfRowSize;         // rowSize / 2
-        bool rowSizeIsOdd;           // rowSize % 2 == 1
- 
-        while (rowSize > 1) {
-            halfRowSize = rowSize / 2;
-            rowSizeIsOdd = rowSize % 2 == 1;
- 
-            for (uint256 i = 0; i < halfRowSize; i++) {
-                leftSibling  = _elements[(2 * i)    ];
-                rightSibling = _elements[(2 * i) + 1];
-                assembly {
-                    mstore(add(buf, 32), leftSibling )
-                    mstore(add(buf, 64), rightSibling)
-                }
- 
-                _elements[i] = keccak256(buf);
-            }
- 
-            if (rowSizeIsOdd) {
-                leftSibling  = _elements[rowSize - 1];
-                rightSibling = bytes32(defaults[depth]);
-                assembly {
-                    mstore(add(buf, 32), leftSibling)
-                    mstore(add(buf, 64), rightSibling)
-                }
- 
-                _elements[halfRowSize] = keccak256(buf);
-            }
- 
-            rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);
-            depth++;
-        }
- 
-        return _elements[0];
-    }
- 
-    /**
-     * Verifies a merkle branch for the given leaf hash.  Assumes the original length
-     * of leaves generated is a known, correct input, and does not return true for indices
-     * extending past that index (even if _siblings would be otherwise valid.)
-     * @param _root The Merkle root to verify against.
-     * @param _leaf The leaf hash to verify inclusion of.
-     * @param _index The index in the tree of this leaf.
-     * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
-     * @param _totalLeaves The total number of leaves originally passed into.
-     * @return Whether or not the merkle branch and leaf passes verification.
-     */
-    function verify(
-        bytes32 _root,
-        bytes32 _leaf,
-        uint256 _index,
-        bytes32[] memory _siblings,
-        uint256 _totalLeaves
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        require(
-            _totalLeaves > 0,
-            "Lib_MerkleTree: Total leaves must be greater than zero."
-        );
- 
-        require(
-            _index < _totalLeaves,
-            "Lib_MerkleTree: Index out of bounds."
-        );
- 
-        require(
-            _siblings.length == _ceilLog2(_totalLeaves),
-            "Lib_MerkleTree: Total siblings does not correctly correspond to total leaves."
-        );
- 
-        bytes32 computedRoot = _leaf;
- 
-        for (uint256 i = 0; i < _siblings.length; i++) {
-            if ((_index & 1) == 1) {
-                computedRoot = keccak256(
-                    abi.encodePacked(
-                        _siblings[i],
-                        computedRoot
-                    )
-                );
-            } else {
-                computedRoot = keccak256(
-                    abi.encodePacked(
-                        computedRoot,
-                        _siblings[i]
-                    )
-                );
-            }
- 
-            _index >>= 1;
-        }
- 
-        return _root == computedRoot;
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Calculates the integer ceiling of the log base 2 of an input.
-     * @param _in Unsigned input to calculate the log.
-     * @return ceil(log_base_2(_in))
-     */
-    function _ceilLog2(
-        uint256 _in
-    )
-        private
-        pure
-        returns (
-            uint256
-        )
-    {
-        Erequire(
-            _in > 0,
-            "Lib_MerkleTree: Cannot compute ceil(log_2) of 0."
-        );
- 
-        if (_in == 1) {
-            return 0;
-        }
- 
-        // Find the highest set bit (will be floor(log_2)).
-        // Borrowed with <3 from https://github.com/ethereum/solidity-examples
-        uint256 val = _in;
-        uint256 highest = 0;
-        for (uint8 i = 128; i >= 1; i >>= 1) {
-            if (val & (uint(1) << i) - 1 << i != 0) {
-                highest += i;
-                val >>= i;
-            }
-        }
- 
-        // Increment by one if this is not a perfect logarithm.
-        if ((uint(1) << highest) != _in) {
-            highest += 1;
-        }
- 
-        return highest;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/utils/Lib_ReentrancyGuard.sol.html b/coverage/libraries/utils/Lib_ReentrancyGuard.sol.html deleted file mode 100644 index f9285d350..000000000 --- a/coverage/libraries/utils/Lib_ReentrancyGuard.sol.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_ReentrancyGuard.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_ReentrancyGuard.sol -

-
-
- 100% - Statements - 4/4 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 5/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -54× -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -14× -  -14× -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @dev Contract module that helps prevent reentrant calls to a function.
- *
- * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
- * available, which can be applied to functions to make sure there are no nested
- * (reentrant) calls to them.
- *
- * Note that because there is a single `nonReentrant` guard, functions marked as
- * `nonReentrant` may not call one another. This can be worked around by making
- * those functions `private`, and then adding `external` `nonReentrant` entry
- * points to them.
- *
- * TIP: If you would like to learn more about reentrancy and alternative ways
- * to protect against it, check out our blog post
- * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
- */
-abstract contract Lib_ReentrancyGuard {
-    // Booleans are more expensive than uint256 or any type that takes up a full
-    // word because each write operation emits an extra SLOAD to first read the
-    // slot's contents, replace the bits taken up by the boolean, and then write
-    // back. This is the compiler's defense against contract upgrades and
-    // pointer aliasing, and it cannot be disabled.
- 
-    // The values being non-zero value makes deployment a bit more expensive,
-    // but in exchange the refund on every call to nonReentrant will be lower in
-    // amount. Since refunds are capped to a percentage of the total
-    // transaction's gas, it is best to keep them low in cases like this one, to
-    // increase the likelihood of the full refund coming into effect.
-    uint256 private constant _NOT_ENTERED = 1;
-    uint256 private constant _ENTERED = 2;
- 
-    uint256 private _status;
- 
-    constructor () {
-        _status = _NOT_ENTERED;
-    }
- 
-    /**
-     * @dev Prevents a contract from calling itself, directly or indirectly.
-     * Calling a `nonReentrant` function from another `nonReentrant`
-     * function is not supported. It is possible to prevent this from happening
-     * by making the `nonReentrant` function external, and make it call a
-     * `private` function that does the actual work.
-     */
-    modifier nonReentrant() {
-        // On the first call to nonReentrant, _notEntered will be true
-        Erequire(_status != _ENTERED, "ReentrancyGuard: reentrant call");
- 
-        // Any calls to nonReentrant after this point will fail
-        _status = _ENTERED;
- 
-        _;
- 
-        // By storing the original value once again, a refund is triggered (see
-        // https://eips.ethereum.org/EIPS/eip-2200)
-        _status = _NOT_ENTERED;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/utils/Lib_RingBuffer.sol.html b/coverage/libraries/utils/Lib_RingBuffer.sol.html deleted file mode 100644 index a0835844d..000000000 --- a/coverage/libraries/utils/Lib_RingBuffer.sol.html +++ /dev/null @@ -1,1193 +0,0 @@ - - - - Code coverage report for libraries/utils/Lib_RingBuffer.sol - - - - - - - -
-
-

- all files / libraries/utils/ Lib_RingBuffer.sol -

-
-
- 78.13% - Statements - 50/64 -
-
- 54.17% - Branches - 13/24 -
-
- 81.82% - Functions - 9/11 -
-
- 77.46% - Lines - 55/71 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -572× -572× -  -  -572× -134× -  -  -  -572× -11× -  -  -  -  -  -  -  -  -  -  -11× -  -  -  -  -572× -572× -  -  -572× -572× -572× -  -  -  -  -  -  -  -  -  -  -  -  -  -470× -  -470× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -538× -  -  -  -  -535× -535× -  -535× -  -  -535× -  -  -535× -  -  -  -  -535× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  - -  -  -  -  -  -  -  -  - - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -441× -441× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -550× -550× -  -  -  -  -  -  -  -  -  -  -  -  -  -573× -573× -  -573× -573× -573× -  -  -  -  -573× -573× -573× -573× -  -  -  -  -  -573× -573× -  -  -573× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2572× -2572× -  -2572× -2572× -2572× -  -  -  -  -2572× -2572× -2572× -2572× -  -  -  -  -  -2572× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1642× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-library Lib_RingBuffer {
-    using Lib_RingBuffer for RingBuffer;
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct Buffer {
-        uint256 length;
-        mapping (uint256 => bytes32) buf;
-    }
- 
-    struct RingBuffer {
-        bytes32 contextA;
-        bytes32 contextB;
-        Buffer bufferA;
-        Buffer bufferB;
-        uint256 nextOverwritableIndex;
-    }
- 
-    struct RingBufferContext {
-        // contextA
-        uint40 globalIndex;
-        bytes27 extraData;
- 
-        // contextB
-        uint64 currBufferIndex;
-        uint40 prevResetIndex;
-        uint40 currResetIndex;
-    }
- 
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 constant MIN_CAPACITY = 16;
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Pushes a single element to the buffer.
-     * @param _self Buffer to access.
-     * @param _value Value to push to the buffer.
-     * @param _extraData Optional global extra data.
-     */
-    function push(
-        RingBuffer storage _self,
-        bytes32 _value,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
- 
-        // Set a minimum capacity.
-        if (currBuffer.length == 0) {
-            currBuffer.length = MIN_CAPACITY;
-        }
- 
-        // Check if we need to expand the buffer.
-        if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {
-            Iif (ctx.currResetIndex < _self.nextOverwritableIndex) {
-                // We're going to overwrite the inactive buffer.
-                // Bump the buffer index, reset the delete offset, and set our reset indices.
-                ctx.currBufferIndex++;
-                ctx.prevResetIndex = ctx.currResetIndex;
-                ctx.currResetIndex = ctx.globalIndex;
- 
-                // Swap over to the next buffer.
-                currBuffer = _self.getBuffer(ctx.currBufferIndex);
-            } else {
-                // We're not overwriting yet, double the length of the current buffer.
-                currBuffer.length *= 2;
-            }
-        }
- 
-        // Index to write to is the difference of the global and reset indices.
-        uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;
-        currBuffer.buf[writeHead] = _value;
- 
-        // Bump the global index and insert our extra data, then save the context.
-        ctx.globalIndex++;
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Pushes a single element to the buffer.
-     * @param _self Buffer to access.
-     * @param _value Value to push to the buffer.
-     */
-    function push(
-        RingBuffer storage _self,
-        bytes32 _value
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        
-        _self.push(
-            _value,
-            ctx.extraData
-        );
-    }
- 
-    /**
-     * Retrieves an element from the buffer.
-     * @param _self Buffer to access.
-     * @param _index Element index to retrieve.
-     * @return Value of the element at the given index.
-     */
-    function get(
-        RingBuffer storage _self,
-        uint256 _index
-    )
-        internal
-        view
-        returns (
-            bytes32    
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
- 
-        require(
-            _index < ctx.globalIndex,
-            "Index out of bounds."
-        );
- 
-        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
-        Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);
- 
-        Eif (_index >= ctx.currResetIndex) {
-            // We're trying to load an element from the current buffer.
-            // Relative index is just the difference from the reset index.
-            uint256 relativeIndex = _index - ctx.currResetIndex;
- 
-            // Shouldn't happen but why not check.
-            Erequire(
-                relativeIndex < currBuffer.length,
-                "Index out of bounds."
-            );
- 
-            return currBuffer.buf[relativeIndex];
-        } else {
-            // We're trying to load an element from the previous buffer.
-            // Relative index is the difference from the reset index in the other direction.
-            uint256 relativeIndex = ctx.currResetIndex - _index;
- 
-            // Condition only fails in the case that we deleted and flipped buffers.
-            require(
-                ctx.currResetIndex > ctx.prevResetIndex,
-                "Index out of bounds."
-            );
- 
-            // Make sure we're not trying to read beyond the array.
-            require(
-                relativeIndex <= prevBuffer.length,
-                "Index out of bounds."
-            );
- 
-            return prevBuffer.buf[prevBuffer.length - relativeIndex];
-        }
-    }
- 
-    /**
-     * Deletes all elements after (and including) a given index.
-     * @param _self Buffer to access.
-     * @param _index Index of the element to delete from (inclusive).
-     * @param _extraData Optional global extra data.
-     */
-    function deleteElementsAfterInclusive(
-        RingBuffer storage _self,
-        uint40 _index,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
- 
-        Erequire(
-            _index < ctx.globalIndex && _index >= ctx.prevResetIndex,
-            "Index out of bounds."
-        );
- 
-        Iif (_index < ctx.currResetIndex) {
-            // We're switching back to the previous buffer.
-            // Reduce the buffer index, set the current reset index back to match the previous one.
-            // We use the equality of these two values to prevent reading beyond this buffer.
-            ctx.currBufferIndex--;
-            ctx.currResetIndex = ctx.prevResetIndex;
-        }
- 
-        // Set our global index and extra data, save the context.
-        ctx.globalIndex = _index;
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Deletes all elements after (and including) a given index.
-     * @param _self Buffer to access.
-     * @param _index Index of the element to delete from (inclusive).
-     */
-    function deleteElementsAfterInclusive(
-        RingBuffer storage _self,
-        uint40 _index
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        _self.deleteElementsAfterInclusive(
-            _index,
-            ctx.extraData
-        );
-    }
- 
-    /**
-     * Retrieves the current global index.
-     * @param _self Buffer to access.
-     * @return Current global index.
-     */
-    function getLength(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        return ctx.globalIndex;
-    }
- 
-    /**
-     * Changes current global extra data.
-     * @param _self Buffer to access.
-     * @param _extraData New global extra data.
-     */
-    function setExtraData(
-        RingBuffer storage _self,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Retrieves the current global extra data.
-     * @param _self Buffer to access.
-     * @return Current global extra data.
-     */
-    function getExtraData(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            bytes27
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        return ctx.extraData;
-    }
- 
-    /**
-     * Sets the current ring buffer context.
-     * @param _self Buffer to access.
-     * @param _ctx Current ring buffer context.
-     */
-    function setContext(
-        RingBuffer storage _self,
-        RingBufferContext memory _ctx
-    )
-        internal
-    {
-        bytes32 contextA;
-        bytes32 contextB;
- 
-        uint40 globalIndex = _ctx.globalIndex;
-        bytes27 extraData = _ctx.extraData;
-        assembly {
-            contextA := globalIndex
-            contextA := or(contextA, extraData)
-        }
- 
-        uint64 currBufferIndex = _ctx.currBufferIndex;
-        uint40 prevResetIndex = _ctx.prevResetIndex;
-        uint40 currResetIndex = _ctx.currResetIndex;
-        assembly {
-            contextB := currBufferIndex
-            contextB := or(contextB, shl(64, prevResetIndex))
-            contextB := or(contextB, shl(104, currResetIndex))
-        }
- 
-        Eif (_self.contextA != contextA) {
-            _self.contextA = contextA;
-        }
- 
-        Iif (_self.contextB != contextB) {
-            _self.contextB = contextB;
-        }
-    }
- 
-    /**
-     * Retrieves the current ring buffer context.
-     * @param _self Buffer to access.
-     * @return Current ring buffer context.
-     */
-    function getContext(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            RingBufferContext memory
-        )
-    {
-        bytes32 contextA = _self.contextA;
-        bytes32 contextB = _self.contextB;
- 
-        uint40 globalIndex;
-        bytes27 extraData;
-        assembly {
-            globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            extraData   := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)
-        }
- 
-        uint64 currBufferIndex;
-        uint40 prevResetIndex;
-        uint40 currResetIndex;
-        assembly {
-            currBufferIndex :=          and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)
-            prevResetIndex  := shr(64,  and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))
-            currResetIndex  := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))
-        }
- 
-        return RingBufferContext({
-            globalIndex: globalIndex,
-            extraData: extraData,
-            currBufferIndex: currBufferIndex,
-            prevResetIndex: prevResetIndex,
-            currResetIndex: currResetIndex
-        });
-    }
- 
-    /**
-     * Retrieves the a buffer from the ring buffer by index.
-     * @param _self Buffer to access.
-     * @param _which Index of the sub buffer to access.
-     * @return Sub buffer for the index.
-     */
-    function getBuffer(
-        RingBuffer storage _self,
-        uint256 _which
-    )
-        internal
-        view
-        returns (
-            Buffer storage
-        )
-    {
-        return _which % 2 == 0 ? _self.bufferA : _self.bufferB;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/utils/index.html b/coverage/libraries/utils/index.html deleted file mode 100644 index c793f1883..000000000 --- a/coverage/libraries/utils/index.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - Code coverage report for libraries/utils/ - - - - - - - -
-
-

- all files libraries/utils/ -

-
-
- 89.07% - Statements - 163/183 -
-
- 67.57% - Branches - 50/74 -
-
- 91.11% - Functions - 41/45 -
-
- 89.27% - Lines - 183/205 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_Bytes32Utils.sol
100%6/6100%0/0100%5/5100%7/7
Lib_BytesUtils.sol
100%38/3863.64%14/22100%11/11100%44/44
Lib_ECDSAUtils.sol
100%9/9100%2/2100%4/4100%9/9
Lib_ErrorUtils.sol
100%1/1100%0/0100%1/1100%1/1
Lib_EthUtils.sol
83.33%10/12100%0/085.71%6/787.5%14/16
Lib_Math.sol
0%0/30%0/20%0/10%0/3
Lib_MerkleTree.sol
97.83%45/4690.91%20/22100%3/397.96%48/49
Lib_ReentrancyGuard.sol
100%4/450%1/2100%2/2100%5/5
Lib_RingBuffer.sol
78.13%50/6454.17%13/2481.82%9/1177.46%55/71
-
-
- - - - - - - diff --git a/coverage/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html b/coverage/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html deleted file mode 100644 index 5e49d6ba8..000000000 --- a/coverage/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html +++ /dev/null @@ -1,1205 +0,0 @@ - - - - Code coverage report for libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol - - - - - - - -
-
-

- all files / libraries/wrappers/ Lib_SafeExecutionManagerWrapper.sol -

-
-
- 100% - Statements - 30/30 -
-
- 83.33% - Branches - 5/6 -
-
- 100% - Functions - 16/16 -
-
- 96.77% - Lines - 30/31 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -11× -  -  -  -  -  -11× -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -41× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -43× -  -  -  -  -  -  -43× -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -146× -146× -  -  -  -  -146× - -  -  -  -  -  -  -  -144× -  -  -  -  -  -  -  -  -  -  -  -145× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_ErrorUtils } from "../utils/Lib_ErrorUtils.sol";
- 
-/**
- * @title Lib_SafeExecutionManagerWrapper
- * @dev The Safe Execution Manager Wrapper provides functions which facilitate writing OVM safe 
- * code using the standard solidity compiler, by routing all its operations through the Execution 
- * Manager.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-library Lib_SafeExecutionManagerWrapper {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Performs a safe ovmCALL.
-     * @param _gasLimit Gas limit for the call.
-     * @param _target Address to call.
-     * @param _calldata Data to send to the call.
-     * @return _success Whether or not the call reverted.
-     * @return _returndata Data returned by the call.
-     */
-    function safeCALL(
-        uint256 _gasLimit,
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCALL(uint256,address,bytes)",
-                _gasLimit,
-                _target,
-                _calldata
-            )
-        );
- 
-        return abi.decode(returndata, (bool, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmDELEGATECALL.
-     * @param _gasLimit Gas limit for the call.
-     * @param _target Address to call.
-     * @param _calldata Data to send to the call.
-     * @return _success Whether or not the call reverted.
-     * @return _returndata Data returned by the call.
-     */
-    function safeDELEGATECALL(
-        uint256 _gasLimit,
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmDELEGATECALL(uint256,address,bytes)",
-                _gasLimit,
-                _target,
-                _calldata
-            )
-        );
- 
-        return abi.decode(returndata, (bool, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmCREATE call.
-     * @param _gasLimit Gas limit for the creation.
-     * @param _bytecode Code for the new contract.
-     * @return _contract Address of the created contract.
-     */
-    function safeCREATE(
-        uint256 _gasLimit,
-        bytes memory _bytecode
-    )
-        internal
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            _gasLimit,
-            abi.encodeWithSignature(
-                "ovmCREATE(bytes)",
-                _bytecode
-            )
-        );
- 
-        return abi.decode(returndata, (address, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmEXTCODESIZE call.
-     * @param _contract Address of the contract to query the size of.
-     * @return _EXTCODESIZE Size of the requested contract in bytes.
-     */
-    function safeEXTCODESIZE(
-        address _contract
-    )
-        internal
-        returns (
-            uint256 _EXTCODESIZE
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmEXTCODESIZE(address)",
-                _contract
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmCHAINID call.
-     * @return _CHAINID Result of calling ovmCHAINID.
-     */
-    function safeCHAINID()
-        internal
-        returns (
-            uint256 _CHAINID
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCHAINID()"
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmCALLER call.
-     * @return _CALLER Result of calling ovmCALLER.
-     */
-    function safeCALLER()
-        internal
-        returns (
-            address _CALLER
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCALLER()"
-            )
-        );
- 
-        return abi.decode(returndata, (address));
-    }
- 
-    /**
-     * Performs a safe ovmADDRESS call.
-     * @return _ADDRESS Result of calling ovmADDRESS.
-     */
-    function safeADDRESS()
-        internal
-        returns (
-            address _ADDRESS
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmADDRESS()"
-            )
-        );
- 
-        return abi.decode(returndata, (address));
-    }
- 
-    /**
-     * Performs a safe ovmGETNONCE call.
-     * @return _nonce Result of calling ovmGETNONCE.
-     */
-    function safeGETNONCE()
-        internal
-        returns (
-            uint256 _nonce
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmGETNONCE()"
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmSETNONCE call.
-     * @param _nonce New account nonce.
-     */
-    function safeSETNONCE(
-        uint256 _nonce
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSETNONCE(uint256)",
-                _nonce
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe ovmCREATEEOA call.
-     * @param _messageHash Message hash which was signed by EOA
-     * @param _v v value of signature (0 or 1)
-     * @param _r r value of signature
-     * @param _s s value of signature
-     */
-    function safeCREATEEOA(
-        bytes32 _messageHash,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCREATEEOA(bytes32,uint8,bytes32,bytes32)",
-                _messageHash,
-                _v,
-                _r,
-                _s
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe REVERT.
-     * @param _reason String revert reason to pass along with the REVERT.
-     */
-    function safeREVERT(
-        string memory _reason
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmREVERT(bytes)",
-                Lib_ErrorUtils.encodeRevertString(
-                    _reason
-                )
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe "require".
-     * @param _condition Boolean condition that must be true or will revert.
-     * @param _reason String revert reason to pass along with the REVERT.
-     */
-    function safeREQUIRE(
-        bool _condition,
-        string memory _reason
-    )
-        internal
-    {
-        if (!_condition) {
-            safeREVERT(
-                _reason
-            );
-        }
-    }
- 
-    /**
-     * Performs a safe ovmSLOAD call.
-     */
-    function safeSLOAD(
-        bytes32 _key
-    )
-        internal
-        returns (
-            bytes32
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSLOAD(bytes32)",
-                _key
-            )
-        );
- 
-        return abi.decode(returndata, (bytes32));
-    }
- 
-    /**
-     * Performs a safe ovmSSTORE call.
-     */
-    function safeSSTORE(
-        bytes32 _key,
-        bytes32 _value
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSSTORE(bytes32,bytes32)",
-                _key,
-                _value
-            )
-        );
-    }
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Performs an ovm interaction and the necessary safety checks.
-     * @param _gasLimit Gas limit for the interaction.
-     * @param _calldata Data to send to the OVM_ExecutionManager (encoded with sighash).
-     * @return _returndata Data sent back by the OVM_ExecutionManager.
-     */
-    function _safeExecutionManagerInteraction(
-        uint256 _gasLimit,
-        bytes memory _calldata
-    )
-        private
-        returns (
-            bytes memory _returndata
-        )
-    {
-        address ovmExecutionManager = msg.sender;
-        (
-            bool success,
-            bytes memory returndata
-        ) = ovmExecutionManager.call{gas: _gasLimit}(_calldata);
- 
-        if (success == false) {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        } else Iif (returndata.length == 1) {
-            assembly {
-                return(0, 1)
-            }
-        } else {
-            return returndata;
-        }
-    }
- 
-    function _safeExecutionManagerInteraction(
-        bytes memory _calldata
-    )
-        private
-        returns (
-            bytes memory _returndata
-        )
-    {
-        return _safeExecutionManagerInteraction(
-            gasleft(),
-            _calldata
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/libraries/wrappers/Lib_SafeMathWrapper.sol.html b/coverage/libraries/wrappers/Lib_SafeMathWrapper.sol.html deleted file mode 100644 index 09c54906c..000000000 --- a/coverage/libraries/wrappers/Lib_SafeMathWrapper.sol.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - Code coverage report for libraries/wrappers/Lib_SafeMathWrapper.sol - - - - - - - -
-
-

- all files / libraries/wrappers/ Lib_SafeMathWrapper.sol -

-
-
- 21.05% - Statements - 4/19 -
-
- 50% - Branches - 1/2 -
-
- 12.5% - Functions - 1/8 -
-
- 21.05% - Lines - 4/19 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// Pulled from @openzeppelin/contracts/math/SafeMath.sol
-// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_SafeExecutionManagerWrapper } from "./Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title Lib_SafeMathWrapper
- */
- 
-/**
- * @dev Wrappers over Solidity's arithmetic operations with added overflow
- * checks.
- *
- * Arithmetic operations in Solidity wrap on overflow. This can easily result
- * in bugs, because programmers usually assume that an overflow raises an
- * error, which is the standard behavior in high level programming languages.
- * `SafeMath` restores this intuition by reverting the transaction when an
- * operation overflows.
- *
- * Using this library instead of the unchecked operations eliminates an entire
- * class of bugs, so it's recommended to use it always.
- */
- 
-library Lib_SafeMathWrapper {
-    /**
-     * @dev Returns the addition of two unsigned integers, reverting on
-     * overflow.
-     *
-     * Counterpart to Solidity's `+` operator.
-     *
-     * Requirements:
-     *
-     * - Addition cannot overflow.
-     */
-    function add(uint256 a, uint256 b) internal returns (uint256) {
-        uint256 c = a + b;
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c >= a, "Lib_SafeMathWrapper: addition overflow");
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the subtraction of two unsigned integers, reverting on
-     * overflow (when the result is negative).
-     *
-     * Counterpart to Solidity's `-` operator.
-     *
-     * Requirements:
-     *
-     * - Subtraction cannot overflow.
-     */
-    function sub(uint256 a, uint256 b) internal returns (uint256) {
-        return sub(a, b, "Lib_SafeMathWrapper: subtraction overflow");
-    }
- 
-    /**
-     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
-     * overflow (when the result is negative).
-     *
-     * Counterpart to Solidity's `-` operator.
-     *
-     * Requirements:
-     *
-     * - Subtraction cannot overflow.
-     */
-    function sub(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b <= a, errorMessage);
-        uint256 c = a - b;
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the multiplication of two unsigned integers, reverting on
-     * overflow.
-     *
-     * Counterpart to Solidity's `*` operator.
-     *
-     * Requirements:
-     *
-     * - Multiplication cannot overflow.
-     */
-    function mul(uint256 a, uint256 b) internal returns (uint256) {
-        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
-        // benefit is lost if 'b' is also tested.
-        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
-        Iif (a == 0) {
-            return 0;
-        }
- 
-        uint256 c = a * b;
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c / a == b, "Lib_SafeMathWrapper: multiplication overflow");
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the integer division of two unsigned integers. Reverts on
-     * division by zero. The result is rounded towards zero.
-     *
-     * Counterpart to Solidity's `/` operator. Note: this function uses a
-     * `revert` opcode (which leaves remaining gas untouched) while Solidity
-     * uses an invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function div(uint256 a, uint256 b) internal returns (uint256) {
-        return div(a, b, "Lib_SafeMathWrapper: division by zero");
-    }
- 
-    /**
-     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
-     * division by zero. The result is rounded towards zero.
-     *
-     * Counterpart to Solidity's `/` operator. Note: this function uses a
-     * `revert` opcode (which leaves remaining gas untouched) while Solidity
-     * uses an invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function div(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b > 0, errorMessage);
-        uint256 c = a / b;
-        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
-     * Reverts when dividing by zero.
-     *
-     * Counterpart to Solidity's `%` operator. This function uses a `revert`
-     * opcode (which leaves remaining gas untouched) while Solidity uses an
-     * invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function mod(uint256 a, uint256 b) internal returns (uint256) {
-        return mod(a, b, "Lib_SafeMathWrapper: modulo by zero");
-    }
- 
-    /**
-     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
-     * Reverts with custom message when dividing by zero.
-     *
-     * Counterpart to Solidity's `%` operator. This function uses a `revert`
-     * opcode (which leaves remaining gas untouched) while Solidity uses an
-     * invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function mod(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b != 0, errorMessage);
-        return a % b;
-    }
-}
-
-
- - - - - - - diff --git a/coverage/libraries/wrappers/index.html b/coverage/libraries/wrappers/index.html deleted file mode 100644 index 4fa651258..000000000 --- a/coverage/libraries/wrappers/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for libraries/wrappers/ - - - - - - - -
-
-

- all files libraries/wrappers/ -

-
-
- 69.39% - Statements - 34/49 -
-
- 75% - Branches - 6/8 -
-
- 70.83% - Functions - 17/24 -
-
- 68% - Lines - 34/50 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_SafeExecutionManagerWrapper.sol
100%30/3083.33%5/6100%16/1696.77%30/31
Lib_SafeMathWrapper.sol
21.05%4/1950%1/212.5%1/821.05%4/19
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html b/coverage/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html deleted file mode 100644 index bf9e75672..000000000 --- a/coverage/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,485 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/accounts/ OVM_ECDSAContractAccount.sol -

-
-
- 93.75% - Statements - 15/16 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 1/1 -
-
- 93.75% - Lines - 15/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  -  - -  -  -  -  -  - - -  -  -  -  -  - - -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
-import { Lib_SafeMathWrapper } from "../../libraries/wrappers/Lib_SafeMathWrapper.sol";
- 
-/**
- * @title OVM_ECDSAContractAccount
- * @dev The ECDSA Contract Account can be used as the implementation for a ProxyEOA deployed by the
- * ovmCREATEEOA operation. It enables backwards compatibility with Ethereum's Layer 1, by 
- * providing eth_sign and EIP155 formatted transaction encodings.
- *
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    // TODO: should be the amount sufficient to cover the gas costs of all of the transactions up
-    // to and including the CALL/CREATE which forms the entrypoint of the transaction.
-    uint256 constant EXECUTION_VALIDATION_GAS_OVERHEAD = 25000;
-    address constant ETH_ERC20_ADDRESS = 0x4200000000000000000000000000000000000006;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Executes a signed transaction.
-     * @param _transaction Signed EOA transaction.
-     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     * @return Whether or not the call returned (rather than reverted).
-     * @return Data returned by the call.
-     */
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        override
-        public
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
- 
-        // Address of this contract within the ovm (ovmADDRESS) should be the same as the
-        // recovered address of the user who signed this message. This is how we manage to shim
-        // account abstraction even though the user isn't a contract.
-        // Need to make sure that the transaction nonce is right and bump it if so.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_ECDSAUtils.recover(
-                _transaction,
-                isEthSign,
-                _v,
-                _r,
-                _s
-            ) == Lib_SafeExecutionManagerWrapper.safeADDRESS(),
-            "Signature provided for EOA transaction execution is invalid."
-        );
- 
-        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
- 
-        // Need to make sure that the transaction chainId is correct.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.chainId == Lib_SafeExecutionManagerWrapper.safeCHAINID(),
-            "Transaction chainId does not match expected OVM chainId."
-        );
- 
-        // Need to make sure that the transaction nonce is right.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
-            "Transaction nonce does not match the expected nonce."
-        );
- 
-        // TEMPORARY: Disable gas checks for mainnet.
-        // // Need to make sure that the gas is sufficient to execute the transaction.
-        // Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-        //    gasleft() >= Lib_SafeMathWrapper.add(decodedTx.gasLimit, EXECUTION_VALIDATION_GAS_OVERHEAD),
-        //    "Gas is not sufficient to execute the transaction."
-        // );
- 
-        // Transfer fee to relayer.
-        address relayer = Lib_SafeExecutionManagerWrapper.safeCALLER();
-        uint256 fee = Lib_SafeMathWrapper.mul(decodedTx.gasLimit, decodedTx.gasPrice);
-        (bool success, ) = Lib_SafeExecutionManagerWrapper.safeCALL(
-            gasleft(),
-            ETH_ERC20_ADDRESS,
-            abi.encodeWithSignature("transfer(address,uint256)", relayer, fee)
-        );
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            success == true,
-            "Fee was not transferred to relayer."
-        );
- 
-        // Contract creations are signalled by sending a transaction to the zero address.
-        if (decodedTx.to == address(0)) {
-            (address created, bytes memory revertData) = Lib_SafeExecutionManagerWrapper.safeCREATE(
-                decodedTx.gasLimit,
-                decodedTx.data
-            );
- 
-            // Return true if the contract creation succeeded, false w/ revertData otherwise.
-            Eif (created != address(0)) {
-                return (true, abi.encode(created));
-            } else {
-                return (false, revertData);
-            }
-        } else {
-            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
-            // the nonce of the calling account. Normally an EOA would bump the nonce for both
-            // cases, but since this is a contract we'd end up bumping the nonce twice.
-            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
- 
-            return Lib_SafeExecutionManagerWrapper.safeCALL(
-                decodedTx.gasLimit,
-                decodedTx.to,
-                decodedTx.data
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html b/coverage/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html deleted file mode 100644 index ff7ae303f..000000000 --- a/coverage/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/accounts/ OVM_ProxyEOA.sol -

-
-
- 87.5% - Statements - 7/8 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 5/5 -
-
- 88.89% - Lines - 8/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_ProxyEOA
- * @dev The Proxy EOA contract uses a delegate call to execute the logic in an implementation contract.
- * In combination with the logic implemented in the ECDSA Contract Account, this enables a form of upgradable 
- * 'account abstraction' on layer 2. 
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ProxyEOA {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _implementation Address of the initial implementation contract.
-     */
-    constructor(
-        address _implementation
-    )
-    {
-        _setImplementation(_implementation);
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        (bool success, bytes memory returndata) = Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
-            gasleft(),
-            getImplementation(),
-            msg.data
-        );
- 
-        Eif (success) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            Lib_SafeExecutionManagerWrapper.safeREVERT(
-                string(returndata)
-            );
-        }
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Changes the implementation address.
-     * @param _implementation New implementation address.
-     */
-    function upgrade(
-        address _implementation
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_SafeExecutionManagerWrapper.safeADDRESS() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
-            "EOAs can only upgrade their own EOA implementation"
-        );
- 
-        _setImplementation(_implementation);
-    }
- 
-    /**
-     * Gets the address of the current implementation.
-     * @return Current implementation address.
-     */
-    function getImplementation()
-        public
-        returns (
-            address
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                IMPLEMENTATION_KEY
-            )
-        );
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _setImplementation(
-        address _implementation
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            IMPLEMENTATION_KEY,
-            Lib_Bytes32Utils.fromAddress(_implementation)
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/accounts/index.html b/coverage/optimistic-ethereum/OVM/accounts/index.html deleted file mode 100644 index 83293fefa..000000000 --- a/coverage/optimistic-ethereum/OVM/accounts/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/accounts/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/accounts/ -

-
-
- 91.67% - Statements - 22/24 -
-
- 66.67% - Branches - 4/6 -
-
- 100% - Functions - 6/6 -
-
- 92% - Lines - 23/25 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_ECDSAContractAccount.sol
93.75%15/1675%3/4100%1/193.75%15/16
OVM_ProxyEOA.sol
87.5%7/850%1/2100%5/588.89%8/9
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html deleted file mode 100644 index 165d915d8..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/Abs_BaseCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/messaging/ Abs_BaseCrossDomainMessenger.sol -

-
-
- 77.78% - Statements - 7/9 -
-
- 50% - Branches - 1/2 -
-
- 80% - Functions - 4/5 -
-
- 77.78% - Lines - 7/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/* Library Imports */
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/**
- * @title Abs_BaseCrossDomainMessenger
- * @dev The Base Cross Domain Messenger is an abstract contract providing the interface and common functionality used in the
- * L1 and L2 Cross Domain Messengers. It can also serve as a template for developers wishing to implement a custom bridge 
- * contract to suit their needs.
- *
- * Compiler used: defined by child contract
- * Runtime target: defined by child contract
- */
-abstract contract Abs_BaseCrossDomainMessenger is iAbs_BaseCrossDomainMessenger, Lib_ReentrancyGuard {
-    /**************
-     *  Constants *
-     **************/
- 
-    // The default x-domain message sender being set to a non-zero value makes
-    // deployment a bit more expensive, but in exchange the refund on every call to
-    // `relayMessage` by the L1 and L2 messengers will be higher.
-    address internal constant DEFAULT_XDOMAIN_SENDER = 0x000000000000000000000000000000000000dEaD;
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    mapping (bytes32 => bool) public relayedMessages;
-    mapping (bytes32 => bool) public successfulMessages;
-    mapping (bytes32 => bool) public sentMessages;
-    uint256 public messageNonce;
-    address internal xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    constructor() Lib_ReentrancyGuard() {}
- 
-    function xDomainMessageSender() public override view returns (address) {
-        Irequire(xDomainMsgSender != DEFAULT_XDOMAIN_SENDER, "xDomainMessageSender is not set");
-        return xDomainMsgSender;
-    }
- 
-    /**
-     * Sends a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _message Message to send to the target.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function sendMessage(
-        address _target,
-        bytes memory _message,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            msg.sender,
-            _message,
-            messageNonce
-        );
- 
-        messageNonce += 1;
-        sentMessages[keccak256(xDomainCalldata)] = true;
- 
-        _sendXDomainMessage(xDomainCalldata, _gasLimit);
-        emit SentMessage(xDomainCalldata);
-    }
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Generates the correct cross domain calldata for a message.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @return ABI encoded cross domain calldata.
-     */
-    function _getXDomainCalldata(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodeWithSignature(
-            "relayMessage(address,address,bytes,uint256)",
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * param // Message to send.
-     * param // Gas limit for the provided message.
-     */
-    function _sendXDomainMessage(
-        bytes memory, // _message,
-        uint256 // _gasLimit
-    )
-        virtual
-        internal
-    {
-        revert("Implement me in child contracts!");
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html deleted file mode 100644 index 64986d93c..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol.html +++ /dev/null @@ -1,947 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L1CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L1CrossDomainMessenger.sol -

-
-
- 100% - Statements - 30/30 -
-
- 75% - Branches - 12/16 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 31/31 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -12× -12× -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  - -  -  -  -  - - - -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_AddressManager } from "../../../libraries/resolver/Lib_AddressManager.sol";
-import { Lib_SecureMerkleTrie } from "../../../libraries/trie/Lib_SecureMerkleTrie.sol";
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-import { iOVM_CanonicalTransactionChain } from "../../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_StateCommitmentChain } from "../../../iOVM/chain/iOVM_StateCommitmentChain.sol";
- 
-/* Contract Imports */
-import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_L1CrossDomainMessenger
- * @dev The L1 Cross Domain Messenger contract sends messages from L1 to L2, and relays messages from L2 onto L1. 
- * In the event that a message sent from L1 to L2 is rejected for exceeding the L2 epoch gas limit, it can be resubmitted 
- * via this contract's replay function. 
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1CrossDomainMessenger is iOVM_L1CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * Pass a default zero address to the address resolver. This will be updated when initialized.
-     */
-    constructor()
-        Lib_AddressResolver(address(0))
-    {}
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    function initialize(
-        address _libAddressManager
-    )
-        public
-    {
-        Erequire(address(libAddressManager) == address(0), "L1CrossDomainMessenger already intialized.");
-        libAddressManager = Lib_AddressManager(_libAddressManager);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Modifier to enforce that, if configured, only the OVM_L2MessageRelayer contract may successfully call a method.
-     */
-    modifier onlyRelayer() {
-        address relayer = resolve("OVM_L2MessageRelayer");
-        if (relayer != address(0)) {
-            Irequire(
-                msg.sender == relayer,
-                "Only OVM_L2MessageRelayer can relay L2-to-L1 messages."
-            );
-        }
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @inheritdoc iOVM_L1CrossDomainMessenger
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        L2MessageInclusionProof memory _proof
-    )
-        override
-        public
-        nonReentrant
-        onlyRelayer()
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        require(
-            _verifyXDomainMessage(
-                xDomainCalldata,
-                _proof
-            ) == true,
-            "Provided message could not be verified."
-        );
- 
-        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
- 
-        require(
-            successfulMessages[xDomainCalldataHash] == false,
-            "Provided message has already been received."
-        );
- 
-        xDomainMsgSender = _sender;
-        (bool success, ) = _target.call(_message);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-        // Mark the message as received if the call was successful. Ensures that a message can be
-        // relayed multiple times in the case that the call reverted.
-        Eif (success == true) {
-            successfulMessages[xDomainCalldataHash] = true;
-            emit RelayedMessage(xDomainCalldataHash);
-        }
- 
-        // Store an identifier that can be used to prove that the given message was relayed by some
-        // user. Gives us an easy way to pay relayers for their work.
-        bytes32 relayId = keccak256(
-            abi.encodePacked(
-                xDomainCalldata,
-                msg.sender,
-                block.number
-            )
-        );
-        relayedMessages[relayId] = true;
-    }
- 
-    /**
-     * Replays a cross domain message to the target messenger.
-     * @inheritdoc iOVM_L1CrossDomainMessenger
-     */
-    function replayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        require(
-            sentMessages[keccak256(xDomainCalldata)] == true,
-            "Provided message has not already been sent."
-        );
- 
-        _sendXDomainMessage(xDomainCalldata, _gasLimit);
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Verifies that the given message is valid.
-     * @param _xDomainCalldata Calldata to verify.
-     * @param _proof Inclusion proof for the message.
-     * @return Whether or not the provided message is valid.
-     */
-    function _verifyXDomainMessage(
-        bytes memory _xDomainCalldata,
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        return (
-            _verifyStateRootProof(_proof)
-            && _verifyStorageProof(_xDomainCalldata, _proof)
-        );
-    }
- 
-    /**
-     * Verifies that the state root within an inclusion proof is valid.
-     * @param _proof Message inclusion proof.
-     * @return Whether or not the provided proof is valid.
-     */
-    function _verifyStateRootProof(
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
- 
-        return (
-            ovmStateCommitmentChain.insideFraudProofWindow(_proof.stateRootBatchHeader) == false
-            && ovmStateCommitmentChain.verifyStateCommitment(
-                _proof.stateRoot,
-                _proof.stateRootBatchHeader,
-                _proof.stateRootProof
-            )
-        );
-    }
- 
-    /**
-     * Verifies that the storage proof within an inclusion proof is valid.
-     * @param _xDomainCalldata Encoded message calldata.
-     * @param _proof Message inclusion proof.
-     * @return Whether or not the provided proof is valid.
-     */
-    function _verifyStorageProof(
-        bytes memory _xDomainCalldata,
-        L2MessageInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 storageKey = keccak256(
-            abi.encodePacked(
-                keccak256(
-                    abi.encodePacked(
-                        _xDomainCalldata,
-                        resolve("OVM_L2CrossDomainMessenger")
-                    )
-                ),
-                uint256(0)
-            )
-        );
- 
-        (
-            bool exists,
-            bytes memory encodedMessagePassingAccount
-        ) = Lib_SecureMerkleTrie.get(
-            abi.encodePacked(0x4200000000000000000000000000000000000000),
-            _proof.stateTrieWitness,
-            _proof.stateRoot
-        );
- 
-        Erequire(
-            exists == true,
-            "Message passing predeploy has not been initialized or invalid proof provided."
-        );
- 
-        Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
-            encodedMessagePassingAccount
-        );
- 
-        return Lib_SecureMerkleTrie.verifyInclusionProof(
-            abi.encodePacked(storageKey),
-            abi.encodePacked(uint8(1)),
-            _proof.storageTrieWitness,
-            account.storageRoot
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * @param _message Message to send.
-     * @param _gasLimit OVM gas limit for the message.
-     */
-    function _sendXDomainMessage(
-        bytes memory _message,
-        uint256 _gasLimit
-    )
-        override
-        internal
-    {
-        iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).enqueue(
-            resolve("OVM_L2CrossDomainMessenger"),
-            _gasLimit,
-            _message
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html deleted file mode 100644 index 71f510689..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L1MultiMessageRelayer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L1MultiMessageRelayer.sol -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 6/6 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-import { iOVM_L1MultiMessageRelayer } from "../../../iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol";
- 
-/* Contract Imports */
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
- 
- 
-/**
- * @title OVM_L1MultiMessageRelayer
- * @dev The L1 Multi-Message Relayer contract is a gas efficiency optimization which enables the 
- * relayer to submit multiple messages in a single transaction to be relayed by the L1 Cross Domain
- * Message Sender.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1MultiMessageRelayer is iOVM_L1MultiMessageRelayer, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
-    constructor(
-        address _libAddressManager
-    ) 
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyBatchRelayer() {
-        require(
-            msg.sender == resolve("OVM_L2BatchMessageRelayer"),
-            "OVM_L1MultiMessageRelayer: Function can only be called by the OVM_L2BatchMessageRelayer"
-        );
-        _;
-    }
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @notice Forwards multiple cross domain messages to the L1 Cross Domain Messenger for relaying
-     * @param _messages An array of L2 to L1 messages
-     */
-    function batchRelayMessages(L2ToL1Message[] calldata _messages) 
-        override
-        external
-        onlyBatchRelayer 
-    {
-        iOVM_L1CrossDomainMessenger messenger = iOVM_L1CrossDomainMessenger(resolve("Proxy__OVM_L1CrossDomainMessenger"));
-        for (uint256 i = 0; i < _messages.length; i++) {
-            L2ToL1Message memory message = _messages[i];
-            messenger.relayMessage(
-                message.target,
-                message.sender,
-                message.message,
-                message.messageNonce,
-                message.proof
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html deleted file mode 100644 index a646692ae..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/OVM_L2CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/messaging/ OVM_L2CrossDomainMessenger.sol -

-
-
- 100% - Statements - 14/14 -
-
- 83.33% - Branches - 5/6 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 14/14 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  - -  - -  -  -  -  - - - -  -  -  - - - -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_ReentrancyGuard } from "../../../libraries/utils/Lib_ReentrancyGuard.sol";
- 
-/* Interface Imports */
-import { iOVM_L2CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol";
-import { iOVM_L1MessageSender } from "../../../iOVM/predeploys/iOVM_L1MessageSender.sol";
-import { iOVM_L2ToL1MessagePasser } from "../../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
- 
-/* Contract Imports */
-import { Abs_BaseCrossDomainMessenger } from "./Abs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_L2CrossDomainMessenger
- * @dev The L2 Cross Domain Messenger contract sends messages from L2 to L1, and is the entry point
- * for L2 messages sent via the L1 Cross Domain Messenger.
- * 
- * Compiler used: optimistic-solc
- * Runtime target: OVM
-  */
-contract OVM_L2CrossDomainMessenger is iOVM_L2CrossDomainMessenger, Abs_BaseCrossDomainMessenger, Lib_AddressResolver {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @inheritdoc iOVM_L2CrossDomainMessenger
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    )
-        override
-        nonReentrant
-        public
-    {
-        require(
-            _verifyXDomainMessage() == true,
-            "Provided message could not be verified."
-        );
- 
-        bytes memory xDomainCalldata = _getXDomainCalldata(
-            _target,
-            _sender,
-            _message,
-            _messageNonce
-        );
- 
-        bytes32 xDomainCalldataHash = keccak256(xDomainCalldata);
- 
-        require(
-            successfulMessages[xDomainCalldataHash] == false,
-            "Provided message has already been received."
-        );
- 
-        xDomainMsgSender = _sender;
-        (bool success, ) = _target.call(_message);
-        xDomainMsgSender = DEFAULT_XDOMAIN_SENDER;
- 
-        // Mark the message as received if the call was successful. Ensures that a message can be
-        // relayed multiple times in the case that the call reverted.
-        Eif (success == true) {
-            successfulMessages[xDomainCalldataHash] = true;
-            emit RelayedMessage(xDomainCalldataHash);
-        }
- 
-        // Store an identifier that can be used to prove that the given message was relayed by some
-        // user. Gives us an easy way to pay relayers for their work.
-        bytes32 relayId = keccak256(
-            abi.encodePacked(
-                xDomainCalldata,
-                msg.sender,
-                block.number
-            )
-        );
-        relayedMessages[relayId] = true;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Verifies that a received cross domain message is valid.
-     * @return _valid Whether or not the message is valid.
-     */
-    function _verifyXDomainMessage()
-        view
-        internal
-        returns (
-            bool _valid
-        )
-    {
-        return (
-            iOVM_L1MessageSender(resolve("OVM_L1MessageSender")).getL1MessageSender() == resolve("OVM_L1CrossDomainMessenger")
-        );
-    }
- 
-    /**
-     * Sends a cross domain message.
-     * @param _message Message to send.
-     * param _gasLimit Gas limit for the provided message.
-     */
-    function _sendXDomainMessage(
-        bytes memory _message,
-        uint256 // _gasLimit
-    )
-        override
-        internal
-    {
-        iOVM_L2ToL1MessagePasser(resolve("OVM_L2ToL1MessagePasser")).passMessageToL1(_message);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/messaging/index.html b/coverage/optimistic-ethereum/OVM/bridge/messaging/index.html deleted file mode 100644 index 69677e4b5..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/messaging/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/messaging/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/bridge/messaging/ -

-
-
- 96.55% - Statements - 56/58 -
-
- 76.92% - Branches - 20/26 -
-
- 95.24% - Functions - 20/21 -
-
- 96.67% - Lines - 58/60 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_BaseCrossDomainMessenger.sol
77.78%7/950%1/280%4/577.78%7/9
OVM_L1CrossDomainMessenger.sol
100%30/3075%12/16100%9/9100%31/31
OVM_L1MultiMessageRelayer.sol
100%5/5100%2/2100%3/3100%6/6
OVM_L2CrossDomainMessenger.sol
100%14/1483.33%5/6100%4/4100%14/14
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html deleted file mode 100644 index 6be8e110e..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol.html +++ /dev/null @@ -1,692 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/Abs_L1TokenGateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ Abs_L1TokenGateway.sol -

-
-
- 83.33% - Statements - 10/12 -
-
- 100% - Branches - 0/0 -
-
- 75% - Functions - 6/8 -
-
- 83.33% - Lines - 10/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm 
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
- 
-/**
- * @title Abs_L1TokenGateway
- * @dev An L1 Token Gateway is a contract which stores deposited L1 funds that are in use on L2.
- * It synchronizes a corresponding L2 representation of the "deposited token", informing it
- * of new deposits and releasing L1 funds when there are newly finalized withdrawals.
- *
- * NOTE: This abstract contract gives all the core functionality of an L1 token gateway, 
- * but provides easy hooks in case developers need extensions in child contracts.
- * In many cases, the default OVM_L1ERC20Gateway will suffice.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-abstract contract Abs_L1TokenGateway is iOVM_L1TokenGateway, OVM_CrossDomainEnabled {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    address public l2DepositedToken;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l2DepositedToken iOVM_L2DepositedToken-compatible address on the chain being deposited into.
-     * @param _l1messenger L1 Messenger address being used for cross-chain communications.
-     */
-    constructor(
-        address _l2DepositedToken,
-        address _l1messenger 
-    )
-        OVM_CrossDomainEnabled(_l1messenger)
-    {
-        l2DepositedToken = _l2DepositedToken;
-    }
- 
-    /********************************
-     * Overridable Accounting logic *
-     ********************************/
- 
-    // Default gas value which can be overridden if more complex logic runs on L2.
-    uint32 public DEFAULT_FINALIZE_DEPOSIT_L2_GAS = 1200000;
- 
-    /**
-     * @dev Core logic to be performed when a withdrawal is finalized on L1.
-     * In most cases, this will simply send locked funds to the withdrawer.
-     *
-     * param _to Address being withdrawn to.
-     * param _amount Amount being withdrawn.
-     */
-    function _handleFinalizeWithdrawal(
-        address, // _to,
-        uint256 // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Implement me in child contracts");
-    }
- 
-    /**
-     * @dev Core logic to be performed when a deposit is initiated on L1.
-     * In most cases, this will simply send locked funds to the withdrawer.
-     *
-     * param _from Address being deposited from on L1.
-     * param _to Address being deposited into on L2.
-     * param _amount Amount being deposited.
-     */
-    function _handleInitiateDeposit(
-        address, // _from,
-        address, // _to,
-        uint256 // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Implement me in child contracts");
-    }
- 
-    /**
-     * @dev Overridable getter for the L2 gas limit, in the case it may be
-     * dynamic, and the above public constant does not suffice.
-     *
-     */
- 
-    function getFinalizeDepositL2Gas()
-        public
-        view
-        returns(
-            uint32
-        )
-    {
-        return DEFAULT_FINALIZE_DEPOSIT_L2_GAS;
-    }
- 
-    /**************
-     * Depositing *
-     **************/
- 
-    /**
-     * @dev deposit an amount of the ERC20 to the caller's balance on L2
-     * @param _amount Amount of the ERC20 to deposit
-     */
-    function deposit(
-        uint _amount
-    )
-        public
-        override
-    {
-        _initiateDeposit(msg.sender, msg.sender, _amount);
-    }
- 
-    /**
-     * @dev deposit an amount of ERC20 to a recipients's balance on L2
-     * @param _to L2 address to credit the withdrawal to
-     * @param _amount Amount of the ERC20 to deposit
-     */
-    function depositTo(
-        address _to,
-        uint _amount
-    )
-        public
-        override
-    {
-        _initiateDeposit(msg.sender, _to, _amount);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by informing the L2 Deposited Token
-     * contract of the deposit and calling a handler to lock the L1 funds. (e.g. transferFrom)
-     *
-     * @param _from Account to pull the deposit from on L1
-     * @param _to Account to give the deposit to on L2
-     * @param _amount Amount of the ERC20 to deposit.
-     */
-    function _initiateDeposit(
-        address _from,
-        address _to,
-        uint _amount
-    )
-        internal
-    {
-        // Call our deposit accounting handler implemented by child contracts.
-        _handleInitiateDeposit(
-            _from,
-            _to,
-            _amount
-        );
- 
-        // Construct calldata for l2DepositedToken.finalizeDeposit(_to, _amount)
-        bytes memory data = abi.encodeWithSelector(
-            iOVM_L2DepositedToken.finalizeDeposit.selector,
-            _to,
-            _amount
-        );
- 
-        // Send calldata into L2
-        sendCrossDomainMessage(
-            l2DepositedToken,
-            data,
-            getFinalizeDepositL2Gas()
-        );
- 
-        emit DepositInitiated(_from, _to, _amount);
-    }
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    /**
-     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the 
-     * L1 ERC20 token. 
-     * This call will fail if the initialized withdrawal from L2 has not been finalized. 
-     *
-     * @param _to L1 address to credit the withdrawal to
-     * @param _amount Amount of the ERC20 to withdraw
-     */
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external
-        override 
-        onlyFromCrossDomainAccount(l2DepositedToken)
-    {
-        // Call our withdrawal accounting handler implemented by child contracts.
-        _handleFinalizeWithdrawal(
-            _to,
-            _amount
-        );
- 
-        emit WithdrawalFinalized(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html deleted file mode 100644 index a16bb0653..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol.html +++ /dev/null @@ -1,755 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/Abs_L2DepositedToken.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ Abs_L2DepositedToken.sol -

-
-
- 86.67% - Statements - 13/15 -
-
- 50% - Branches - 2/4 -
-
- 80% - Functions - 8/10 -
-
- 87.5% - Lines - 14/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  - -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
- 
-/**
- * @title Abs_L2DepositedToken
- * @dev An L2 Deposited Token is an L2 representation of funds which were deposited from L1.
- * Usually contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
- * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
- *
- * NOTE: This abstract contract gives all the core functionality of a deposited token implementation except for the
- * token's internal accounting itself.  This gives developers an easy way to implement children with their own token code.
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-abstract contract Abs_L2DepositedToken is iOVM_L2DepositedToken, OVM_CrossDomainEnabled {
- 
-    /*******************
-     * Contract Events *
-     *******************/
- 
-    event Initialized(iOVM_L1TokenGateway _l1TokenGateway);
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    iOVM_L1TokenGateway public l1TokenGateway;
- 
-    /********************************
-     * Constructor & Initialization *
-     ********************************/
- 
-    /**
-     * @param _l2CrossDomainMessenger L1 Messenger address being used for cross-chain communications.
-     */
-    constructor(
-        address _l2CrossDomainMessenger
-    )
-        OVM_CrossDomainEnabled(_l2CrossDomainMessenger)
-    {}
- 
-    /**
-     * @dev Initialize this contract with the L1 token gateway address.
-     * The flow: 1) this contract gets deployed on L2, 2) the L1
-     * gateway is deployed with addr from (1), 3) L1 gateway address passed here.
-     *
-     * @param _l1TokenGateway Address of the corresponding L1 gateway deployed to the main chain
-     */
- 
-    function init(
-        iOVM_L1TokenGateway _l1TokenGateway
-    )
-        public
-    {
-        Erequire(address(l1TokenGateway) == address(0), "Contract has already been initialized");
- 
-        l1TokenGateway = _l1TokenGateway;
-        
-        emit Initialized(l1TokenGateway);
-    }
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyInitialized() {
-        Erequire(address(l1TokenGateway) != address(0), "Contract has not yet been initialized");
-        _;
-    }
- 
-    /********************************
-     * Overridable Accounting logic *
-     ********************************/
- 
-    // Default gas value which can be overridden if more complex logic runs on L2.
-    uint32 constant DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS = 100000;
- 
-    /**
-     * @dev Core logic to be performed when a withdrawal from L2 is initialized.
-     * In most cases, this will simply burn the withdrawn L2 funds.
-     *
-     * param _to Address being withdrawn to
-     * param _amount Amount being withdrawn
-     */
- 
-    function _handleInitiateWithdrawal(
-        address, // _to,
-        uint // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Accounting must be implemented by child contract.");
-    }
- 
-    /**
-     * @dev Core logic to be performed when a deposit from L2 is finalized on L2.
-     * In most cases, this will simply _mint() to credit L2 funds to the recipient.
-     *
-     * param _to Address being deposited to on L2
-     * param _amount Amount which was deposited on L1
-     */
-    function _handleFinalizeDeposit(
-        address, // _to
-        uint // _amount
-    )
-        internal
-        virtual
-    {
-        revert("Accounting must be implemented by child contract.");
-    }
- 
-    /**
-     * @dev Overridable getter for the *L1* gas limit of settling the withdrawal, in the case it may be
-     * dynamic, and the above public constant does not suffice.
-     *
-     */
- 
-    function getFinalizeWithdrawalL1Gas()
-        public
-        view
-        virtual
-        returns(
-            uint32
-        )
-    {
-        return DEFAULT_FINALIZE_WITHDRAWAL_L1_GAS;
-    }
- 
- 
-    /***************
-     * Withdrawing *
-     ***************/
- 
-    /**
-     * @dev initiate a withdraw of some tokens to the caller's account on L1
-     * @param _amount Amount of the token to withdraw
-     */
-    function withdraw(
-        uint _amount
-    )
-        external
-        override
-        onlyInitialized()
-    {
-        _initiateWithdrawal(msg.sender, _amount);
-    }
- 
-    /**
-     * @dev initiate a withdraw of some token to a recipient's account on L1
-     * @param _to L1 adress to credit the withdrawal to
-     * @param _amount Amount of the token to withdraw
-     */
-    function withdrawTo(
-        address _to,
-        uint _amount
-    )
-        external
-        override
-        onlyInitialized()
-    {
-        _initiateWithdrawal(_to, _amount);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by storing the token and informing the L2 token Gateway of the deposit.
-     *
-     * @param _to Account to give the withdrawal to on L1
-     * @param _amount Amount of the token to withdraw
-     */
-    function _initiateWithdrawal(
-        address _to,
-        uint _amount
-    )
-        internal
-    {
-        // Call our withdrawal accounting handler implemented by child contracts (usually a _burn)
-        _handleInitiateWithdrawal(_to, _amount);
- 
-        // Construct calldata for l1TokenGateway.finalizeWithdrawal(_to, _amount)
-        bytes memory data = abi.encodeWithSelector(
-            iOVM_L1TokenGateway.finalizeWithdrawal.selector,
-            _to,
-            _amount
-        );
- 
-        // Send message up to L1 gateway
-        sendCrossDomainMessage(
-            address(l1TokenGateway),
-            data,
-            getFinalizeWithdrawalL1Gas()
-        );
- 
-        emit WithdrawalInitiated(msg.sender, _to, _amount);
-    }
- 
-    /************************************
-     * Cross-chain Function: Depositing *
-     ************************************/
- 
-    /**
-     * @dev Complete a deposit from L1 to L2, and credits funds to the recipient's balance of this 
-     * L2 token. 
-     * This call will fail if it did not originate from a corresponding deposit in OVM_l1TokenGateway. 
-     *
-     * @param _to Address to receive the withdrawal at
-     * @param _amount Amount of the token to withdraw
-     */
-    function finalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        external
-        override 
-        onlyInitialized()
-        onlyFromCrossDomainAccount(address(l1TokenGateway))
-    {
-        _handleFinalizeDeposit(_to, _amount);
-        emit DepositFinalized(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html deleted file mode 100644 index d1b1fb47f..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L1ERC20Gateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L1ERC20Gateway.sol -

-
-
- 100% - Statements - 3/3 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 3/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm 
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
-import { Abs_L1TokenGateway } from "./Abs_L1TokenGateway.sol";
-import { iOVM_ERC20 } from "../../../iOVM/predeploys/iOVM_ERC20.sol";
- 
-/**
- * @title OVM_L1ERC20Gateway
- * @dev The L1 ERC20 Gateway is a contract which stores deposited L1 funds that are in use on L2.
- * It synchronizes a corresponding L2 ERC20 Gateway, informing it of deposits, and listening to it
- * for newly finalized withdrawals.
- *
- * NOTE: This contract extends Abs_L1TokenGateway, which is where we
- * takes care of most of the initialization and the cross-chain logic.
- * If you are looking to implement your own deposit/withdrawal contracts, you
- * may also want to extend the abstract contract in a similar manner.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1ERC20Gateway is Abs_L1TokenGateway {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
-    
-    iOVM_ERC20 public l1ERC20;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l1ERC20 L1 ERC20 address this contract stores deposits for
-     * @param _l2DepositedERC20 L2 Gateway address on the chain being deposited into
-     */
-    constructor(
-        iOVM_ERC20 _l1ERC20,
-        address _l2DepositedERC20,
-        address _l1messenger 
-    )
-        Abs_L1TokenGateway(
-            _l2DepositedERC20,
-            _l1messenger
-        )
-    {
-        l1ERC20 = _l1ERC20;
-    }
- 
- 
-    /**************
-     * Accounting *
-     **************/
- 
-    /**
-     * @dev When a deposit is initiated on L1, the L1 Gateway
-     * transfers the funds to itself for future withdrawals
-     *
-     * @param _from L1 address ETH is being deposited from
-     * param _to L2 address that the ETH is being deposited to
-     * @param _amount Amount of ERC20 to send
-     */
-    function _handleInitiateDeposit(
-        address _from,
-        address, // _to,
-        uint256 _amount
-    )
-        internal
-        override
-    {
-         // Hold on to the newly deposited funds
-        l1ERC20.transferFrom(
-            _from,
-            address(this),
-            _amount
-        );
-    }
- 
-    /**
-     * @dev When a withdrawal is finalized on L1, the L1 Gateway
-     * transfers the funds to the withdrawer
-     *
-     * @param _to L1 address that the ERC20 is being withdrawn to
-     * @param _amount Amount of ERC20 to send
-     */
-    function _handleFinalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        // Transfer withdrawn funds out to withdrawer
-        l1ERC20.transfer(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html deleted file mode 100644 index 64267feef..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol.html +++ /dev/null @@ -1,557 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L1ETHGateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L1ETHGateway.sol -

-
-
- 100% - Statements - 11/11 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 6/6 -
-
- 91.67% - Lines - 11/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1ETHGateway } from "../../../iOVM/bridge/tokens/iOVM_L1ETHGateway.sol";
-import { iOVM_L2DepositedToken } from "../../../iOVM/bridge/tokens/iOVM_L2DepositedToken.sol";
- 
-/* Library Imports */
-import { OVM_CrossDomainEnabled } from "../../../libraries/bridge/OVM_CrossDomainEnabled.sol";
-import { Lib_AddressResolver } from "../../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/**
- * @title OVM_L1ETHGateway
- * @dev The L1 ETH Gateway is a contract which stores deposited ETH that is in use on L2.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L1ETHGateway is iOVM_L1ETHGateway, OVM_CrossDomainEnabled, Lib_AddressResolver {
- 
-    /********************
-     * Public Constants *
-     ********************/
- 
-    uint32 public constant override getFinalizeDepositL2Gas = 1200000;
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    address public ovmEth;
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address manager for this OE deployment
-     * @param _ovmEth L2 OVM_ETH implementation of iOVM_DepositedToken
-     */
-    constructor(
-        address _libAddressManager,
-        address _ovmEth
-    )
-        OVM_CrossDomainEnabled(address(0)) // overridden in constructor code
-        Lib_AddressResolver(_libAddressManager)
-    {
-        ovmEth = _ovmEth;
-        messenger = resolve("Proxy__OVM_L1CrossDomainMessenger"); // overrides OVM_CrossDomainEnabled constructor setting because resolve() is not yet accessible
-    }
- 
-    /**************
-     * Depositing *
-     **************/
- 
-    receive()
-        external
-        payable
-    {
-        _initiateDeposit(msg.sender, msg.sender);
-    }
- 
-    /**
-     * @dev deposit an amount of the ETH to the caller's balance on L2
-     */
-    function deposit() 
-        external
-        override
-        payable
-    {
-        _initiateDeposit(msg.sender, msg.sender);
-    }
- 
-    /**
-     * @dev deposit an amount of ETH to a recipients's balance on L2
-     * @param _to L2 address to credit the withdrawal to
-     */
-    function depositTo(
-        address _to
-    )
-        external
-        override
-        payable
-    {
-        _initiateDeposit(msg.sender, _to);
-    }
- 
-    /**
-     * @dev Performs the logic for deposits by storing the ETH and informing the L2 ETH Gateway of the deposit.
-     *
-     * @param _from Account to pull the deposit from on L1
-     * @param _to Account to give the deposit to on L2
-     */
-    function _initiateDeposit(
-        address _from,
-        address _to
-    )
-        internal
-    {
-        // Construct calldata for l2ETHGateway.finalizeDeposit(_to, _amount)
-        bytes memory data =
-            abi.encodeWithSelector(
-                iOVM_L2DepositedToken.finalizeDeposit.selector,
-                _to,
-                msg.value
-            );
- 
-        // Send calldata into L2
-        sendCrossDomainMessage(
-            ovmEth,
-            data,
-            getFinalizeDepositL2Gas
-        );
- 
-        emit DepositInitiated(_from, _to, msg.value);
-    }
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    /**
-     * @dev Complete a withdrawal from L2 to L1, and credit funds to the recipient's balance of the
-     * L1 ETH token.
-     * Since only the xDomainMessenger can call this function, it will never be called before the withdrawal is finalized. 
-     *
-     * @param _to L1 address to credit the withdrawal to
-     * @param _amount Amount of the ETH to withdraw
-     */
-    function finalizeWithdrawal(
-        address _to,
-        uint256 _amount
-    )
-        external
-        override
-        onlyFromCrossDomainAccount(ovmEth)
-    {
-        _safeTransferETH(_to, _amount);
- 
-        emit WithdrawalFinalized(_to, _amount);
-    }
- 
-    /**********************************
-     * Internal Functions: Accounting *
-     **********************************/
- 
-    /**
-     * @dev Internal accounting function for moving around L1 ETH.
-     *
-     * @param _to L1 address to transfer ETH to
-     * @param _value Amount of ETH to send to
-     */
-    function _safeTransferETH(
-        address _to,
-        uint256 _value
-    )
-        internal
-    {
-        (bool success, ) = _to.call{value: _value}(new bytes(0));
-        Erequire(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html deleted file mode 100644 index 703ace05a..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/OVM_L2DepositedERC20.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/bridge/tokens/ OVM_L2DepositedERC20.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Contract Imports */
-import { UniswapV2ERC20 } from "../../../libraries/standards/UniswapV2ERC20.sol";
- 
-/* Library Imports */
-import { Abs_L2DepositedToken } from "./Abs_L2DepositedToken.sol";
- 
-/**
- * @title OVM_L2DepositedERC20
- * @dev The L2 Deposited ERC20 is an ERC20 implementation which represents L1 assets deposited into L2.
- * This contract mints new tokens when it hears about deposits into the L1 ERC20 gateway.
- * This contract also burns the tokens intended for withdrawal, informing the L1 gateway to release L1 funds.
- *
- * NOTE: This contract implements the Abs_L2DepositedToken contract using Uniswap's ERC20 as the implementation.
- * Alternative implementations can be used in this similar manner.
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract OVM_L2DepositedERC20 is Abs_L2DepositedToken, UniswapV2ERC20 {
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _l2CrossDomainMessenger Cross-domain messenger used by this contract.
-     * @param _name ERC20 name
-     * @param _symbol ERC20 symbol
-     */
-    constructor(
-        address _l2CrossDomainMessenger,
-        string memory _name,
-        string memory _symbol
-    )
-        Abs_L2DepositedToken(_l2CrossDomainMessenger)
-        UniswapV2ERC20(_name, _symbol)
-    {}
- 
-    // When a withdrawal is initiated, we burn the withdrawer's funds to prevent subsequent L2 usage.
-    function _handleInitiateWithdrawal(
-        address, // _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        _burn(msg.sender, _amount);
-    }
- 
-    // When a deposit is finalized, we credit the account on L2 with the same amount of tokens.
-    function _handleFinalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        internal
-        override
-    {
-        _mint(_to, _amount);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/bridge/tokens/index.html b/coverage/optimistic-ethereum/OVM/bridge/tokens/index.html deleted file mode 100644 index 6d14f7c59..000000000 --- a/coverage/optimistic-ethereum/OVM/bridge/tokens/index.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/bridge/tokens/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/bridge/tokens/ -

-
-
- 90.7% - Statements - 39/43 -
-
- 50% - Branches - 3/6 -
-
- 86.67% - Functions - 26/30 -
-
- 88.89% - Lines - 40/45 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_L1TokenGateway.sol
83.33%10/12100%0/075%6/883.33%10/12
Abs_L2DepositedToken.sol
86.67%13/1550%2/480%8/1087.5%14/16
OVM_L1ERC20Gateway.sol
100%3/3100%0/0100%3/3100%3/3
OVM_L1ETHGateway.sol
100%11/1150%1/2100%6/691.67%11/12
OVM_L2DepositedERC20.sol
100%2/2100%0/0100%3/3100%2/2
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html b/coverage/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html deleted file mode 100644 index a87b5bba5..000000000 --- a/coverage/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol.html +++ /dev/null @@ -1,3755 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/chain/ OVM_CanonicalTransactionChain.sol -

-
-
- 95.51% - Statements - 149/156 -
-
- 87.5% - Branches - 63/72 -
-
- 84.38% - Functions - 27/32 -
-
- 95.88% - Lines - 163/170 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -228× -228× -228× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -595× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -388× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -309× -309× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -106× -106× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -47× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -239× -  -  -  -  -238× -  -  -  -  -237× -  -  -  -  -  -  -  -236× -236× -  -  -  -236× -  -  -  -  -  -  -235× -235× -37600× -  -  -235× -  -  -  -  -  -  -  -  -235× -235× -  -  -  -  -235× -  -235× -235× -  -  -  -  -235× -235× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -110× -110× -110× -110× -  -  -  -  -  -110× -  -  -  -  -109× -  -  -  -  -108× -  -  -  -  -107× -  -  -  -  -106× -  -106× -  -  -  -  -  -  -  -106× -106× -  -  -  -  -106× -  -  -106× -  -  -106× -  -  -106× -  -  -  -106× -  -106× -106× -835× -  -835× -  -106× -  -  -  -829× -  -  -  -  -  -  -  -824× -  -  -824× -1639× -1639× -  -  -  -1639× -  -  -  -  -  -  -1639× -1639× -1639× -  -  -  -824× -179× -  -  -  -  -178× -178× -178× -  -  -  -94× -  -  -  -  -  -  -88× -  -  -  -  -87× -  -  -  -  -  -87× -87× -87× -87× -  -45× -45× -  -  -  -  -  -42× -  -  -  -  -42× -42× -  -  -  -  -  -87× -  -  -  -  -  -  -  -87× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -835× -835× -835× -835× -835× -  -835× -  -  -  -  -  -  -835× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -506× -  -506× -506× -506× -506× -506× -  -  -  -  -  -  -  -506× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -87× -87× -  -  -  -  -  -  -  -87× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -179× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -267× -267× -265× -  -265× -265× -265× -  -  -  -  -265× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -106× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1639× -419× -  -  -1639× -1639× -  -1639× -1639× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1639× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -87× -87× -  -87× -  -  -  -  -  -  -  -87× -  -  -  -  -  -  -  -87× -87× -  -  -  -  -  -  -87× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -106× - -  - -  -  -  -  - -  -  -  -  -  -  -102× -  -  -  -  -101× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -178× -  -  -  -  -  -177× -  -  -  -  -  -  -176× -  -  -  -  -174× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -829× -  -  -  -  -828× -  -  -  -  -  -827× -175× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -94× - -  -  -  -  -  -  -91× -89× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -179× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
-import { Lib_Math } from "../../libraries/utils/Lib_Math.sol";
- 
-/* Interface Imports */
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/* Contract Imports */
-import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
- 
- 
-/**
- * @title OVM_CanonicalTransactionChain
- * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions
- * which must be applied to the rollup state. It defines the ordering of rollup transactions by
- * writing them to the 'CTC:batches' instance of the Chain Storage Container.
- * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer
- * will eventually append it to the rollup state.
- * If the Sequencer does not include an enqueued transaction within the 'force inclusion period',
- * then any account may force it to be included by calling appendQueueBatch().
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_AddressResolver {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    // L2 tx gas-related
-    uint256 constant public MIN_ROLLUP_TX_GAS = 100000;
-    uint256 constant public MAX_ROLLUP_TX_SIZE = 10000;
-    uint256 constant public L2_GAS_DISCOUNT_DIVISOR = 32;
- 
-    // Encoding-related (all in bytes)
-    uint256 constant internal BATCH_CONTEXT_SIZE = 16;
-    uint256 constant internal BATCH_CONTEXT_LENGTH_POS = 12;
-    uint256 constant internal BATCH_CONTEXT_START_POS = 15;
-    uint256 constant internal TX_DATA_HEADER_SIZE = 3;
-    uint256 constant internal BYTES_TILL_TX_DATA = 65;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    uint256 public forceInclusionPeriodSeconds;
-    uint256 public forceInclusionPeriodBlocks;
-    uint256 public maxTransactionGasLimit;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    constructor(
-        address _libAddressManager,
-        uint256 _forceInclusionPeriodSeconds,
-        uint256 _forceInclusionPeriodBlocks,
-        uint256 _maxTransactionGasLimit
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        forceInclusionPeriodSeconds = _forceInclusionPeriodSeconds;
-        forceInclusionPeriodBlocks = _forceInclusionPeriodBlocks;
-        maxTransactionGasLimit = _maxTransactionGasLimit;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        override
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:CTC:batches")
-        );
-    }
- 
-    /**
-     * Accesses the queue storage container.
-     * @return Reference to the queue storage container.
-     */
-    function queue()
-        override
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:CTC:queue")
-        );
-    }
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        override
-        public
-        view
-        returns (
-            uint256 _totalElements
-        )
-    {
-        (uint40 totalElements,,,) = _getBatchExtraData();
-        return uint256(totalElements);
-    }
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        override
-        public
-        view
-        returns (
-            uint256 _totalBatches
-        )
-    {
-        return batches().length();
-    }
- 
-    /**
-     * Returns the index of the next element to be enqueued.
-     * @return Index for the next queue element.
-     */
-    function getNextQueueIndex()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,uint40 nextQueueIndex,,) = _getBatchExtraData();
-        return nextQueueIndex;
-    }
- 
-    /**
-     * Returns the timestamp of the last transaction.
-     * @return Timestamp for the last transaction.
-     */
-    function getLastTimestamp()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,,uint40 lastTimestamp,) = _getBatchExtraData();
-        return lastTimestamp;
-    }
- 
-    /**
-     * Returns the blocknumber of the last transaction.
-     * @return Blocknumber for the last transaction.
-     */
-    function getLastBlockNumber()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        (,,,uint40 lastBlockNumber) = _getBatchExtraData();
-        return lastBlockNumber;
-    }
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function getQueueElement(
-        uint256 _index
-    )
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        )
-    {
-        return _getQueueElement(
-            _index,
-            queue()
-        );
-    }
- 
-    /**
-     * Get the number of queue elements which have not yet been included.
-     * @return Number of pending queue elements.
-     */
-    function getNumPendingQueueElements()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        return getQueueLength() - getNextQueueIndex();
-    }
- 
-   /**
-     * Retrieves the length of the queue, including
-     * both pending and canonical transactions.
-     * @return Length of the queue.
-     */
-    function getQueueLength()
-        override
-        public
-        view
-        returns (
-            uint40
-        )
-    {
-        return _getQueueLength(
-            queue()
-        );
-    }
- 
-    /**
-     * Adds a transaction to the queue.
-     * @param _target Target L2 contract to send the transaction to.
-     * @param _gasLimit Gas limit for the enqueued L2 transaction.
-     * @param _data Transaction data.
-     */
-    function enqueue(
-        address _target,
-        uint256 _gasLimit,
-        bytes memory _data
-    )
-        override
-        public
-    {
-        require(
-            _data.length <= MAX_ROLLUP_TX_SIZE,
-            "Transaction data size exceeds maximum for rollup transaction."
-        );
- 
-        require(
-            _gasLimit <= maxTransactionGasLimit,
-            "Transaction gas limit exceeds maximum for rollup transaction."
-        );
- 
-        require(
-            _gasLimit >= MIN_ROLLUP_TX_GAS,
-            "Transaction gas limit too low to enqueue."
-        );
- 
-        // We need to consume some amount of L1 gas in order to rate limit transactions going into
-        // L2. However, L2 is cheaper than L1 so we only need to burn some small proportion of the
-        // provided L1 gas.
-        uint256 gasToConsume = _gasLimit/L2_GAS_DISCOUNT_DIVISOR;
-        uint256 startingGas = gasleft();
- 
-        // Although this check is not necessary (burn below will run out of gas if not true), it
-        // gives the user an explicit reason as to why the enqueue attempt failed.
-        require(
-            startingGas > gasToConsume,
-            "Insufficient gas for L2 rate limiting burn."
-        );
- 
-        // Here we do some "dumb" work in order to burn gas, although we should probably replace
-        // this with something like minting gas token later on.
-        uint256 i;
-        while(startingGas - gasleft() < gasToConsume) {
-            i++;
-        }
- 
-        bytes32 transactionHash = keccak256(
-            abi.encode(
-                msg.sender,
-                _target,
-                _gasLimit,
-                _data
-            )
-        );
- 
-        bytes32 timestampAndBlockNumber;
-        assembly {
-            timestampAndBlockNumber := timestamp()
-            timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
-        }
- 
-        iOVM_ChainStorageContainer queueRef = queue();
- 
-        queueRef.push(transactionHash);
-        queueRef.push(timestampAndBlockNumber);
- 
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the real queue length we need
-        // to divide by 2 and subtract 1.
-        uint256 queueIndex = queueRef.length() / 2 - 1;
-        emit TransactionEnqueued(
-            msg.sender,
-            _target,
-            _gasLimit,
-            _data,
-            queueIndex,
-            block.timestamp
-        );
-    }
- 
-    /**
-     * Appends a given number of queued transactions as a single batch.
-     * param _numQueuedTransactions Number of transactions to append.
-     */
-    function appendQueueBatch(
-        uint256 // _numQueuedTransactions
-    )
-        override
-        public
-        pure
-    {
-        // TEMPORARY: Disable `appendQueueBatch` for minnet
-        revert("appendQueueBatch is currently disabled.");
- 
-        // _numQueuedTransactions = Lib_Math.min(_numQueuedTransactions, getNumPendingQueueElements());
-        // require(
-        //     _numQueuedTransactions > 0,
-        //     "Must append more than zero transactions."
-        // );
- 
-        // bytes32[] memory leaves = new bytes32[](_numQueuedTransactions);
-        // uint40 nextQueueIndex = getNextQueueIndex();
- 
-        // for (uint256 i = 0; i < _numQueuedTransactions; i++) {
-        //     if (msg.sender != resolve("OVM_Sequencer")) {
-        //         Lib_OVMCodec.QueueElement memory el = getQueueElement(nextQueueIndex);
-        //         require(
-        //             el.timestamp + forceInclusionPeriodSeconds < block.timestamp,
-        //             "Queue transactions cannot be submitted during the sequencer inclusion period."
-        //         );
-        //     }
-        //     leaves[i] = _getQueueLeafHash(nextQueueIndex);
-        //     nextQueueIndex++;
-        // }
- 
-        // Lib_OVMCodec.QueueElement memory lastElement = getQueueElement(nextQueueIndex - 1);
- 
-        // _appendBatch(
-        //     Lib_MerkleTree.getMerkleRoot(leaves),
-        //     _numQueuedTransactions,
-        //     _numQueuedTransactions,
-        //     lastElement.timestamp,
-        //     lastElement.blockNumber
-        // );
- 
-        // emit QueueBatchAppended(
-        //     nextQueueIndex - _numQueuedTransactions,
-        //     _numQueuedTransactions,
-        //     getTotalElements()
-        // );
-    }
- 
-    /**
-     * Allows the sequencer to append a batch of transactions.
-     * @dev This function uses a custom encoding scheme for efficiency reasons.
-     * .param _shouldStartAtElement Specific batch we expect to start appending to.
-     * .param _totalElementsToAppend Total number of batch elements we expect to append.
-     * .param _contexts Array of batch contexts.
-     * .param _transactionDataFields Array of raw transaction data.
-     */
-    function appendSequencerBatch()
-        override
-        public
-    {
-        uint40 shouldStartAtElement;
-        uint24 totalElementsToAppend;
-        uint24 numContexts;
-        assembly {
-            shouldStartAtElement  := shr(216, calldataload(4))
-            totalElementsToAppend := shr(232, calldataload(9))
-            numContexts           := shr(232, calldataload(12))
-        }
- 
-        require(
-            shouldStartAtElement == getTotalElements(),
-            "Actual batch start index does not match expected start index."
-        );
- 
-        require(
-            msg.sender == resolve("OVM_Sequencer"),
-            "Function can only be called by the Sequencer."
-        );
- 
-        require(
-            numContexts > 0,
-            "Must provide at least one batch context."
-        );
- 
-        require(
-            totalElementsToAppend > 0,
-            "Must append at least one element."
-        );
- 
-        uint40 nextTransactionPtr = uint40(BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts);
- 
-        Erequire(
-            msg.data.length >= nextTransactionPtr,
-            "Not enough BatchContexts provided."
-        );
- 
-        // Take a reference to the queue and its length so we don't have to keep resolving it.
-        // Length isn't going to change during the course of execution, so it's fine to simply
-        // resolve this once at the start. Saves gas.
-        iOVM_ChainStorageContainer queueRef = queue();
-        uint40 queueLength = _getQueueLength(queueRef);
- 
-        // Reserve some memory to save gas on hashing later on. This is a relatively safe estimate
-        // for the average transaction size that will prevent having to resize this chunk of memory
-        // later on. Saves gas.
-        bytes memory hashMemory = new bytes((msg.data.length / totalElementsToAppend) * 2);
- 
-        // Initialize the array of canonical chain leaves that we will append.
-        bytes32[] memory leaves = new bytes32[](totalElementsToAppend);
- 
-        // Each leaf index corresponds to a tx, either sequenced or enqueued.
-        uint32 leafIndex = 0;
- 
-        // Counter for number of sequencer transactions appended so far.
-        uint32 numSequencerTransactions = 0;
- 
-        // We will sequentially append leaves which are pointers to the queue.
-        // The initial queue index is what is currently in storage.
-        uint40 nextQueueIndex = getNextQueueIndex();
- 
-        BatchContext memory curContext;
-        for (uint32 i = 0; i < numContexts; i++) {
-            BatchContext memory nextContext = _getBatchContext(i);
- 
-            if (i == 0) {
-                // Execute a special check for the first batch.
-                _validateFirstBatchContext(nextContext);
-            }
- 
-            // Execute this check on every single batch, including the first one.
-            _validateNextBatchContext(
-                curContext,
-                nextContext,
-                nextQueueIndex,
-                queueRef
-            );
- 
-            // Now we can update our current context.
-            curContext = nextContext;
- 
-            // Process sequencer transactions first.
-            for (uint32 j = 0; j < curContext.numSequencedTransactions; j++) {
-                uint256 txDataLength;
-                assembly {
-                    txDataLength := shr(232, calldataload(nextTransactionPtr))
-                }
- 
-                leaves[leafIndex] = _getSequencerLeafHash(
-                    curContext,
-                    nextTransactionPtr,
-                    txDataLength,
-                    hashMemory
-                );
- 
-                nextTransactionPtr += uint40(TX_DATA_HEADER_SIZE + txDataLength);
-                numSequencerTransactions++;
-                leafIndex++;
-            }
- 
-            // Now process any subsequent queue transactions.
-            for (uint32 j = 0; j < curContext.numSubsequentQueueTransactions; j++) {
-                require(
-                    nextQueueIndex < queueLength,
-                    "Not enough queued transactions to append."
-                );
- 
-                leaves[leafIndex] = _getQueueLeafHash(nextQueueIndex);
-                nextQueueIndex++;
-                leafIndex++;
-            }
-        }
- 
-        _validateFinalBatchContext(
-            curContext,
-            nextQueueIndex,
-            queueLength,
-            queueRef
-        );
- 
-        require(
-            msg.data.length == nextTransactionPtr,
-            "Not all sequencer transactions were processed."
-        );
- 
-        Erequire(
-            leafIndex == totalElementsToAppend,
-            "Actual transaction index does not match expected total elements to append."
-        );
- 
-        // Generate the required metadata that we need to append this batch
-        uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;
-        uint40 blockTimestamp;
-        uint40 blockNumber;
-        if (curContext.numSubsequentQueueTransactions == 0) {
-            // The last element is a sequencer tx, therefore pull timestamp and block number from the last context.
-            blockTimestamp = uint40(curContext.timestamp);
-            blockNumber = uint40(curContext.blockNumber);
-        } else {
-            // The last element is a queue tx, therefore pull timestamp and block number from the queue element.
-            // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at least one queue element.
-            // We increment nextQueueIndex after processing each queue element,
-            // so the index of the last element we processed is nextQueueIndex - 1.
-            Lib_OVMCodec.QueueElement memory lastElement = _getQueueElement(
-                nextQueueIndex - 1,
-                queueRef
-            );
- 
-            blockTimestamp = lastElement.timestamp;
-            blockNumber = lastElement.blockNumber;
-        }
- 
-        // For efficiency reasons getMerkleRoot modifies the `leaves` argument in place
-        // while calculating the root hash therefore any arguments passed to it must not
-        // be used again afterwards
-        _appendBatch(
-            Lib_MerkleTree.getMerkleRoot(leaves),
-            totalElementsToAppend,
-            numQueuedTransactions,
-            blockTimestamp,
-            blockNumber
-        );
- 
-        emit SequencerBatchAppended(
-            nextQueueIndex - numQueuedTransactions,
-            numQueuedTransactions,
-            getTotalElements()
-        );
-    }
- 
-    /**
-     * Verifies whether a transaction is included in the chain.
-     * @param _transaction Transaction to verify.
-     * @param _txChainElement Transaction chain element corresponding to the transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
-     * @return True if the transaction exists in the CTC, false if not.
-     */
-    function verifyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        if (_txChainElement.isSequenced == true) {
-            return _verifySequencerTransaction(
-                _transaction,
-                _txChainElement,
-                _batchHeader,
-                _inclusionProof
-            );
-        } else {
-            return _verifyQueueTransaction(
-                _transaction,
-                _txChainElement.queueIndex,
-                _batchHeader,
-                _inclusionProof
-            );
-        }
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Returns the BatchContext located at a particular index.
-     * @param _index The index of the BatchContext
-     * @return The BatchContext at the specified index.
-     */
-    function _getBatchContext(
-        uint256 _index
-    )
-        internal
-        pure
-        returns (
-            BatchContext memory
-        )
-    {
-        uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;
-        uint256 numSequencedTransactions;
-        uint256 numSubsequentQueueTransactions;
-        uint256 ctxTimestamp;
-        uint256 ctxBlockNumber;
- 
-        assembly {
-            numSequencedTransactions       := shr(232, calldataload(contextPtr))
-            numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))
-            ctxTimestamp                   := shr(216, calldataload(add(contextPtr, 6)))
-            ctxBlockNumber                 := shr(216, calldataload(add(contextPtr, 11)))
-        }
- 
-        return BatchContext({
-            numSequencedTransactions: numSequencedTransactions,
-            numSubsequentQueueTransactions: numSubsequentQueueTransactions,
-            timestamp: ctxTimestamp,
-            blockNumber: ctxBlockNumber
-        });
-    }
- 
-    /**
-     * Parses the batch context from the extra data.
-     * @return Total number of elements submitted.
-     * @return Index of the next queue element.
-     */
-    function _getBatchExtraData()
-        internal
-        view
-        returns (
-            uint40,
-            uint40,
-            uint40,
-            uint40
-        )
-    {
-        bytes27 extraData = batches().getGlobalMetadata();
- 
-        uint40 totalElements;
-        uint40 nextQueueIndex;
-        uint40 lastTimestamp;
-        uint40 lastBlockNumber;
-        assembly {
-            extraData       :=  shr(40, extraData)
-            totalElements   :=  and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            nextQueueIndex  :=  shr(40, and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000))
-            lastTimestamp   :=  shr(80, and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000))
-            lastBlockNumber :=  shr(120, and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000))
-        }
- 
-        return (
-            totalElements,
-            nextQueueIndex,
-            lastTimestamp,
-            lastBlockNumber
-        );
-    }
- 
-    /**
-     * Encodes the batch context for the extra data.
-     * @param _totalElements Total number of elements submitted.
-     * @param _nextQueueIndex Index of the next queue element.
-     * @param _timestamp Timestamp for the last batch.
-     * @param _blockNumber Block number of the last batch.
-     * @return Encoded batch context.
-     */
-    function _makeBatchExtraData(
-        uint40 _totalElements,
-        uint40 _nextQueueIndex,
-        uint40 _timestamp,
-        uint40 _blockNumber
-    )
-        internal
-        pure
-        returns (
-            bytes27
-        )
-    {
-        bytes27 extraData;
-        assembly {
-            extraData := _totalElements
-            extraData := or(extraData, shl(40, _nextQueueIndex))
-            extraData := or(extraData, shl(80, _timestamp))
-            extraData := or(extraData, shl(120, _blockNumber))
-            extraData := shl(40, extraData)
-        }
- 
-        return extraData;
-    }
- 
-    /**
-     * Retrieves the hash of a queue element.
-     * @param _index Index of the queue element to retrieve a hash for.
-     * @return Hash of the queue element.
-     */
-    function _getQueueLeafHash(
-        uint256 _index
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return _hashTransactionChainElement(
-            Lib_OVMCodec.TransactionChainElement({
-                isSequenced: false,
-                queueIndex: _index,
-                timestamp: 0,
-                blockNumber: 0,
-                txData: hex""
-            })
-        );
-    }
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function _getQueueElement(
-        uint256 _index,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        )
-    {
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the actual desired queue index
-        // we need to multiply by 2.
-        uint40 trueIndex = uint40(_index * 2);
-        bytes32 transactionHash = _queueRef.get(trueIndex);
-        bytes32 timestampAndBlockNumber = _queueRef.get(trueIndex + 1);
- 
-        uint40 elementTimestamp;
-        uint40 elementBlockNumber;
-        assembly {
-            elementTimestamp   :=         and(timestampAndBlockNumber, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            elementBlockNumber := shr(40, and(timestampAndBlockNumber, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
-        }
- 
-        return Lib_OVMCodec.QueueElement({
-            transactionHash: transactionHash,
-            timestamp: elementTimestamp,
-            blockNumber: elementBlockNumber
-        });
-    }
- 
-    /**
-     * Retrieves the length of the queue.
-     * @return Length of the queue.
-     */
-    function _getQueueLength(
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        // The underlying queue data structure stores 2 elements
-        // per insertion, so to get the real queue length we need
-        // to divide by 2.
-        return uint40(_queueRef.length() / 2);
-    }
- 
-    /**
-     * Retrieves the hash of a sequencer element.
-     * @param _context Batch context for the given element.
-     * @param _nextTransactionPtr Pointer to the next transaction in the calldata.
-     * @param _txDataLength Length of the transaction item.
-     * @return Hash of the sequencer element.
-     */
-    function _getSequencerLeafHash(
-        BatchContext memory _context,
-        uint256 _nextTransactionPtr,
-        uint256 _txDataLength,
-        bytes memory _hashMemory
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        // Only allocate more memory if we didn't reserve enough to begin with.
-        if (BYTES_TILL_TX_DATA + _txDataLength > _hashMemory.length) {
-            _hashMemory = new bytes(BYTES_TILL_TX_DATA + _txDataLength);
-        }
- 
-        uint256 ctxTimestamp = _context.timestamp;
-        uint256 ctxBlockNumber = _context.blockNumber;
- 
-        bytes32 leafHash;
-        assembly {
-            let chainElementStart := add(_hashMemory, 0x20)
- 
-            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
-            // This distinguishes sequencer ChainElements from queue ChainElements because
-            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
-            // elements is always zero
-            mstore8(chainElementStart, 1)
- 
-            mstore(add(chainElementStart, 1), ctxTimestamp)
-            mstore(add(chainElementStart, 33), ctxBlockNumber)
- 
-            calldatacopy(add(chainElementStart, BYTES_TILL_TX_DATA), add(_nextTransactionPtr, 3), _txDataLength)
- 
-            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, _txDataLength))
-        }
- 
-        return leafHash;
-    }
- 
-    /**
-     * Retrieves the hash of a sequencer element.
-     * @param _txChainElement The chain element which is hashed to calculate the leaf.
-     * @return Hash of the sequencer element.
-     */
-    function _getSequencerLeafHash(
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement
-    )
-        internal
-        view
-        returns(
-            bytes32
-        )
-    {
-        bytes memory txData = _txChainElement.txData;
-        uint256 txDataLength = _txChainElement.txData.length;
- 
-        bytes memory chainElement = new bytes(BYTES_TILL_TX_DATA + txDataLength);
-        uint256 ctxTimestamp = _txChainElement.timestamp;
-        uint256 ctxBlockNumber = _txChainElement.blockNumber;
- 
-        bytes32 leafHash;
-        assembly {
-            let chainElementStart := add(chainElement, 0x20)
- 
-            // Set the first byte equal to `1` to indicate this is a sequencer chain element.
-            // This distinguishes sequencer ChainElements from queue ChainElements because
-            // all queue ChainElements are ABI encoded and the first byte of ABI encoded
-            // elements is always zero
-            mstore8(chainElementStart, 1)
- 
-            mstore(add(chainElementStart, 1), ctxTimestamp)
-            mstore(add(chainElementStart, 33), ctxBlockNumber)
- 
-            pop(staticcall(gas(), 0x04, add(txData, 0x20), txDataLength, add(chainElementStart, BYTES_TILL_TX_DATA), txDataLength))
- 
-            leafHash := keccak256(chainElementStart, add(BYTES_TILL_TX_DATA, txDataLength))
-        }
- 
-        return leafHash;
-    }
- 
-    /**
-     * Inserts a batch into the chain of batches.
-     * @param _transactionRoot Root of the transaction tree for this batch.
-     * @param _batchSize Number of elements in the batch.
-     * @param _numQueuedTransactions Number of queue transactions in the batch.
-     * @param _timestamp The latest batch timestamp.
-     * @param _blockNumber The latest batch blockNumber.
-     */
-    function _appendBatch(
-        bytes32 _transactionRoot,
-        uint256 _batchSize,
-        uint256 _numQueuedTransactions,
-        uint40 _timestamp,
-        uint40 _blockNumber
-    )
-        internal
-    {
-        iOVM_ChainStorageContainer batchesRef = batches();
-        (uint40 totalElements, uint40 nextQueueIndex,,) = _getBatchExtraData();
- 
-        Lib_OVMCodec.ChainBatchHeader memory header = Lib_OVMCodec.ChainBatchHeader({
-            batchIndex: batchesRef.length(),
-            batchRoot: _transactionRoot,
-            batchSize: _batchSize,
-            prevTotalElements: totalElements,
-            extraData: hex""
-        });
- 
-        emit TransactionBatchAppended(
-            header.batchIndex,
-            header.batchRoot,
-            header.batchSize,
-            header.prevTotalElements,
-            header.extraData
-        );
- 
-        bytes32 batchHeaderHash = Lib_OVMCodec.hashBatchHeader(header);
-        bytes27 latestBatchContext = _makeBatchExtraData(
-            totalElements + uint40(header.batchSize),
-            nextQueueIndex + uint40(_numQueuedTransactions),
-            _timestamp,
-            _blockNumber
-        );
- 
-        batchesRef.push(batchHeaderHash, latestBatchContext);
-    }
- 
-    /**
-     * Checks that the first batch context in a sequencer submission is valid
-     * @param _firstContext The batch context to validate.
-     */
-    function _validateFirstBatchContext(
-        BatchContext memory _firstContext
-    )
-        internal
-        view
-    {
-        // If there are existing elements, this batch must have the same context 
-        // or a later timestamp and block number.
-        if (getTotalElements() > 0) {
-            (,, uint40 lastTimestamp, uint40 lastBlockNumber) = _getBatchExtraData();
- 
-            require(
-                _firstContext.blockNumber >= lastBlockNumber,
-                "Context block number is lower than last submitted."
-            );
- 
-            Irequire(
-                _firstContext.timestamp >= lastTimestamp,
-                "Context timestamp is lower than last submitted."
-            );
-        }
- 
-        // Sequencer cannot submit contexts which are more than the force inclusion period old.
-        require(
-            _firstContext.timestamp + forceInclusionPeriodSeconds >= block.timestamp,
-            "Context timestamp too far in the past."
-        );
- 
-        require(
-            _firstContext.blockNumber + forceInclusionPeriodBlocks >= block.number,
-            "Context block number too far in the past."
-        );
-    }
- 
-    /**
-     * Checks that a given batch context has a time context which is below a given que element
-     * @param _context The batch context to validate has values lower.
-     * @param _queueIndex Index of the queue element we are validating came later than the context.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateContextBeforeEnqueue(
-        BatchContext memory _context,
-        uint40 _queueIndex,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-            Lib_OVMCodec.QueueElement memory nextQueueElement = _getQueueElement(
-                _queueIndex,
-                _queueRef
-            );
- 
-            // If the force inclusion period has passed for an enqueued transaction, it MUST be the next chain element.
-            require(
-                block.timestamp < nextQueueElement.timestamp + forceInclusionPeriodSeconds,
-                "Previously enqueued batches have expired and must be appended before a new sequencer batch."
-            );
- 
-            // Just like sequencer transaction times must be increasing relative to each other,
-            // We also require that they be increasing relative to any interspersed queue elements.
-            require(
-                _context.timestamp <= nextQueueElement.timestamp,
-                "Sequencer transaction timestamp exceeds that of next queue element."
-            );
- 
-            require(
-                _context.blockNumber <= nextQueueElement.blockNumber,
-                "Sequencer transaction blockNumber exceeds that of next queue element."
-            );
-    }
- 
-    /**
-     * Checks that a given batch context is valid based on its previous context, and the next queue elemtent.
-     * @param _prevContext The previously validated batch context.
-     * @param _nextContext The batch context to validate with this call.
-     * @param _nextQueueIndex Index of the next queue element to process for the _nextContext's subsequentQueueElements.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateNextBatchContext(
-        BatchContext memory _prevContext,
-        BatchContext memory _nextContext,
-        uint40 _nextQueueIndex,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-        // All sequencer transactions' times must be greater than or equal to the previous ones.
-        require(
-            _nextContext.timestamp >= _prevContext.timestamp,
-            "Context timestamp values must monotonically increase."
-        );
- 
-        require(
-            _nextContext.blockNumber >= _prevContext.blockNumber,
-            "Context blockNumber values must monotonically increase."
-        );
- 
-        // If there is going to be a queue element pulled in from this context:
-        if (_nextContext.numSubsequentQueueTransactions > 0) {
-            _validateContextBeforeEnqueue(
-                _nextContext,
-                _nextQueueIndex,
-                _queueRef
-            );
-        }
-    }
- 
-    /**
-     * Checks that the final batch context in a sequencer submission is valid.
-     * @param _finalContext The batch context to validate.
-     * @param _queueLength The length of the queue at the start of the batchAppend call.
-     * @param _nextQueueIndex The next element in the queue that will be pulled into the CTC.
-     * @param _queueRef The storage container for the queue.
-     */
-    function _validateFinalBatchContext(
-        BatchContext memory _finalContext,
-        uint40 _nextQueueIndex,
-        uint40 _queueLength,
-        iOVM_ChainStorageContainer _queueRef
-    )
-        internal
-        view
-    {
-        // If the queue is not now empty, check the mononoticity of whatever the next batch that will come in is.
-        if (_queueLength - _nextQueueIndex > 0 && _finalContext.numSubsequentQueueTransactions == 0) {
-            _validateContextBeforeEnqueue(
-                _finalContext,
-                _nextQueueIndex,
-                _queueRef
-            );
-        }
-        // Batches cannot be added from the future, or subsequent enqueue() contexts would violate monotonicity.
-        require(_finalContext.timestamp <= block.timestamp, "Context timestamp is from the future.");
-        require(_finalContext.blockNumber <= block.number, "Context block number is from the future.");
-    }
- 
-    /**
-     * Hashes a transaction chain element.
-     * @param _element Chain element to hash.
-     * @return Hash of the chain element.
-     */
-    function _hashTransactionChainElement(
-        Lib_OVMCodec.TransactionChainElement memory _element
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(
-            abi.encode(
-                _element.isSequenced,
-                _element.queueIndex,
-                _element.timestamp,
-                _element.blockNumber,
-                _element.txData
-            )
-        );
-    }
- 
-    /**
-     * Verifies a sequencer transaction, returning true if it was indeed included in the CTC
-     * @param _transaction The transaction we are verifying inclusion of.
-     * @param _txChainElement The chain element that the transaction is claimed to be a part of.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof An inclusion proof into the CTC at a particular index.
-     * @return True if the transaction was included in the specified location, else false.
-     */
-    function _verifySequencerTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        OVM_ExecutionManager ovmExecutionManager = OVM_ExecutionManager(resolve("OVM_ExecutionManager"));
-        uint256 gasLimit = ovmExecutionManager.getMaxTransactionGasLimit();
-        bytes32 leafHash = _getSequencerLeafHash(_txChainElement);
- 
-        Erequire(
-            _verifyElement(
-                leafHash,
-                _batchHeader,
-                _inclusionProof
-            ),
-            "Invalid Sequencer transaction inclusion proof."
-        );
- 
-        Erequire(
-            _transaction.blockNumber        == _txChainElement.blockNumber
-            && _transaction.timestamp       == _txChainElement.timestamp
-            && _transaction.entrypoint      == resolve("OVM_DecompressionPrecompileAddress")
-            && _transaction.gasLimit        == gasLimit
-            && _transaction.l1TxOrigin      == address(0)
-            && _transaction.l1QueueOrigin   == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE
-            && keccak256(_transaction.data) == keccak256(_txChainElement.txData),
-            "Invalid Sequencer transaction."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * Verifies a queue transaction, returning true if it was indeed included in the CTC
-     * @param _transaction The transaction we are verifying inclusion of.
-     * @param _queueIndex The queueIndex of the queued transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof An inclusion proof into the CTC at a particular index (should point to queue tx).
-     * @return True if the transaction was included in the specified location, else false.
-     */
-    function _verifyQueueTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        uint256 _queueIndex,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 leafHash = _getQueueLeafHash(_queueIndex);
- 
-        Erequire(
-            _verifyElement(
-                leafHash,
-                _batchHeader,
-                _inclusionProof
-            ),
-            "Invalid Queue transaction inclusion proof."
-        );
- 
-        bytes32 transactionHash = keccak256(
-            abi.encode(
-                _transaction.l1TxOrigin,
-                _transaction.entrypoint,
-                _transaction.gasLimit,
-                _transaction.data
-            )
-        );
- 
-        Lib_OVMCodec.QueueElement memory el = getQueueElement(_queueIndex);
-        Erequire(
-            el.transactionHash      == transactionHash
-            && el.timestamp   == _transaction.timestamp
-            && el.blockNumber == _transaction.blockNumber,
-            "Invalid Queue transaction."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * Verifies a batch inclusion proof.
-     * @param _element Hash of the element to verify a proof for.
-     * @param _batchHeader Header of the batch in which the element was included.
-     * @param _proof Merkle inclusion proof for the element.
-     */
-    function _verifyElement(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        Erequire(
-            Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(uint32(_batchHeader.batchIndex)),
-            "Invalid batch header."
-        );
- 
-        Erequire(
-            Lib_MerkleTree.verify(
-                _batchHeader.batchRoot,
-                _element,
-                _proof.index,
-                _proof.siblings,
-                _batchHeader.batchSize
-            ),
-            "Invalid inclusion proof."
-        );
- 
-        return true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html b/coverage/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html deleted file mode 100644 index 1e2bd3a07..000000000 --- a/coverage/optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol.html +++ /dev/null @@ -1,680 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/chain/OVM_ChainStorageContainer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/chain/ OVM_ChainStorageContainer.sol -

-
-
- 72.73% - Statements - 8/11 -
-
- 50% - Branches - 1/2 -
-
- 72.73% - Functions - 8/11 -
-
- 75% - Lines - 9/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -516× -  -  -  -  -  -  -  -  -579× -  -  -  -579× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -580× -  -  -  -  -  -  -  -  -  -  -  -  -  -453× -  -  -  -  -  -  -  -  -  -  -  -  -470× -  -  -  -  -  -  -  -  -  -  -  -  -  -108× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_RingBuffer } from "../../libraries/utils/Lib_RingBuffer.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/**
- * @title OVM_ChainStorageContainer
- * @dev The Chain Storage Container provides its owner contract with read, write and delete functionality.
- * This provides gas efficiency gains by enabling it to overwrite storage slots which can no longer be used
- * in a fraud proof due to the fraud window having passed, and the associated chain state or
- * transactions being finalized.
- * Three distinct Chain Storage Containers will be deployed on Layer 1:
- * 1. Stores transaction batches for the Canonical Transaction Chain
- * 2. Stores queued transactions for the Canonical Transaction Chain
- * 3. Stores chain state batches for the State Commitment Chain
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressResolver {
- 
-    /*************
-     * Libraries *
-     *************/
- 
-    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    string public owner;
-    Lib_RingBuffer.RingBuffer internal buffer;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _owner Name of the contract that owns this container (will be resolved later).
-     */
-    constructor(
-        address _libAddressManager,
-        string memory _owner
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        owner = _owner;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyOwner() {
-        Erequire(
-            msg.sender == resolve(owner),
-            "OVM_ChainStorageContainer: Function can only be called by the owner."
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function setGlobalMetadata(
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        return buffer.setExtraData(_globalMetadata);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function getGlobalMetadata()
-        override
-        public
-        view
-        returns (
-            bytes27
-        )
-    {
-        return buffer.getExtraData();
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function length()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return uint256(buffer.getLength());
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function push(
-        bytes32 _object
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.push(_object);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function push(
-        bytes32 _object,
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.push(_object, _globalMetadata);
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function get(
-        uint256 _index
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        return buffer.get(uint40(_index));
-    }
-    
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.deleteElementsAfterInclusive(
-            uint40(_index)
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index,
-        bytes27 _globalMetadata
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.deleteElementsAfterInclusive(
-            uint40(_index),
-            _globalMetadata
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_ChainStorageContainer
-     */
-    function setNextOverwritableIndex(
-        uint256 _index
-    )
-        override
-        public
-        onlyOwner
-    {
-        buffer.nextOverwritableIndex = _index;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html b/coverage/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html deleted file mode 100644 index 8b0dbf3fb..000000000 --- a/coverage/optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol.html +++ /dev/null @@ -1,1307 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/chain/ OVM_StateCommitmentChain.sol -

-
-
- 88.1% - Statements - 37/42 -
-
- 67.86% - Branches - 19/28 -
-
- 85.71% - Functions - 12/14 -
-
- 88.64% - Lines - 39/44 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -60× -60× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -125× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -24× -  -  -  -  -24× -  -  -  -  -23× -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -74× -  -74× -74× -74× -  -  -  -  -  -74× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -  -22× -20× -  -  -  -  -  - -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol";
- 
-/* Interface Imports */
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
-import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol";
- 
-/* External Imports */
-import '@openzeppelin/contracts/math/SafeMath.sol';
- 
-/**
- * @title OVM_StateCommitmentChain
- * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which
- * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC).
- * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique
- * state root calculated off-chain by applying the canonical transactions one by one.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 public FRAUD_PROOF_WINDOW;
-    uint256 public SEQUENCER_PUBLISH_WINDOW;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager,
-        uint256 _fraudProofWindow,
-        uint256 _sequencerPublishWindow
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        FRAUD_PROOF_WINDOW = _fraudProofWindow;
-        SEQUENCER_PUBLISH_WINDOW = _sequencerPublishWindow;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        public
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        )
-    {
-        return iOVM_ChainStorageContainer(
-            resolve("OVM_ChainStorageContainer:SCC:batches")
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getTotalElements()
-        override
-        public
-        view
-        returns (
-            uint256 _totalElements
-        )
-    {
-        (uint40 totalElements, ) = _getBatchExtraData();
-        return uint256(totalElements);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getTotalBatches()
-        override
-        public
-        view
-        returns (
-            uint256 _totalBatches
-        )
-    {
-        return batches().length();
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function getLastSequencerTimestamp()
-        override
-        public
-        view
-        returns (
-            uint256 _lastSequencerTimestamp
-        )
-    {
-        (, uint40 lastSequencerTimestamp) = _getBatchExtraData();
-        return uint256(lastSequencerTimestamp);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function appendStateBatch(
-        bytes32[] memory _batch,
-        uint256 _shouldStartAtElement
-    )
-        override
-        public
-    {
-        // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the
-        // publication of batches by some other user.
-        require(
-            _shouldStartAtElement == getTotalElements(),
-            "Actual batch start index does not match expected start index."
-        );
- 
-        // Proposers must have previously staked at the BondManager
-        Erequire(
-            iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender),
-            "Proposer does not have enough collateral posted"
-        );
- 
-        require(
-            _batch.length > 0,
-            "Cannot submit an empty state batch."
-        );
- 
-        require(
-            getTotalElements() + _batch.length <= iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(),
-            "Number of state roots cannot exceed the number of canonical transactions."
-        );
- 
-        // Pass the block's timestamp and the publisher of the data
-        // to be used in the fraud proofs
-        _appendBatch(
-            _batch,
-            abi.encode(block.timestamp, msg.sender)
-        );
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function deleteStateBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        override
-        public
-    {
-        require(
-            msg.sender == resolve("OVM_FraudVerifier"),
-            "State batches can only be deleted by the OVM_FraudVerifier."
-        );
- 
-        require(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        Erequire(
-            insideFraudProofWindow(_batchHeader),
-            "State batches can only be deleted within the fraud proof window."
-        );
- 
-        _deleteBatch(_batchHeader);
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function verifyStateCommitment(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        require(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        require(
-            Lib_MerkleTree.verify(
-                _batchHeader.batchRoot,
-                _element,
-                _proof.index,
-                _proof.siblings,
-                _batchHeader.batchSize
-            ),
-            "Invalid inclusion proof."
-        );
- 
-        return true;
-    }
- 
-    /**
-     * @inheritdoc iOVM_StateCommitmentChain
-     */
-    function insideFraudProofWindow(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        override
-        public
-        view
-        returns (
-            bool _inside
-        )
-    {
-        (uint256 timestamp,) = abi.decode(
-            _batchHeader.extraData,
-            (uint256, address)
-        );
- 
-        Erequire(
-            timestamp != 0,
-            "Batch header timestamp cannot be zero"
-        );
-        return SafeMath.add(timestamp, FRAUD_PROOF_WINDOW) > block.timestamp;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Parses the batch context from the extra data.
-     * @return Total number of elements submitted.
-     * @return Timestamp of the last batch submitted by the sequencer.
-     */
-    function _getBatchExtraData()
-        internal
-        view
-        returns (
-            uint40,
-            uint40
-        )
-    {
-        bytes27 extraData = batches().getGlobalMetadata();
- 
-        uint40 totalElements;
-        uint40 lastSequencerTimestamp;
-        assembly {
-            extraData              := shr(40, extraData)
-            totalElements          :=         and(extraData, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            lastSequencerTimestamp := shr(40, and(extraData, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000))
-        }
- 
-        return (
-            totalElements,
-            lastSequencerTimestamp
-        );
-    }
- 
-    /**
-     * Encodes the batch context for the extra data.
-     * @param _totalElements Total number of elements submitted.
-     * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer.
-     * @return Encoded batch context.
-     */
-    function _makeBatchExtraData(
-        uint40 _totalElements,
-        uint40 _lastSequencerTimestamp
-    )
-        internal
-        pure
-        returns (
-            bytes27
-        )
-    {
-        bytes27 extraData;
-        assembly {
-            extraData := _totalElements
-            extraData := or(extraData, shl(40, _lastSequencerTimestamp))
-            extraData := shl(40, extraData)
-        }
- 
-        return extraData;
-    }
- 
-    /**
-     * Appends a batch to the chain.
-     * @param _batch Elements within the batch.
-     * @param _extraData Any extra data to append to the batch.
-     */
-    function _appendBatch(
-        bytes32[] memory _batch,
-        bytes memory _extraData
-    )
-        internal
-    {
-        address sequencer = resolve("OVM_Proposer");
-        (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData();
- 
-        if (msg.sender == sequencer) {
-            lastSequencerTimestamp = uint40(block.timestamp);
-        } else {
-            // We keep track of the last batch submitted by the sequencer so there's a window in
-            // which only the sequencer can publish state roots. A window like this just reduces
-            // the chance of "system breaking" state roots being published while we're still in
-            // testing mode. This window should be removed or significantly reduced in the future.
-            require(
-                lastSequencerTimestamp + SEQUENCER_PUBLISH_WINDOW < block.timestamp,
-                "Cannot publish state roots within the sequencer publication window."
-            );
-        }
- 
-        // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place
-        // while calculating the root hash therefore any arguments passed to it must not
-        // be used again afterwards
-        Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({
-            batchIndex: getTotalBatches(),
-            batchRoot: Lib_MerkleTree.getMerkleRoot(_batch),
-            batchSize: _batch.length,
-            prevTotalElements: totalElements,
-            extraData: _extraData
-        });
- 
-        emit StateBatchAppended(
-            batchHeader.batchIndex,
-            batchHeader.batchRoot,
-            batchHeader.batchSize,
-            batchHeader.prevTotalElements,
-            batchHeader.extraData
-        );
- 
-        batches().push(
-            Lib_OVMCodec.hashBatchHeader(batchHeader),
-            _makeBatchExtraData(
-                uint40(batchHeader.prevTotalElements + batchHeader.batchSize),
-                lastSequencerTimestamp
-            )
-        );
-    }
- 
-    /**
-     * Removes a batch and all subsequent batches from the chain.
-     * @param _batchHeader Header of the batch to remove.
-     */
-    function _deleteBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-    {
-        Erequire(
-            _batchHeader.batchIndex < batches().length(),
-            "Invalid batch index."
-        );
- 
-        Erequire(
-            _isValidBatchHeader(_batchHeader),
-            "Invalid batch header."
-        );
- 
-        batches().deleteElementsAfterInclusive(
-            _batchHeader.batchIndex,
-            _makeBatchExtraData(
-                uint40(_batchHeader.prevTotalElements),
-                0
-            )
-        );
- 
-        emit StateBatchDeleted(
-            _batchHeader.batchIndex,
-            _batchHeader.batchRoot
-        );
-    }
- 
-    /**
-     * Checks that a batch header matches the stored hash for the given index.
-     * @param _batchHeader Batch header to validate.
-     * @return Whether or not the header matches the stored one.
-     */
-    function _isValidBatchHeader(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-        view
-        returns (
-            bool
-        )
-    {
-        return Lib_OVMCodec.hashBatchHeader(_batchHeader) == batches().get(_batchHeader.batchIndex);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/chain/index.html b/coverage/optimistic-ethereum/OVM/chain/index.html deleted file mode 100644 index 4929bf6b5..000000000 --- a/coverage/optimistic-ethereum/OVM/chain/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/chain/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/chain/ -

-
-
- 92.82% - Statements - 194/209 -
-
- 81.37% - Branches - 83/102 -
-
- 82.46% - Functions - 47/57 -
-
- 93.36% - Lines - 211/226 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_CanonicalTransactionChain.sol
95.51%149/15687.5%63/7284.38%27/3295.88%163/170
OVM_ChainStorageContainer.sol
72.73%8/1150%1/272.73%8/1175%9/12
OVM_StateCommitmentChain.sol
88.1%37/4267.86%19/2885.71%12/1488.64%39/44
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html b/coverage/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html deleted file mode 100644 index 89edc14b7..000000000 --- a/coverage/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol.html +++ /dev/null @@ -1,5654 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/execution/ OVM_ExecutionManager.sol -

-
-
- 82.2% - Statements - 194/236 -
-
- 68.29% - Branches - 56/82 -
-
- 88.52% - Functions - 54/61 -
-
- 82.64% - Lines - 200/242 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231 -1232 -1233 -1234 -1235 -1236 -1237 -1238 -1239 -1240 -1241 -1242 -1243 -1244 -1245 -1246 -1247 -1248 -1249 -1250 -1251 -1252 -1253 -1254 -1255 -1256 -1257 -1258 -1259 -1260 -1261 -1262 -1263 -1264 -1265 -1266 -1267 -1268 -1269 -1270 -1271 -1272 -1273 -1274 -1275 -1276 -1277 -1278 -1279 -1280 -1281 -1282 -1283 -1284 -1285 -1286 -1287 -1288 -1289 -1290 -1291 -1292 -1293 -1294 -1295 -1296 -1297 -1298 -1299 -1300 -1301 -1302 -1303 -1304 -1305 -1306 -1307 -1308 -1309 -1310 -1311 -1312 -1313 -1314 -1315 -1316 -1317 -1318 -1319 -1320 -1321 -1322 -1323 -1324 -1325 -1326 -1327 -1328 -1329 -1330 -1331 -1332 -1333 -1334 -1335 -1336 -1337 -1338 -1339 -1340 -1341 -1342 -1343 -1344 -1345 -1346 -1347 -1348 -1349 -1350 -1351 -1352 -1353 -1354 -1355 -1356 -1357 -1358 -1359 -1360 -1361 -1362 -1363 -1364 -1365 -1366 -1367 -1368 -1369 -1370 -1371 -1372 -1373 -1374 -1375 -1376 -1377 -1378 -1379 -1380 -1381 -1382 -1383 -1384 -1385 -1386 -1387 -1388 -1389 -1390 -1391 -1392 -1393 -1394 -1395 -1396 -1397 -1398 -1399 -1400 -1401 -1402 -1403 -1404 -1405 -1406 -1407 -1408 -1409 -1410 -1411 -1412 -1413 -1414 -1415 -1416 -1417 -1418 -1419 -1420 -1421 -1422 -1423 -1424 -1425 -1426 -1427 -1428 -1429 -1430 -1431 -1432 -1433 -1434 -1435 -1436 -1437 -1438 -1439 -1440 -1441 -1442 -1443 -1444 -1445 -1446 -1447 -1448 -1449 -1450 -1451 -1452 -1453 -1454 -1455 -1456 -1457 -1458 -1459 -1460 -1461 -1462 -1463 -1464 -1465 -1466 -1467 -1468 -1469 -1470 -1471 -1472 -1473 -1474 -1475 -1476 -1477 -1478 -1479 -1480 -1481 -1482 -1483 -1484 -1485 -1486 -1487 -1488 -1489 -1490 -1491 -1492 -1493 -1494 -1495 -1496 -1497 -1498 -1499 -1500 -1501 -1502 -1503 -1504 -1505 -1506 -1507 -1508 -1509 -1510 -1511 -1512 -1513 -1514 -1515 -1516 -1517 -1518 -1519 -1520 -1521 -1522 -1523 -1524 -1525 -1526 -1527 -1528 -1529 -1530 -1531 -1532 -1533 -1534 -1535 -1536 -1537 -1538 -1539 -1540 -1541 -1542 -1543 -1544 -1545 -1546 -1547 -1548 -1549 -1550 -1551 -1552 -1553 -1554 -1555 -1556 -1557 -1558 -1559 -1560 -1561 -1562 -1563 -1564 -1565 -1566 -1567 -1568 -1569 -1570 -1571 -1572 -1573 -1574 -1575 -1576 -1577 -1578 -1579 -1580 -1581 -1582 -1583 -1584 -1585 -1586 -1587 -1588 -1589 -1590 -1591 -1592 -1593 -1594 -1595 -1596 -1597 -1598 -1599 -1600 -1601 -1602 -1603 -1604 -1605 -1606 -1607 -1608 -1609 -1610 -1611 -1612 -1613 -1614 -1615 -1616 -1617 -1618 -1619 -1620 -1621 -1622 -1623 -1624 -1625 -1626 -1627 -1628 -1629 -1630 -1631 -1632 -1633 -1634 -1635 -1636 -1637 -1638 -1639 -1640 -1641 -1642 -1643 -1644 -1645 -1646 -1647 -1648 -1649 -1650 -1651 -1652 -1653 -1654 -1655 -1656 -1657 -1658 -1659 -1660 -1661 -1662 -1663 -1664 -1665 -1666 -1667 -1668 -1669 -1670 -1671 -1672 -1673 -1674 -1675 -1676 -1677 -1678 -1679 -1680 -1681 -1682 -1683 -1684 -1685 -1686 -1687 -1688 -1689 -1690 -1691 -1692 -1693 -1694 -1695 -1696 -1697 -1698 -1699 -1700 -1701 -1702 -1703 -1704 -1705 -1706 -1707 -1708 -1709 -1710 -1711 -1712 -1713 -1714 -1715 -1716 -1717 -1718 -1719 -1720 -1721 -1722 -1723 -1724 -1725 -1726 -1727 -1728 -1729 -1730 -1731 -1732 -1733 -1734 -1735 -1736 -1737 -1738 -1739 -1740 -1741 -1742 -1743 -1744 -1745 -1746 -1747 -1748 -1749 -1750 -1751 -1752 -1753 -1754 -1755 -1756 -1757 -1758 -1759 -1760 -1761 -1762 -1763 -1764 -1765 -1766 -1767 -1768 -1769 -1770 -1771 -1772 -1773 -1774 -1775 -1776 -1777 -1778 -1779 -1780 -1781 -1782 -1783 -1784 -1785 -1786 -1787 -1788 -1789 -1790 -1791 -1792 -1793 -1794 -1795 -1796 -1797 -1798 -1799 -1800 -1801 -1802 -1803 -1804 -1805 -1806 -1807 -1808 -1809 -1810 -1811 -1812 -1813 -1814 -1815 -1816 -1817 -1818 -1819 -1820 -1821 -1822 -1823 -1824 -1825 -1826 -1827 -1828 -1829 -1830 -1831 -1832 -1833 -1834 -1835 -1836 -1837 -1838 -1839 -1840 -1841 -1842 -1843 -1844 -1845 -1846 -1847 -1848 -1849 -1850 -1851 -1852 -1853 -1854 -1855 -1856 -1857 -1858 -1859 -1860 -1861 -1862 -1863 -1864  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -30× -30× -30× -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -55× -55× -55× -  -  -55× -46× -  -  -  -  -  -  -  -  -  -  -  -202× -202× -193× -  -  -193× -165× -  -  -28× -  -  -  -  -  -  -  -42× - -  -38× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -150× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -  -  -  -28× -  -  -27× -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  - - -  -  -  - -  -  - -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -155× -155× -155× -  -155× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -48× -  -48× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -  -29× -  -29× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -27× -27× -27× -  -  -  -27× -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -173× -  -  -  -  - -  -  -  -172× -  -  -  -  -170× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -197× -197× -  -  -  -  -  -197× -197× -197× -  -  -  -  -  -  -  -197× -  -  -  -  -  -197× -  -  -  -197× -  -  -  -197× -23× -  -  -  -  -  -  -  -  -  -23× - -  -  -  -  -  -18× -  -  -  -  -  -14× -  -  -  -  -18× -  -  -  -10× -  - -  -  -  -  -  -  -  -18× -  -  -  -192× -  -192× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -27× -  -  -27× -  -27× -  -  -10× -10× -10× -10× -  -  -  -  -  -  -  -10× -  -  -  -  -17× -17× - -  -  -  -  -  -  -  -  -  -  -16× -  -  -  -  -  -  -16× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -29× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -57× -57× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -370× -368× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -17× -17× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -55× -55× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -536× -  -  -  -  -536× - -  -  -  -  -534× -  -  -  -  -  -534× -144× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -53× -  -  -  -53× -  -  -  -  -  -53× -47× -47× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -62× -  -  -  -  -  -  -62× -  -  -  -  -  -62× -  -  -  -  -  -62× -46× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - -  -  -  -  -  - -  -  - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -20× -  -  -  -  -  -  -20× - -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -23× - -  -  -  -  -  -  -  -  -20× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -198× -  -  -  -  -  -  -  -  -  -  -  -  -  -244× -  -  -  -244× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -394× -202× -  -  -  -394× -310× -  -  -  -394× -16× -  -  -  -  -  -  -  -  -  -  -  -  - - - - - - -  - -  -  -  -  -  -  -  -  -31× -31× -31× -31× -31× -31× -  -31× -  -31× -31× -31× -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
-import { Lib_ErrorUtils } from "../../libraries/utils/Lib_ErrorUtils.sol";
- 
-/* Interface Imports */
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
- 
-/* Contract Imports */
-import { OVM_ECDSAContractAccount } from "../accounts/OVM_ECDSAContractAccount.sol";
-import { OVM_ProxyEOA } from "../accounts/OVM_ProxyEOA.sol";
-import { OVM_DeployerWhitelist } from "../predeploys/OVM_DeployerWhitelist.sol";
- 
-/**
- * @title OVM_ExecutionManager
- * @dev The Execution Manager (EM) is the core of our OVM implementation, and provides a sandboxed
- * environment allowing us to execute OVM transactions deterministically on either Layer 1 or
- * Layer 2.
- * The EM's run() function is the first function called during the execution of any
- * transaction on L2.
- * For each context-dependent EVM operation the EM has a function which implements a corresponding
- * OVM operation, which will read state from the State Manager contract.
- * The EM relies on the Safety Checker to verify that code deployed to Layer 2 does not contain any
- * context-dependent operations.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
- 
-    /********************************
-     * External Contract References *
-     ********************************/
- 
-    iOVM_SafetyChecker internal ovmSafetyChecker;
-    iOVM_StateManager internal ovmStateManager;
- 
- 
-    /*******************************
-     * Execution Context Variables *
-     *******************************/
- 
-    GasMeterConfig internal gasMeterConfig;
-    GlobalContext internal globalContext;
-    TransactionContext internal transactionContext;
-    MessageContext internal messageContext;
-    TransactionRecord internal transactionRecord;
-    MessageRecord internal messageRecord;
- 
- 
-    /**************************
-     * Gas Metering Constants *
-     **************************/
- 
-    address constant GAS_METADATA_ADDRESS = 0x06a506A506a506A506a506a506A506A506A506A5;
-    uint256 constant NUISANCE_GAS_SLOAD = 20000;
-    uint256 constant NUISANCE_GAS_SSTORE = 20000;
-    uint256 constant MIN_NUISANCE_GAS_PER_CONTRACT = 30000;
-    uint256 constant NUISANCE_GAS_PER_CONTRACT_BYTE = 100;
-    uint256 constant MIN_GAS_FOR_INVALID_STATE_ACCESS = 30000;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager,
-        GasMeterConfig memory _gasMeterConfig,
-        GlobalContext memory _globalContext
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        ovmSafetyChecker = iOVM_SafetyChecker(resolve("OVM_SafetyChecker"));
-        gasMeterConfig = _gasMeterConfig;
-        globalContext = _globalContext;
-        _resetContext();
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Applies dynamically-sized refund to a transaction to account for the difference in execution
-     * between L1 and L2, so that the overall cost of the ovmOPCODE is fixed.
-     * @param _cost Desired gas cost for the function after the refund.
-     */
-    modifier netGasCost(
-        uint256 _cost
-    ) {
-        uint256 gasProvided = gasleft();
-        _;
-        uint256 gasUsed = gasProvided - gasleft();
- 
-        // We want to refund everything *except* the specified cost.
-        if (_cost < gasUsed) {
-            transactionRecord.ovmGasRefund += gasUsed - _cost;
-        }
-    }
- 
-    /**
-     * Applies a fixed-size gas refund to a transaction to account for the difference in execution
-     * between L1 and L2, so that the overall cost of an ovmOPCODE can be lowered.
-     * @param _discount Amount of gas cost to refund for the ovmOPCODE.
-     */
-    modifier fixedGasDiscount(
-        uint256 _discount
-    ) {
-        uint256 gasProvided = gasleft();
-        _;
-        uint256 gasUsed = gasProvided - gasleft();
- 
-        // We want to refund the specified _discount, unless this risks underflow.
-        if (_discount < gasUsed) {
-            transactionRecord.ovmGasRefund += _discount;
-        } else {
-            // refund all we can without risking underflow.
-            transactionRecord.ovmGasRefund += gasUsed;
-        }
-    }
- 
-    /**
-     * Makes sure we're not inside a static context.
-     */
-    modifier notStatic() {
-        if (messageContext.isStatic == true) {
-            _revertWithFlag(RevertFlag.STATIC_VIOLATION);
-        }
-        _;
-    }
- 
- 
-    /************************************
-     * Transaction Execution Entrypoint *
-     ************************************/
- 
-    /**
-     * Starts the execution of a transaction via the OVM_ExecutionManager.
-     * @param _transaction Transaction data to be executed.
-     * @param _ovmStateManager iOVM_StateManager implementation providing account state.
-     */
-    function run(
-        Lib_OVMCodec.Transaction memory _transaction,
-        address _ovmStateManager
-    )
-        override
-        public
-    {
-        Erequire(transactionContext.ovmNUMBER == 0, "Only be callable at the start of a transaction");
-        // Store our OVM_StateManager instance (significantly easier than attempting to pass the
-        // address around in calldata).
-        ovmStateManager = iOVM_StateManager(_ovmStateManager);
- 
-        // Make sure this function can't be called by anyone except the owner of the
-        // OVM_StateManager (expected to be an OVM_StateTransitioner). We can revert here because
-        // this would make the `run` itself invalid.
-        Erequire(
-            // This method may return false during fraud proofs, but always returns true in L2 nodes' State Manager precompile.
-            ovmStateManager.isAuthenticated(msg.sender),
-            "Only authenticated addresses in ovmStateManager can call this function"
-        );
- 
-        // Initialize the execution context, must be initialized before we perform any gas metering
-        // or we'll throw a nuisance gas error.
-        _initContext(_transaction);
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Check whether we need to start a new epoch, do so if necessary.
-        // _checkNeedsNewEpoch(_transaction.timestamp);
- 
-        // Make sure the transaction's gas limit is valid. We don't revert here because we reserve
-        // reverts for INVALID_STATE_ACCESS.
-        Iif (_isValidGasLimit(_transaction.gasLimit, _transaction.l1QueueOrigin) == false) {
-            _resetContext();
-            return;
-        }
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Check gas right before the call to get total gas consumed by OVM transaction.
-        // uint256 gasProvided = gasleft();
- 
-        // Run the transaction, make sure to meter the gas usage.
-        ovmCALL(
-            _transaction.gasLimit - gasMeterConfig.minTransactionGasLimit,
-            _transaction.entrypoint,
-            _transaction.data
-        );
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        // // Update the cumulative gas based on the amount of gas used.
-        // uint256 gasUsed = gasProvided - gasleft();
-        // _updateCumulativeGas(gasUsed, _transaction.l1QueueOrigin);
- 
-        // Wipe the execution context.
-        _resetContext();
- 
-        // Reset the ovmStateManager.
-        ovmStateManager = iOVM_StateManager(address(0));
-    }
- 
- 
-    /******************************
-     * Opcodes: Execution Context *
-     ******************************/
- 
-    /**
-     * @notice Overrides CALLER.
-     * @return _CALLER Address of the CALLER within the current message context.
-     */
-    function ovmCALLER()
-        override
-        public
-        view
-        returns (
-            address _CALLER
-        )
-    {
-        return messageContext.ovmCALLER;
-    }
- 
-    /**
-     * @notice Overrides ADDRESS.
-     * @return _ADDRESS Active ADDRESS within the current message context.
-     */
-    function ovmADDRESS()
-        override
-        public
-        view
-        returns (
-            address _ADDRESS
-        )
-    {
-        return messageContext.ovmADDRESS;
-    }
- 
-    /**
-     * @notice Overrides TIMESTAMP.
-     * @return _TIMESTAMP Value of the TIMESTAMP within the transaction context.
-     */
-    function ovmTIMESTAMP()
-        override
-        public
-        view
-        returns (
-            uint256 _TIMESTAMP
-        )
-    {
-        return transactionContext.ovmTIMESTAMP;
-    }
- 
-    /**
-     * @notice Overrides NUMBER.
-     * @return _NUMBER Value of the NUMBER within the transaction context.
-     */
-    function ovmNUMBER()
-        override
-        public
-        view
-        returns (
-            uint256 _NUMBER
-        )
-    {
-        return transactionContext.ovmNUMBER;
-    }
- 
-    /**
-     * @notice Overrides GASLIMIT.
-     * @return _GASLIMIT Value of the block's GASLIMIT within the transaction context.
-     */
-    function ovmGASLIMIT()
-        override
-        public
-        view
-        returns (
-            uint256 _GASLIMIT
-        )
-    {
-        return transactionContext.ovmGASLIMIT;
-    }
- 
-    /**
-     * @notice Overrides CHAINID.
-     * @return _CHAINID Value of the chain's CHAINID within the global context.
-     */
-    function ovmCHAINID()
-        override
-        public
-        view
-        returns (
-            uint256 _CHAINID
-        )
-    {
-        return globalContext.ovmCHAINID;
-    }
- 
-    /*********************************
-     * Opcodes: L2 Execution Context *
-     *********************************/
- 
-    /**
-     * @notice Specifies from which L1 rollup queue this transaction originated from.
-     * @return _queueOrigin Address of the ovmL1QUEUEORIGIN within the current message context.
-     */
-    function ovmL1QUEUEORIGIN()
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.QueueOrigin _queueOrigin
-        )
-    {
-        return transactionContext.ovmL1QUEUEORIGIN;
-    }
- 
-    /**
-     * @notice Specifies which L1 account, if any, sent this transaction by calling enqueue().
-     * @return _l1TxOrigin Address of the account which sent the tx into L2 from L1.
-     */
-    function ovmL1TXORIGIN()
-        override
-        public
-        view
-        returns (
-            address _l1TxOrigin
-        )
-    {
-        return transactionContext.ovmL1TXORIGIN;
-    }
- 
-    /********************
-     * Opcodes: Halting *
-     ********************/
- 
-    /**
-     * @notice Overrides REVERT.
-     * @param _data Bytes data to pass along with the REVERT.
-     */
-    function ovmREVERT(
-        bytes memory _data
-    )
-        override
-        public
-    {
-        _revertWithFlag(RevertFlag.INTENTIONAL_REVERT, _data);
-    }
- 
- 
-    /******************************
-     * Opcodes: Contract Creation *
-     ******************************/
- 
-    /**
-     * @notice Overrides CREATE.
-     * @param _bytecode Code to be used to CREATE a new contract.
-     * @return Address of the created contract.
-     * @return Revert data, if and only if the creation threw an exception.
-     */
-    function ovmCREATE(
-        bytes memory _bytecode
-    )
-        override
-        public
-        notStatic
-        fixedGasDiscount(40000)
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // Creator is always the current ADDRESS.
-        address creator = ovmADDRESS();
- 
-        // Check that the deployer is whitelisted, or
-        // that arbitrary contract deployment has been enabled.
-        _checkDeployerAllowed(creator);
- 
-        // Generate the correct CREATE address.
-        address contractAddress = Lib_EthUtils.getAddressForCREATE(
-            creator,
-            _getAccountNonce(creator)
-        );
- 
-        return _createContract(
-            contractAddress,
-            _bytecode
-        );
-    }
- 
-    /**
-     * @notice Overrides CREATE2.
-     * @param _bytecode Code to be used to CREATE2 a new contract.
-     * @param _salt Value used to determine the contract's address.
-     * @return Address of the created contract.
-     * @return Revert data, if and only if the creation threw an exception.
-     */
-    function ovmCREATE2(
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        override
-        public
-        notStatic
-        fixedGasDiscount(40000)
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // Creator is always the current ADDRESS.
-        address creator = ovmADDRESS();
- 
-        // Check that the deployer is whitelisted, or
-        // that arbitrary contract deployment has been enabled.
-        _checkDeployerAllowed(creator);
- 
-        // Generate the correct CREATE2 address.
-        address contractAddress = Lib_EthUtils.getAddressForCREATE2(
-            creator,
-            _bytecode,
-            _salt
-        );
- 
-        return _createContract(
-            contractAddress,
-            _bytecode
-        );
-    }
- 
- 
-    /*******************************
-     * Account Abstraction Opcodes *
-     ******************************/
- 
-    /**
-     * Retrieves the nonce of the current ovmADDRESS.
-     * @return _nonce Nonce of the current contract.
-     */
-    function ovmGETNONCE()
-        override
-        public
-        returns (
-            uint256 _nonce
-        )
-    {
-        return _getAccountNonce(ovmADDRESS());
-    }
- 
-    /**
-     * Sets the nonce of the current ovmADDRESS.
-     * @param _nonce New nonce for the current contract.
-     */
-    function ovmSETNONCE(
-        uint256 _nonce
-    )
-        override
-        public
-        notStatic
-    {
-        _setAccountNonce(ovmADDRESS(), _nonce);
-    }
- 
-    /**
-     * Creates a new EOA contract account, for account abstraction.
-     * @dev Essentially functions like ovmCREATE or ovmCREATE2, but we can bypass a lot of checks
-     *      because the contract we're creating is trusted (no need to do safety checking or to
-     *      handle unexpected reverts). Doesn't need to return an address because the address is
-     *      assumed to be the user's actual address.
-     * @param _messageHash Hash of a message signed by some user, for verification.
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     */
-    function ovmCREATEEOA(
-        bytes32 _messageHash,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        override
-        public
-        notStatic
-    {
-        // Recover the EOA address from the message hash and signature parameters. Since we do the
-        // hashing in advance, we don't have handle different message hashing schemes. Even if this
-        // function were to return the wrong address (rather than explicitly returning the zero
-        // address), the rest of the transaction would simply fail (since there's no EOA account to
-        // actually execute the transaction).
-        address eoa = ecrecover(
-            _messageHash,
-            _v + 27,
-            _r,
-            _s
-        );
- 
-        // Invalid signature is a case we proactively handle with a revert. We could alternatively
-        // have this function return a `success` boolean, but this is just easier.
-        Iif (eoa == address(0)) {
-            ovmREVERT(bytes("Signature provided for EOA contract creation is invalid."));
-        }
- 
-        // If the user already has an EOA account, then there's no need to perform this operation.
-        Iif (_hasEmptyAccount(eoa) == false) {
-            return;
-        }
- 
-        // We always need to initialize the contract with the default account values.
-        _initPendingAccount(eoa);
- 
-        // Temporarily set the current address so it's easier to access on L2.
-        address prevADDRESS = messageContext.ovmADDRESS;
-        messageContext.ovmADDRESS = eoa;
- 
-        // Now actually create the account and get its bytecode. We're not worried about reverts
-        // (other than out of gas, which we can't capture anyway) because this contract is trusted.
-        OVM_ProxyEOA proxyEOA = new OVM_ProxyEOA(0x4200000000000000000000000000000000000003);
- 
-        // Reset the address now that we're done deploying.
-        messageContext.ovmADDRESS = prevADDRESS;
- 
-        // Commit the account with its final values.
-        _commitPendingAccount(
-            eoa,
-            address(proxyEOA),
-            keccak256(Lib_EthUtils.getCode(address(proxyEOA)))
-        );
- 
-        _setAccountNonce(eoa, 0);
-    }
- 
- 
-    /*********************************
-     * Opcodes: Contract Interaction *
-     *********************************/
- 
-    /**
-     * @notice Overrides CALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmCALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(100000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // CALL updates the CALLER and ADDRESS.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _address;
- 
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
-    /**
-     * @notice Overrides STATICCALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmSTATICCALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(80000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // STATICCALL updates the CALLER, updates the ADDRESS, and runs in a static context.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = nextMessageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _address;
-        nextMessageContext.isStatic = true;
- 
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
-    /**
-     * @notice Overrides DELEGATECALL.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _address Address of the contract to call.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function ovmDELEGATECALL(
-        uint256 _gasLimit,
-        address _address,
-        bytes memory _calldata
-    )
-        override
-        public
-        fixedGasDiscount(40000)
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // DELEGATECALL does not change anything about the message context.
-        MessageContext memory nextMessageContext = messageContext;
-        
-        return _callContract(
-            nextMessageContext,
-            _gasLimit,
-            _address,
-            _calldata
-        );
-    }
- 
- 
-    /************************************
-     * Opcodes: Contract Storage Access *
-     ************************************/
- 
-    /**
-     * @notice Overrides SLOAD.
-     * @param _key 32 byte key of the storage slot to load.
-     * @return _value 32 byte value of the requested storage slot.
-     */
-    function ovmSLOAD(
-        bytes32 _key
-    )
-        override
-        public
-        netGasCost(40000)
-        returns (
-            bytes32 _value
-        )
-    {
-        // We always SLOAD from the storage of ADDRESS.
-        address contractAddress = ovmADDRESS();
- 
-        return _getContractStorage(
-            contractAddress,
-            _key
-        );
-    }
- 
-    /**
-     * @notice Overrides SSTORE.
-     * @param _key 32 byte key of the storage slot to set.
-     * @param _value 32 byte value for the storage slot.
-     */
-    function ovmSSTORE(
-        bytes32 _key,
-        bytes32 _value
-    )
-        override
-        public
-        notStatic
-        netGasCost(60000)
-    {
-        // We always SSTORE to the storage of ADDRESS.
-        address contractAddress = ovmADDRESS();
- 
-        _putContractStorage(
-            contractAddress,
-            _key,
-            _value
-        );
-    }
- 
- 
-    /*********************************
-     * Opcodes: Contract Code Access *
-     *********************************/
- 
-    /**
-     * @notice Overrides EXTCODECOPY.
-     * @param _contract Address of the contract to copy code from.
-     * @param _offset Offset in bytes from the start of contract code to copy beyond.
-     * @param _length Total number of bytes to copy from the contract's code.
-     * @return _code Bytes of code copied from the requested contract.
-     */
-    function ovmEXTCODECOPY(
-        address _contract,
-        uint256 _offset,
-        uint256 _length
-    )
-        override
-        public
-        returns (
-            bytes memory _code
-        )
-    {
-        // `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of
-        // return data. By blocking reads of one byte, we're able to use the condition that an
-        // OVM_ExecutionManager function return value having a length of exactly one byte indicates
-        // an error without an explicit revert. If users were able to read a single byte, they
-        // could forcibly trigger behavior that should only be available to this contract.
-        uint256 length = _length == 1 ? 2 : _length;
- 
-        return Lib_EthUtils.getCode(
-            _getAccountEthAddress(_contract),
-            _offset,
-            length
-        );
-    }
- 
-    /**
-     * @notice Overrides EXTCODESIZE.
-     * @param _contract Address of the contract to query the size of.
-     * @return _EXTCODESIZE Size of the requested contract in bytes.
-     */
-    function ovmEXTCODESIZE(
-        address _contract
-    )
-        override
-        public
-        returns (
-            uint256 _EXTCODESIZE
-        )
-    {
-        return Lib_EthUtils.getCodeSize(
-            _getAccountEthAddress(_contract)
-        );
-    }
- 
-    /**
-     * @notice Overrides EXTCODEHASH.
-     * @param _contract Address of the contract to query the hash of.
-     * @return _EXTCODEHASH Hash of the requested contract.
-     */
-    function ovmEXTCODEHASH(
-        address _contract
-    )
-        override
-        public
-        returns (
-            bytes32 _EXTCODEHASH
-        )
-    {
-        return Lib_EthUtils.getCodeHash(
-            _getAccountEthAddress(_contract)
-        );
-    }
- 
-    /***************************************
-     * Public Functions: Execution Context *
-     ***************************************/
- 
-    function getMaxTransactionGasLimit()
-        external
-        view
-        override
-        returns (
-            uint256 _maxTransactionGasLimit
-        )
-    {
-        return gasMeterConfig.maxTransactionGasLimit;
-    }
- 
-    /********************************************
-     * Public Functions: Deployment Whitelisting *
-     ********************************************/
- 
-    /**
-     * Checks whether the given address is on the whitelist to ovmCREATE/ovmCREATE2, and reverts if not.
-     * @param _deployerAddress Address attempting to deploy a contract.
-     */
-    function _checkDeployerAllowed(
-        address _deployerAddress
-    )
-        internal
-    {
-        // From an OVM semantics perspective, this will appear identical to
-        // the deployer ovmCALLing the whitelist.  This is fine--in a sense, we are forcing them to.
-        (bool success, bytes memory data) = ovmCALL(
-            gasleft(),
-            0x4200000000000000000000000000000000000002,
-            abi.encodeWithSignature("isDeployerAllowed(address)", _deployerAddress)
-        );
-        bool isAllowed = abi.decode(data, (bool));
- 
-        if (!isAllowed || !success) {
-            _revertWithFlag(RevertFlag.CREATOR_NOT_ALLOWED);
-        }
-    }
- 
-    /********************************************
-     * Internal Functions: Contract Interaction *
-     ********************************************/
- 
-    /**
-     * Creates a new contract and associates it with some contract address.
-     * @param _contractAddress Address to associate the created contract with.
-     * @param _bytecode Bytecode to be used to create the contract.
-     * @return Final OVM contract address.
-     * @return Revertdata, if and only if the creation threw an exception.
-     */
-    function _createContract(
-        address _contractAddress,
-        bytes memory _bytecode
-    )
-        internal
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        // We always update the nonce of the creating account, even if the creation fails.
-        _setAccountNonce(ovmADDRESS(), _getAccountNonce(ovmADDRESS()) + 1);
- 
-        // We're stepping into a CREATE or CREATE2, so we need to update ADDRESS to point
-        // to the contract's associated address and CALLER to point to the previous ADDRESS.
-        MessageContext memory nextMessageContext = messageContext;
-        nextMessageContext.ovmCALLER = messageContext.ovmADDRESS;
-        nextMessageContext.ovmADDRESS = _contractAddress;
- 
-        // Run the common logic which occurs between call-type and create-type messages,
-        // passing in the creation bytecode and `true` to trigger create-specific logic.
-        (bool success, bytes memory data) = _handleExternalMessage(
-            nextMessageContext,
-            gasleft(),
-            _contractAddress,
-            _bytecode,
-            true
-        );
- 
-        // Yellow paper requires that address returned is zero if the contract deployment fails.
-        return (
-            success ? _contractAddress : address(0),
-            data
-        );
-    }
- 
-    /**
-     * Calls the deployed contract associated with a given address.
-     * @param _nextMessageContext Message context to be used for the call.
-     * @param _gasLimit Amount of gas to be passed into this call.
-     * @param _contract OVM address to be called.
-     * @param _calldata Data to send along with the call.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function _callContract(
-        MessageContext memory _nextMessageContext,
-        uint256 _gasLimit,
-        address _contract,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        // We reserve addresses of the form 0xdeaddeaddead...NNNN for the container contracts in L2 geth.
-        // So, we block calls to these addresses since they are not safe to run as an OVM contract itself.
-        if (
-            (uint256(_contract) & uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000))
-            == uint256(0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000)
-        ) {
-            // EVM does not return data in the success case, see: https://github.com/ethereum/go-ethereum/blob/aae7660410f0ef90279e14afaaf2f429fdc2a186/core/vm/instructions.go#L600-L604
-            return (true, hex'');
-        }
- 
-        // Both 0x0000... and the EVM precompiles have the same address on L1 and L2 --> no trie lookup needed.
-        address codeContractAddress =
-            uint(_contract) < 100
-            ? _contract
-            : _getAccountEthAddress(_contract);
- 
-        return _handleExternalMessage(
-            _nextMessageContext,
-            _gasLimit,
-            codeContractAddress,
-            _calldata,
-            false
-        );
-    }
- 
-    /**
-     * Handles all interactions which involve the execution manager calling out to untrusted code (both calls and creates).
-     * Ensures that OVM-related measures are enforced, including L2 gas refunds, nuisance gas, and flagged reversions.
-     * 
-     * @param _nextMessageContext Message context to be used for the external message.
-     * @param _gasLimit Amount of gas to be passed into this message.
-     * @param _contract OVM address being called or deployed to
-     * @param _data Data for the message (either calldata or creation code)
-     * @param _isCreate Whether this is a create-type message.
-     * @return Whether or not the message (either a call or deployment) succeeded.
-     * @return Data returned by the message.
-     */
-    function _handleExternalMessage(
-        MessageContext memory _nextMessageContext,
-        uint256 _gasLimit,
-        address _contract,
-        bytes memory _data,
-        bool _isCreate
-    )
-        internal
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        // We need to switch over to our next message context for the duration of this call.
-        MessageContext memory prevMessageContext = messageContext;
-        _switchMessageContext(prevMessageContext, _nextMessageContext);
- 
-        // Nuisance gas is a system used to bound the ability for an attacker to make fraud proofs
-        // expensive by touching a lot of different accounts or storage slots. Since most contracts
-        // only use a few storage slots during any given transaction, this shouldn't be a limiting
-        // factor.
-        uint256 prevNuisanceGasLeft = messageRecord.nuisanceGasLeft;
-        uint256 nuisanceGasLimit = _getNuisanceGasLimit(_gasLimit);
-        messageRecord.nuisanceGasLeft = nuisanceGasLimit;
- 
-        // Make the call and make sure to pass in the gas limit. Another instance of hidden
-        // complexity. `_contract` is guaranteed to be a safe contract, meaning its return/revert
-        // behavior can be controlled. In particular, we enforce that flags are passed through
-        // revert data as to retrieve execution metadata that would normally be reverted out of
-        // existence.
- 
-        (bool success, bytes memory returndata) =
-            _isCreate
-            ? _handleContractCreation(_gasLimit, _data, _contract)
-            : _contract.call{gas: _gasLimit}(_data);
- 
-        // Switch back to the original message context now that we're out of the call.
-        _switchMessageContext(_nextMessageContext, prevMessageContext);
- 
-        // Assuming there were no reverts, the message record should be accurate here. We'll update
-        // this value in the case of a revert.
-        uint256 nuisanceGasLeft = messageRecord.nuisanceGasLeft;
- 
-        // Reverts at this point are completely OK, but we need to make a few updates based on the
-        // information passed through the revert.
-        if (success == false) {
-            (
-                RevertFlag flag,
-                uint256 nuisanceGasLeftPostRevert,
-                uint256 ovmGasRefund,
-                bytes memory returndataFromFlag
-            ) = _decodeRevertData(returndata);
- 
-            // INVALID_STATE_ACCESS is the only flag that triggers an immediate abort of the
-            // parent EVM message. This behavior is necessary because INVALID_STATE_ACCESS must
-            // halt any further transaction execution that could impact the execution result.
-            if (flag == RevertFlag.INVALID_STATE_ACCESS) {
-                _revertWithFlag(flag);
-            }
- 
-            // INTENTIONAL_REVERT, UNSAFE_BYTECODE, STATIC_VIOLATION, and CREATOR_NOT_ALLOWED aren't
-            // dependent on the input state, so we can just handle them like standard reverts. Our only change here
-            // is to record the gas refund reported by the call (enforced by safety checking).
-            if (
-                flag == RevertFlag.INTENTIONAL_REVERT
-                || flag == RevertFlag.UNSAFE_BYTECODE
-                || flag == RevertFlag.STATIC_VIOLATION
-                || flag == RevertFlag.CREATOR_NOT_ALLOWED
-            ) {
-                transactionRecord.ovmGasRefund = ovmGasRefund;
-            }
- 
-            // INTENTIONAL_REVERT needs to pass up the user-provided return data encoded into the
-            // flag, *not* the full encoded flag. All other revert types return no data.
-            if (
-                flag == RevertFlag.INTENTIONAL_REVERT
-                || _isCreate
-            ) {
-                returndata = returndataFromFlag;
-            } else {
-                returndata = hex'';
-            }
- 
-            // Reverts mean we need to use up whatever "nuisance gas" was used by the call.
-            // EXCEEDS_NUISANCE_GAS explicitly reduces the remaining nuisance gas for this message
-            // to zero. OUT_OF_GAS is a "pseudo" flag given that messages return no data when they
-            // run out of gas, so we have to treat this like EXCEEDS_NUISANCE_GAS. All other flags
-            // will simply pass up the remaining nuisance gas.
-            nuisanceGasLeft = nuisanceGasLeftPostRevert;
-        }
- 
-        // We need to reset the nuisance gas back to its original value minus the amount used here.
-        messageRecord.nuisanceGasLeft = prevNuisanceGasLeft - (nuisanceGasLimit - nuisanceGasLeft);
- 
-        return (
-            success,
-            returndata
-        );
-    }
- 
-    /**
-     * Handles the creation-specific safety measures required for OVM contract deployment.
-     * This function sanitizes the return types for creation messages to match calls (bool, bytes).
-     * This allows for consistent handling of both types of messages in _handleExternalMessage().
-     * 
-     * @param _gasLimit Amount of gas to be passed into this creation.
-     * @param _creationCode Code to pass into CREATE for deployment.
-     * @param _address OVM address being deployed to.
-     * @return Whether or not the call succeeded.
-     * @return If creation fails: revert data. Otherwise: empty.
-     */
-    function _handleContractCreation(
-        uint _gasLimit,
-        bytes memory _creationCode,
-        address _address
-    )
-        internal
-        returns(
-            bool,
-            bytes memory
-        )
-    {
-        // Check that there is not already code at this address.
-        Iif (_hasEmptyAccount(_address) == false) {
-            // Note: in the EVM, this case burns all allotted gas.  For improved
-            // developer experience, we do return the remaining ones.
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.CREATE_COLLISION,
-                    Lib_ErrorUtils.encodeRevertString("A contract has already been deployed to this address")
-                )
-            );
-        }
- 
-        // Check the creation bytecode against the OVM_SafetyChecker.
-        Iif (ovmSafetyChecker.isBytecodeSafe(_creationCode) == false) {
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.UNSAFE_BYTECODE,
-                    Lib_ErrorUtils.encodeRevertString("Contract creation code contains unsafe opcodes. Did you use the right compiler or pass an unsafe constructor argument?")
-                )
-            );
-        }
- 
-        // We always need to initialize the contract with the default account values.
-        _initPendingAccount(_address);
- 
-        // Actually execute the EVM create message,
-        address ethAddress = Lib_EthUtils.createContract(_creationCode);
-        
-        if (ethAddress == address(0)) {
-            // If the creation fails, the EVM lets us grab its revert data. This may contain a revert flag
-            // to be used above in _handleExternalMessage.
-            uint256 revertDataSize;
-            assembly { revertDataSize := returndatasize() }
-            bytes memory revertdata = new bytes(revertDataSize);
-            assembly {
-                returndatacopy(
-                    add(revertdata, 0x20),
-                    0,
-                    revertDataSize
-                )
-            }
-            // Return that the creation failed, and the data it reverted with.
-            return (false, revertdata);
-        }
- 
-        // Again simply checking that the deployed code is safe too. Contracts can generate
-        // arbitrary deployment code, so there's no easy way to analyze this beforehand.
-        bytes memory deployedCode = Lib_EthUtils.getCode(ethAddress);
-        if (ovmSafetyChecker.isBytecodeSafe(deployedCode) == false) {
-            return (
-                false,
-                _encodeRevertData(
-                    RevertFlag.UNSAFE_BYTECODE,
-                    Lib_ErrorUtils.encodeRevertString("Constructor attempted to deploy unsafe bytecode.")
-                )
-            );
-        }
- 
-        // Contract creation didn't need to be reverted and the bytecode is safe. We finish up by
-        // associating the desired address with the newly created contract's code hash and address.
-        _commitPendingAccount(
-            _address,
-            ethAddress,
-            Lib_EthUtils.getCodeHash(ethAddress)
-        );
- 
-        // Successful deployments will not give access to returndata, in both the EVM and the OVM.
-        return (true, hex'');
-    }
- 
-    /******************************************
-     * Internal Functions: State Manipulation *
-     ******************************************/
- 
-    /**
-     * Checks whether an account exists within the OVM_StateManager.
-     * @param _address Address of the account to check.
-     * @return _exists Whether or not the account exists.
-     */
-    function _hasAccount(
-        address _address
-    )
-        internal
-        returns (
-            bool _exists
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.hasAccount(_address);
-    }
- 
-    /**
-     * Checks whether a known empty account exists within the OVM_StateManager.
-     * @param _address Address of the account to check.
-     * @return _exists Whether or not the account empty exists.
-     */
-    function _hasEmptyAccount(
-        address _address
-    )
-        internal
-        returns (
-            bool _exists
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.hasEmptyAccount(_address);
-    }
- 
-    /**
-     * Sets the nonce of an account.
-     * @param _address Address of the account to modify.
-     * @param _nonce New account nonce.
-     */
-    function _setAccountNonce(
-        address _address,
-        uint256 _nonce
-    )
-        internal
-    {
-        _checkAccountChange(_address);
-        ovmStateManager.setAccountNonce(_address, _nonce);
-    }
- 
-    /**
-     * Gets the nonce of an account.
-     * @param _address Address of the account to access.
-     * @return _nonce Nonce of the account.
-     */
-    function _getAccountNonce(
-        address _address
-    )
-        internal
-        returns (
-            uint256 _nonce
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.getAccountNonce(_address);
-    }
- 
-    /**
-     * Retrieves the Ethereum address of an account.
-     * @param _address Address of the account to access.
-     * @return _ethAddress Corresponding Ethereum address.
-     */
-    function _getAccountEthAddress(
-        address _address
-    )
-        internal
-        returns (
-            address _ethAddress
-        )
-    {
-        _checkAccountLoad(_address);
-        return ovmStateManager.getAccountEthAddress(_address);
-    }
- 
-    /**
-     * Creates the default account object for the given address.
-     * @param _address Address of the account create.
-     */
-    function _initPendingAccount(
-        address _address
-    )
-        internal
-    {
-        // Although it seems like `_checkAccountChange` would be more appropriate here, we don't
-        // actually consider an account "changed" until it's inserted into the state (in this case
-        // by `_commitPendingAccount`).
-        _checkAccountLoad(_address);
-        ovmStateManager.initPendingAccount(_address);
-    }
- 
-    /**
-     * Stores additional relevant data for a new account, thereby "committing" it to the state.
-     * This function is only called during `ovmCREATE` and `ovmCREATE2` after a successful contract
-     * creation.
-     * @param _address Address of the account to commit.
-     * @param _ethAddress Address of the associated deployed contract.
-     * @param _codeHash Hash of the code stored at the address.
-     */
-    function _commitPendingAccount(
-        address _address,
-        address _ethAddress,
-        bytes32 _codeHash
-    )
-        internal
-    {
-        _checkAccountChange(_address);
-        ovmStateManager.commitPendingAccount(
-            _address,
-            _ethAddress,
-            _codeHash
-        );
-    }
- 
-    /**
-     * Retrieves the value of a storage slot.
-     * @param _contract Address of the contract to query.
-     * @param _key 32 byte key of the storage slot.
-     * @return _value 32 byte storage slot value.
-     */
-    function _getContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-        returns (
-            bytes32 _value
-        )
-    {
-        _checkContractStorageLoad(_contract, _key);
-        return ovmStateManager.getContractStorage(_contract, _key);
-    }
- 
-    /**
-     * Sets the value of a storage slot.
-     * @param _contract Address of the contract to modify.
-     * @param _key 32 byte key of the storage slot.
-     * @param _value 32 byte storage slot value.
-     */
-    function _putContractStorage(
-        address _contract,
-        bytes32 _key,
-        bytes32 _value
-    )
-        internal
-    {
-        // We don't set storage if the value didn't change. Although this acts as a convenient
-        // optimization, it's also necessary to avoid the case in which a contract with no storage
-        // attempts to store the value "0" at any key. Putting this value (and therefore requiring
-        // that the value be committed into the storage trie after execution) would incorrectly
-        // modify the storage root.
-        Iif (_getContractStorage(_contract, _key) == _value) {
-            return;
-        }
- 
-        _checkContractStorageChange(_contract, _key);
-        ovmStateManager.putContractStorage(_contract, _key, _value);
-    }
- 
-    /**
-     * Validation whenever a contract needs to be loaded. Checks that the account exists, charges
-     * nuisance gas if the account hasn't been loaded before.
-     * @param _address Address of the account to load.
-     */
-    function _checkAccountLoad(
-        address _address
-    )
-        internal
-    {
-        // See `_checkContractStorageLoad` for more information.
-        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
-            _revertWithFlag(RevertFlag.OUT_OF_GAS);
-        }
- 
-        // See `_checkContractStorageLoad` for more information.
-        if (ovmStateManager.hasAccount(_address) == false) {
-            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
-        }
- 
-        // Check whether the account has been loaded before and mark it as loaded if not. We need
-        // this because "nuisance gas" only applies to the first time that an account is loaded.
-        (
-            bool _wasAccountAlreadyLoaded
-        ) = ovmStateManager.testAndSetAccountLoaded(_address);
- 
-        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
-        // on the size of the contract code.
-        if (_wasAccountAlreadyLoaded == false) {
-            _useNuisanceGas(
-                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
-            );
-        }
-    }
- 
-    /**
-     * Validation whenever a contract needs to be changed. Checks that the account exists, charges
-     * nuisance gas if the account hasn't been changed before.
-     * @param _address Address of the account to change.
-     */
-    function _checkAccountChange(
-        address _address
-    )
-        internal
-    {
-        // Start by checking for a load as we only want to charge nuisance gas proportional to
-        // contract size once.
-        _checkAccountLoad(_address);
- 
-        // Check whether the account has been changed before and mark it as changed if not. We need
-        // this because "nuisance gas" only applies to the first time that an account is changed.
-        (
-            bool _wasAccountAlreadyChanged
-        ) = ovmStateManager.testAndSetAccountChanged(_address);
- 
-        // If we hadn't already loaded the account, then we'll need to charge "nuisance gas" based
-        // on the size of the contract code.
-        if (_wasAccountAlreadyChanged == false) {
-            ovmStateManager.incrementTotalUncommittedAccounts();
-            _useNuisanceGas(
-                (Lib_EthUtils.getCodeSize(_getAccountEthAddress(_address)) * NUISANCE_GAS_PER_CONTRACT_BYTE) + MIN_NUISANCE_GAS_PER_CONTRACT
-            );
-        }
-    }
- 
-    /**
-     * Validation whenever a slot needs to be loaded. Checks that the account exists, charges
-     * nuisance gas if the slot hasn't been loaded before.
-     * @param _contract Address of the account to load from.
-     * @param _key 32 byte key to load.
-     */
-    function _checkContractStorageLoad(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-    {
-        // Another case of hidden complexity. If we didn't enforce this requirement, then a
-        // contract could pass in just enough gas to cause the INVALID_STATE_ACCESS check to fail
-        // on L1 but not on L2. A contract could use this behavior to prevent the
-        // OVM_ExecutionManager from detecting an invalid state access. Reverting with OUT_OF_GAS
-        // allows us to also charge for the full message nuisance gas, because you deserve that for
-        // trying to break the contract in this way.
-        Iif (gasleft() < MIN_GAS_FOR_INVALID_STATE_ACCESS) {
-            _revertWithFlag(RevertFlag.OUT_OF_GAS);
-        }
- 
-        // We need to make sure that the transaction isn't trying to access storage that hasn't
-        // been provided to the OVM_StateManager. We'll immediately abort if this is the case.
-        // We know that we have enough gas to do this check because of the above test.
-        Iif (ovmStateManager.hasContractStorage(_contract, _key) == false) {
-            _revertWithFlag(RevertFlag.INVALID_STATE_ACCESS);
-        }
- 
-        // Check whether the slot has been loaded before and mark it as loaded if not. We need
-        // this because "nuisance gas" only applies to the first time that a slot is loaded.
-        (
-            bool _wasContractStorageAlreadyLoaded
-        ) = ovmStateManager.testAndSetContractStorageLoaded(_contract, _key);
- 
-        // If we hadn't already loaded the account, then we'll need to charge some fixed amount of
-        // "nuisance gas".
-        if (_wasContractStorageAlreadyLoaded == false) {
-            _useNuisanceGas(NUISANCE_GAS_SLOAD);
-        }
-    }
- 
-    /**
-     * Validation whenever a slot needs to be changed. Checks that the account exists, charges
-     * nuisance gas if the slot hasn't been changed before.
-     * @param _contract Address of the account to change.
-     * @param _key 32 byte key to change.
-     */
-    function _checkContractStorageChange(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-    {
-        // Start by checking for load to make sure we have the storage slot and that we charge the
-        // "nuisance gas" necessary to prove the storage slot state.
-        _checkContractStorageLoad(_contract, _key);
- 
-        // Check whether the slot has been changed before and mark it as changed if not. We need
-        // this because "nuisance gas" only applies to the first time that a slot is changed.
-        (
-            bool _wasContractStorageAlreadyChanged
-        ) = ovmStateManager.testAndSetContractStorageChanged(_contract, _key);
- 
-        // If we hadn't already changed the account, then we'll need to charge some fixed amount of
-        // "nuisance gas".
-        Eif (_wasContractStorageAlreadyChanged == false) {
-            // Changing a storage slot means that we're also going to have to change the
-            // corresponding account, so do an account change check.
-            _checkAccountChange(_contract);
- 
-            ovmStateManager.incrementTotalUncommittedContractStorage();
-            _useNuisanceGas(NUISANCE_GAS_SSTORE);
-        }
-    }
- 
- 
-    /************************************
-     * Internal Functions: Revert Logic *
-     ************************************/
- 
-    /**
-     * Simple encoding for revert data.
-     * @param _flag Flag to revert with.
-     * @param _data Additional user-provided revert data.
-     * @return _revertdata Encoded revert data.
-     */
-    function _encodeRevertData(
-        RevertFlag _flag,
-        bytes memory _data
-    )
-        internal
-        view
-        returns (
-            bytes memory _revertdata
-        )
-    {
-        // Out of gas and create exceptions will fundamentally return no data, so simulating it shouldn't either.
-        Iif (
-            _flag == RevertFlag.OUT_OF_GAS
-        ) {
-            return bytes('');
-        }
- 
-        // INVALID_STATE_ACCESS doesn't need to return any data other than the flag.
-        if (_flag == RevertFlag.INVALID_STATE_ACCESS) {
-            return abi.encode(
-                _flag,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        // Just ABI encode the rest of the parameters.
-        return abi.encode(
-            _flag,
-            messageRecord.nuisanceGasLeft,
-            transactionRecord.ovmGasRefund,
-            _data
-        );
-    }
- 
-    /**
-     * Simple decoding for revert data.
-     * @param _revertdata Revert data to decode.
-     * @return _flag Flag used to revert.
-     * @return _nuisanceGasLeft Amount of nuisance gas unused by the message.
-     * @return _ovmGasRefund Amount of gas refunded during the message.
-     * @return _data Additional user-provided revert data.
-     */
-    function _decodeRevertData(
-        bytes memory _revertdata
-    )
-        internal
-        pure
-        returns (
-            RevertFlag _flag,
-            uint256 _nuisanceGasLeft,
-            uint256 _ovmGasRefund,
-            bytes memory _data
-        )
-    {
-        // A length of zero means the call ran out of gas, just return empty data.
-        if (_revertdata.length == 0) {
-            return (
-                RevertFlag.OUT_OF_GAS,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        // ABI decode the incoming data.
-        return abi.decode(_revertdata, (RevertFlag, uint256, uint256, bytes));
-    }
- 
-    /**
-     * Causes a message to revert or abort.
-     * @param _flag Flag to revert with.
-     * @param _data Additional user-provided data.
-     */
-    function _revertWithFlag(
-        RevertFlag _flag,
-        bytes memory _data
-    )
-        internal
-        view
-    {
-        bytes memory revertdata = _encodeRevertData(
-            _flag,
-            _data
-        );
- 
-        assembly {
-            revert(add(revertdata, 0x20), mload(revertdata))
-        }
-    }
- 
-    /**
-     * Causes a message to revert or abort.
-     * @param _flag Flag to revert with.
-     */
-    function _revertWithFlag(
-        RevertFlag _flag
-    )
-        internal
-    {
-        _revertWithFlag(_flag, bytes(''));
-    }
- 
- 
-    /******************************************
-     * Internal Functions: Nuisance Gas Logic *
-     ******************************************/
- 
-    /**
-     * Computes the nuisance gas limit from the gas limit.
-     * @dev This function is currently using a naive implementation whereby the nuisance gas limit
-     *      is set to exactly equal the lesser of the gas limit or remaining gas. It's likely that
-     *      this implementation is perfectly fine, but we may change this formula later.
-     * @param _gasLimit Gas limit to compute from.
-     * @return _nuisanceGasLimit Computed nuisance gas limit.
-     */
-    function _getNuisanceGasLimit(
-        uint256 _gasLimit
-    )
-        internal
-        view
-        returns (
-            uint256 _nuisanceGasLimit
-        )
-    {
-        return _gasLimit < gasleft() ? _gasLimit : gasleft();
-    }
- 
-    /**
-     * Uses a certain amount of nuisance gas.
-     * @param _amount Amount of nuisance gas to use.
-     */
-    function _useNuisanceGas(
-        uint256 _amount
-    )
-        internal
-    {
-        // Essentially the same as a standard OUT_OF_GAS, except we also retain a record of the gas
-        // refund to be given at the end of the transaction.
-        Iif (messageRecord.nuisanceGasLeft < _amount) {
-            _revertWithFlag(RevertFlag.EXCEEDS_NUISANCE_GAS);
-        }
- 
-        messageRecord.nuisanceGasLeft -= _amount;
-    }
- 
- 
-    /************************************
-     * Internal Functions: Gas Metering *
-     ************************************/
- 
-    /**
-     * Checks whether a transaction needs to start a new epoch and does so if necessary.
-     * @param _timestamp Transaction timestamp.
-     */
-    function _checkNeedsNewEpoch(
-        uint256 _timestamp
-    )
-        internal
-    {
-        if (
-            _timestamp >= (
-                _getGasMetadata(GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP)
-                + gasMeterConfig.secondsPerEpoch
-            )
-        ) {
-            _putGasMetadata(
-                GasMetadataKey.CURRENT_EPOCH_START_TIMESTAMP,
-                _timestamp
-            );
- 
-            _putGasMetadata(
-                GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS,
-                _getGasMetadata(
-                    GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS
-                )
-            );
- 
-            _putGasMetadata(
-                GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS,
-                _getGasMetadata(
-                    GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS
-                )
-            );
-        }
-    }
- 
-    /**
-     * Validates the gas limit for a given transaction.
-     * @param _gasLimit Gas limit provided by the transaction.
-     * param _queueOrigin Queue from which the transaction originated.
-     * @return _valid Whether or not the gas limit is valid.
-     */
-    function _isValidGasLimit(
-        uint256 _gasLimit,
-        Lib_OVMCodec.QueueOrigin // _queueOrigin
-    )
-        view
-        internal
-        returns (
-            bool _valid
-        )
-    {
-        // Always have to be below the maximum gas limit.
-        Iif (_gasLimit > gasMeterConfig.maxTransactionGasLimit) {
-            return false;
-        }
- 
-        // Always have to be above the minimum gas limit.
-        Iif (_gasLimit < gasMeterConfig.minTransactionGasLimit) {
-            return false;
-        }
- 
-        // TEMPORARY: Gas metering is disabled for minnet.
-        return true;
-        // GasMetadataKey cumulativeGasKey;
-        // GasMetadataKey prevEpochGasKey;
-        // if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
-        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
-        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_SEQUENCER_QUEUE_GAS;
-        // } else {
-        //     cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
-        //     prevEpochGasKey = GasMetadataKey.PREV_EPOCH_L1TOL2_QUEUE_GAS;
-        // }
- 
-        // return (
-        //     (
-        //         _getGasMetadata(cumulativeGasKey)
-        //         - _getGasMetadata(prevEpochGasKey)
-        //         + _gasLimit
-        //     ) < gasMeterConfig.maxGasPerQueuePerEpoch
-        // );
-    }
- 
-    /**
-     * Updates the cumulative gas after a transaction.
-     * @param _gasUsed Gas used by the transaction.
-     * @param _queueOrigin Queue from which the transaction originated.
-     */
-    function _updateCumulativeGas(
-        uint256 _gasUsed,
-        Lib_OVMCodec.QueueOrigin _queueOrigin
-    )
-        internal
-    {
-        GasMetadataKey cumulativeGasKey;
-        if (_queueOrigin == Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE) {
-            cumulativeGasKey = GasMetadataKey.CUMULATIVE_SEQUENCER_QUEUE_GAS;
-        } else {
-            cumulativeGasKey = GasMetadataKey.CUMULATIVE_L1TOL2_QUEUE_GAS;
-        }
- 
-        _putGasMetadata(
-            cumulativeGasKey,
-            (
-                _getGasMetadata(cumulativeGasKey)
-                + gasMeterConfig.minTransactionGasLimit
-                + _gasUsed
-                - transactionRecord.ovmGasRefund
-            )
-        );
-    }
- 
-    /**
-     * Retrieves the value of a gas metadata key.
-     * @param _key Gas metadata key to retrieve.
-     * @return _value Value stored at the given key.
-     */
-    function _getGasMetadata(
-        GasMetadataKey _key
-    )
-        internal
-        returns (
-            uint256 _value
-        )
-    {
-        return uint256(_getContractStorage(
-            GAS_METADATA_ADDRESS,
-            bytes32(uint256(_key))
-        ));
-    }
- 
-    /**
-     * Sets the value of a gas metadata key.
-     * @param _key Gas metadata key to set.
-     * @param _value Value to store at the given key.
-     */
-    function _putGasMetadata(
-        GasMetadataKey _key,
-        uint256 _value
-    )
-        internal
-    {
-        _putContractStorage(
-            GAS_METADATA_ADDRESS,
-            bytes32(uint256(_key)),
-            bytes32(uint256(_value))
-        );
-    }
- 
- 
-    /*****************************************
-     * Internal Functions: Execution Context *
-     *****************************************/
- 
-    /**
-     * Swaps over to a new message context.
-     * @param _prevMessageContext Context we're switching from.
-     * @param _nextMessageContext Context we're switching to.
-     */
-    function _switchMessageContext(
-        MessageContext memory _prevMessageContext,
-        MessageContext memory _nextMessageContext
-    )
-        internal
-    {
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.ovmCALLER != _nextMessageContext.ovmCALLER) {
-            messageContext.ovmCALLER = _nextMessageContext.ovmCALLER;
-        }
- 
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.ovmADDRESS != _nextMessageContext.ovmADDRESS) {
-            messageContext.ovmADDRESS = _nextMessageContext.ovmADDRESS;
-        }
- 
-        // Avoid unnecessary the SSTORE.
-        if (_prevMessageContext.isStatic != _nextMessageContext.isStatic) {
-            messageContext.isStatic = _nextMessageContext.isStatic;
-        }
-    }
- 
-    /**
-     * Initializes the execution context.
-     * @param _transaction OVM transaction being executed.
-     */
-    function _initContext(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        internal
-    {
-        transactionContext.ovmTIMESTAMP = _transaction.timestamp;
-        transactionContext.ovmNUMBER = _transaction.blockNumber;
-        transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
-        transactionContext.ovmL1QUEUEORIGIN = _transaction.l1QueueOrigin;
-        transactionContext.ovmL1TXORIGIN = _transaction.l1TxOrigin;
-        transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
- 
-        messageRecord.nuisanceGasLeft = _getNuisanceGasLimit(_transaction.gasLimit);
-    }
- 
-    /**
-     * Resets the transaction and message context.
-     */
-    function _resetContext()
-        internal
-    {
-        transactionContext.ovmL1TXORIGIN = address(0);
-        transactionContext.ovmTIMESTAMP = 0;
-        transactionContext.ovmNUMBER = 0;
-        transactionContext.ovmGASLIMIT = 0;
-        transactionContext.ovmTXGASLIMIT = 0;
-        transactionContext.ovmL1QUEUEORIGIN = Lib_OVMCodec.QueueOrigin.SEQUENCER_QUEUE;
- 
-        transactionRecord.ovmGasRefund = 0;
- 
-        messageContext.ovmCALLER = address(0);
-        messageContext.ovmADDRESS = address(0);
-        messageContext.isStatic = false;
- 
-        messageRecord.nuisanceGasLeft = 0;
-    }
- 
-    /*****************************
-     * L2-only Helper Functions *
-     *****************************/
- 
-    /**
-     * Unreachable helper function for simulating eth_calls with an OVM message context.
-     * This function will throw an exception in all cases other than when used as a custom entrypoint in L2 Geth to simulate eth_call.
-     * @param _transaction the message transaction to simulate.
-     * @param _from the OVM account the simulated call should be from.
-     */
-    function simulateMessage(
-        Lib_OVMCodec.Transaction memory _transaction,
-        address _from,
-        iOVM_StateManager _ovmStateManager
-    )
-        external
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        // Prevent this call from having any effect unless in a custom-set VM frame
-        require(msg.sender == address(0));
- 
-        ovmStateManager = _ovmStateManager;
-        _initContext(_transaction);
-        messageRecord.nuisanceGasLeft = uint(-1);
- 
-        messageContext.ovmADDRESS = _from;
- 
-        bool isCreate = _transaction.entrypoint == address(0);
-        if (isCreate) {
-            (address created, bytes memory revertData) = ovmCREATE(_transaction.data);
-            if (created == address(0)) {
-                return (false, revertData);
-            } else {
-                // The eth_call RPC endpoint for to = undefined will return the deployed bytecode 
-                // in the success case, differing from standard create messages.
-                return (true, Lib_EthUtils.getCode(created));
-            }
-        } else {
-            return ovmCALL(
-                _transaction.gasLimit,
-                _transaction.entrypoint,
-                _transaction.data
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html b/coverage/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html deleted file mode 100644 index 90baa02d9..000000000 --- a/coverage/optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol.html +++ /dev/null @@ -1,509 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/OVM_SafetyChecker.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/execution/ OVM_SafetyChecker.sol -

-
-
- 100% - Statements - 8/8 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 10/10 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -277× -  -  -  -  -  -  -  -  -  -  -277× -  -277× -  -277× -  -277× -277× -277× -  -  -277× -277× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -152× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_SafetyChecker } from "../../iOVM/execution/iOVM_SafetyChecker.sol";
- 
-/**
- * @title OVM_SafetyChecker
- * @dev  The Safety Checker verifies that contracts deployed on L2 do not contain any
- * "unsafe" operations. An operation is considered unsafe if it would access state variables which
- * are specific to the environment (ie. L1 or L2) in which it is executed, as this could be used
- * to "escape the sandbox" of the OVM, resulting in non-deterministic fraud proofs. 
- * That is, an attacker would be able to "prove fraud" on an honestly applied transaction.
- * Note that a "safe" contract requires opcodes to appear in a particular pattern;
- * omission of "unsafe" opcodes is necessary, but not sufficient.
- *
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_SafetyChecker is iOVM_SafetyChecker {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Returns whether or not all of the provided bytecode is safe.
-     * @param _bytecode The bytecode to safety check.
-     * @return `true` if the bytecode is safe, `false` otherwise.
-     */
-    function isBytecodeSafe(
-        bytes memory _bytecode
-    )
-        override
-        external
-        pure
-        returns (
-            bool
-        )
-    {
-        // autogenerated by gen_safety_checker_constants.py
-        // number of bytes to skip for each opcode
-        uint256[8] memory opcodeSkippableBytes = [
-            uint256(0x0001010101010101010101010000000001010101010101010101010101010000),
-            uint256(0x0100000000000000000000000000000000000000010101010101000000010100),
-            uint256(0x0000000000000000000000000000000001010101000000010101010100000000),
-            uint256(0x0203040500000000000000000000000000000000000000000000000000000000),
-            uint256(0x0101010101010101010101010101010101010101010101010101010101010101),
-            uint256(0x0101010101000000000000000000000000000000000000000000000000000000),
-            uint256(0x0000000000000000000000000000000000000000000000000000000000000000),
-            uint256(0x0000000000000000000000000000000000000000000000000000000000000000)
-        ];
-        // Mask to gate opcode specific cases
-        uint256 opcodeGateMask = ~uint256(0xffffffffffffffffffffffe000000000fffffffff070ffff9c0ffffec000f001);
-        // Halting opcodes
-        uint256 opcodeHaltingMask = ~uint256(0x4008000000000000000000000000000000000000004000000000000000000001);
-        // PUSH opcodes
-        uint256 opcodePushMask = ~uint256(0xffffffff000000000000000000000000);
- 
-        uint256 codeLength;
-        uint256 _pc;
-        assembly {
-            _pc := add(_bytecode, 0x20)
-        }
-        codeLength = _pc + _bytecode.length;
-        do {
-            // current opcode: 0x00...0xff
-            uint256 opNum;
- 
-            // inline assembly removes the extra add + bounds check
-            assembly {
-                let word := mload(_pc) //load the next 32 bytes at pc into word
- 
-                // Look up number of bytes to skip from opcodeSkippableBytes and then update indexInWord
-                // E.g. the 02030405 in opcodeSkippableBytes is the number of bytes to skip for PUSH1->4
-                // We repeat this 6 times, thus we can only skip bytes for up to PUSH4 ((1+4) * 6 = 30 < 32).
-                // If we see an opcode that is listed as 0 skippable bytes e.g. PUSH5,
-                // then we will get stuck on that indexInWord and then opNum will be set to the PUSH5 opcode.
-                let indexInWord := byte(0, mload(add(opcodeSkippableBytes, byte(0, word))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                indexInWord := add(indexInWord, byte(0, mload(add(opcodeSkippableBytes, byte(indexInWord, word)))))
-                _pc := add(_pc, indexInWord)
- 
-                opNum := byte(indexInWord, word)
-            }
- 
-            // + push opcodes
-            // + stop opcodes [STOP(0x00),JUMP(0x56),RETURN(0xf3),INVALID(0xfe)]
-            // + caller opcode CALLER(0x33)
-            // + blacklisted opcodes
-            uint256 opBit = 1 << opNum;
-            if (opBit & opcodeGateMask == 0) {
-                if (opBit & opcodePushMask == 0) {
-                    // all pushes are valid opcodes
-                    // subsequent bytes are not opcodes. Skip them.
-                    _pc += (opNum - 0x5e); // PUSH1 is 0x60, so opNum-0x5f = PUSHed bytes and we +1 to
-                    // skip the _pc++; line below in order to save gas ((-0x5f + 1) = -0x5e)
-                    continue;
-                } else if (opBit & opcodeHaltingMask == 0) {
-                    // STOP or JUMP or RETURN or INVALID (Note: REVERT is blacklisted, so not included here)
-                    // We are now inside unreachable code until we hit a JUMPDEST!
-                    do {
-                        _pc++;
-                        assembly {
-                            opNum := byte(0, mload(_pc))
-                        }
-                        // encountered a JUMPDEST
-                        if (opNum == 0x5b) break;
-                        // skip PUSHed bytes
-                        if ((1 << opNum) & opcodePushMask == 0) _pc += (opNum - 0x5f); // opNum-0x5f = PUSHed bytes (PUSH1 is 0x60)
-                    } while (_pc < codeLength);
-                    // opNum is 0x5b, so we don't continue here since the pc++ is fine
-                } else if (opNum == 0x33) { // Caller opcode
-                    uint256 firstOps; // next 32 bytes of bytecode
-                    uint256 secondOps; // following 32 bytes of bytecode
- 
-                    assembly {
-                        firstOps := mload(_pc)
-                        // 37 bytes total, 5 left over --> 32 - 5 bytes = 27 bytes = 216 bits
-                        secondOps := shr(216, mload(add(_pc, 0x20)))
-                    }
- 
-                    // Call identity precompile
-                    // CALLER POP PUSH1 0x00 PUSH1 0x04 GAS CALL
-                    // 32 - 8 bytes = 24 bytes = 192
-                    if ((firstOps >> 192) == 0x3350600060045af1) {
-                        _pc += 8;
-                    // Call EM and abort execution if instructed
-                    // CALLER PUSH1 0x00 SWAP1 GAS CALL PC PUSH1 0x0E ADD JUMPI RETURNDATASIZE PUSH1 0x00 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x00 REVERT JUMPDEST RETURNDATASIZE PUSH1 0x01 EQ ISZERO PC PUSH1 0x0a ADD JUMPI PUSH1 0x01 PUSH1 0x00 RETURN JUMPDEST 
-                    } else if (firstOps == 0x336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760 && secondOps == 0x016000f35b) {
-                        _pc += 37;
-                    } else {
-                        return false;
-                    }
-                    continue;
-                } else {
-                    // encountered a non-whitelisted opcode!
-                    return false;
-                }
-            }
-            _pc++;
-        } while (_pc < codeLength);
-        return true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html b/coverage/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html deleted file mode 100644 index 35ac577fa..000000000 --- a/coverage/optimistic-ethereum/OVM/execution/OVM_StateManager.sol.html +++ /dev/null @@ -1,2279 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/OVM_StateManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/execution/ OVM_StateManager.sol -

-
-
- 79.69% - Statements - 51/64 -
-
- 100% - Branches - 12/12 -
-
- 80% - Functions - 28/35 -
-
- 80% - Lines - 52/65 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -348× -  -  -  -  -  -  -  -  -  -  -  -  -  -1041× -  -  -  -1040× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -58× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -33× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -35× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -62× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -371× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -32× -32× -32× -32× -32× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -19× -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -543× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -66× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -73× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -38× -  -  -  -  -  -  -38× -23× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -62× -  -  -  - -  -  -  -55× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -77× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -74× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -33× -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -616× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -107× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -707× -  -707× -282× -  -  -707× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
- 
-/**
- * @title OVM_StateManager
- * @dev The State Manager contract holds all storage values for contracts in the OVM. It can only be written to by the
- * the Execution Manager and State Transitioner. It runs on L1 during the setup and execution of a fraud proof.
- * The same logic runs on L2, but has been implemented as a precompile in the L2 go-ethereum client
- * (see https://github.com/ethereum-optimism/go-ethereum/blob/master/core/vm/ovm_state_manager.go).
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateManager is iOVM_StateManager {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 constant internal EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
-    bytes32 constant internal EMPTY_ACCOUNT_CODE_HASH =    0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
-    bytes32 constant internal STORAGE_XOR_VALUE =          0xFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEFFEEDFACECAFEBEEF;
- 
- 
-    /*************
-     * Variables *
-     *************/
- 
-    address override public owner;
-    address override public ovmExecutionManager;
-    mapping (address => Lib_OVMCodec.Account) internal accounts;
-    mapping (address => mapping (bytes32 => bytes32)) internal contractStorage;
-    mapping (address => mapping (bytes32 => bool)) internal verifiedContractStorage;
-    mapping (bytes32 => ItemState) internal itemStates;
-    uint256 internal totalUncommittedAccounts;
-    uint256 internal totalUncommittedContractStorage;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _owner Address of the owner of this contract.
-     */
-    constructor(
-        address _owner
-    )
-    {
-        owner = _owner;
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Simple authentication, this contract should only be accessible to the owner (which is expected to be the State Transitioner during `PRE_EXECUTION` 
-     * or the OVM_ExecutionManager during transaction execution.
-     */
-    modifier authenticated() {
-        // owner is the State Transitioner
-        require(
-            msg.sender == owner || msg.sender == ovmExecutionManager,
-            "Function can only be called by authenticated addresses"
-        );
-        _;
-    }
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Checks whether a given address is allowed to modify this contract.
-     * @param _address Address to check.
-     * @return Whether or not the address can modify this contract.
-     */
-    function isAuthenticated(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return (_address == owner || _address == ovmExecutionManager);
-    }
- 
-    /**
-     * Sets the address of the OVM_ExecutionManager.
-     * @param _ovmExecutionManager Address of the OVM_ExecutionManager.
-     */
-    function setExecutionManager(
-        address _ovmExecutionManager
-    )
-        override
-        public
-        authenticated
-    {
-        ovmExecutionManager = _ovmExecutionManager;
-    }
- 
-    /**
-     * Inserts an account into the state.
-     * @param _address Address of the account to insert.
-     * @param _account Account to insert for the given address.
-     */
-    function putAccount(
-        address _address,
-        Lib_OVMCodec.Account memory _account
-    )
-        override
-        public
-        authenticated
-    {
-        accounts[_address] = _account;
-    }
- 
-    /**
-     * Marks an account as empty.
-     * @param _address Address of the account to mark.
-     */
-    function putEmptyAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
-        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
-    }
- 
-    /**
-     * Retrieves an account from the state.
-     * @param _address Address of the account to retrieve.
-     * @return Account for the given address.
-     */
-    function getAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            Lib_OVMCodec.Account memory
-        )
-    {
-        return accounts[_address];
-    }
- 
-    /**
-     * Checks whether the state has a given account.
-     * @param _address Address of the account to check.
-     * @return Whether or not the state has the account.
-     */
-    function hasAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return accounts[_address].codeHash != bytes32(0);
-    }
- 
-    /**
-     * Checks whether the state has a given known empty account.
-     * @param _address Address of the account to check.
-     * @return Whether or not the state has the empty account.
-     */
-    function hasEmptyAccount(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return (
-            accounts[_address].codeHash == EMPTY_ACCOUNT_CODE_HASH
-            && accounts[_address].nonce == 0
-        );
-    }
- 
-    /**
-     * Sets the nonce of an account.
-     * @param _address Address of the account to modify.
-     * @param _nonce New account nonce.
-     */
-    function setAccountNonce(
-        address _address,
-        uint256 _nonce
-    )
-        override
-        public
-        authenticated
-    {
-        accounts[_address].nonce = _nonce;
-    }
- 
-    /**
-     * Gets the nonce of an account.
-     * @param _address Address of the account to access.
-     * @return Nonce of the account.
-     */
-    function getAccountNonce(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return accounts[_address].nonce;
-    }
- 
-    /**
-     * Retrieves the Ethereum address of an account.
-     * @param _address Address of the account to access.
-     * @return Corresponding Ethereum address.
-     */
-    function getAccountEthAddress(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            address
-        )
-    {
-        return accounts[_address].ethAddress;
-    }
- 
-    /**
-     * Retrieves the storage root of an account.
-     * @param _address Address of the account to access.
-     * @return Corresponding storage root.
-     */
-    function getAccountStorageRoot(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        return accounts[_address].storageRoot;
-    }
- 
-    /**
-     * Initializes a pending account (during CREATE or CREATE2) with the default values.
-     * @param _address Address of the account to initialize.
-     */
-    function initPendingAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.nonce = 1;
-        account.storageRoot = EMPTY_ACCOUNT_STORAGE_ROOT;
-        account.codeHash = EMPTY_ACCOUNT_CODE_HASH;
-        account.isFresh = true;
-    }
- 
-    /**
-     * Finalizes the creation of a pending account (during CREATE or CREATE2).
-     * @param _address Address of the account to finalize.
-     * @param _ethAddress Address of the account's associated contract on Ethereum.
-     * @param _codeHash Hash of the account's code.
-     */
-    function commitPendingAccount(
-        address _address,
-        address _ethAddress,
-        bytes32 _codeHash
-    )
-        override
-        public
-        authenticated
-    {
-        Lib_OVMCodec.Account storage account = accounts[_address];
-        account.ethAddress = _ethAddress;
-        account.codeHash = _codeHash;
-    }
- 
-    /**
-     * Checks whether an account has already been retrieved, and marks it as retrieved if not.
-     * @param _address Address of the account to check.
-     * @return Whether or not the account was already loaded.
-     */
-    function testAndSetAccountLoaded(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_address),
-            ItemState.ITEM_LOADED
-        );
-    }
- 
-    /**
-     * Checks whether an account has already been modified, and marks it as modified if not.
-     * @param _address Address of the account to check.
-     * @return Whether or not the account was already modified.
-     */
-    function testAndSetAccountChanged(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_address),
-            ItemState.ITEM_CHANGED
-        );
-    }
- 
-    /**
-     * Attempts to mark an account as committed.
-     * @param _address Address of the account to commit.
-     * @return Whether or not the account was committed.
-     */
-    function commitAccount(
-        address _address
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        if (itemStates[item] != ItemState.ITEM_CHANGED) {
-            return false;
-        }
- 
-        itemStates[item] = ItemState.ITEM_COMMITTED;
-        totalUncommittedAccounts -= 1;
- 
-        return true;
-    }
- 
-    /**
-     * Increments the total number of uncommitted accounts.
-     */
-    function incrementTotalUncommittedAccounts()
-        override
-        public
-        authenticated
-    {
-        totalUncommittedAccounts += 1;
-    }
- 
-    /**
-     * Gets the total number of uncommitted accounts.
-     * @return Total uncommitted accounts.
-     */
-    function getTotalUncommittedAccounts()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return totalUncommittedAccounts;
-    }
- 
-    /**
-     * Checks whether a given account was changed during execution.
-     * @param _address Address to check.
-     * @return Whether or not the account was changed.
-     */
-    function wasAccountChanged(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        return itemStates[item] >= ItemState.ITEM_CHANGED;
-    }
- 
-    /**
-     * Checks whether a given account was committed after execution.
-     * @param _address Address to check.
-     * @return Whether or not the account was committed.
-     */
-    function wasAccountCommitted(
-        address _address
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_address);
-        return itemStates[item] >= ItemState.ITEM_COMMITTED;
-    }
- 
- 
-    /************************************
-     * Public Functions: Storage Access *
-     ************************************/
- 
-    /**
-     * Changes a contract storage slot value.
-     * @param _contract Address of the contract to modify.
-     * @param _key 32 byte storage slot key.
-     * @param _value 32 byte storage slot value.
-     */
-    function putContractStorage(
-        address _contract,
-        bytes32 _key,
-        bytes32 _value
-    )
-        override
-        public
-        authenticated
-    {
-        // A hilarious optimization. `SSTORE`ing a value of `bytes32(0)` is common enough that it's
-        // worth populating this with a non-zero value in advance (during the fraud proof
-        // initialization phase) to cut the execution-time cost down to 5000 gas.
-        contractStorage[_contract][_key] = _value ^ STORAGE_XOR_VALUE;
- 
-        // Only used when initially populating the contract storage. OVM_ExecutionManager will
-        // perform a `hasContractStorage` INVALID_STATE_ACCESS check before putting any contract
-        // storage because writing to zero when the actual value is nonzero causes a gas
-        // discrepancy. Could be moved into a new `putVerifiedContractStorage` function, or
-        // something along those lines.
-        if (verifiedContractStorage[_contract][_key] == false) {
-            verifiedContractStorage[_contract][_key] = true;
-        }
-    }
- 
-    /**
-     * Retrieves a contract storage slot value.
-     * @param _contract Address of the contract to access.
-     * @param _key 32 byte storage slot key.
-     * @return 32 byte storage slot value.
-     */
-    function getContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bytes32
-        )
-    {
-        // Storage XOR system doesn't work for newly created contracts that haven't set this
-        // storage slot value yet.
-        if (
-            verifiedContractStorage[_contract][_key] == false
-            && accounts[_contract].isFresh
-        ) {
-            return bytes32(0);
-        }
- 
-        // See `putContractStorage` for more information about the XOR here.
-        return contractStorage[_contract][_key] ^ STORAGE_XOR_VALUE;
-    }
- 
-    /**
-     * Checks whether a contract storage slot exists in the state.
-     * @param _contract Address of the contract to access.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the key was set in the state.
-     */
-    function hasContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        return verifiedContractStorage[_contract][_key] || accounts[_contract].isFresh;
-    }
- 
-    /**
-     * Checks whether a storage slot has already been retrieved, and marks it as retrieved if not.
-     * @param _contract Address of the contract to check.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the slot was already loaded.
-     */
-    function testAndSetContractStorageLoaded(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_contract, _key),
-            ItemState.ITEM_LOADED
-        );
-    }
- 
-    /**
-     * Checks whether a storage slot has already been modified, and marks it as modified if not.
-     * @param _contract Address of the contract to check.
-     * @param _key 32 byte storage slot key.
-     * @return Whether or not the slot was already modified.
-     */
-    function testAndSetContractStorageChanged(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        return _testAndSetItemState(
-            _getItemHash(_contract, _key),
-            ItemState.ITEM_CHANGED
-        );
-    }
- 
-    /**
-     * Attempts to mark a storage slot as committed.
-     * @param _contract Address of the account to commit.
-     * @param _key 32 byte slot key to commit.
-     * @return Whether or not the slot was committed.
-     */
-    function commitContractStorage(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        authenticated
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        if (itemStates[item] != ItemState.ITEM_CHANGED) {
-            return false;
-        }
- 
-        itemStates[item] = ItemState.ITEM_COMMITTED;
-        totalUncommittedContractStorage -= 1;
- 
-        return true;
-    }
- 
-    /**
-     * Increments the total number of uncommitted storage slots.
-     */
-    function incrementTotalUncommittedContractStorage()
-        override
-        public
-        authenticated
-    {
-        totalUncommittedContractStorage += 1;
-    }
- 
-    /**
-     * Gets the total number of uncommitted storage slots.
-     * @return Total uncommitted storage slots.
-     */
-    function getTotalUncommittedContractStorage()
-        override
-        public
-        view
-        returns (
-            uint256
-        )
-    {
-        return totalUncommittedContractStorage;
-    }
- 
-    /**
-     * Checks whether a given storage slot was changed during execution.
-     * @param _contract Address to check.
-     * @param _key Key of the storage slot to check.
-     * @return Whether or not the storage slot was changed.
-     */
-    function wasContractStorageChanged(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        return itemStates[item] >= ItemState.ITEM_CHANGED;
-    }
- 
-    /**
-     * Checks whether a given storage slot was committed after execution.
-     * @param _contract Address to check.
-     * @param _key Key of the storage slot to check.
-     * @return Whether or not the storage slot was committed.
-     */
-    function wasContractStorageCommitted(
-        address _contract,
-        bytes32 _key
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        bytes32 item = _getItemHash(_contract, _key);
-        return itemStates[item] >= ItemState.ITEM_COMMITTED;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Generates a unique hash for an address.
-     * @param _address Address to generate a hash for.
-     * @return Unique hash for the given address.
-     */
-    function _getItemHash(
-        address _address
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(abi.encodePacked(_address));
-    }
- 
-    /**
-     * Generates a unique hash for an address/key pair.
-     * @param _contract Address to generate a hash for.
-     * @param _key Key to generate a hash for.
-     * @return Unique hash for the given pair.
-     */
-    function _getItemHash(
-        address _contract,
-        bytes32 _key
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(abi.encodePacked(
-            _contract,
-            _key
-        ));
-    }
- 
-    /**
-     * Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets the
-     * item to the provided state if not.
-     * @param _item 32 byte item ID to check.
-     * @param _minItemState Minimum state that must be satisfied by the item.
-     * @return Whether or not the item was already in the state.
-     */
-    function _testAndSetItemState(
-        bytes32 _item,
-        ItemState _minItemState
-    )
-        internal
-        returns (
-            bool
-        )
-    {
-        bool wasItemState = itemStates[_item] >= _minItemState;
- 
-        if (wasItemState == false) {
-            itemStates[_item] = _minItemState;
-        }
- 
-        return wasItemState;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html b/coverage/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html deleted file mode 100644 index 24ddc0ae5..000000000 --- a/coverage/optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/OVM_StateManagerFactory.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/execution/ OVM_StateManagerFactory.sol -

-
-
- 0% - Statements - 0/1 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
- 
-/* Contract Imports */
-import { OVM_StateManager } from "./OVM_StateManager.sol";
- 
-/**
- * @title OVM_StateManagerFactory
- * @dev The State Manager Factory is called by a State Transitioner's init code, to create a new
- * State Manager for use in the Fraud Verification process.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateManagerFactory is iOVM_StateManagerFactory {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Creates a new OVM_StateManager
-     * @param _owner Owner of the created contract.
-     * @return New OVM_StateManager instance.
-     */
-    function create(
-        address _owner
-    )
-        override
-        public
-        returns (
-            iOVM_StateManager
-        )
-    {
-        return new OVM_StateManager(_owner);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/execution/index.html b/coverage/optimistic-ethereum/OVM/execution/index.html deleted file mode 100644 index f8e89be66..000000000 --- a/coverage/optimistic-ethereum/OVM/execution/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/execution/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/execution/ -

-
-
- 81.88% - Statements - 253/309 -
-
- 72.34% - Branches - 68/94 -
-
- 84.69% - Functions - 83/98 -
-
- 82.39% - Lines - 262/318 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_ExecutionManager.sol
82.2%194/23668.29%56/8288.52%54/6182.64%200/242
OVM_SafetyChecker.sol
100%8/8100%0/0100%1/1100%10/10
OVM_StateManager.sol
79.69%51/64100%12/1280%28/3580%52/65
OVM_StateManagerFactory.sol
0%0/1100%0/00%0/10%0/1
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html deleted file mode 100644 index 510331797..000000000 --- a/coverage/optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol.html +++ /dev/null @@ -1,662 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/ERC1820Registry.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ ERC1820Registry.sol -

-
-
- 0% - Statements - 0/38 -
-
- 0% - Branches - 0/22 -
-
- 0% - Functions - 0/10 -
-
- 0% - Lines - 0/39 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: CC0-1.0
-/* ERC1820 Pseudo-introspection Registry Contract
- * This standard defines a universal registry smart contract where any address (contract or regular account) can
- * register which interface it supports and which smart contract is responsible for its implementation.
- *
- * Written in 2019 by Jordi Baylina and Jacques Dafflon
- *
- * To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to
- * this software to the public domain worldwide. This software is distributed without any warranty.
- *
- * You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
- * <http://creativecommons.org/publicdomain/zero/1.0/>.
- */
-pragma solidity >0.5.0 <0.8.0;
- 
-/// @dev The interface a contract MUST implement if it is the implementer of
-/// some (other) interface for any address other than itself.
-interface ERC1820ImplementerInterface {
-    /// @notice Indicates whether the contract implements the interface 'interfaceHash' for the address 'addr' or not.
-    /// @param interfaceHash keccak256 hash of the name of the interface
-    /// @param addr Address for which the contract will implement the interface
-    /// @return ERC1820_ACCEPT_MAGIC only if the contract implements 'interfaceHash' for the address 'addr'.
-    function canImplementInterfaceForAddress(bytes32 interfaceHash, address addr) external view returns(bytes32);
-}
- 
-/**
- * @title ERC1820 Pseudo-introspection Registry Contract
- * @author Jordi Baylina and Jacques Dafflon
- * @dev This contract is the official implementation of the ERC1820 Registry 
- * For more details, see https://eips.ethereum.org/EIPS/eip-1820
- *
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract ERC1820Registry {
-    bytes4 constant internal INVALID_ID = 0xffffffff;
-    bytes4 constant internal ERC165ID = 0x01ffc9a7;
-    bytes32 constant internal ERC1820_ACCEPT_MAGIC = keccak256(abi.encodePacked("ERC1820_ACCEPT_MAGIC"));
- 
-    mapping(address => mapping(bytes32 => address)) internal interfaces;
-    mapping(address => address) internal managers;
-    mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
- 
-    /// @notice Indicates a contract is the 'implementer' of 'interfaceHash' for 'addr'.
-    event InterfaceImplementerSet(address indexed addr, bytes32 indexed interfaceHash, address indexed implementer);
-    /// @notice Indicates 'newManager' is the address of the new manager for 'addr'.
-    event ManagerChanged(address indexed addr, address indexed newManager);
- 
-    /// @notice Query if an address implements an interface and through which contract.
-    /// @param _addr Address being queried for the implementer of an interface.
-    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
-    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
-    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
-    /// @return The address of the contract which implements the interface '_interfaceHash' for '_addr'
-    /// or '0' if '_addr' did not register an implementer for this interface.
-    function getInterfaceImplementer(address _addr, bytes32 _interfaceHash) external view returns (address) {
-        address addr = _addr == address(0) ? msg.sender : _addr;
-        if (isERC165Interface(_interfaceHash)) {
-            bytes4 erc165InterfaceHash = bytes4(_interfaceHash);
-            return implementsERC165Interface(addr, erc165InterfaceHash) ? addr : address(0);
-        }
-        return interfaces[addr][_interfaceHash];
-    }
- 
-    /// @notice Sets the contract which implements a specific interface for an address.
-    /// Only the manager defined for that address can set it.
-    /// (Each address is the manager for itself until it sets a new manager.)
-    /// @param _addr Address for which to set the interface.
-    /// (If '_addr' is the zero address then 'msg.sender' is assumed.)
-    /// @param _interfaceHash Keccak256 hash of the name of the interface as a string.
-    /// E.g., 'web3.utils.keccak256("ERC777TokensRecipient")' for the 'ERC777TokensRecipient' interface.
-    /// @param _implementer Contract address implementing '_interfaceHash' for '_addr'.
-    function setInterfaceImplementer(address _addr, bytes32 _interfaceHash, address _implementer) external {
-        address addr = _addr == address(0) ? msg.sender : _addr;
-        require(getManager(addr) == msg.sender, "Not the manager");
- 
-        require(!isERC165Interface(_interfaceHash), "Must not be an ERC165 hash");
-        if (_implementer != address(0) && _implementer != msg.sender) {
-            require(
-                ERC1820ImplementerInterface(_implementer)
-                    .canImplementInterfaceForAddress(_interfaceHash, addr) == ERC1820_ACCEPT_MAGIC,
-                "Does not implement the interface"
-            );
-        }
-        interfaces[addr][_interfaceHash] = _implementer;
-        emit InterfaceImplementerSet(addr, _interfaceHash, _implementer);
-    }
- 
-    /// @notice Sets '_newManager' as manager for '_addr'.
-    /// The new manager will be able to call 'setInterfaceImplementer' for '_addr'.
-    /// @param _addr Address for which to set the new manager.
-    /// @param _newManager Address of the new manager for 'addr'. (Pass '0x0' to reset the manager to '_addr'.)
-    function setManager(address _addr, address _newManager) external {
-        require(getManager(_addr) == msg.sender, "Not the manager");
-        managers[_addr] = _newManager == _addr ? address(0) : _newManager;
-        emit ManagerChanged(_addr, _newManager);
-    }
- 
-    /// @notice Get the manager of an address.
-    /// @param _addr Address for which to return the manager.
-    /// @return Address of the manager for a given address.
-    function getManager(address _addr) public view returns(address) {
-        // By default the manager of an address is the same address
-        if (managers[_addr] == address(0)) {
-            return _addr;
-        } else {
-            return managers[_addr];
-        }
-    }
- 
-    /// @notice Compute the keccak256 hash of an interface given its name.
-    /// @param _interfaceName Name of the interface.
-    /// @return The keccak256 hash of an interface name.
-    function interfaceHash(string calldata _interfaceName) external pure returns(bytes32) {
-        return keccak256(abi.encodePacked(_interfaceName));
-    }
- 
-    /* --- ERC165 Related Functions --- */
-    /* --- Developed in collaboration with William Entriken. --- */
- 
-    /// @notice Updates the cache with whether the contract implements an ERC165 interface or not.
-    /// @param _contract Address of the contract for which to update the cache.
-    /// @param _interfaceId ERC165 interface for which to update the cache.
-    function updateERC165Cache(address _contract, bytes4 _interfaceId) external {
-        interfaces[_contract][_interfaceId] = implementsERC165InterfaceNoCache(
-            _contract, _interfaceId) ? _contract : address(0);
-        erc165Cached[_contract][_interfaceId] = true;
-    }
- 
-    /// @notice Checks whether a contract implements an ERC165 interface or not.
-    //  If the result is not cached a direct lookup on the contract address is performed.
-    //  If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
-    //  'updateERC165Cache' with the contract address.
-    /// @param _contract Address of the contract to check.
-    /// @param _interfaceId ERC165 interface to check.
-    /// @return True if '_contract' implements '_interfaceId', false otherwise.
-    function implementsERC165Interface(address _contract, bytes4 _interfaceId) public view returns (bool) {
-        if (!erc165Cached[_contract][_interfaceId]) {
-            return implementsERC165InterfaceNoCache(_contract, _interfaceId);
-        }
-        return interfaces[_contract][_interfaceId] == _contract;
-    }
- 
-    /// @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
-    /// @param _contract Address of the contract to check.
-    /// @param _interfaceId ERC165 interface to check.
-    /// @return True if '_contract' implements '_interfaceId', false otherwise.
-    function implementsERC165InterfaceNoCache(address _contract, bytes4 _interfaceId) public view returns (bool) {
-        uint256 success;
-        uint256 result;
- 
-        (success, result) = noThrowCall(_contract, ERC165ID);
-        if (success == 0 || result == 0) {
-            return false;
-        }
- 
-        (success, result) = noThrowCall(_contract, INVALID_ID);
-        if (success == 0 || result != 0) {
-            return false;
-        }
- 
-        (success, result) = noThrowCall(_contract, _interfaceId);
-        if (success == 1 && result == 1) {
-            return true;
-        }
-        return false;
-    }
- 
-    /// @notice Checks whether the hash is a ERC165 interface (ending with 28 zeroes) or not.
-    /// @param _interfaceHash The hash to check.
-    /// @return True if '_interfaceHash' is an ERC165 interface (ending with 28 zeroes), false otherwise.
-    function isERC165Interface(bytes32 _interfaceHash) internal pure returns (bool) {
-        return _interfaceHash & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0;
-    }
- 
-    /// @dev Make a call on a contract without throwing if the function does not exist.
-    function noThrowCall(address _contract, bytes4 _interfaceId)
-        internal view returns (uint256 success, uint256 result)
-    {
-        bytes4 erc165ID = ERC165ID;
- 
-        assembly {
-            let x := mload(0x40)               // Find empty storage location using "free memory pointer"
-            mstore(x, erc165ID)                // Place signature at beginning of empty storage
-            mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature
- 
-            success := staticcall(
-                30000,                         // 30k gas
-                _contract,                     // To addr
-                x,                             // Inputs are stored at location x
-                0x24,                          // Inputs are 36 (4 + 32) bytes long
-                x,                             // Store output over input (saves space)
-                0x20                           // Outputs are 32 bytes long
-            )
- 
-            result := mload(x)                 // Load the result
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html deleted file mode 100644 index bf503a6c9..000000000 --- a/coverage/optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol.html +++ /dev/null @@ -1,701 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_DeployerWhitelist.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_DeployerWhitelist.sol -

-
-
- 36.36% - Statements - 8/22 -
-
- 66.67% - Branches - 4/6 -
-
- 12.5% - Functions - 1/8 -
-
- 34.78% - Lines - 8/23 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -29× -  -  -  -29× -25× -  -  - -  -  -  - - -  -  - -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
- 
-/* Interface Imports */
-import { iOVM_DeployerWhitelist } from "../../iOVM/predeploys/iOVM_DeployerWhitelist.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_DeployerWhitelist
- * @dev The Deployer Whitelist is a temporary predeploy used to provide additional safety during the
- * initial phases of our mainnet roll out. It is owned by the Optimism team, and defines accounts
- * which are allowed to deploy contracts on Layer2. The Execution Manager will only allow an 
- * ovmCREATE or ovmCREATE2 operation to proceed if the deployer's address whitelisted.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_DeployerWhitelist is iOVM_DeployerWhitelist {
- 
-    /**********************
-     * Contract Constants *
-     **********************/
- 
-    bytes32 internal constant KEY_INITIALIZED =                0x0000000000000000000000000000000000000000000000000000000000000010;
-    bytes32 internal constant KEY_OWNER =                      0x0000000000000000000000000000000000000000000000000000000000000011;
-    bytes32 internal constant KEY_ALLOW_ARBITRARY_DEPLOYMENT = 0x0000000000000000000000000000000000000000000000000000000000000012;
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
-    
-    /**
-     * Blocks functions to anyone except the contract owner.
-     */
-    modifier onlyOwner() {
-        address owner = Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                KEY_OWNER
-            )
-        );
- 
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            Lib_SafeExecutionManagerWrapper.safeCALLER() == owner,
-            "Function can only be called by the owner of this contract."
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
-    
-    /**
-     * Initializes the whitelist.
-     * @param _owner Address of the owner for this contract.
-     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
-     */
-    function initialize(
-        address _owner,
-        bool _allowArbitraryDeployment
-    )
-        override
-        public
-    {
-        bool initialized = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
-        );
- 
-        if (initialized == true) {
-            return;
-        }
- 
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_INITIALIZED,
-            Lib_Bytes32Utils.fromBool(true)
-        );
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_OWNER,
-            Lib_Bytes32Utils.fromAddress(_owner)
-        );
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
-            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
-        );
-    }
- 
-    /**
-     * Gets the owner of the whitelist.
-     */
-    function getOwner()
-        override
-        public
-        returns(
-            address
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                KEY_OWNER
-            )
-        );
-    }
- 
-    /**
-     * Adds or removes an address from the deployment whitelist.
-     * @param _deployer Address to update permissions for.
-     * @param _isWhitelisted Whether or not the address is whitelisted.
-     */
-    function setWhitelistedDeployer(
-        address _deployer,
-        bool _isWhitelisted
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            Lib_Bytes32Utils.fromAddress(_deployer),
-            Lib_Bytes32Utils.fromBool(_isWhitelisted)
-        );
-    }
- 
-    /**
-     * Updates the owner of this contract.
-     * @param _owner Address of the new owner.
-     */
-    function setOwner(
-        address _owner
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_OWNER,
-            Lib_Bytes32Utils.fromAddress(_owner)
-        );
-    }
- 
-    /**
-     * Updates the arbitrary deployment flag.
-     * @param _allowArbitraryDeployment Whether or not to allow arbitrary contract deployment.
-     */
-    function setAllowArbitraryDeployment(
-        bool _allowArbitraryDeployment
-    )
-        override
-        public
-        onlyOwner
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            KEY_ALLOW_ARBITRARY_DEPLOYMENT,
-            Lib_Bytes32Utils.fromBool(_allowArbitraryDeployment)
-        );
-    }
- 
-    /**
-     * Permanently enables arbitrary contract deployment and deletes the owner.
-     */
-    function enableArbitraryContractDeployment()
-        override
-        public
-        onlyOwner
-    {
-        setAllowArbitraryDeployment(true);
-        setOwner(address(0));
-    }
- 
-    /**
-     * Checks whether an address is allowed to deploy contracts.
-     * @param _deployer Address to check.
-     * @return _allowed Whether or not the address can deploy contracts.
-     */
-    function isDeployerAllowed(
-        address _deployer
-    )
-        override
-        public
-        returns (
-            bool _allowed
-        )
-    {
-        bool initialized = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_INITIALIZED)
-        );
- 
-        if (initialized == false) {
-            return true;
-        }
- 
-        bool allowArbitraryDeployment = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(KEY_ALLOW_ARBITRARY_DEPLOYMENT)
-        );
- 
-        if (allowArbitraryDeployment == true) {
-            return true;
-        }
- 
-        bool isWhitelisted = Lib_Bytes32Utils.toBool(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                Lib_Bytes32Utils.fromAddress(_deployer)
-            )
-        );
- 
-        return isWhitelisted;        
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html deleted file mode 100644 index 2aaa2721b..000000000 --- a/coverage/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_ETH.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_ETH.sol -

-
-
- 0% - Statements - 0/1 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_L1TokenGateway } from "../../iOVM/bridge/tokens/iOVM_L1TokenGateway.sol";
- 
-/* Contract Imports */
-import { OVM_L2DepositedERC20 } from "../bridge/tokens/OVM_L2DepositedERC20.sol";
- 
-/**
- * @title OVM_ETH
- * @dev The ETH predeploy provides an ERC20 interface for ETH deposited to Layer 2. Note that 
- * unlike on Layer 1, Layer 2 accounts do not have a balance field.
- * 
- * Compiler used: optimistic-solc
- * Runtime target: OVM
- */
-contract OVM_ETH is OVM_L2DepositedERC20 {
-    constructor(
-        address _l2CrossDomainMessenger,
-        address _l1ETHGateway
-    ) 
-        OVM_L2DepositedERC20(
-            _l2CrossDomainMessenger,
-            "Ether",
-            "ETH"
-        )
-    {
-        init(iOVM_L1TokenGateway(_l1ETHGateway));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html deleted file mode 100644 index cb471696f..000000000 --- a/coverage/optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_L1MessageSender.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_L1MessageSender.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_L1MessageSender } from "../../iOVM/predeploys/iOVM_L1MessageSender.sol";
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
- 
-/**
- * @title OVM_L1MessageSender
- * @dev The L1MessageSender is a predeploy contract running on L2. During the execution of cross 
- * domain transaction from L1 to L2, it returns the address of the L1 account (either an EOA or
- * contract) which sent the message to L2 via the Canonical Transaction Chain's `enqueue()` 
- * function.
- * 
- * This contract exclusively serves as a getter for the ovmL1TXORIGIN operation. This is necessary 
- * because there is no corresponding operation in the EVM which the the optimistic solidity compiler 
- * can be replaced with a call to the ExecutionManager's ovmL1TXORIGIN() function.
- *
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_L1MessageSender is iOVM_L1MessageSender {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * @return _l1MessageSender L1 message sender address (msg.sender).
-     */
-    function getL1MessageSender()
-        override
-        public
-        view
-        returns (
-            address _l1MessageSender
-        )
-    {
-        // Note that on L2 msg.sender (ie. evmCALLER) will always be the Execution Manager 
-        return iOVM_ExecutionManager(msg.sender).ovmL1TXORIGIN();
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html deleted file mode 100644 index 0795787c0..000000000 --- a/coverage/optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_L2ToL1MessagePasser.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_L2ToL1MessagePasser } from "../../iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol";
- 
-/**
- * @title OVM_L2ToL1MessagePasser
- * @dev The L2 to L1 Message Passer is a utility contract which facilitate an L1 proof of the 
- * of a message on L2. The L1 Cross Domain Messenger performs this proof in its
- * _verifyStorageProof function, which verifies the existence of the transaction hash in this 
- * contract's `sentMessages` mapping.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_L2ToL1MessagePasser is iOVM_L2ToL1MessagePasser {
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    mapping (bytes32 => bool) public sentMessages;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Passes a message to L1.
-     * @param _message Message to pass to L1.
-     */
-    function passMessageToL1(
-        bytes memory _message
-    )
-        override
-        public
-    {
-        // Note: although this function is public, only messages sent from the OVM_L2CrossDomainMessenger 
-        // will be relayed by the OVM_L1CrossDomainMessenger. This is enforced by a check in 
-        // OVM_L1CrossDomainMessenger._verifyStorageProof().
-        sentMessages[keccak256(
-            abi.encodePacked(
-                _message,
-                msg.sender
-            )
-        )] = true;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html deleted file mode 100644 index e738ae32f..000000000 --- a/coverage/optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_ProxySequencerEntrypoint.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_ProxySequencerEntrypoint.sol -

-
-
- 100% - Statements - 10/10 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 7/7 -
-
- 100% - Lines - 10/10 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_ProxySequencerEntrypoint 
- * @dev The Proxy Sequencer Entrypoint is a predeployed proxy to the implementation of the 
- * Sequencer Entrypoint. This will enable the Optimism team to upgrade the Sequencer Entrypoint 
- * contract.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_ProxySequencerEntrypoint {
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeDELEGATECALL(
-            gasleft(),
-            _getImplementation(),
-            msg.data
-        );
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function init(
-        address _implementation,
-        address _owner
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            _getOwner() == address(0),
-            "ProxySequencerEntrypoint has already been inited"
-        );
-        _setOwner(_owner);
-        _setImplementation(_implementation);
-    }
- 
-    function upgrade(
-        address _implementation
-    )
-        external
-    {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            _getOwner() == Lib_SafeExecutionManagerWrapper.safeCALLER(),
-            "Only owner can upgrade the Entrypoint"
-        );
- 
-        _setImplementation(_implementation);
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _setImplementation(
-        address _implementation
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            bytes32(uint256(0)),
-            bytes32(uint256(uint160(_implementation)))
-        );
-    }
- 
-    function _getImplementation()
-        internal
-        returns (
-            address _implementation
-        )
-    {
-        return address(uint160(uint256(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                bytes32(uint256(0))
-            )
-        )));
-    }
- 
-    function _setOwner(
-        address _owner
-    )
-        internal
-    {
-        Lib_SafeExecutionManagerWrapper.safeSSTORE(
-            bytes32(uint256(1)),
-            bytes32(uint256(uint160(_owner)))
-        );
-    }
- 
-    function _getOwner()
-        internal
-        returns (
-            address _owner
-        )
-    {
-        return address(uint160(uint256(
-            Lib_SafeExecutionManagerWrapper.safeSLOAD(
-                bytes32(uint256(1))
-            )
-        )));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html b/coverage/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html deleted file mode 100644 index 3d96f0a5e..000000000 --- a/coverage/optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/OVM_SequencerEntrypoint.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/predeploys/ OVM_SequencerEntrypoint.sol -

-
-
- 100% - Statements - 18/18 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 17/17 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - - - -  -  - - -  -  - -  -  -  -  - -  -  -  -  -  -  -  - -  - - -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title OVM_SequencerEntrypoint
- * @dev The Sequencer Entrypoint is a predeploy which, despite its name, can in fact be called by 
- * any account. It accepts a more efficient compressed calldata format, which it decompresses and 
- * encodes to the standard EIP155 transaction format.
- * This contract is the implementation referenced by the Proxy Sequencer Entrypoint, thus enabling
- * the Optimism team to upgrade the decompression of calldata from the Sequencer.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-contract OVM_SequencerEntrypoint {
- 
-    /*********
-     * Enums *
-     *********/
-    
-    enum TransactionType {
-        NATIVE_ETH_TRANSACTION,
-        ETH_SIGNED_MESSAGE
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    /**
-     * Uses a custom "compressed" format to save on calldata gas:
-     * calldata[00:01]: transaction type (0 == EIP 155, 2 == Eth Sign Message)
-     * calldata[01:33]: signature "r" parameter
-     * calldata[33:65]: signature "s" parameter
-     * calldata[65:66]: signature "v" parameter
-     * calldata[66:69]: transaction gas limit
-     * calldata[69:72]: transaction gas price
-     * calldata[72:75]: transaction nonce
-     * calldata[75:95]: transaction target address
-     * calldata[95:XX]: transaction data
-     */
-    fallback()
-        external
-    {
-        TransactionType transactionType = _getTransactionType(Lib_BytesUtils.toUint8(msg.data, 0));
- 
-        bytes32 r = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 1, 32));
-        bytes32 s = Lib_BytesUtils.toBytes32(Lib_BytesUtils.slice(msg.data, 33, 32));
-        uint8 v = Lib_BytesUtils.toUint8(msg.data, 65);
- 
-        // Remainder is the transaction to execute.
-        bytes memory compressedTx = Lib_BytesUtils.slice(msg.data, 66);
-        bool isEthSignedMessage = transactionType == TransactionType.ETH_SIGNED_MESSAGE;
- 
-        // Need to decompress and then re-encode the transaction based on the original encoding.
-        bytes memory encodedTx = Lib_OVMCodec.encodeEIP155Transaction(
-            Lib_OVMCodec.decompressEIP155Transaction(compressedTx),
-            isEthSignedMessage
-        );
- 
-        address target = Lib_ECDSAUtils.recover(
-            encodedTx,
-            isEthSignedMessage,
-            uint8(v),
-            r,
-            s
-        );
- 
-        if (Lib_SafeExecutionManagerWrapper.safeEXTCODESIZE(target) == 0) {
-            // ProxyEOA has not yet been deployed for this EOA.
-            bytes32 messageHash = Lib_ECDSAUtils.getMessageHash(encodedTx, isEthSignedMessage);
-            Lib_SafeExecutionManagerWrapper.safeCREATEEOA(messageHash, uint8(v), r, s);
-        }
- 
-        // ProxyEOA has been deployed for this EOA, continue to CALL.
-        bytes memory callbytes = abi.encodeWithSignature(
-            "execute(bytes,uint8,uint8,bytes32,bytes32)",
-            encodedTx,
-            isEthSignedMessage,
-            uint8(v),
-            r,
-            s
-        );
- 
-        Lib_SafeExecutionManagerWrapper.safeCALL(
-            gasleft(),
-            target,
-            callbytes
-        );
-    }
-    
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Converts a uint256 into a TransactionType enum.
-     * @param _transactionType Transaction type index.
-     * @return _txType Transaction type enum value.
-     */
-    function _getTransactionType(
-        uint8 _transactionType
-    )
-        internal
-        returns (
-            TransactionType _txType
-        )
-    {
-        if (_transactionType == 0) {
-            return TransactionType.NATIVE_ETH_TRANSACTION;
-        } if (_transactionType == 2) {
-            return TransactionType.ETH_SIGNED_MESSAGE;
-        } else {
-            Lib_SafeExecutionManagerWrapper.safeREVERT(
-                "Transaction type must be 0 or 2"
-            );
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/predeploys/index.html b/coverage/optimistic-ethereum/OVM/predeploys/index.html deleted file mode 100644 index 82416007a..000000000 --- a/coverage/optimistic-ethereum/OVM/predeploys/index.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/predeploys/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/predeploys/ -

-
-
- 41.76% - Statements - 38/91 -
-
- 29.41% - Branches - 10/34 -
-
- 40% - Functions - 12/30 -
-
- 40.22% - Lines - 37/92 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
ERC1820Registry.sol
0%0/380%0/220%0/100%0/39
OVM_DeployerWhitelist.sol
36.36%8/2266.67%4/612.5%1/834.78%8/23
OVM_ETH.sol
0%0/1100%0/00%0/10%0/1
OVM_L1MessageSender.sol
100%1/1100%0/0100%1/1100%1/1
OVM_L2ToL1MessagePasser.sol
100%1/1100%0/0100%1/1100%1/1
OVM_ProxySequencerEntrypoint.sol
100%10/10100%0/0100%7/7100%10/10
OVM_SequencerEntrypoint.sol
100%18/18100%6/6100%2/2100%17/17
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html b/coverage/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html deleted file mode 100644 index 23684e3af..000000000 --- a/coverage/optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/Abs_FraudContributor.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ Abs_FraudContributor.sol -

-
-
- 100% - Statements - 3/3 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  -  -  -  -  -  -28× -28× -14× -14× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/// Minimal contract to be inherited by contracts consumed by users that provide
-/// data for fraud proofs
-abstract contract Abs_FraudContributor is Lib_AddressResolver {
-    /// Decorate your functions with this modifier to store how much total gas was
-    /// consumed by the sender, to reward users fairly
-    modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
-        uint256 startGas = gasleft();
-        _;
-        uint256 gasSpent = startGas - gasleft();
-        iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html b/coverage/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html deleted file mode 100644 index 1de4a2fa1..000000000 --- a/coverage/optimistic-ethereum/OVM/verification/OVM_BondManager.sol.html +++ /dev/null @@ -1,689 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/OVM_BondManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ OVM_BondManager.sol -

-
-
- 100% - Statements - 42/42 -
-
- 86.67% - Branches - 26/30 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 41/41 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -63× -  -  -  -  -  -  -  -  -  -  -46× -46× -  -45× -45× -  -  -  -  -  -13× -12× -  -  -  -11× -  -11× -11× - - - -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -11× -  -  -  -  - -  -  -  -10× -  -  -  -  -  -18× -  -  -  -  -  -18× -  -  -  -  - - - -  - - -  -  -  -  - -  - -  -  -  - -  -  - - -  - -  -  -  -  -  -  -  -  - - -  -  -  -  -  - - -  -  - -  -  -  - -  -  - -  -  - -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_BondManager, Errors, ERC20 } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
- 
-/**
- * @title OVM_BondManager
- * @dev The Bond Manager contract handles deposits in the form of an ERC20 token from bonded 
- * Proposers. It also handles the accounting of gas costs spent by a Verifier during the course of a
- * fraud proof. In the event of a successful fraud proof, the fraudulent Proposer's bond is slashed, 
- * and the Verifier's gas costs are refunded.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
- 
-    /****************************
-     * Constants and Parameters *
-     ****************************/
- 
-    /// The period to find the earliest fraud proof for a publisher
-    uint256 public constant multiFraudProofPeriod = 7 days;
- 
-    /// The dispute period
-    uint256 public constant disputePeriodSeconds = 7 days;
- 
-    /// The minimum collateral a sequencer must post
-    uint256 public constant requiredCollateral = 1 ether;
- 
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    /// The bond token
-    ERC20 immutable public token;
- 
- 
-    /********************************************
-     * Contract Variables: Internal Accounting  *
-     *******************************************/
- 
-    /// The bonds posted by each proposer
-    mapping(address => Bond) public bonds;
- 
-    /// For each pre-state root, there's an array of witnessProviders that must be rewarded
-    /// for posting witnesses
-    mapping(bytes32 => Rewards) public witnessProviders;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /// Initializes with a ERC20 token to be used for the fidelity bonds
-    /// and with the Address Manager
-    constructor(
-        ERC20 _token,
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        token = _token;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /// Adds `who` to the list of witnessProviders for the provided `preStateRoot`.
-    function recordGasSpent(bytes32 _preStateRoot, bytes32 _txHash, address who, uint256 gasSpent) override public {
-        // The sender must be the transitioner that corresponds to the claimed pre-state root
-        address transitioner = address(iOVM_FraudVerifier(resolve("OVM_FraudVerifier")).getStateTransitioner(_preStateRoot, _txHash));
-        require(transitioner == msg.sender, Errors.ONLY_TRANSITIONER);
- 
-        witnessProviders[_preStateRoot].total += gasSpent;
-        witnessProviders[_preStateRoot].gasSpent[who] += gasSpent;
-    }
- 
-    /// Slashes + distributes rewards or frees up the sequencer's bond, only called by
-    /// `FraudVerifier.finalizeFraudVerification`
-    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) override public {
-        require(msg.sender == resolve("OVM_FraudVerifier"), Errors.ONLY_FRAUD_VERIFIER);
-        require(witnessProviders[_preStateRoot].canClaim == false, Errors.ALREADY_FINALIZED);
- 
-        // allow users to claim from that state root's
-        // pool of collateral (effectively slashing the sequencer)
-        witnessProviders[_preStateRoot].canClaim = true;
- 
-        Bond storage bond = bonds[publisher];
-        if (bond.firstDisputeAt == 0) {
-            bond.firstDisputeAt = block.timestamp;
-            bond.earliestDisputedStateRoot = _preStateRoot;
-            bond.earliestTimestamp = timestamp;
-        } else if (
-            // only update the disputed state root for the publisher if it's within
-            // the dispute period _and_ if it's before the previous one
-            block.timestamp < bond.firstDisputeAt + multiFraudProofPeriod &&
-            timestamp < bond.earliestTimestamp
-        ) {
-            bond.earliestDisputedStateRoot = _preStateRoot;
-            bond.earliestTimestamp = timestamp;
-        }
- 
-        // if the fraud proof's dispute period does not intersect with the 
-        // withdrawal's timestamp, then the user should not be slashed
-        // e.g if a user at day 10 submits a withdrawal, and a fraud proof
-        // from day 1 gets published, the user won't be slashed since day 8 (1d + 7d)
-        // is before the user started their withdrawal. on the contrary, if the user
-        // had started their withdrawal at, say, day 6, they would be slashed
-        if (
-            bond.withdrawalTimestamp != 0 && 
-            uint256(bond.withdrawalTimestamp) > timestamp + disputePeriodSeconds &&
-            bond.state == State.WITHDRAWING
-        ) {
-            return;
-        }
- 
-        // slash!
-        bond.state = State.NOT_COLLATERALIZED;
-    }
- 
-    /// Sequencers call this function to post collateral which will be used for
-    /// the `appendBatch` call
-    function deposit() override public {
-        Erequire(
-            token.transferFrom(msg.sender, address(this), requiredCollateral),
-            Errors.ERC20_ERR
-        );
- 
-        // This cannot overflow
-        bonds[msg.sender].state = State.COLLATERALIZED;
-    }
- 
-    /// Starts the withdrawal for a publisher
-    function startWithdrawal() override public {
-        Bond storage bond = bonds[msg.sender];
-        Erequire(bond.withdrawalTimestamp == 0, Errors.WITHDRAWAL_PENDING);
-        require(bond.state == State.COLLATERALIZED, Errors.WRONG_STATE);
- 
-        bond.state = State.WITHDRAWING;
-        bond.withdrawalTimestamp = uint32(block.timestamp);
-    }
- 
-    /// Finalizes a pending withdrawal from a publisher
-    function finalizeWithdrawal() override public {
-        Bond storage bond = bonds[msg.sender];
- 
-        require(
-            block.timestamp >= uint256(bond.withdrawalTimestamp) + disputePeriodSeconds, 
-            Errors.TOO_EARLY
-        );
-        require(bond.state == State.WITHDRAWING, Errors.SLASHED);
-        
-        // refunds!
-        bond.state = State.NOT_COLLATERALIZED;
-        bond.withdrawalTimestamp = 0;
-        
-        Erequire(
-            token.transfer(msg.sender, requiredCollateral),
-            Errors.ERC20_ERR
-        );
-    }
- 
-    /// Claims the user's reward for the witnesses they provided for the earliest
-    /// disputed state root of the designated publisher
-    function claim(address who) override public {
-        Bond storage bond = bonds[who];
-        require(
-            block.timestamp >= bond.firstDisputeAt + multiFraudProofPeriod,
-            Errors.WAIT_FOR_DISPUTES
-        );
- 
-        // reward the earliest state root for this publisher
-        bytes32 _preStateRoot = bond.earliestDisputedStateRoot;
-        Rewards storage rewards = witnessProviders[_preStateRoot];
- 
-        // only allow claiming if fraud was proven in `finalize`
-        require(rewards.canClaim, Errors.CANNOT_CLAIM);
- 
-        // proportional allocation - only reward 50% (rest gets locked in the
-        // contract forever
-        uint256 amount = (requiredCollateral * rewards.gasSpent[msg.sender]) / (2 * rewards.total);
- 
-        // reset the user's spent gas so they cannot double claim
-        rewards.gasSpent[msg.sender] = 0;
- 
-        // transfer
-        Erequire(token.transfer(msg.sender, amount), Errors.ERC20_ERR);
-    }
- 
-    /// Checks if the user is collateralized
-    function isCollateralized(address who) override public view returns (bool) {
-        return bonds[who].state == State.COLLATERALIZED;
-    }
- 
-    /// Gets how many witnesses the user has provided for the state root
-    function getGasSpent(bytes32 preStateRoot, address who) override public view returns (uint256) {
-        return witnessProviders[preStateRoot].gasSpent[who];
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html b/coverage/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html deleted file mode 100644 index d513958f4..000000000 --- a/coverage/optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol.html +++ /dev/null @@ -1,953 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/OVM_FraudVerifier.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ OVM_FraudVerifier.sol -

-
-
- 96.43% - Statements - 27/28 -
-
- 94.44% - Branches - 17/18 -
-
- 100% - Functions - 7/7 -
-
- 96.43% - Lines - 27/28 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -12× -  -  -  -12× -12× -  -12× -  -  -  -  -  -  -  -  -11× -  -  -  -  -  -  -  -  -  -10× -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - -  -  -  -  - -  -  - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol";
-import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol";
- 
-/* Contract Imports */
-import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
- 
- 
- 
-/**
- * @title OVM_FraudVerifier
- * @dev The Fraud Verifier contract coordinates the entire fraud proof verification process. 
- * If the fraud proof was successful it prunes any state batches from State Commitment Chain
- * which were published after the fraudulent state root.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_FraudVerifier is Lib_AddressResolver, Abs_FraudContributor, iOVM_FraudVerifier {
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    mapping (bytes32 => iOVM_StateTransitioner) internal transitioners;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     */
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
- 
-    /***************************************
-     * Public Functions: Transition Status *
-     ***************************************/
- 
-    /**
-     * Retrieves the state transitioner for a given root.
-     * @param _preStateRoot State root to query a transitioner for.
-     * @return _transitioner Corresponding state transitioner contract.
-     */
-    function getStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        override
-        public
-        view
-        returns (
-            iOVM_StateTransitioner _transitioner
-        )
-    {
-        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
-    }
- 
- 
-    /****************************************
-     * Public Functions: Fraud Verification *
-     ****************************************/
- 
-    /**
-     * Begins the fraud verification process.
-     * @param _preStateRoot State root before the fraudulent transaction.
-     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
-     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
-     * @param _transaction OVM transaction claimed to be fraudulent.
-     * @param _txChainElement OVM transaction chain element.
-     * @param _transactionBatchHeader Batch header for the provided transaction.
-     * @param _transactionProof Inclusion proof for the provided transaction.
-     */
-    function initializeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _transactionBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _transactionProof
-    )
-        override
-        public
-        contributesToFraudProof(_preStateRoot, Lib_OVMCodec.hashTransaction(_transaction))
-    {
-        bytes32 _txHash = Lib_OVMCodec.hashTransaction(_transaction);
- 
-        Iif (_hasStateTransitioner(_preStateRoot, _txHash)) {
-            return;
-        }
- 
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
-        iOVM_CanonicalTransactionChain ovmCanonicalTransactionChain = iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain"));
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _preStateRoot,
-                _preStateRootBatchHeader,
-                _preStateRootProof
-            ),
-            "Invalid pre-state root inclusion proof."
-        );
- 
-        require(
-            ovmCanonicalTransactionChain.verifyTransaction(
-                _transaction,
-                _txChainElement,
-                _transactionBatchHeader,
-                _transactionProof
-            ),
-            "Invalid transaction inclusion proof."
-        );
- 
-        require (
-            _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1 == _transactionBatchHeader.prevTotalElements + _transactionProof.index,
-            "Pre-state root global index must equal to the transaction root global index."
-        );
- 
-        _deployTransitioner(_preStateRoot, _txHash, _preStateRootProof.index);
- 
-        emit FraudProofInitialized(
-            _preStateRoot,
-            _preStateRootProof.index,
-            _txHash,
-            msg.sender
-        );
-    }
- 
-    /**
-     * Finalizes the fraud verification process.
-     * @param _preStateRoot State root before the fraudulent transaction.
-     * @param _preStateRootBatchHeader Batch header for the provided pre-state root.
-     * @param _preStateRootProof Inclusion proof for the provided pre-state root.
-     * @param _txHash The transaction for the state root
-     * @param _postStateRoot State root after the fraudulent transaction.
-     * @param _postStateRootBatchHeader Batch header for the provided post-state root.
-     * @param _postStateRootProof Inclusion proof for the provided post-state root.
-     */
-    function finalizeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _preStateRootProof,
-        bytes32 _txHash,
-        bytes32 _postStateRoot,
-        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _postStateRootProof
-    )
-        override
-        public
-        contributesToFraudProof(_preStateRoot, _txHash)
-    {
-        iOVM_StateTransitioner transitioner = getStateTransitioner(_preStateRoot, _txHash);
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
- 
-        require(
-            transitioner.isComplete() == true,
-            "State transition process must be completed prior to finalization."
-        );
- 
-        require (
-            _postStateRootBatchHeader.prevTotalElements + _postStateRootProof.index == _preStateRootBatchHeader.prevTotalElements + _preStateRootProof.index + 1,
-            "Post-state root global index must equal to the pre state root global index plus one."
-        );
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _preStateRoot,
-                _preStateRootBatchHeader,
-                _preStateRootProof
-            ),
-            "Invalid pre-state root inclusion proof."
-        );
- 
-        require(
-            ovmStateCommitmentChain.verifyStateCommitment(
-                _postStateRoot,
-                _postStateRootBatchHeader,
-                _postStateRootProof
-            ),
-            "Invalid post-state root inclusion proof."
-        );
- 
-        // If the post state root did not match, then there was fraud and we should delete the batch
-        require(
-            _postStateRoot != transitioner.getPostStateRoot(),
-            "State transition has not been proven fraudulent."
-        );
-        
-        _cancelStateTransition(_postStateRootBatchHeader, _preStateRoot);
- 
-        // TEMPORARY: Remove the transitioner; for minnet.
-        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitioner(0x0000000000000000000000000000000000000000);
- 
-        emit FraudProofFinalized(
-            _preStateRoot,
-            _preStateRootProof.index,
-            _txHash,
-            msg.sender
-        );
-    }
- 
- 
-    /************************************
-     * Internal Functions: Verification *
-     ************************************/
- 
-    /**
-     * Checks whether a transitioner already exists for a given pre-state root.
-     * @param _preStateRoot Pre-state root to check.
-     * @return _exists Whether or not we already have a transitioner for the root.
-     */
-    function _hasStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        internal
-        view
-        returns (
-            bool _exists
-        )
-    {
-        return address(getStateTransitioner(_preStateRoot, _txHash)) != address(0);
-    }
- 
-    /**
-     * Deploys a new state transitioner.
-     * @param _preStateRoot Pre-state root to initialize the transitioner with.
-     * @param _txHash Hash of the transaction this transitioner will execute.
-     * @param _stateTransitionIndex Index of the transaction in the chain.
-     */
-    function _deployTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        uint256 _stateTransitionIndex
-    )
-        internal
-    {
-        transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))] = iOVM_StateTransitionerFactory(
-            resolve("OVM_StateTransitionerFactory")
-        ).create(
-            address(libAddressManager),
-            _stateTransitionIndex,
-            _preStateRoot,
-            _txHash
-        );
-    }
- 
-    /**
-     * Removes a state transition from the state commitment chain.
-     * @param _postStateRootBatchHeader Header for the post-state root.
-     * @param _preStateRoot Pre-state root hash.
-     */
-    function _cancelStateTransition(
-        Lib_OVMCodec.ChainBatchHeader memory _postStateRootBatchHeader,
-        bytes32 _preStateRoot
-    )
-        internal
-    {
-        iOVM_StateCommitmentChain ovmStateCommitmentChain = iOVM_StateCommitmentChain(resolve("OVM_StateCommitmentChain"));
-        iOVM_BondManager ovmBondManager = iOVM_BondManager(resolve("OVM_BondManager"));
- 
-        // Delete the state batch.
-        ovmStateCommitmentChain.deleteStateBatch(
-            _postStateRootBatchHeader
-        );
- 
-        // Get the timestamp and publisher for that block.
-        (uint256 timestamp, address publisher) = abi.decode(_postStateRootBatchHeader.extraData, (uint256, address));
- 
-        // Slash the bonds at the bond manager.
-        ovmBondManager.finalize(
-            _preStateRoot,
-            publisher,
-            timestamp
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html b/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html deleted file mode 100644 index fe900da65..000000000 --- a/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol.html +++ /dev/null @@ -1,1484 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/OVM_StateTransitioner.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ OVM_StateTransitioner.sol -

-
-
- 80% - Statements - 40/50 -
-
- 62.5% - Branches - 20/32 -
-
- 90.91% - Functions - 10/11 -
-
- 80.39% - Lines - 41/51 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -42× -42× -  -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -13× -  -  -  -13× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  - -  -  -  - - -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
-import { Lib_EthUtils } from "../../libraries/utils/Lib_EthUtils.sol";
-import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol";
-import { Lib_BytesUtils } from "../../libraries/utils/Lib_BytesUtils.sol";
-import { Lib_SecureMerkleTrie } from "../../libraries/trie/Lib_SecureMerkleTrie.sol";
-import { Lib_RLPWriter } from "../../libraries/rlp/Lib_RLPWriter.sol";
-import { Lib_RLPReader } from "../../libraries/rlp/Lib_RLPReader.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
-import { iOVM_ExecutionManager } from "../../iOVM/execution/iOVM_ExecutionManager.sol";
-import { iOVM_StateManager } from "../../iOVM/execution/iOVM_StateManager.sol";
-import { iOVM_StateManagerFactory } from "../../iOVM/execution/iOVM_StateManagerFactory.sol";
- 
-/* Contract Imports */
-import { Abs_FraudContributor } from "./Abs_FraudContributor.sol";
- 
-/**
- * @title OVM_StateTransitioner
- * @dev The State Transitioner coordinates the execution of a state transition during the evaluation of a
- * fraud proof. It feeds verified input to the Execution Manager's run(), and controls a State Manager (which is
- * uniquely created for each fraud proof).
- * Once a fraud proof has been initialized, this contract is provided with the pre-state root and verifies
- * that the OVM storage slots committed to the State Mangager are contained in that state
- * This contract controls the State Manager and Execution Manager, and uses them to calculate the
- * post-state root by applying the transaction. The Fraud Verifier can then check for fraud by comparing
- * the calculated post-state root with the proposed post-state root.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateTransitioner is Lib_AddressResolver, Abs_FraudContributor, iOVM_StateTransitioner {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum TransitionPhase {
-        PRE_EXECUTION,
-        POST_EXECUTION,
-        COMPLETE
-    }
- 
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    iOVM_StateManager public ovmStateManager;
- 
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    bytes32 internal preStateRoot;
-    bytes32 internal postStateRoot;
-    TransitionPhase public phase;
-    uint256 internal stateTransitionIndex;
-    bytes32 internal transactionHash;
- 
- 
-    /*************
-     * Constants *
-     *************/
- 
-    bytes32 internal constant EMPTY_ACCOUNT_CODE_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
-    bytes32 internal constant EMPTY_ACCOUNT_STORAGE_ROOT = 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _stateTransitionIndex Index of the state transition being verified.
-     * @param _preStateRoot State root before the transition was executed.
-     * @param _transactionHash Hash of the executed transaction.
-     */
-    constructor(
-        address _libAddressManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {
-        stateTransitionIndex = _stateTransitionIndex;
-        preStateRoot = _preStateRoot;
-        postStateRoot = _preStateRoot;
-        transactionHash = _transactionHash;
- 
-        ovmStateManager = iOVM_StateManagerFactory(resolve("OVM_StateManagerFactory")).create(address(this));
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * Checks that a function is only run during a specific phase.
-     * @param _phase Phase the function must run within.
-     */
-    modifier onlyDuringPhase(
-        TransitionPhase _phase
-    ) {
-        Erequire(
-            phase == _phase,
-            "Function must be called during the correct phase."
-        );
-        _;
-    }
- 
- 
-    /**********************************
-     * Public Functions: State Access *
-     **********************************/
- 
-    /**
-     * Retrieves the state root before execution.
-     * @return _preStateRoot State root before execution.
-     */
-    function getPreStateRoot()
-        override
-        public
-        view
-        returns (
-            bytes32 _preStateRoot
-        )
-    {
-        return preStateRoot;
-    }
- 
-    /**
-     * Retrieves the state root after execution.
-     * @return _postStateRoot State root after execution.
-     */
-    function getPostStateRoot()
-        override
-        public
-        view
-        returns (
-            bytes32 _postStateRoot
-        )
-    {
-        return postStateRoot;
-    }
- 
-    /**
-     * Checks whether the transitioner is complete.
-     * @return _complete Whether or not the transition process is finished.
-     */
-    function isComplete()
-        override
-        public
-        view
-        returns (
-            bool _complete
-        )
-    {
-        return phase == TransitionPhase.COMPLETE;
-    }
-    
- 
-    /***********************************
-     * Public Functions: Pre-Execution *
-     ***********************************/
- 
-    /**
-     * Allows a user to prove the initial state of a contract.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _ethContractAddress Address of the corresponding contract on L1.
-     * @param _stateTrieWitness Proof of the account state.
-     */
-    function proveContractState(
-        address _ovmContractAddress,
-        address _ethContractAddress,
-        bytes memory _stateTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        // Exit quickly to avoid unnecessary work.
-        Erequire(
-            (
-                ovmStateManager.hasAccount(_ovmContractAddress) == false
-                && ovmStateManager.hasEmptyAccount(_ovmContractAddress) == false
-            ),
-            "Account state has already been proven."
-        );
- 
-        // Function will fail if the proof is not a valid inclusion or exclusion proof.
-        (
-            bool exists,
-            bytes memory encodedAccount
-        ) = Lib_SecureMerkleTrie.get(
-            abi.encodePacked(_ovmContractAddress),
-            _stateTrieWitness,
-            preStateRoot
-        );
- 
-        Eif (exists == true) {
-            // Account exists, this was an inclusion proof.
-            Lib_OVMCodec.EVMAccount memory account = Lib_OVMCodec.decodeEVMAccount(
-                encodedAccount
-            );
- 
-            address ethContractAddress = _ethContractAddress;
-            Iif (account.codeHash == EMPTY_ACCOUNT_CODE_HASH) {
-                // Use a known empty contract to prevent an attack in which a user provides a
-                // contract address here and then later deploys code to it.
-                ethContractAddress = 0x0000000000000000000000000000000000000000;
-            } else {
-                // Otherwise, make sure that the code at the provided eth address matches the hash
-                // of the code stored on L2.
-                Erequire(
-                    Lib_EthUtils.getCodeHash(ethContractAddress) == account.codeHash,
-                    "OVM_StateTransitioner: Provided L1 contract code hash does not match L2 contract code hash."
-                );
-            }
- 
-            ovmStateManager.putAccount(
-                _ovmContractAddress,
-                Lib_OVMCodec.Account({
-                    nonce: account.nonce,
-                    balance: account.balance,
-                    storageRoot: account.storageRoot,
-                    codeHash: account.codeHash,
-                    ethAddress: ethContractAddress,
-                    isFresh: false
-                })
-            );
-        } else {
-            // Account does not exist, this was an exclusion proof.
-            ovmStateManager.putEmptyAccount(_ovmContractAddress);
-        }
-    }
- 
-    /**
-     * Allows a user to prove the initial state of a contract storage slot.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _key Claimed account slot key.
-     * @param _storageTrieWitness Proof of the storage slot.
-     */
-    function proveStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes memory _storageTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        // Exit quickly to avoid unnecessary work.
-        Erequire(
-            ovmStateManager.hasContractStorage(_ovmContractAddress, _key) == false,
-            "Storage slot has already been proven."
-        );
- 
-        require(
-            ovmStateManager.hasAccount(_ovmContractAddress) == true,
-            "Contract must be verified before proving a storage slot."
-        );
- 
-        bytes32 storageRoot = ovmStateManager.getAccountStorageRoot(_ovmContractAddress);
-        bytes32 value;
- 
-        Iif (storageRoot == EMPTY_ACCOUNT_STORAGE_ROOT) {
-            // Storage trie was empty, so the user is always allowed to insert zero-byte values.
-            value = bytes32(0);
-        } else {
-            // Function will fail if the proof is not a valid inclusion or exclusion proof.
-            (
-                bool exists,
-                bytes memory encodedValue
-            ) = Lib_SecureMerkleTrie.get(
-                abi.encodePacked(_key),
-                _storageTrieWitness,
-                storageRoot
-            );
- 
-            Eif (exists == true) {
-                // Inclusion proof.
-                // Stored values are RLP encoded, with leading zeros removed.
-                value = Lib_BytesUtils.toBytes32PadLeft(
-                    Lib_RLPReader.readBytes(encodedValue)
-                );
-            } else {
-                // Exclusion proof, can only be zero bytes.
-                value = bytes32(0);
-            }
-        }
- 
-        ovmStateManager.putContractStorage(
-            _ovmContractAddress,
-            _key,
-            value
-        );
-    }
- 
- 
-    /*******************************
-     * Public Functions: Execution *
-     *******************************/
- 
-    /**
-     * Executes the state transition.
-     * @param _transaction OVM transaction to execute.
-     */
-    function applyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.PRE_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        Irequire(
-            Lib_OVMCodec.hashTransaction(_transaction) == transactionHash,
-            "Invalid transaction provided."
-        );
- 
-        // We require gas to complete the logic here in run() before/after execution,
-        // But must ensure the full _tx.gasLimit can be given to the ovmCALL (determinism)
-        // This includes 1/64 of the gas getting lost because of EIP-150 (lost twice--first 
-        // going into EM, then going into the code contract).
-        require(
-            gasleft() >= 100000 + _transaction.gasLimit * 1032 / 1000, // 1032/1000 = 1.032 = (64/63)^2 rounded up
-            "Not enough gas to execute transaction deterministically."
-        );
- 
-        iOVM_ExecutionManager ovmExecutionManager = iOVM_ExecutionManager(resolve("OVM_ExecutionManager"));
- 
-        // We call `setExecutionManager` right before `run` (and not earlier) just in case the
-        // OVM_ExecutionManager address was updated between the time when this contract was created
-        // and when `applyTransaction` was called.
-        ovmStateManager.setExecutionManager(address(ovmExecutionManager));
- 
-        // `run` always succeeds *unless* the user hasn't provided enough gas to `applyTransaction`
-        // or an INVALID_STATE_ACCESS flag was triggered. Either way, we won't get beyond this line
-        // if that's the case.
-        ovmExecutionManager.run(_transaction, address(ovmStateManager));
- 
-        phase = TransitionPhase.POST_EXECUTION;
-    }
- 
- 
-    /************************************
-     * Public Functions: Post-Execution *
-     ************************************/
- 
-    /**
-     * Allows a user to commit the final state of a contract.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _stateTrieWitness Proof of the account state.
-     */
-    function commitContractState(
-        address _ovmContractAddress,
-        bytes memory _stateTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        Erequire(
-            ovmStateManager.getTotalUncommittedContractStorage() == 0,
-            "All storage must be committed before committing account states."
-        );
- 
-        require (
-            ovmStateManager.commitAccount(_ovmContractAddress) == true,
-            "Account state wasn't changed or has already been committed."
-        );
- 
-        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
- 
-        postStateRoot = Lib_SecureMerkleTrie.update(
-            abi.encodePacked(_ovmContractAddress),
-            Lib_OVMCodec.encodeEVMAccount(
-                Lib_OVMCodec.toEVMAccount(account)
-            ),
-            _stateTrieWitness,
-            postStateRoot
-        );
- 
-        // Emit an event to help clients figure out the proof ordering.
-        emit AccountCommitted(
-            _ovmContractAddress
-        );
-    }
- 
-    /**
-     * Allows a user to commit the final state of a contract storage slot.
-     * @param _ovmContractAddress Address of the contract on the OVM.
-     * @param _key Claimed account slot key.
-     * @param _storageTrieWitness Proof of the storage slot.
-     */
-    function commitStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes memory _storageTrieWitness
-    )
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-        contributesToFraudProof(preStateRoot, transactionHash)
-    {
-        require(
-            ovmStateManager.commitContractStorage(_ovmContractAddress, _key) == true,
-            "Storage slot value wasn't changed or has already been committed."
-        );
- 
-        Lib_OVMCodec.Account memory account = ovmStateManager.getAccount(_ovmContractAddress);
-        bytes32 value = ovmStateManager.getContractStorage(_ovmContractAddress, _key);
- 
-        account.storageRoot = Lib_SecureMerkleTrie.update(
-            abi.encodePacked(_key),
-            Lib_RLPWriter.writeBytes(
-                Lib_Bytes32Utils.removeLeadingZeros(value)
-            ),
-            _storageTrieWitness,
-            account.storageRoot
-        );
- 
-        ovmStateManager.putAccount(_ovmContractAddress, account);
- 
-        // Emit an event to help clients figure out the proof ordering.
-        emit ContractStorageCommitted(
-            _ovmContractAddress,
-            _key
-        );
-    }
- 
- 
-    /**********************************
-     * Public Functions: Finalization *
-     **********************************/
- 
-    /**
-     * Finalizes the transition process.
-     */
-    function completeTransition()
-        override
-        public
-        onlyDuringPhase(TransitionPhase.POST_EXECUTION)
-    {
-        require(
-            ovmStateManager.getTotalUncommittedAccounts() == 0,
-            "All accounts must be committed before completing a transition."
-        );
- 
-        require(
-            ovmStateManager.getTotalUncommittedContractStorage() == 0,
-            "All storage must be committed before completing a transition."
-        );
- 
-        phase = TransitionPhase.COMPLETE;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html b/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html deleted file mode 100644 index 6072bb685..000000000 --- a/coverage/optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/OVM_StateTransitionerFactory.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/OVM/verification/ OVM_StateTransitionerFactory.sol -

-
-
- 50% - Statements - 1/2 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 2/2 -
-
- 50% - Lines - 1/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "../../iOVM/verification/iOVM_StateTransitioner.sol";
-import { iOVM_StateTransitionerFactory } from "../../iOVM/verification/iOVM_StateTransitionerFactory.sol";
-import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol";
- 
-/* Contract Imports */
-import { OVM_StateTransitioner } from "./OVM_StateTransitioner.sol";
- 
-/**
- * @title OVM_StateTransitionerFactory
- * @dev The State Transitioner Factory is used by the Fraud Verifier to create a new State 
- * Transitioner during the initialization of a fraud proof.
- * 
- * Compiler used: solc
- * Runtime target: EVM
- */
-contract OVM_StateTransitionerFactory is iOVM_StateTransitionerFactory, Lib_AddressResolver {
- 
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    /**
-     * Creates a new OVM_StateTransitioner
-     * @param _libAddressManager Address of the Address Manager.
-     * @param _stateTransitionIndex Index of the state transition being verified.
-     * @param _preStateRoot State root before the transition was executed.
-     * @param _transactionHash Hash of the executed transaction.
-     * @return _ovmStateTransitioner New OVM_StateTransitioner instance.
-     */
-    function create(
-        address _libAddressManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        override
-        public
-        returns (
-            iOVM_StateTransitioner _ovmStateTransitioner
-        )
-    {
-        Irequire(
-            msg.sender == resolve("OVM_FraudVerifier"),
-            "Create can only be done by the OVM_FraudVerifier."
-        );
-        return new OVM_StateTransitioner(
-            _libAddressManager,
-            _stateTransitionIndex,
-            _preStateRoot,
-            _transactionHash
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/OVM/verification/index.html b/coverage/optimistic-ethereum/OVM/verification/index.html deleted file mode 100644 index e160dcf28..000000000 --- a/coverage/optimistic-ethereum/OVM/verification/index.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/OVM/verification/ - - - - - - - -
-
-

- all files optimistic-ethereum/OVM/verification/ -

-
-
- 90.4% - Statements - 113/125 -
-
- 78.05% - Branches - 64/82 -
-
- 96.67% - Functions - 29/30 -
-
- 90.48% - Lines - 114/126 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Abs_FraudContributor.sol
100%3/3100%0/0100%1/1100%4/4
OVM_BondManager.sol
100%42/4286.67%26/30100%9/9100%41/41
OVM_FraudVerifier.sol
96.43%27/2894.44%17/18100%7/796.43%27/28
OVM_StateTransitioner.sol
80%40/5062.5%20/3290.91%10/1180.39%41/51
OVM_StateTransitionerFactory.sol
50%1/250%1/2100%2/250%1/2
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html b/coverage/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html deleted file mode 100644 index cb0d9f22a..000000000 --- a/coverage/optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/accounts/iOVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/accounts/ iOVM_ECDSAContractAccount.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_ECDSAContractAccount
- */
-interface iOVM_ECDSAContractAccount {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    ) external returns (bool _success, bytes memory _returndata);
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/accounts/index.html b/coverage/optimistic-ethereum/iOVM/accounts/index.html deleted file mode 100644 index ef910e5b5..000000000 --- a/coverage/optimistic-ethereum/iOVM/accounts/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/accounts/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/accounts/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_ECDSAContractAccount.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html deleted file mode 100644 index f21d38c1a..000000000 --- a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/messaging/ iAbs_BaseCrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iAbs_BaseCrossDomainMessenger
- */
-interface iAbs_BaseCrossDomainMessenger {
- 
-    /**********
-     * Events *
-     **********/
-    event SentMessage(bytes message);
-    event RelayedMessage(bytes32 msgHash);
- 
-    /**********************
-     * Contract Variables *
-     **********************/
-    function xDomainMessageSender() external view returns (address);
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sends a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _message Message to send to the target.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function sendMessage(
-        address _target,
-        bytes calldata _message,
-        uint32 _gasLimit
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html deleted file mode 100644 index da13fd02b..000000000 --- a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L1CrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title iOVM_L1CrossDomainMessenger
- */
-interface iOVM_L1CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    struct L2MessageInclusionProof {
-        bytes32 stateRoot;
-        Lib_OVMCodec.ChainBatchHeader stateRootBatchHeader;
-        Lib_OVMCodec.ChainInclusionProof stateRootProof;
-        bytes stateTrieWitness;
-        bytes storageTrieWitness;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @param _proof Inclusion proof for the given message.
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        L2MessageInclusionProof memory _proof
-    ) external;
- 
-    /**
-     * Replays a cross domain message to the target messenger.
-     * @param _target Target contract address.
-     * @param _sender Original sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     * @param _gasLimit Gas limit for the provided message.
-     */
-    function replayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce,
-        uint32 _gasLimit
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html deleted file mode 100644 index bb37bbe09..000000000 --- a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L1MultiMessageRelayer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L1MultiMessageRelayer.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_L1CrossDomainMessenger } from "../../../iOVM/bridge/messaging/iOVM_L1CrossDomainMessenger.sol";
-interface iOVM_L1MultiMessageRelayer {
- 
-    struct L2ToL1Message {
-        address target;
-        address sender;
-        bytes message;
-        uint256 messageNonce;
-        iOVM_L1CrossDomainMessenger.L2MessageInclusionProof proof;
-    }
- 
-    function batchRelayMessages(L2ToL1Message[] calldata _messages) external; 
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html deleted file mode 100644 index 10a409698..000000000 --- a/coverage/optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/iOVM_L2CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/messaging/ iOVM_L2CrossDomainMessenger.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "./iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title iOVM_L2CrossDomainMessenger
- */
-interface iOVM_L2CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Relays a cross domain message to a contract.
-     * @param _target Target contract address.
-     * @param _sender Message sender address.
-     * @param _message Message to send to the target.
-     * @param _messageNonce Nonce for the provided message.
-     */
-    function relayMessage(
-        address _target,
-        address _sender,
-        bytes memory _message,
-        uint256 _messageNonce
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/bridge/messaging/index.html b/coverage/optimistic-ethereum/iOVM/bridge/messaging/index.html deleted file mode 100644 index 3d8e3efae..000000000 --- a/coverage/optimistic-ethereum/iOVM/bridge/messaging/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/messaging/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/bridge/messaging/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iAbs_BaseCrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MultiMessageRelayer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2CrossDomainMessenger.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html deleted file mode 100644 index 8f52453eb..000000000 --- a/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1ETHGateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L1ETHGateway.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L1ETHGateway
- */
-interface iOVM_L1ETHGateway {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event DepositInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
- 
-    event WithdrawalFinalized(
-        address indexed _to,
-        uint256 _amount
-    );
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function deposit()
-        external
-        payable;
- 
-    function depositTo(
-        address _to
-    )
-        external
-        payable;
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external;
- 
-    function getFinalizeDepositL2Gas()
-        external
-        view
-        returns(
-            uint32
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html deleted file mode 100644 index 4de6d7385..000000000 --- a/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L1TokenGateway.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L1TokenGateway.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L1TokenGateway
- */
-interface iOVM_L1TokenGateway {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event DepositInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
-  
-    event WithdrawalFinalized(
-        address indexed _to,
-        uint256 _amount
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function deposit(
-        uint _amount
-    )
-        external;
- 
-    function depositTo(
-        address _to,
-        uint _amount
-    )
-        external;
- 
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeWithdrawal(
-        address _to,
-        uint _amount
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html b/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html deleted file mode 100644 index 0b3777f82..000000000 --- a/coverage/optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/iOVM_L2DepositedToken.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/bridge/tokens/ iOVM_L2DepositedToken.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title iOVM_L2DepositedToken
- */
-interface iOVM_L2DepositedToken {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event WithdrawalInitiated(
-        address indexed _from,
-        address _to,
-        uint256 _amount
-    );
- 
-    event DepositFinalized(
-        address indexed _to,
-        uint256 _amount
-    );    
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function withdraw(
-        uint _amount
-    )
-        external;
- 
-    function withdrawTo(
-        address _to,
-        uint _amount
-    )
-        external;
- 
- 
-    /*************************
-     * Cross-chain Functions *
-     *************************/
- 
-    function finalizeDeposit(
-        address _to,
-        uint _amount
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/bridge/tokens/index.html b/coverage/optimistic-ethereum/iOVM/bridge/tokens/index.html deleted file mode 100644 index 60ef990a9..000000000 --- a/coverage/optimistic-ethereum/iOVM/bridge/tokens/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/bridge/tokens/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/bridge/tokens/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_L1ETHGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1TokenGateway.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2DepositedToken.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html b/coverage/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html deleted file mode 100644 index 719bb7c7e..000000000 --- a/coverage/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol.html +++ /dev/null @@ -1,782 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/chain/ iOVM_CanonicalTransactionChain.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_ChainStorageContainer } from "./iOVM_ChainStorageContainer.sol";
- 
-/**
- * @title iOVM_CanonicalTransactionChain
- */
-interface iOVM_CanonicalTransactionChain {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event TransactionEnqueued(
-        address _l1TxOrigin,
-        address _target,
-        uint256 _gasLimit,
-        bytes _data,
-        uint256 _queueIndex,
-        uint256 _timestamp
-    );
- 
-    event QueueBatchAppended(
-        uint256 _startingQueueIndex,
-        uint256 _numQueueElements,
-        uint256 _totalElements
-    );
- 
-    event SequencerBatchAppended(
-        uint256 _startingQueueIndex,
-        uint256 _numQueueElements,
-        uint256 _totalElements
-    );
- 
-    event TransactionBatchAppended(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot,
-        uint256 _batchSize,
-        uint256 _prevTotalElements,
-        bytes _extraData
-    );
- 
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct BatchContext {
-        uint256 numSequencedTransactions;
-        uint256 numSubsequentQueueTransactions;
-        uint256 timestamp;
-        uint256 blockNumber;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
- 
-    /**
-     * Accesses the batch storage container.
-     * @return Reference to the batch storage container.
-     */
-    function batches()
-        external
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        );
- 
-    /**
-     * Accesses the queue storage container.
-     * @return Reference to the queue storage container.
-     */
-    function queue()
-        external
-        view
-        returns (
-            iOVM_ChainStorageContainer
-        );
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        external
-        view
-        returns (
-            uint256 _totalElements
-        );
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        external
-        view
-        returns (
-            uint256 _totalBatches
-        );
- 
-    /**
-     * Returns the index of the next element to be enqueued.
-     * @return Index for the next queue element.
-     */
-    function getNextQueueIndex()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Gets the queue element at a particular index.
-     * @param _index Index of the queue element to access.
-     * @return _element Queue element at the given index.
-     */
-    function getQueueElement(
-        uint256 _index
-    )
-        external
-        view
-        returns (
-            Lib_OVMCodec.QueueElement memory _element
-        );
- 
-    /**
-     * Returns the timestamp of the last transaction.
-     * @return Timestamp for the last transaction.
-     */
-    function getLastTimestamp()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Returns the blocknumber of the last transaction.
-     * @return Blocknumber for the last transaction.
-     */
-    function getLastBlockNumber()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Get the number of queue elements which have not yet been included.
-     * @return Number of pending queue elements.
-     */
-    function getNumPendingQueueElements()
-        external
-        view
-        returns (
-            uint40
-        );
- 
-    /**
-     * Retrieves the length of the queue, including
-     * both pending and canonical transactions.
-     * @return Length of the queue.
-     */
-    function getQueueLength()
-        external
-        view
-        returns (
-            uint40
-        );
- 
- 
-    /**
-     * Adds a transaction to the queue.
-     * @param _target Target contract to send the transaction to.
-     * @param _gasLimit Gas limit for the given transaction.
-     * @param _data Transaction data.
-     */
-    function enqueue(
-        address _target,
-        uint256 _gasLimit,
-        bytes memory _data
-    )
-        external;
- 
-    /**
-     * Appends a given number of queued transactions as a single batch.
-     * @param _numQueuedTransactions Number of transactions to append.
-     */
-    function appendQueueBatch(
-        uint256 _numQueuedTransactions
-    )
-        external;
- 
-    /**
-     * Allows the sequencer to append a batch of transactions.
-     * @dev This function uses a custom encoding scheme for efficiency reasons.
-     * .param _shouldStartAtElement Specific batch we expect to start appending to.
-     * .param _totalElementsToAppend Total number of batch elements we expect to append.
-     * .param _contexts Array of batch contexts.
-     * .param _transactionDataFields Array of raw transaction data.
-     */
-    function appendSequencerBatch(
-        // uint40 _shouldStartAtElement,
-        // uint24 _totalElementsToAppend,
-        // BatchContext[] _contexts,
-        // bytes[] _transactionDataFields
-    )
-        external;
- 
-    /**
-     * Verifies whether a transaction is included in the chain.
-     * @param _transaction Transaction to verify.
-     * @param _txChainElement Transaction chain element corresponding to the transaction.
-     * @param _batchHeader Header of the batch the transaction was included in.
-     * @param _inclusionProof Inclusion proof for the provided transaction chain element.
-     * @return True if the transaction exists in the CTC, false if not.
-     */
-    function verifyTransaction(
-        Lib_OVMCodec.Transaction memory _transaction,
-        Lib_OVMCodec.TransactionChainElement memory _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _inclusionProof
-    )
-        external
-        view
-        returns (
-            bool
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html b/coverage/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html deleted file mode 100644 index 2a6ce20dc..000000000 --- a/coverage/optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_ChainStorageContainer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/chain/ iOVM_ChainStorageContainer.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_ChainStorageContainer
- */
-interface iOVM_ChainStorageContainer {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sets the container's global metadata field. We're using `bytes27` here because we use five
-     * bytes to maintain the length of the underlying data structure, meaning we have an extra
-     * 27 bytes to store arbitrary data.
-     * @param _globalMetadata New global metadata to set.
-     */
-    function setGlobalMetadata(
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Retrieves the container's global metadata field.
-     * @return Container global metadata field.
-     */
-    function getGlobalMetadata()
-        external
-        view
-        returns (
-            bytes27
-        );
- 
-    /**
-     * Retrieves the number of objects stored in the container.
-     * @return Number of objects in the container.
-     */
-    function length()
-        external
-        view
-        returns (
-            uint256
-        );
- 
-    /**
-     * Pushes an object into the container.
-     * @param _object A 32 byte value to insert into the container.
-     */
-    function push(
-        bytes32 _object
-    )
-        external;
- 
-    /**
-     * Pushes an object into the container. Function allows setting the global metadata since
-     * we'll need to touch the "length" storage slot anyway, which also contains the global
-     * metadata (it's an optimization).
-     * @param _object A 32 byte value to insert into the container.
-     * @param _globalMetadata New global metadata for the container.
-     */
-    function push(
-        bytes32 _object,
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Retrieves an object from the container.
-     * @param _index Index of the particular object to access.
-     * @return 32 byte object value.
-     */
-    function get(
-        uint256 _index
-    )
-        external
-        view
-        returns (
-            bytes32
-        );
- 
-    /**
-     * Removes all objects after and including a given index.
-     * @param _index Object index to delete from.
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index
-    )
-        external;
- 
-    /**
-     * Removes all objects after and including a given index. Also allows setting the global
-     * metadata field.
-     * @param _index Object index to delete from.
-     * @param _globalMetadata New global metadata for the container.
-     */
-    function deleteElementsAfterInclusive(
-        uint256 _index,
-        bytes27 _globalMetadata
-    )
-        external;
- 
-    /**
-     * Marks an index as overwritable, meaing the underlying buffer can start to write values over
-     * any objects before and including the given index.
-     */
-    function setNextOverwritableIndex(
-        uint256 _index
-    )
-        external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html b/coverage/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html deleted file mode 100644 index a65b5ceef..000000000 --- a/coverage/optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/chain/iOVM_StateCommitmentChain.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/chain/ iOVM_StateCommitmentChain.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateCommitmentChain
- */
-interface iOVM_StateCommitmentChain {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event StateBatchAppended(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot,
-        uint256 _batchSize,
-        uint256 _prevTotalElements,
-        bytes _extraData
-    );
- 
-    event StateBatchDeleted(
-        uint256 indexed _batchIndex,
-        bytes32 _batchRoot
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Retrieves the total number of elements submitted.
-     * @return _totalElements Total submitted elements.
-     */
-    function getTotalElements()
-        external
-        view
-        returns (
-            uint256 _totalElements
-        );
- 
-    /**
-     * Retrieves the total number of batches submitted.
-     * @return _totalBatches Total submitted batches.
-     */
-    function getTotalBatches()
-        external
-        view
-        returns (
-            uint256 _totalBatches
-        );
- 
-    /**
-     * Retrieves the timestamp of the last batch submitted by the sequencer.
-     * @return _lastSequencerTimestamp Last sequencer batch timestamp.
-     */
-    function getLastSequencerTimestamp()
-        external
-        view
-        returns (
-            uint256 _lastSequencerTimestamp
-        );
- 
-    /**
-     * Appends a batch of state roots to the chain.
-     * @param _batch Batch of state roots.
-     * @param _shouldStartAtElement Index of the element at which this batch should start.
-     */
-    function appendStateBatch(
-        bytes32[] calldata _batch,
-        uint256 _shouldStartAtElement
-    )
-        external;
- 
-    /**
-     * Deletes all state roots after (and including) a given batch.
-     * @param _batchHeader Header of the batch to start deleting from.
-     */
-    function deleteStateBatch(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        external;
- 
-    /**
-     * Verifies a batch inclusion proof.
-     * @param _element Hash of the element to verify a proof for.
-     * @param _batchHeader Header of the batch in which the element was included.
-     * @param _proof Merkle inclusion proof for the element.
-     */
-    function verifyStateCommitment(
-        bytes32 _element,
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader,
-        Lib_OVMCodec.ChainInclusionProof memory _proof
-    )
-        external
-        view
-        returns (
-            bool _verified
-        );
- 
-    /**
-     * Checks whether a given batch is still inside its fraud proof window.
-     * @param _batchHeader Header of the batch to check.
-     * @return _inside Whether or not the batch is inside the fraud proof window.
-     */
-    function insideFraudProofWindow(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        external
-        view
-        returns (
-            bool _inside
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/chain/index.html b/coverage/optimistic-ethereum/iOVM/chain/index.html deleted file mode 100644 index 79692cb03..000000000 --- a/coverage/optimistic-ethereum/iOVM/chain/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/chain/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/chain/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_CanonicalTransactionChain.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ChainStorageContainer.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateCommitmentChain.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html b/coverage/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html deleted file mode 100644 index caae9773f..000000000 --- a/coverage/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol.html +++ /dev/null @@ -1,533 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/execution/ iOVM_ExecutionManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-interface iOVM_ExecutionManager {
-    /**********
-     * Enums *
-     *********/
- 
-    enum RevertFlag {
-        OUT_OF_GAS,
-        INTENTIONAL_REVERT,
-        EXCEEDS_NUISANCE_GAS,
-        INVALID_STATE_ACCESS,
-        UNSAFE_BYTECODE,
-        CREATE_COLLISION,
-        STATIC_VIOLATION,
-        CREATOR_NOT_ALLOWED
-    }
- 
-    enum GasMetadataKey {
-        CURRENT_EPOCH_START_TIMESTAMP,
-        CUMULATIVE_SEQUENCER_QUEUE_GAS,
-        CUMULATIVE_L1TOL2_QUEUE_GAS,
-        PREV_EPOCH_SEQUENCER_QUEUE_GAS,
-        PREV_EPOCH_L1TOL2_QUEUE_GAS
-    }
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct GasMeterConfig {
-        uint256 minTransactionGasLimit;
-        uint256 maxTransactionGasLimit;
-        uint256 maxGasPerQueuePerEpoch;
-        uint256 secondsPerEpoch;
-    }
- 
-    struct GlobalContext {
-        uint256 ovmCHAINID;
-    }
- 
-    struct TransactionContext {
-        Lib_OVMCodec.QueueOrigin ovmL1QUEUEORIGIN;
-        uint256 ovmTIMESTAMP;
-        uint256 ovmNUMBER;
-        uint256 ovmGASLIMIT;
-        uint256 ovmTXGASLIMIT;
-        address ovmL1TXORIGIN;
-    }
- 
-    struct TransactionRecord {
-        uint256 ovmGasRefund;
-    }
- 
-    struct MessageContext {
-        address ovmCALLER;
-        address ovmADDRESS;
-        bool isStatic;
-    }
- 
-    struct MessageRecord {
-        uint256 nuisanceGasLeft;
-    }
- 
- 
-    /************************************
-     * Transaction Execution Entrypoint *
-     ************************************/
- 
-    function run(
-        Lib_OVMCodec.Transaction calldata _transaction,
-        address _txStateManager
-    ) external;
- 
- 
-    /*******************
-     * Context Opcodes *
-     *******************/
- 
-    function ovmCALLER() external view returns (address _caller);
-    function ovmADDRESS() external view returns (address _address);
-    function ovmTIMESTAMP() external view returns (uint256 _timestamp);
-    function ovmNUMBER() external view returns (uint256 _number);
-    function ovmGASLIMIT() external view returns (uint256 _gasLimit);
-    function ovmCHAINID() external view returns (uint256 _chainId);
- 
- 
-    /**********************
-     * L2 Context Opcodes *
-     **********************/
- 
-    function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
-    function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
- 
- 
-    /*******************
-     * Halting Opcodes *
-     *******************/
- 
-    function ovmREVERT(bytes memory _data) external;
- 
- 
-    /*****************************
-     * Contract Creation Opcodes *
-     *****************************/
- 
-    function ovmCREATE(bytes memory _bytecode) external returns (address _contract, bytes memory _revertdata);
-    function ovmCREATE2(bytes memory _bytecode, bytes32 _salt) external returns (address _contract, bytes memory _revertdata);
- 
- 
-    /*******************************
-     * Account Abstraction Opcodes *
-     ******************************/
- 
-    function ovmGETNONCE() external returns (uint256 _nonce);
-    function ovmSETNONCE(uint256 _nonce) external;
-    function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
- 
- 
-    /****************************
-     * Contract Calling Opcodes *
-     ****************************/
- 
-    function ovmCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
-    function ovmSTATICCALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
-    function ovmDELEGATECALL(uint256 _gasLimit, address _address, bytes memory _calldata) external returns (bool _success, bytes memory _returndata);
- 
- 
-    /****************************
-     * Contract Storage Opcodes *
-     ****************************/
- 
-    function ovmSLOAD(bytes32 _key) external returns (bytes32 _value);
-    function ovmSSTORE(bytes32 _key, bytes32 _value) external;
- 
- 
-    /*************************
-     * Contract Code Opcodes *
-     *************************/
- 
-    function ovmEXTCODECOPY(address _contract, uint256 _offset, uint256 _length) external returns (bytes memory _code);
-    function ovmEXTCODESIZE(address _contract) external returns (uint256 _size);
-    function ovmEXTCODEHASH(address _contract) external returns (bytes32 _hash);
- 
- 
-    /***************************************
-     * Public Functions: Execution Context *
-     ***************************************/
- 
-    function getMaxTransactionGasLimit() external view returns (uint _maxTransactionGasLimit);
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html b/coverage/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html deleted file mode 100644 index 2879de4b0..000000000 --- a/coverage/optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_SafetyChecker.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/execution/ iOVM_SafetyChecker.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_SafetyChecker
- */
-interface iOVM_SafetyChecker {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function isBytecodeSafe(bytes calldata _bytecode) external pure returns (bool);
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html b/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html deleted file mode 100644 index d50f8d0b1..000000000 --- a/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol.html +++ /dev/null @@ -1,296 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_StateManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/execution/ iOVM_StateManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateManager
- */
-interface iOVM_StateManager {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum ItemState {
-        ITEM_UNTOUCHED,
-        ITEM_LOADED,
-        ITEM_CHANGED,
-        ITEM_COMMITTED
-    }
- 
-    /***************************
-     * Public Functions: Misc *
-     ***************************/
- 
-    function isAuthenticated(address _address) external view returns (bool);
- 
-    /***************************
-     * Public Functions: Setup *
-     ***************************/
- 
-    function owner() external view returns (address _owner);
-    function ovmExecutionManager() external view returns (address _ovmExecutionManager);
-    function setExecutionManager(address _ovmExecutionManager) external;
- 
- 
-    /************************************
-     * Public Functions: Account Access *
-     ************************************/
- 
-    function putAccount(address _address, Lib_OVMCodec.Account memory _account) external;
-    function putEmptyAccount(address _address) external;
-    function getAccount(address _address) external view returns (Lib_OVMCodec.Account memory _account);
-    function hasAccount(address _address) external view returns (bool _exists);
-    function hasEmptyAccount(address _address) external view returns (bool _exists);
-    function setAccountNonce(address _address, uint256 _nonce) external;
-    function getAccountNonce(address _address) external view returns (uint256 _nonce);
-    function getAccountEthAddress(address _address) external view returns (address _ethAddress);
-    function getAccountStorageRoot(address _address) external view returns (bytes32 _storageRoot);
-    function initPendingAccount(address _address) external;
-    function commitPendingAccount(address _address, address _ethAddress, bytes32 _codeHash) external;
-    function testAndSetAccountLoaded(address _address) external returns (bool _wasAccountAlreadyLoaded);
-    function testAndSetAccountChanged(address _address) external returns (bool _wasAccountAlreadyChanged);
-    function commitAccount(address _address) external returns (bool _wasAccountCommitted);
-    function incrementTotalUncommittedAccounts() external;
-    function getTotalUncommittedAccounts() external view returns (uint256 _total);
-    function wasAccountChanged(address _address) external view returns (bool);
-    function wasAccountCommitted(address _address) external view returns (bool);
- 
- 
-    /************************************
-     * Public Functions: Storage Access *
-     ************************************/
- 
-    function putContractStorage(address _contract, bytes32 _key, bytes32 _value) external;
-    function getContractStorage(address _contract, bytes32 _key) external view returns (bytes32 _value);
-    function hasContractStorage(address _contract, bytes32 _key) external view returns (bool _exists);
-    function testAndSetContractStorageLoaded(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyLoaded);
-    function testAndSetContractStorageChanged(address _contract, bytes32 _key) external returns (bool _wasContractStorageAlreadyChanged);
-    function commitContractStorage(address _contract, bytes32 _key) external returns (bool _wasContractStorageCommitted);
-    function incrementTotalUncommittedContractStorage() external;
-    function getTotalUncommittedContractStorage() external view returns (uint256 _total);
-    function wasContractStorageChanged(address _contract, bytes32 _key) external view returns (bool);
-    function wasContractStorageCommitted(address _contract, bytes32 _key) external view returns (bool);
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html b/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html deleted file mode 100644 index ad5e6f218..000000000 --- a/coverage/optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/iOVM_StateManagerFactory.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/execution/ iOVM_StateManagerFactory.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { iOVM_StateManager } from "./iOVM_StateManager.sol";
- 
-/**
- * @title iOVM_StateManagerFactory
- */
-interface iOVM_StateManagerFactory {
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    function create(
-        address _owner
-    )
-        external
-        returns (
-            iOVM_StateManager _ovmStateManager
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/execution/index.html b/coverage/optimistic-ethereum/iOVM/execution/index.html deleted file mode 100644 index 05e6abd73..000000000 --- a/coverage/optimistic-ethereum/iOVM/execution/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/execution/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/execution/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_ExecutionManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_SafetyChecker.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateManagerFactory.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html deleted file mode 100644 index eea280b9e..000000000 --- a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_DeployerWhitelist.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/predeploys/ iOVM_DeployerWhitelist.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_DeployerWhitelist
- */
-interface iOVM_DeployerWhitelist {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function initialize(address _owner, bool _allowArbitraryDeployment) external;
-    function getOwner() external returns (address _owner);
-    function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;
-    function setOwner(address _newOwner) external;
-    function setAllowArbitraryDeployment(bool _allowArbitraryDeployment) external;
-    function enableArbitraryContractDeployment() external;
-    function isDeployerAllowed(address _deployer) external returns (bool _allowed);
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html deleted file mode 100644 index 4015dddbb..000000000 --- a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_ERC20.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/predeploys/ iOVM_ERC20.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_ERC20
- */
-interface iOVM_ERC20 {
-    /* This is a slight change to the ERC20 base standard.
-    function totalSupply() constant returns (uint256 supply);
-    is replaced with:
-    uint256 public totalSupply;
-    This automatically creates a getter function for the totalSupply.
-    This is moved to the base contract since public getter functions are not
-    currently recognised as an implementation of the matching abstract
-    function by the compiler.
-    */
-    /// total amount of tokens
-    function totalSupply() external view returns (uint256);
- 
-    /// @param _owner The address from which the balance will be retrieved
-    /// @return balance The balance
-    function balanceOf(address _owner) external view returns (uint256 balance);
- 
-    /// @notice send `_value` token to `_to` from `msg.sender`
-    /// @param _to The address of the recipient
-    /// @param _value The amount of token to be transferred
-    /// @return success Whether the transfer was successful or not
-    function transfer(address _to, uint256 _value) external returns (bool success);
- 
-    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
-    /// @param _from The address of the sender
-    /// @param _to The address of the recipient
-    /// @param _value The amount of token to be transferred
-    /// @return success Whether the transfer was successful or not
-    function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
- 
-    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens
-    /// @param _spender The address of the account able to transfer the tokens
-    /// @param _value The amount of tokens to be approved for transfer
-    /// @return success Whether the approval was successful or not
-    function approve(address _spender, uint256 _value) external returns (bool success);
- 
-    /// @param _owner The address of the account owning tokens
-    /// @param _spender The address of the account able to transfer the tokens
-    /// @return remaining Amount of remaining tokens allowed to spent
-    function allowance(address _owner, address _spender) external view returns (uint256 remaining);
- 
-    // solhint-disable-next-line no-simple-event-func-name
-    event Transfer(address indexed _from, address indexed _to, uint256 _value);
-    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
-    event Mint(address indexed _account, uint256 _amount);
-    event Burn(address indexed _account, uint256 _amount);
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html deleted file mode 100644 index 2ee6275c9..000000000 --- a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_L1MessageSender.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/predeploys/ iOVM_L1MessageSender.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_L1MessageSender
- */
-interface iOVM_L1MessageSender {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function getL1MessageSender() external view returns (address _l1MessageSender);
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html b/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html deleted file mode 100644 index 3fbedd282..000000000 --- a/coverage/optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/iOVM_L2ToL1MessagePasser.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/predeploys/ iOVM_L2ToL1MessagePasser.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title iOVM_L2ToL1MessagePasser
- */
-interface iOVM_L2ToL1MessagePasser {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event L2ToL1Message(
-        uint256 _nonce,
-        address _sender,
-        bytes _data
-    );
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function passMessageToL1(bytes calldata _message) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/predeploys/index.html b/coverage/optimistic-ethereum/iOVM/predeploys/index.html deleted file mode 100644 index fc65f5166..000000000 --- a/coverage/optimistic-ethereum/iOVM/predeploys/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/predeploys/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/predeploys/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_DeployerWhitelist.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_ERC20.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L1MessageSender.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_L2ToL1MessagePasser.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html b/coverage/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html deleted file mode 100644 index 736e664e0..000000000 --- a/coverage/optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_BondManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/verification/ iOVM_BondManager.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-interface ERC20 {
-    function transfer(address, uint256) external returns (bool);
-    function transferFrom(address, address, uint256) external returns (bool);
-}
- 
-/// All the errors which may be encountered on the bond manager
-library Errors {
-    string constant ERC20_ERR = "BondManager: Could not post bond";
-    string constant ALREADY_FINALIZED = "BondManager: Fraud proof for this pre-state root has already been finalized";
-    string constant SLASHED = "BondManager: Cannot finalize withdrawal, you probably got slashed";
-    string constant WRONG_STATE = "BondManager: Wrong bond state for proposer";
-    string constant CANNOT_CLAIM = "BondManager: Cannot claim yet. Dispute must be finalized first";
- 
-    string constant WITHDRAWAL_PENDING = "BondManager: Withdrawal already pending";
-    string constant TOO_EARLY = "BondManager: Too early to finalize your withdrawal";
- 
-    string constant ONLY_TRANSITIONER = "BondManager: Only the transitioner for this pre-state root may call this function";
-    string constant ONLY_FRAUD_VERIFIER = "BondManager: Only the fraud verifier may call this function";
-    string constant ONLY_STATE_COMMITMENT_CHAIN = "BondManager: Only the state commitment chain may call this function";
-    string constant WAIT_FOR_DISPUTES = "BondManager: Wait for other potential disputes";
-}
- 
-/**
- * @title iOVM_BondManager
- */
-interface iOVM_BondManager {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    /// The lifecycle of a proposer's bond
-    enum State {
-        // Before depositing or after getting slashed, a user is uncollateralized
-        NOT_COLLATERALIZED,
-        // After depositing, a user is collateralized
-        COLLATERALIZED,
-        // After a user has initiated a withdrawal
-        WITHDRAWING
-    }
- 
-    /// A bond posted by a proposer
-    struct Bond {
-        // The user's state
-        State state;
-        // The timestamp at which a proposer issued their withdrawal request
-        uint32 withdrawalTimestamp;
-        // The time when the first disputed was initiated for this bond
-        uint256 firstDisputeAt;
-        // The earliest observed state root for this bond which has had fraud
-        bytes32 earliestDisputedStateRoot;
-        // The state root's timestamp
-        uint256 earliestTimestamp;
-    }
- 
-    // Per pre-state root, store the number of state provisions that were made
-    // and how many of these calls were made by each user. Payouts will then be
-    // claimed by users proportionally for that dispute.
-    struct Rewards {
-        // Flag to check if rewards for a fraud proof are claimable
-        bool canClaim;
-        // Total number of `recordGasSpent` calls made
-        uint256 total;
-        // The gas spent by each user to provide witness data. The sum of all
-        // values inside this map MUST be equal to the value of `total`
-        mapping(address => uint256) gasSpent;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function recordGasSpent(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        address _who,
-        uint256 _gasSpent
-    ) external;
- 
-    function finalize(
-        bytes32 _preStateRoot,
-        address _publisher,
-        uint256 _timestamp
-    ) external;
- 
-    function deposit() external;
- 
-    function startWithdrawal() external;
- 
-    function finalizeWithdrawal() external;
- 
-    function claim(
-        address _who
-    ) external;
- 
-    function isCollateralized(
-        address _who
-    ) external view returns (bool);
- 
-    function getGasSpent(
-        bytes32 _preStateRoot,
-        address _who
-    ) external view returns (uint256);
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html b/coverage/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html deleted file mode 100644 index 6a84d41e2..000000000 --- a/coverage/optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_FraudVerifier.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/verification/ iOVM_FraudVerifier.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/* Interface Imports */
-import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
- 
-/**
- * @title iOVM_FraudVerifier
- */
-interface iOVM_FraudVerifier {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event FraudProofInitialized(
-        bytes32 _preStateRoot,
-        uint256 _preStateRootIndex,
-        bytes32 _transactionHash,
-        address _who
-    );
- 
-    event FraudProofFinalized(
-        bytes32 _preStateRoot,
-        uint256 _preStateRootIndex,
-        bytes32 _transactionHash,
-        address _who
-    );
- 
- 
-    /***************************************
-     * Public Functions: Transition Status *
-     ***************************************/
- 
-    function getStateTransitioner(bytes32 _preStateRoot, bytes32 _txHash) external view returns (iOVM_StateTransitioner _transitioner);
- 
- 
-    /****************************************
-     * Public Functions: Fraud Verification *
-     ****************************************/
- 
-    function initializeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
-        Lib_OVMCodec.Transaction calldata _transaction,
-        Lib_OVMCodec.TransactionChainElement calldata _txChainElement,
-        Lib_OVMCodec.ChainBatchHeader calldata _transactionBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _transactionProof
-    ) external;
- 
-    function finalizeFraudVerification(
-        bytes32 _preStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _preStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _preStateRootProof,
-        bytes32 _txHash,
-        bytes32 _postStateRoot,
-        Lib_OVMCodec.ChainBatchHeader calldata _postStateRootBatchHeader,
-        Lib_OVMCodec.ChainInclusionProof calldata _postStateRootProof
-    ) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html b/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html deleted file mode 100644 index 7bf0a4555..000000000 --- a/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_StateTransitioner.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/verification/ iOVM_StateTransitioner.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title iOVM_StateTransitioner
- */
-interface iOVM_StateTransitioner {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event AccountCommitted(
-        address _address
-    );
- 
-    event ContractStorageCommitted(
-        address _address,
-        bytes32 _key
-    );
- 
- 
-    /**********************************
-     * Public Functions: State Access *
-     **********************************/
- 
-    function getPreStateRoot() external view returns (bytes32 _preStateRoot);
-    function getPostStateRoot() external view returns (bytes32 _postStateRoot);
-    function isComplete() external view returns (bool _complete);
- 
- 
-    /***********************************
-     * Public Functions: Pre-Execution *
-     ***********************************/
- 
-    function proveContractState(
-        address _ovmContractAddress,
-        address _ethContractAddress,
-        bytes calldata _stateTrieWitness
-    ) external;
- 
-    function proveStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes calldata _storageTrieWitness
-    ) external;
- 
- 
-    /*******************************
-     * Public Functions: Execution *
-     *******************************/
- 
-    function applyTransaction(
-        Lib_OVMCodec.Transaction calldata _transaction
-    ) external;
- 
- 
-    /************************************
-     * Public Functions: Post-Execution *
-     ************************************/
- 
-    function commitContractState(
-        address _ovmContractAddress,
-        bytes calldata _stateTrieWitness
-    ) external;
- 
-    function commitStorageSlot(
-        address _ovmContractAddress,
-        bytes32 _key,
-        bytes calldata _storageTrieWitness
-    ) external;
- 
- 
-    /**********************************
-     * Public Functions: Finalization *
-     **********************************/
- 
-    function completeTransition() external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html b/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html deleted file mode 100644 index 29124d9c6..000000000 --- a/coverage/optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/iOVM_StateTransitionerFactory.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/iOVM/verification/ iOVM_StateTransitionerFactory.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { iOVM_StateTransitioner } from "./iOVM_StateTransitioner.sol";
- 
-/**
- * @title iOVM_StateTransitionerFactory
- */
-interface iOVM_StateTransitionerFactory {
- 
-    /***************************************
-     * Public Functions: Contract Creation *
-     ***************************************/
- 
-    function create(
-        address _proxyManager,
-        uint256 _stateTransitionIndex,
-        bytes32 _preStateRoot,
-        bytes32 _transactionHash
-    )
-        external
-        returns (
-            iOVM_StateTransitioner _ovmStateTransitioner
-        );
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/iOVM/verification/index.html b/coverage/optimistic-ethereum/iOVM/verification/index.html deleted file mode 100644 index 4655a37c6..000000000 --- a/coverage/optimistic-ethereum/iOVM/verification/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/iOVM/verification/ - - - - - - - -
-
-

- all files optimistic-ethereum/iOVM/verification/ -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
iOVM_BondManager.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_FraudVerifier.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitioner.sol
100%0/0100%0/0100%0/0100%0/0
iOVM_StateTransitionerFactory.sol
100%0/0100%0/0100%0/0100%0/0
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html b/coverage/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html deleted file mode 100644 index 38cfe2666..000000000 --- a/coverage/optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/bridge/OVM_CrossDomainEnabled.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/bridge/ OVM_CrossDomainEnabled.sol -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 4/4 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 6/6 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -78× -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-/* Interface Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title OVM_CrossDomainEnabled
- * @dev Helper contract for contracts performing cross-domain communications
- *
- * Compiler used: defined by inheriting contract
- * Runtime target: defined by inheriting contract
- */
-contract OVM_CrossDomainEnabled {
-    // Messenger contract used to send and recieve messages from the other domain.
-    address public messenger;
- 
-    /***************
-     * Constructor *
-     ***************/    
-    constructor(
-        address _messenger
-    ) {
-        messenger = _messenger;
-    }
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    /**
-     * @notice Enforces that the modified function is only callable by a specific cross-domain account.
-     * @param _sourceDomainAccount The only account on the originating domain which is authenticated to call this function.
-     */
-    modifier onlyFromCrossDomainAccount(
-        address _sourceDomainAccount
-    ) {
-        require(
-            msg.sender == address(getCrossDomainMessenger()),
-            "OVM_XCHAIN: messenger contract unauthenticated"
-        );
- 
-        require(
-            getCrossDomainMessenger().xDomainMessageSender() == _sourceDomainAccount,
-            "OVM_XCHAIN: wrong sender of cross-domain message"
-        );
- 
-        _;
-    }
-    
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Gets the messenger, usually from storage.  This function is exposed in case a child contract needs to override.
-     * @return The address of the cross-domain messenger contract which should be used. 
-     */
-    function getCrossDomainMessenger()
-        internal
-        virtual
-        returns(
-            iAbs_BaseCrossDomainMessenger
-        )
-    {
-        return iAbs_BaseCrossDomainMessenger(messenger);
-    }
- 
-    /**
-     * @notice Sends a message to an account on another domain
-     * @param _crossDomainTarget The intended recipient on the destination domain
-     * @param _data The data to send to the target (usually calldata to a function with `onlyFromCrossDomainAccount()`)
-     * @param _gasLimit The gasLimit for the receipt of the message on the target domain.
-     */
-    function sendCrossDomainMessage(
-        address _crossDomainTarget,
-        bytes memory _data,
-        uint32 _gasLimit
-    ) internal {
-        getCrossDomainMessenger().sendMessage(_crossDomainTarget, _data, _gasLimit);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/bridge/index.html b/coverage/optimistic-ethereum/libraries/bridge/index.html deleted file mode 100644 index 53b785d67..000000000 --- a/coverage/optimistic-ethereum/libraries/bridge/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/bridge/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/bridge/ -

-
-
- 100% - Statements - 5/5 -
-
- 100% - Branches - 4/4 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 6/6 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
OVM_CrossDomainEnabled.sol
100%5/5100%4/4100%4/4100%6/6
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html b/coverage/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html deleted file mode 100644 index d903ad31e..000000000 --- a/coverage/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol.html +++ /dev/null @@ -1,1178 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/codec/ Lib_OVMCodec.sol -

-
-
- 100% - Statements - 33/33 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 33/33 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  -  -  - -  - - - - - -  - -  - - - - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - -  -  -  -  - -  -  -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -113× -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
-import { Lib_Bytes32Utils } from "../utils/Lib_Bytes32Utils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title Lib_OVMCodec
- */
-library Lib_OVMCodec {
- 
-    /*********
-     * Enums *
-     *********/
- 
-    enum EOASignatureType {
-        EIP155_TRANSACTON,
-        ETH_SIGNED_MESSAGE
-    }
- 
-    enum QueueOrigin {
-        SEQUENCER_QUEUE,
-        L1TOL2_QUEUE
-    }
- 
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct Account {
-        uint256 nonce;
-        uint256 balance;
-        bytes32 storageRoot;
-        bytes32 codeHash;
-        address ethAddress;
-        bool isFresh;
-    }
- 
-    struct EVMAccount {
-        uint256 nonce;
-        uint256 balance;
-        bytes32 storageRoot;
-        bytes32 codeHash;
-    }
- 
-    struct ChainBatchHeader {
-        uint256 batchIndex;
-        bytes32 batchRoot;
-        uint256 batchSize;
-        uint256 prevTotalElements;
-        bytes extraData;
-    }
- 
-    struct ChainInclusionProof {
-        uint256 index;
-        bytes32[] siblings;
-    }
- 
-    struct Transaction {
-        uint256 timestamp;
-        uint256 blockNumber;
-        QueueOrigin l1QueueOrigin;
-        address l1TxOrigin;
-        address entrypoint;
-        uint256 gasLimit;
-        bytes data;
-    }
- 
-    struct TransactionChainElement {
-        bool isSequenced;
-        uint256 queueIndex;  // QUEUED TX ONLY
-        uint256 timestamp;   // SEQUENCER TX ONLY
-        uint256 blockNumber; // SEQUENCER TX ONLY
-        bytes txData;        // SEQUENCER TX ONLY
-    }
- 
-    struct QueueElement {
-        bytes32 transactionHash;
-        uint40 timestamp;
-        uint40 blockNumber;
-    }
- 
-    struct EIP155Transaction {
-        uint256 nonce;
-        uint256 gasPrice;
-        uint256 gasLimit;
-        address to;
-        uint256 value;
-        bytes data;
-        uint256 chainId;
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Decodes an EOA transaction (i.e., native Ethereum RLP encoding).
-     * @param _transaction Encoded EOA transaction.
-     * @return Transaction decoded into a struct.
-     */
-    function decodeEIP155Transaction(
-        bytes memory _transaction,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (
-            EIP155Transaction memory
-        )
-    {
-        if (_isEthSignedMessage) {
-            (
-                uint256 _nonce,
-                uint256 _gasLimit,
-                uint256 _gasPrice,
-                uint256 _chainId,
-                address _to,
-                bytes memory _data
-            ) = abi.decode(
-                _transaction,
-                (uint256, uint256, uint256, uint256, address ,bytes)
-            );
-            return EIP155Transaction({
-                nonce: _nonce,
-                gasPrice: _gasPrice,
-                gasLimit: _gasLimit,
-                to: _to,
-                value: 0,
-                data: _data,
-                chainId: _chainId
-            });
-        } else {
-            Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_transaction);
- 
-            return EIP155Transaction({
-                nonce: Lib_RLPReader.readUint256(decoded[0]),
-                gasPrice: Lib_RLPReader.readUint256(decoded[1]),
-                gasLimit: Lib_RLPReader.readUint256(decoded[2]),
-                to: Lib_RLPReader.readAddress(decoded[3]),
-                value: Lib_RLPReader.readUint256(decoded[4]),
-                data: Lib_RLPReader.readBytes(decoded[5]),
-                chainId:  Lib_RLPReader.readUint256(decoded[6])
-            });
-        }
-    }
- 
-    /**
-     * Decompresses a compressed EIP155 transaction.
-     * @param _transaction Compressed EIP155 transaction bytes.
-     * @return Transaction parsed into a struct.
-     */
-    function decompressEIP155Transaction(
-        bytes memory _transaction
-    )
-        internal
-        returns (
-            EIP155Transaction memory
-        )
-    {
-        return EIP155Transaction({
-            gasLimit: Lib_BytesUtils.toUint24(_transaction, 0),
-            gasPrice: uint256(Lib_BytesUtils.toUint24(_transaction, 3)) * 1000000,
-            nonce: Lib_BytesUtils.toUint24(_transaction, 6),
-            to: Lib_BytesUtils.toAddress(_transaction, 9),
-            data: Lib_BytesUtils.slice(_transaction, 29),
-            chainId: Lib_SafeExecutionManagerWrapper.safeCHAINID(),
-            value: 0
-        });
-    }
- 
-    /**
-     * Encodes an EOA transaction back into the original transaction.
-     * @param _transaction EIP155transaction to encode.
-     * @param _isEthSignedMessage Whether or not this was an eth signed message.
-     * @return Encoded transaction.
-     */
-    function encodeEIP155Transaction(
-        EIP155Transaction memory _transaction,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        if (_isEthSignedMessage) {
-            return abi.encode(
-                _transaction.nonce,
-                _transaction.gasLimit,
-                _transaction.gasPrice,
-                _transaction.chainId,
-                _transaction.to,
-                _transaction.data
-            );
-        } else {
-            bytes[] memory raw = new bytes[](9);
- 
-            raw[0] = Lib_RLPWriter.writeUint(_transaction.nonce);
-            raw[1] = Lib_RLPWriter.writeUint(_transaction.gasPrice);
-            raw[2] = Lib_RLPWriter.writeUint(_transaction.gasLimit);
-            if (_transaction.to == address(0)) {
-                raw[3] = Lib_RLPWriter.writeBytes('');
-            } else {
-                raw[3] = Lib_RLPWriter.writeAddress(_transaction.to);
-            }
-            raw[4] = Lib_RLPWriter.writeUint(0);
-            raw[5] = Lib_RLPWriter.writeBytes(_transaction.data);
-            raw[6] = Lib_RLPWriter.writeUint(_transaction.chainId);
-            raw[7] = Lib_RLPWriter.writeBytes(bytes(''));
-            raw[8] = Lib_RLPWriter.writeBytes(bytes(''));
- 
-            return Lib_RLPWriter.writeList(raw);
-        }
-    }
- 
-    /**
-     * Encodes a standard OVM transaction.
-     * @param _transaction OVM transaction to encode.
-     * @return Encoded transaction bytes.
-     */
-    function encodeTransaction(
-        Transaction memory _transaction
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodePacked(
-            _transaction.timestamp,
-            _transaction.blockNumber,
-            _transaction.l1QueueOrigin,
-            _transaction.l1TxOrigin,
-            _transaction.entrypoint,
-            _transaction.gasLimit,
-            _transaction.data
-        );
-    }
- 
-    /**
-     * Hashes a standard OVM transaction.
-     * @param _transaction OVM transaction to encode.
-     * @return Hashed transaction
-     */
-    function hashTransaction(
-        Transaction memory _transaction
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(encodeTransaction(_transaction));
-    }
- 
-    /**
-     * Converts an OVM account to an EVM account.
-     * @param _in OVM account to convert.
-     * @return Converted EVM account.
-     */
-    function toEVMAccount(
-        Account memory _in
-    )
-        internal
-        pure
-        returns (
-            EVMAccount memory
-        )
-    {
-        return EVMAccount({
-            nonce: _in.nonce,
-            balance: _in.balance,
-            storageRoot: _in.storageRoot,
-            codeHash: _in.codeHash
-        });
-    }
- 
-    /**
-     * @notice RLP-encodes an account state struct.
-     * @param _account Account state struct.
-     * @return RLP-encoded account state.
-     */
-    function encodeEVMAccount(
-        EVMAccount memory _account
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes[] memory raw = new bytes[](4);
- 
-        // Unfortunately we can't create this array outright because
-        // Lib_RLPWriter.writeList will reject fixed-size arrays. Assigning
-        // index-by-index circumvents this issue.
-        raw[0] = Lib_RLPWriter.writeBytes(
-            Lib_Bytes32Utils.removeLeadingZeros(
-                bytes32(_account.nonce)
-            )
-        );
-        raw[1] = Lib_RLPWriter.writeBytes(
-            Lib_Bytes32Utils.removeLeadingZeros(
-                bytes32(_account.balance)
-            )
-        );
-        raw[2] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.storageRoot));
-        raw[3] = Lib_RLPWriter.writeBytes(abi.encodePacked(_account.codeHash));
- 
-        return Lib_RLPWriter.writeList(raw);
-    }
- 
-    /**
-     * @notice Decodes an RLP-encoded account state into a useful struct.
-     * @param _encoded RLP-encoded account state.
-     * @return Account state struct.
-     */
-    function decodeEVMAccount(
-        bytes memory _encoded
-    )
-        internal
-        pure
-        returns (
-            EVMAccount memory
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory accountState = Lib_RLPReader.readList(_encoded);
- 
-        return EVMAccount({
-            nonce: Lib_RLPReader.readUint256(accountState[0]),
-            balance: Lib_RLPReader.readUint256(accountState[1]),
-            storageRoot: Lib_RLPReader.readBytes32(accountState[2]),
-            codeHash: Lib_RLPReader.readBytes32(accountState[3])
-        });
-    }
- 
-    /**
-     * Calculates a hash for a given batch header.
-     * @param _batchHeader Header to hash.
-     * @return Hash of the header.
-     */
-    function hashBatchHeader(
-        Lib_OVMCodec.ChainBatchHeader memory _batchHeader
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return keccak256(
-            abi.encode(
-                _batchHeader.batchRoot,
-                _batchHeader.batchSize,
-                _batchHeader.prevTotalElements,
-                _batchHeader.extraData
-            )
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/codec/index.html b/coverage/optimistic-ethereum/libraries/codec/index.html deleted file mode 100644 index 9d8deae87..000000000 --- a/coverage/optimistic-ethereum/libraries/codec/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/codec/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/codec/ -

-
-
- 100% - Statements - 33/33 -
-
- 100% - Branches - 6/6 -
-
- 100% - Functions - 9/9 -
-
- 100% - Lines - 33/33 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_OVMCodec.sol
100%33/33100%6/6100%9/9100%33/33
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html b/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html deleted file mode 100644 index 39482864f..000000000 --- a/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/Lib_AddressManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/resolver/ Lib_AddressManager.sol -

-
-
- 100% - Statements - 4/4 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -390× -390× -  -  -  -  -  -  -  -  -  -2164× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2554× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Contract Imports */
-import { Ownable } from "./Lib_Ownable.sol";
- 
-/**
- * @title Lib_AddressManager
- */
-contract Lib_AddressManager is Ownable {
- 
-    /**********
-     * Events *
-     **********/
- 
-    event AddressSet(
-        string _name,
-        address _newAddress
-    );
- 
-    /*******************************************
-     * Contract Variables: Internal Accounting *
-     *******************************************/
- 
-    mapping (bytes32 => address) private addresses;
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function setAddress(
-        string memory _name,
-        address _address
-    )
-        public
-        onlyOwner
-    {
-        emit AddressSet(_name, _address);
-        addresses[_getNameHash(_name)] = _address;
-    }
- 
-    function getAddress(
-        string memory _name
-    )
-        public
-        view
-        returns (address)
-    {
-        return addresses[_getNameHash(_name)];
-    }
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function _getNameHash(
-        string memory _name
-    )
-        internal
-        pure
-        returns (
-            bytes32 _hash
-        )
-    {
-        return keccak256(abi.encodePacked(_name));
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html b/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html deleted file mode 100644 index 648b9c25f..000000000 --- a/coverage/optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/Lib_AddressResolver.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/resolver/ Lib_AddressResolver.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1062× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2133× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressManager } from "./Lib_AddressManager.sol";
- 
-/**
- * @title Lib_AddressResolver
- */
-abstract contract Lib_AddressResolver {
- 
-    /*******************************************
-     * Contract Variables: Contract References *
-     *******************************************/
- 
-    Lib_AddressManager internal libAddressManager;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Lib_AddressManager.
-     */
-    constructor(
-        address _libAddressManager
-    )  {
-        libAddressManager = Lib_AddressManager(_libAddressManager);
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function resolve(
-        string memory _name
-    )
-        public
-        view
-        returns (
-            address _contract
-        )
-    {
-        return libAddressManager.getAddress(_name);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html b/coverage/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html deleted file mode 100644 index b25d23d2e..000000000 --- a/coverage/optimistic-ethereum/libraries/resolver/Lib_Ownable.sol.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/Lib_Ownable.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/resolver/ Lib_Ownable.sol -

-
-
- 37.5% - Statements - 3/8 -
-
- 25% - Branches - 1/4 -
-
- 50% - Functions - 2/4 -
-
- 44.44% - Lines - 4/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -126× -126× -  -  -  -  -  -  -  -  -390× -  -  -  -390× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Ownable
- * @dev Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
- */
-abstract contract Ownable {
- 
-    /*************
-     * Variables *
-     *************/
- 
-    address public owner;
- 
- 
-    /**********
-     * Events *
-     **********/
- 
-    event OwnershipTransferred(
-        address indexed previousOwner,
-        address indexed newOwner
-    );
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    constructor() {
-        owner = msg.sender;
-        emit OwnershipTransferred(address(0), owner);
-    }
- 
- 
-    /**********************
-     * Function Modifiers *
-     **********************/
- 
-    modifier onlyOwner() {
-        Erequire(
-            owner == msg.sender,
-            "Ownable: caller is not the owner"
-        );
-        _;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    function renounceOwnership()
-        public
-        virtual
-        onlyOwner
-    {
-        emit OwnershipTransferred(owner, address(0));
-        owner = address(0);
-    }
- 
-    function transferOwnership(address _newOwner)
-        public
-        virtual
-        onlyOwner
-    {
-        require(
-            _newOwner != address(0),
-            "Ownable: new owner cannot be the zero address"
-        );
- 
-        emit OwnershipTransferred(owner, _newOwner);
-        owner = _newOwner;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html b/coverage/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html deleted file mode 100644 index 5d72132f0..000000000 --- a/coverage/optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/Lib_ResolvedDelegateProxy.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/resolver/ Lib_ResolvedDelegateProxy.sol -

-
-
- 100% - Statements - 6/6 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 8/8 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -36× -36× -  -  -  -  -  -  -  -  -  -  -31× -31× -  -  -  -  -31× -  -31× -22× -  -  -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_AddressManager } from "./Lib_AddressManager.sol";
- 
-/**
- * @title Lib_ResolvedDelegateProxy
- */
-contract Lib_ResolvedDelegateProxy {
- 
-    /*************
-     * Variables *
-     *************/
- 
- 
-    // Using mappings to store fields to avoid overwriting storage slots in the
-    // implementation contract. For example, instead of storing these fields at
-    // storage slot `0` & `1`, they are stored at `keccak256(key + slot)`.
-    // See: https://solidity.readthedocs.io/en/v0.7.0/internals/layout_in_storage.html
-    // NOTE: Do not use this code in your own contract system. 
-    //      There is a known flaw in this contract, and we will remove it from the repository
-    //      in the near future. Due to the very limited way that we are using it, this flaw is
-    //      not an issue in our system. 
-    mapping(address=>string) private implementationName;
-    mapping(address=>Lib_AddressManager) private addressManager;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _libAddressManager Address of the Lib_AddressManager.
-     * @param _implementationName implementationName of the contract to proxy to.
-     */
-    constructor(
-        address _libAddressManager,
-        string memory _implementationName
-    )
-    {
-        addressManager[address(this)] = Lib_AddressManager(_libAddressManager);
-        implementationName[address(this)] = _implementationName;
-    }
- 
- 
-    /*********************
-     * Fallback Function *
-     *********************/
- 
-    fallback()
-        external
-    {
-        address target = addressManager[address(this)].getAddress((implementationName[address(this)]));
-        Erequire(
-            target != address(0),
-            "Target address must be initialized."
-        );
- 
-        (bool success, bytes memory returndata) = target.delegatecall(msg.data);
- 
-        if (success == true) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/resolver/index.html b/coverage/optimistic-ethereum/libraries/resolver/index.html deleted file mode 100644 index db7272d11..000000000 --- a/coverage/optimistic-ethereum/libraries/resolver/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/resolver/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/resolver/ -

-
-
- 75% - Statements - 15/20 -
-
- 50% - Branches - 4/8 -
-
- 81.82% - Functions - 9/11 -
-
- 78.26% - Lines - 18/23 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_AddressManager.sol
100%4/4100%0/0100%3/3100%4/4
Lib_AddressResolver.sol
100%2/2100%0/0100%2/2100%2/2
Lib_Ownable.sol
37.5%3/825%1/450%2/444.44%4/9
Lib_ResolvedDelegateProxy.sol
100%6/675%3/4100%2/2100%8/8
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html b/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html deleted file mode 100644 index 4e8f16658..000000000 --- a/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol.html +++ /dev/null @@ -1,1925 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/rlp/ Lib_RLPReader.sol -

-
-
- 98.68% - Statements - 75/76 -
-
- 67.5% - Branches - 27/40 -
-
- 94.74% - Functions - 18/19 -
-
- 98.8% - Lines - 82/83 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -512× -512× -  -  -  -512× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -450× -  -  -  -  -  -446× -  -  -  -  -  -  -  -  -446× -  -446× -446× -446× -4230× -  -  -  -  -4230× -  -  -  -  -  -  -  -4230× -  -  -  -  -4230× -4230× -  -  -  -446× -  -  -  -446× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -450× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -651× -  -  -  -  -  -651× -  -  -  -  -651× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -68× -  -  -  -  -68× -  -  -  -  -  -68× -  -  -  -  -68× -68× -68× -  -  -  -  -  -  -  -  -68× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -56× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  - - - -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -776× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -5399× -  -  -  -  -5395× -5395× -5395× -  -  -  -5395× -  -  -33× -  -  -  -4334× -  -4334× -  -  -  -  -4334× -  -  -536× -  -536× -  -  -  -  -536× -536× -  -  -  -  -  -  -  -536× -  -  -  -  -536× -  -  -89× -  -89× -  -  -  -  -89× -  -  -403× -  -403× -  -  -  -  -403× -403× -  -  -  -  -  -  -  -403× -  -  -  -  -403× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1427× -1427× - -  -  -1426× -1426× -1426× -  -  -  -  -1426× -2634× -  -  -  -2634× -2634× -  -  -  -1426× -1426× -  -  -  -  -  -  -  -  -  -1426× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -776× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_RLPReader
- * @dev Adapted from "RLPReader" by Hamdi Allam (hamdi.allam97@gmail.com).
- */
-library Lib_RLPReader {
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 constant internal MAX_LIST_LENGTH = 32;
- 
- 
-    /*********
-     * Enums *
-     *********/
- 
-    enum RLPItemType {
-        DATA_ITEM,
-        LIST_ITEM
-    }
- 
-    
-    /***********
-     * Structs *
-     ***********/
- 
-    struct RLPItem {
-        uint256 length;
-        uint256 ptr;
-    }
-    
- 
-    /**********************
-     * Internal Functions *
-     **********************/
-    
-    /**
-     * Converts bytes to a reference to memory position and length.
-     * @param _in Input bytes to convert.
-     * @return Output memory reference.
-     */
-    function toRLPItem(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem memory
-        )
-    {
-        uint256 ptr;
-        assembly {
-            ptr := add(_in, 32)
-        }
- 
-        return RLPItem({
-            length: _in.length,
-            ptr: ptr
-        });
-    }
- 
-    /**
-     * Reads an RLP list value into a list of RLP items.
-     * @param _in RLP list value.
-     * @return Decoded RLP list items.
-     */
-    function readList(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem[] memory
-        )
-    {
-        (
-            uint256 listOffset,
-            ,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.LIST_ITEM,
-            "Invalid RLP list value."
-        );
- 
-        // Solidity in-memory arrays can't be increased in size, but *can* be decreased in size by
-        // writing to the length. Since we can't know the number of RLP items without looping over
-        // the entire input, we'd have to loop twice to accurately size this array. It's easier to
-        // simply set a reasonable maximum list length and decrease the size before we finish.
-        RLPItem[] memory out = new RLPItem[](MAX_LIST_LENGTH);
- 
-        uint256 itemCount = 0;
-        uint256 offset = listOffset;
-        while (offset < _in.length) {
-            Erequire(
-                itemCount < MAX_LIST_LENGTH,
-                "Provided RLP list exceeds max list length."
-            );
- 
-            (
-                uint256 itemOffset,
-                uint256 itemLength,
-            ) = _decodeLength(RLPItem({
-                length: _in.length - offset,
-                ptr: _in.ptr + offset
-            }));
- 
-            out[itemCount] = RLPItem({
-                length: itemLength + itemOffset,
-                ptr: _in.ptr + offset
-            });
- 
-            itemCount += 1;
-            offset += itemOffset + itemLength;
-        }
- 
-        // Decrease the array size to match the actual item count.
-        assembly {
-            mstore(out, itemCount)
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Reads an RLP list value into a list of RLP items.
-     * @param _in RLP list value.
-     * @return Decoded RLP list items.
-     */
-    function readList(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            RLPItem[] memory
-        )
-    {
-        return readList(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bytes value into bytes.
-     * @param _in RLP bytes value.
-     * @return Decoded bytes.
-     */
-    function readBytes(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        (
-            uint256 itemOffset,
-            uint256 itemLength,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.DATA_ITEM,
-            "Invalid RLP bytes value."
-        );
- 
-        return _copy(_in.ptr, itemOffset, itemLength);
-    }
- 
-    /**
-     * Reads an RLP bytes value into bytes.
-     * @param _in RLP bytes value.
-     * @return Decoded bytes.
-     */
-    function readBytes(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return readBytes(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP string value into a string.
-     * @param _in RLP string value.
-     * @return Decoded string.
-     */
-    function readString(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            string memory
-        )
-    {
-        return string(readBytes(_in));
-    }
- 
-    /**
-     * Reads an RLP string value into a string.
-     * @param _in RLP string value.
-     * @return Decoded string.
-     */
-    function readString(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            string memory
-        )
-    {
-        return readString(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bytes32 value into a bytes32.
-     * @param _in RLP bytes32 value.
-     * @return Decoded bytes32.
-     */
-    function readBytes32(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        Erequire(
-            _in.length <= 33,
-            "Invalid RLP bytes32 value."
-        );
- 
-        (
-            uint256 itemOffset,
-            uint256 itemLength,
-            RLPItemType itemType
-        ) = _decodeLength(_in);
- 
-        Erequire(
-            itemType == RLPItemType.DATA_ITEM,
-            "Invalid RLP bytes32 value."
-        );
- 
-        uint256 ptr = _in.ptr + itemOffset;
-        bytes32 out;
-        assembly {
-            out := mload(ptr)
- 
-            // Shift the bytes over to match the item size.
-            if lt(itemLength, 32) {
-                out := div(out, exp(256, sub(32, itemLength)))
-            }
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Reads an RLP bytes32 value into a bytes32.
-     * @param _in RLP bytes32 value.
-     * @return Decoded bytes32.
-     */
-    function readBytes32(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return readBytes32(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP uint256 value into a uint256.
-     * @param _in RLP uint256 value.
-     * @return Decoded uint256.
-     */
-    function readUint256(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        return uint256(readBytes32(_in));
-    }
- 
-    /**
-     * Reads an RLP uint256 value into a uint256.
-     * @param _in RLP uint256 value.
-     * @return Decoded uint256.
-     */
-    function readUint256(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        return readUint256(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP bool value into a bool.
-     * @param _in RLP bool value.
-     * @return Decoded bool.
-     */
-    function readBool(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        Erequire(
-            _in.length == 1,
-            "Invalid RLP boolean value."
-        );
- 
-        uint256 ptr = _in.ptr;
-        uint256 out;
-        assembly {
-            out := byte(0, mload(ptr))
-        }
- 
-        return out != 0;
-    }
- 
-    /**
-     * Reads an RLP bool value into a bool.
-     * @param _in RLP bool value.
-     * @return Decoded bool.
-     */
-    function readBool(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        return readBool(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads an RLP address value into a address.
-     * @param _in RLP address value.
-     * @return Decoded address.
-     */
-    function readAddress(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        if (_in.length == 1) {
-            return address(0);
-        }
- 
-        Erequire(
-            _in.length == 21,
-            "Invalid RLP address value."
-        );
- 
-        return address(readUint256(_in));
-    }
- 
-    /**
-     * Reads an RLP address value into a address.
-     * @param _in RLP address value.
-     * @return Decoded address.
-     */
-    function readAddress(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        return readAddress(
-            toRLPItem(_in)
-        );
-    }
- 
-    /**
-     * Reads the raw bytes of an RLP item.
-     * @param _in RLP item to read.
-     * @return Raw RLP bytes.
-     */
-    function readRawBytes(
-        RLPItem memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return _copy(_in);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Decodes the length of an RLP item.
-     * @param _in RLP item to decode.
-     * @return Offset of the encoded data.
-     * @return Length of the encoded data.
-     * @return RLP item type (LIST_ITEM or DATA_ITEM).
-     */
-    function _decodeLength(
-        RLPItem memory _in
-    )
-        private
-        pure
-        returns (
-            uint256,
-            uint256,
-            RLPItemType
-        )
-    {
-        require(
-            _in.length > 0,
-            "RLP item cannot be null."
-        );
- 
-        uint256 ptr = _in.ptr;
-        uint256 prefix;
-        assembly {
-            prefix := byte(0, mload(ptr))
-        }
- 
-        if (prefix <= 0x7f) {
-            // Single byte.
- 
-            return (0, 1, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xb7) {
-            // Short string.
- 
-            uint256 strLen = prefix - 0x80;
-            
-            Erequire(
-                _in.length > strLen,
-                "Invalid RLP short string."
-            );
- 
-            return (1, strLen, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xbf) {
-            // Long string.
-            uint256 lenOfStrLen = prefix - 0xb7;
- 
-            Erequire(
-                _in.length > lenOfStrLen,
-                "Invalid RLP long string length."
-            );
- 
-            uint256 strLen;
-            assembly {
-                // Pick out the string length.
-                strLen := div(
-                    mload(add(ptr, 1)),
-                    exp(256, sub(32, lenOfStrLen))
-                )
-            }
- 
-            Erequire(
-                _in.length > lenOfStrLen + strLen,
-                "Invalid RLP long string."
-            );
- 
-            return (1 + lenOfStrLen, strLen, RLPItemType.DATA_ITEM);
-        } else if (prefix <= 0xf7) {
-            // Short list.
-            uint256 listLen = prefix - 0xc0;
- 
-            Erequire(
-                _in.length > listLen,
-                "Invalid RLP short list."
-            );
- 
-            return (1, listLen, RLPItemType.LIST_ITEM);
-        } else {
-            // Long list.
-            uint256 lenOfListLen = prefix - 0xf7;
- 
-            Erequire(
-                _in.length > lenOfListLen,
-                "Invalid RLP long list length."
-            );
- 
-            uint256 listLen;
-            assembly {
-                // Pick out the list length.
-                listLen := div(
-                    mload(add(ptr, 1)),
-                    exp(256, sub(32, lenOfListLen))
-                )
-            }
- 
-            Erequire(
-                _in.length > lenOfListLen + listLen,
-                "Invalid RLP long list."
-            );
- 
-            return (1 + lenOfListLen, listLen, RLPItemType.LIST_ITEM);
-        }
-    }
- 
-    /**
-     * Copies the bytes from a memory location.
-     * @param _src Pointer to the location to read from.
-     * @param _offset Offset to start reading from.
-     * @param _length Number of bytes to read.
-     * @return Copied bytes.
-     */
-    function _copy(
-        uint256 _src,
-        uint256 _offset,
-        uint256 _length
-    )
-        private
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes memory out = new bytes(_length);
-        if (out.length == 0) {
-            return out;
-        }
- 
-        uint256 src = _src + _offset;
-        uint256 dest;
-        assembly {
-            dest := add(out, 32)
-        }
- 
-        // Copy over as many complete words as we can.
-        for (uint256 i = 0; i < _length / 32; i++) {
-            assembly {
-                mstore(dest, mload(src))
-            }
- 
-            src += 32;
-            dest += 32;
-        }
- 
-        // Pick out the remaining bytes.
-        uint256 mask = 256 ** (32 - (_length % 32)) - 1;
-        assembly {
-            mstore(
-                dest,
-                or(
-                    and(mload(src), not(mask)),
-                    and(mload(dest), mask)
-                )
-            )
-        }
- 
-        return out;
-    }
- 
-    /**
-     * Copies an RLP item into bytes.
-     * @param _in RLP item to copy.
-     * @return Copied bytes.
-     */
-    function _copy(
-        RLPItem memory _in
-    )
-        private
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return _copy(_in.ptr, 0, _in.length);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html b/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html deleted file mode 100644 index 03e613a85..000000000 --- a/coverage/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol.html +++ /dev/null @@ -1,911 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/rlp/ Lib_RLPWriter.sol -

-
-
- 94.55% - Statements - 52/55 -
-
- 100% - Branches - 8/8 -
-
- 90% - Functions - 9/10 -
-
- 95.08% - Lines - 58/61 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -324× -  -324× -16× -  -308× -  -  -324× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -157× -157× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -139× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -30× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -465× -  -465× -415× -415× -  -50× -50× -50× -72× -72× -  -  -50× -50× -50× -72× -  -  -  -465× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -52× -  -52× -52× -1643× -24× -  -  -  -52× -52× -45× -  -  -52× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1030× -1030× -1030× -  -1030× -420× -  -  -420× -420× -  -  -1030× -1030× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -157× - -  -  -149× -149× -149× -1030× -  -  -149× -149× -149× -  -149× -1030× -  -1030× -1030× -  -1030× -1030× -  -  -149× -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
- 
-/**
- * @title Lib_RLPWriter
- * @author Bakaoh (with modifications)
- */
-library Lib_RLPWriter {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * RLP encodes a byte string.
-     * @param _in The byte string to encode.
-     * @return _out The RLP encoded string in bytes.
-     */
-    function writeBytes(
-        bytes memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory encoded;
- 
-        if (_in.length == 1 && uint8(_in[0]) < 128) {
-            encoded = _in;
-        } else {
-            encoded = abi.encodePacked(_writeLength(_in.length, 128), _in);
-        }
- 
-        return encoded;
-    }
- 
-    /**
-     * RLP encodes a list of RLP encoded byte byte strings.
-     * @param _in The list of RLP encoded byte strings.
-     * @return _out The RLP encoded list of items in bytes.
-     */
-    function writeList(
-        bytes[] memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory list = _flatten(_in);
-        return abi.encodePacked(_writeLength(list.length, 192), list);
-    }
- 
-    /**
-     * RLP encodes a string.
-     * @param _in The string to encode.
-     * @return _out The RLP encoded string in bytes.
-     */
-    function writeString(
-        string memory _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(bytes(_in));
-    }
- 
-    /**
-     * RLP encodes an address.
-     * @param _in The address to encode.
-     * @return _out The RLP encoded address in bytes.
-     */
-    function writeAddress(
-        address _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(abi.encodePacked(_in));
-    }
- 
-    /**
-     * RLP encodes a uint.
-     * @param _in The uint256 to encode.
-     * @return _out The RLP encoded uint256 in bytes.
-     */
-    function writeUint(
-        uint256 _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return writeBytes(_toBinary(_in));
-    }
- 
-    /**
-     * RLP encodes a bool.
-     * @param _in The bool to encode.
-     * @return _out The RLP encoded bool in bytes.
-     */
-    function writeBool(
-        bool _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        bytes memory encoded = new bytes(1);
-        encoded[0] = (_in ? bytes1(0x01) : bytes1(0x80));
-        return encoded;
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Encode the first byte, followed by the `len` in binary form if `length` is more than 55.
-     * @param _len The length of the string or the payload.
-     * @param _offset 128 if item is string, 192 if item is list.
-     * @return _encoded RLP encoded bytes.
-     */
-    function _writeLength(
-        uint256 _len,
-        uint256 _offset
-    )
-        private
-        pure
-        returns (
-            bytes memory _encoded
-        )
-    {
-        bytes memory encoded;
- 
-        if (_len < 56) {
-            encoded = new bytes(1);
-            encoded[0] = byte(uint8(_len) + uint8(_offset));
-        } else {
-            uint256 lenLen;
-            uint256 i = 1;
-            while (_len / i != 0) {
-                lenLen++;
-                i *= 256;
-            }
- 
-            encoded = new bytes(lenLen + 1);
-            encoded[0] = byte(uint8(lenLen) + uint8(_offset) + 55);
-            for(i = 1; i <= lenLen; i++) {
-                encoded[i] = byte(uint8((_len / (256**(lenLen-i))) % 256));
-            }
-        }
- 
-        return encoded;
-    }
- 
-    /**
-     * Encode integer in big endian binary form with no leading zeroes.
-     * @notice TODO: This should be optimized with assembly to save gas costs.
-     * @param _x The integer to encode.
-     * @return _binary RLP encoded bytes.
-     */
-    function _toBinary(
-        uint256 _x
-    )
-        private
-        pure
-        returns (
-            bytes memory _binary
-        )
-    {
-        bytes memory b = abi.encodePacked(_x);
- 
-        uint256 i = 0;
-        for (; i < 32; i++) {
-            if (b[i] != 0) {
-                break;
-            }
-        }
- 
-        bytes memory res = new bytes(32 - i);
-        for (uint256 j = 0; j < res.length; j++) {
-            res[j] = b[i++];
-        }
- 
-        return res;
-    }
- 
-    /**
-     * Copies a piece of memory to another location.
-     * @notice From: https://github.com/Arachnid/solidity-stringutils/blob/master/src/strings.sol.
-     * @param _dest Destination location.
-     * @param _src Source location.
-     * @param _len Length of memory to copy.
-     */
-    function _memcpy(
-        uint256 _dest,
-        uint256 _src,
-        uint256 _len
-    )
-        private
-        pure
-    {
-        uint256 dest = _dest;
-        uint256 src = _src;
-        uint256 len = _len;
- 
-        for(; len >= 32; len -= 32) {
-            assembly {
-                mstore(dest, mload(src))
-            }
-            dest += 32;
-            src += 32;
-        }
- 
-        uint256 mask = 256 ** (32 - len) - 1;
-        assembly {
-            let srcpart := and(mload(src), not(mask))
-            let destpart := and(mload(dest), mask)
-            mstore(dest, or(destpart, srcpart))
-        }
-    }
- 
-    /**
-     * Flattens a list of byte strings into one byte string.
-     * @notice From: https://github.com/sammayo/solidity-rlp-encoder/blob/master/RLPEncode.sol.
-     * @param _list List of byte strings to flatten.
-     * @return _flattened The flattened byte string.
-     */
-    function _flatten(
-        bytes[] memory _list
-    )
-        private
-        pure
-        returns (
-            bytes memory _flattened
-        )
-    {
-        if (_list.length == 0) {
-            return new bytes(0);
-        }
- 
-        uint256 len;
-        uint256 i = 0;
-        for (; i < _list.length; i++) {
-            len += _list[i].length;
-        }
- 
-        bytes memory flattened = new bytes(len);
-        uint256 flattenedPtr;
-        assembly { flattenedPtr := add(flattened, 0x20) }
- 
-        for(i = 0; i < _list.length; i++) {
-            bytes memory item = _list[i];
- 
-            uint256 listPtr;
-            assembly { listPtr := add(item, 0x20)}
- 
-            _memcpy(flattenedPtr, listPtr, item.length);
-            flattenedPtr += _list[i].length;
-        }
- 
-        return flattened;
-    }
-}
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/rlp/index.html b/coverage/optimistic-ethereum/libraries/rlp/index.html deleted file mode 100644 index a6477149e..000000000 --- a/coverage/optimistic-ethereum/libraries/rlp/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/rlp/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/rlp/ -

-
-
- 96.95% - Statements - 127/131 -
-
- 72.92% - Branches - 35/48 -
-
- 93.1% - Functions - 27/29 -
-
- 97.22% - Lines - 140/144 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_RLPReader.sol
98.68%75/7667.5%27/4094.74%18/1998.8%82/83
Lib_RLPWriter.sol
94.55%52/55100%8/890%9/1095.08%58/61
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html b/coverage/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html deleted file mode 100644 index c7a07cece..000000000 --- a/coverage/optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/standards/IUniswapV2ERC20.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/standards/ IUniswapV2ERC20.sol -

-
-
- 100% - Statements - 0/0 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 0/0 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-interface IUniswapV2ERC20 {
-    event Approval(address indexed owner, address indexed spender, uint value);
-    event Transfer(address indexed from, address indexed to, uint value);
- 
-    function name() external view returns (string memory);
-    function symbol() external view returns (string memory);
-    function decimals() external view returns (uint8);
-    function totalSupply() external view returns (uint);
-    function balanceOf(address owner) external view returns (uint);
-    function allowance(address owner, address spender) external view returns (uint);
- 
-    function approve(address spender, uint value) external returns (bool);
-    function transfer(address to, uint value) external returns (bool);
-    function transferFrom(address from, address to, uint value) external returns (bool);
- 
-    function DOMAIN_SEPARATOR() external view returns (bytes32);
-    function PERMIT_TYPEHASH() external pure returns (bytes32);
-    function nonces(address owner) external view returns (uint);
- 
-    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html b/coverage/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html deleted file mode 100644 index fca77d0f2..000000000 --- a/coverage/optimistic-ethereum/libraries/standards/UniSafeMath.sol.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/standards/UniSafeMath.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/standards/ UniSafeMath.sol -

-
-
- 66.67% - Statements - 2/3 -
-
- 33.33% - Branches - 2/6 -
-
- 66.67% - Functions - 2/3 -
-
- 66.67% - Lines - 2/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19  -  -  -  -  -  -  - -  -  -  -10× -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
- 
-library UniSafeMath {
-    function add(uint x, uint y) internal pure returns (uint z) {
-        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
-    }
- 
-    function sub(uint x, uint y) internal pure returns (uint z) {
-        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
-    }
- 
-    function mul(uint x, uint y) internal pure returns (uint z) {
-        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html b/coverage/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html deleted file mode 100644 index 17a1f4209..000000000 --- a/coverage/optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/standards/UniswapV2ERC20.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/standards/ UniswapV2ERC20.sol -

-
-
- 82.14% - Statements - 23/28 -
-
- 16.67% - Branches - 1/6 -
-
- 88.89% - Functions - 8/9 -
-
- 82.76% - Lines - 24/29 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -39× -39× -  -39× -39× -  -  -39× -  -  -  -  -  -  -  -  -  -  -  - - - -  -  -  - - - -  -  -  - - -  -  -  - - - -  -  -  - - -  -  -  - - -  -  -  - - -  - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >=0.5.16 <0.8.0;
- 
-import './IUniswapV2ERC20.sol';
-import './UniSafeMath.sol';
- 
-contract UniswapV2ERC20 is IUniswapV2ERC20 {
-    using UniSafeMath for uint;
- 
-    string public override name;
-    string public override symbol;
-    uint8 public constant override decimals = 18;
-    uint public override totalSupply;
-    mapping(address => uint) public override balanceOf;
-    mapping(address => mapping(address => uint)) public override allowance;
- 
-    bytes32 public override DOMAIN_SEPARATOR;
-    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
-    bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
-    mapping(address => uint) public override nonces;
- 
-    constructor(
-    string memory _name,
-        string memory _symbol
-    ) {
-        name = _name;
-        symbol = _symbol;
- 
-        uint chainId;
-        assembly {
-            chainId := chainid()
-        }
-        DOMAIN_SEPARATOR = keccak256(
-            abi.encode(
-                keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
-                keccak256(bytes(name)),
-                keccak256(bytes('1')),
-                chainId,
-                address(this)
-            )
-        );
-    }
- 
-    function _mint(address to, uint value) internal {
-        totalSupply = totalSupply.add(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(address(0), to, value);
-    }
- 
-    function _burn(address from, uint value) internal {
-        balanceOf[from] = balanceOf[from].sub(value);
-        totalSupply = totalSupply.sub(value);
-        emit Transfer(from, address(0), value);
-    }
- 
-    function _approve(address owner, address spender, uint value) private {
-        allowance[owner][spender] = value;
-        emit Approval(owner, spender, value);
-    }
- 
-    function _transfer(address from, address to, uint value) private {
-        balanceOf[from] = balanceOf[from].sub(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(from, to, value);
-    }
- 
-    function approve(address spender, uint value) external override returns (bool) {
-        _approve(msg.sender, spender, value);
-        return true;
-    }
- 
-    function transfer(address to, uint value) external override returns (bool) {
-        _transfer(msg.sender, to, value);
-        return true;
-    }
- 
-    function transferFrom(address from, address to, uint value) external override returns (bool) {
-        Eif (allowance[from][msg.sender] != uint(-1)) {
-            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
-        }
-        _transfer(from, to, value);
-        return true;
-    }
- 
-    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override {
-        require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
-        bytes32 digest = keccak256(
-            abi.encodePacked(
-                '\x19\x01',
-                DOMAIN_SEPARATOR,
-                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
-            )
-        );
-        address recoveredAddress = ecrecover(digest, v, r, s);
-        require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
-        _approve(owner, spender, value);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/standards/index.html b/coverage/optimistic-ethereum/libraries/standards/index.html deleted file mode 100644 index a7881423d..000000000 --- a/coverage/optimistic-ethereum/libraries/standards/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/standards/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/standards/ -

-
-
- 80.65% - Statements - 25/31 -
-
- 25% - Branches - 3/12 -
-
- 83.33% - Functions - 10/12 -
-
- 81.25% - Lines - 26/32 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
IUniswapV2ERC20.sol
100%0/0100%0/0100%0/0100%0/0
UniSafeMath.sol
66.67%2/333.33%2/666.67%2/366.67%2/3
UniswapV2ERC20.sol
82.14%23/2816.67%1/688.89%8/982.76%24/29
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html b/coverage/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html deleted file mode 100644 index 873c10410..000000000 --- a/coverage/optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol.html +++ /dev/null @@ -1,2945 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/trie/ Lib_MerkleTrie.sol -

-
-
- 72.45% - Statements - 142/196 -
-
- 55.88% - Branches - 38/68 -
-
- 84.62% - Functions - 22/26 -
-
- 72.02% - Lines - 139/193 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -25× -  -  -  -  -24× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -22× -22× -22× -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -77× -73× -  -58× -  -58× -  -  -  -  -58× -  -58× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -95× -95× -  -95× -95× -95× -95× -  -  -95× -243× -243× -  -  -  -243× -  -243× -  -95× -  -  -  -  -  -148× -  -  -  -  -  -  -  -  -  -  -  -229× -147× -  -  -  -  -  -147× -147× -147× -147× -147× -  -  -82× -82× -82× -82× -82× -82× -  -82× -80× -  -  -  -  -  -73× -  -  -  -80× -80× -  - -  -  -  -  -  -  -  - - - -  -  - -  -  -  -  -  -  -  -80× -80× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -22× -  -  -  -  -  -22× -22× -  -22× -  -  -22× -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -22× -22× -  -  -22× -  -65× -65× -  -65× -  -  -22× -22× -  -  - - -  -  -  - -  - -  -  -  -  -42× -  -42× -42× -42× -  -  -  -  -65× -  -  -  -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -99× -95× -  -95× -265× -265× -  -  -  -  -  -95× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -148× -  -148× -  -  -  -  -148× -  -  -148× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -172× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -45× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -51× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -65× -  -  -65× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -87× -42× -  -45× -45× -  -45× -44× -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -82× -82× -4991× -  -82× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -65× -  -65× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -714× -  -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -22× -22× -22× -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -42× -42× -42× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -23× -23× -23× -23× -23× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -45× -26× -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -  -22× -43× -  -  -  -22× -22× -  -  -22× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../utils/Lib_BytesUtils.sol";
-import { Lib_RLPReader } from "../rlp/Lib_RLPReader.sol";
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
- 
-/**
- * @title Lib_MerkleTrie
- */
-library Lib_MerkleTrie {
- 
-    /*******************
-     * Data Structures *
-     *******************/
- 
-    enum NodeType {
-        BranchNode,
-        ExtensionNode,
-        LeafNode
-    }
- 
-    struct TrieNode {
-        bytes encoded;
-        Lib_RLPReader.RLPItem[] decoded;
-    }
- 
- 
-    /**********************
-     * Contract Constants *
-     **********************/
- 
-    // TREE_RADIX determines the number of elements per branch node.
-    uint256 constant TREE_RADIX = 16;
-    // Branch nodes have TREE_RADIX elements plus an additional `value` slot.
-    uint256 constant BRANCH_NODE_LENGTH = TREE_RADIX + 1;
-    // Leaf nodes and extension nodes always have two elements, a `path` and a `value`.
-    uint256 constant LEAF_OR_EXTENSION_NODE_LENGTH = 2;
- 
-    // Prefixes are prepended to the `path` within a leaf or extension node and
-    // allow us to differentiate between the two node types. `ODD` or `EVEN` is
-    // determined by the number of nibbles within the unprefixed `path`. If the
-    // number of nibbles if even, we need to insert an extra padding nibble so
-    // the resulting prefixed `path` has an even number of nibbles.
-    uint8 constant PREFIX_EXTENSION_EVEN = 0;
-    uint8 constant PREFIX_EXTENSION_ODD = 1;
-    uint8 constant PREFIX_LEAF_EVEN = 2;
-    uint8 constant PREFIX_LEAF_ODD = 3;
- 
-    // Just a utility constant. RLP represents `NULL` as 0x80.
-    bytes1 constant RLP_NULL = bytes1(0x80);
-    bytes constant RLP_NULL_BYTES = hex'80';
-    bytes32 constant internal KECCAK256_RLP_NULL_BYTES = keccak256(RLP_NULL_BYTES);
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Verifies a proof that a given key/value pair is present in the
-     * Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _value Value of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
-     * traditional Merkle trees, this proof is executed top-down and consists
-     * of a list of RLP-encoded nodes that make a path down to the target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
-     */
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        (
-            bool exists,
-            bytes memory value
-        ) = get(_key, _proof, _root);
- 
-        return (
-            exists && Lib_BytesUtils.equal(_value, value)
-        );
-    }
- 
-    /**
-     * @notice Verifies a proof that a given key is *not* present in
-     * the Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the key is absent in the trie, `false` otherwise.
-     */
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        (
-            bool exists,
-        ) = get(_key, _proof, _root);
- 
-        return exists == false;
-    }
- 
-    /**
-     * @notice Updates a Merkle trie and returns a new root hash.
-     * @param _key Key of the node to update, as a hex string.
-     * @param _value Value of the node to update, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node. If the key exists, we can simply update the value.
-     * Otherwise, we need to modify the trie to handle the new k/v pair.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _updatedRoot Root hash of the newly constructed trie.
-     */
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        // Special case when inserting the very first node.
-        Iif (_root == KECCAK256_RLP_NULL_BYTES) {
-            return getSingleNodeRootHash(_key, _value);
-        }
- 
-        TrieNode[] memory proof = _parseProof(_proof);
-        (uint256 pathLength, bytes memory keyRemainder, ) = _walkNodePath(proof, _key, _root);
-        TrieNode[] memory newPath = _getNewPath(proof, pathLength, keyRemainder, _value);
- 
-        return _getUpdatedTrieRoot(newPath, _key);
-    }
- 
-    /**
-     * @notice Retrieves the value associated with a given key.
-     * @param _key Key to search for, as hex bytes.
-     * @param _proof Merkle trie inclusion proof for the key.
-     * @param _root Known root of the Merkle trie.
-     * @return _exists Whether or not the key exists.
-     * @return _value Value of the key if it exists.
-     */
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _exists,
-            bytes memory _value
-        )
-    {
-        TrieNode[] memory proof = _parseProof(_proof);
-        (uint256 pathLength, bytes memory keyRemainder, bool isFinalNode) = _walkNodePath(proof, _key, _root);
- 
-        bool exists = keyRemainder.length == 0;
- 
-        Erequire(
-            exists || isFinalNode,
-            "Provided proof is invalid."
-        );
- 
-        bytes memory value = exists ? _getNodeValue(proof[pathLength - 1]) : bytes('');
- 
-        return (
-            exists,
-            value
-        );
-    }
- 
-    /**
-     * Computes the root hash for a trie with a single node.
-     * @param _key Key for the single node.
-     * @param _value Value for the single node.
-     * @return _updatedRoot Hash of the trie.
-     */
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        return keccak256(_makeLeafNode(
-            Lib_BytesUtils.toNibbles(_key),
-            _value
-        ).encoded);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * @notice Walks through a proof using a provided key.
-     * @param _proof Inclusion proof to walk through.
-     * @param _key Key to use for the walk.
-     * @param _root Known root of the trie.
-     * @return _pathLength Length of the final path
-     * @return _keyRemainder Portion of the key remaining after the walk.
-     * @return _isFinalNode Whether or not we've hit a dead end.
-     */
-    function _walkNodePath(
-        TrieNode[] memory _proof,
-        bytes memory _key,
-        bytes32 _root
-    )
-        private
-        pure
-        returns (
-            uint256 _pathLength,
-            bytes memory _keyRemainder,
-            bool _isFinalNode
-        )
-    {
-        uint256 pathLength = 0;
-        bytes memory key = Lib_BytesUtils.toNibbles(_key);
- 
-        bytes32 currentNodeID = _root;
-        uint256 currentKeyIndex = 0;
-        uint256 currentKeyIncrement = 0;
-        TrieNode memory currentNode;
- 
-        // Proof is top-down, so we start at the first element (root).
-        for (uint256 i = 0; i < _proof.length; i++) {
-            currentNode = _proof[i];
-            currentKeyIndex += currentKeyIncrement;
- 
-            // Keep track of the proof elements we actually need.
-            // It's expensive to resize arrays, so this simply reduces gas costs.
-            pathLength += 1;
- 
-            if (currentKeyIndex == 0) {
-                // First proof element is always the root node.
-                require(
-                    keccak256(currentNode.encoded) == currentNodeID,
-                    "Invalid root hash"
-                );
-            } else Eif (currentNode.encoded.length >= 32) {
-                // Nodes 32 bytes or larger are hashed inside branch nodes.
-                require(
-                    keccak256(currentNode.encoded) == currentNodeID,
-                    "Invalid large internal hash"
-                );
-            } else {
-                // Nodes smaller than 31 bytes aren't hashed.
-                require(
-                    Lib_BytesUtils.toBytes32(currentNode.encoded) == currentNodeID,
-                    "Invalid internal node hash"
-                );
-            }
- 
-            if (currentNode.decoded.length == BRANCH_NODE_LENGTH) {
-                Iif (currentKeyIndex == key.length) {
-                    // We've hit the end of the key, meaning the value should be within this branch node.
-                    break;
-                } else {
-                    // We're not at the end of the key yet.
-                    // Figure out what the next node ID should be and continue.
-                    uint8 branchKey = uint8(key[currentKeyIndex]);
-                    Lib_RLPReader.RLPItem memory nextNode = currentNode.decoded[branchKey];
-                    currentNodeID = _getNodeID(nextNode);
-                    currentKeyIncrement = 1;
-                    continue;
-                }
-            } else Eif (currentNode.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
-                bytes memory path = _getNodePath(currentNode);
-                uint8 prefix = uint8(path[0]);
-                uint8 offset = 2 - prefix % 2;
-                bytes memory pathRemainder = Lib_BytesUtils.slice(path, offset);
-                bytes memory keyRemainder = Lib_BytesUtils.slice(key, currentKeyIndex);
-                uint256 sharedNibbleLength = _getSharedNibbleLength(pathRemainder, keyRemainder);
- 
-                if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
-                    if (
-                        pathRemainder.length == sharedNibbleLength &&
-                        keyRemainder.length == sharedNibbleLength
-                    ) {
-                        // The key within this leaf matches our key exactly.
-                        // Increment the key index to reflect that we have no remainder.
-                        currentKeyIndex += sharedNibbleLength;
-                    }
- 
-                    // We've hit a leaf node, so our next node should be NULL.
-                    currentNodeID = bytes32(RLP_NULL);
-                    break;
-                } else if (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
-                    Iif (sharedNibbleLength == 0) {
-                        // Our extension node doesn't share any part of our key.
-                        // We've hit the end of this path, updates will need to modify this extension.
-                        currentNodeID = bytes32(RLP_NULL);
-                        break;
-                    } else {
-                        // Our extension shares some nibbles.
-                        // Carry on to the next node.
-                        currentNodeID = _getNodeID(currentNode.decoded[1]);
-                        currentKeyIncrement = sharedNibbleLength;
-                        continue;
-                    }
-                } else {
-                    revert("Received a node with an unknown prefix");
-                }
-            } else {
-                revert("Received an unparseable node.");
-            }
-        }
- 
-        // If our node ID is NULL, then we're at a dead end.
-        bool isFinalNode = currentNodeID == bytes32(RLP_NULL);
-        return (pathLength, Lib_BytesUtils.slice(key, currentKeyIndex), isFinalNode);
-    }
- 
-    /**
-     * @notice Creates new nodes to support a k/v pair insertion into a given
-     * Merkle trie path.
-     * @param _path Path to the node nearest the k/v pair.
-     * @param _pathLength Length of the path. Necessary because the provided
-     * path may include additional nodes (e.g., it comes directly from a proof)
-     * and we can't resize in-memory arrays without costly duplication.
-     * @param _keyRemainder Portion of the initial key that must be inserted
-     * into the trie.
-     * @param _value Value to insert at the given key.
-     * @return _newPath A new path with the inserted k/v pair and extra supporting nodes.
-     */
-    function _getNewPath(
-        TrieNode[] memory _path,
-        uint256 _pathLength,
-        bytes memory _keyRemainder,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _newPath
-        )
-    {
-        bytes memory keyRemainder = _keyRemainder;
- 
-        // Most of our logic depends on the status of the last node in the path.
-        TrieNode memory lastNode = _path[_pathLength - 1];
-        NodeType lastNodeType = _getNodeType(lastNode);
- 
-        // Create an array for newly created nodes.
-        // We need up to three new nodes, depending on the contents of the last node.
-        // Since array resizing is expensive, we'll keep track of the size manually.
-        // We're using an explicit `totalNewNodes += 1` after insertions for clarity.
-        TrieNode[] memory newNodes = new TrieNode[](3);
-        uint256 totalNewNodes = 0;
- 
-        Eif (keyRemainder.length == 0 && lastNodeType == NodeType.LeafNode) {
-            // We've found a leaf node with the given key.
-            // Simply need to update the value of the node to match.
-            newNodes[totalNewNodes] = _makeLeafNode(_getNodeKey(lastNode), _value);
-            totalNewNodes += 1;
-        } else if (lastNodeType == NodeType.BranchNode) {
-            if (keyRemainder.length == 0) {
-                // We've found a branch node with the given key.
-                // Simply need to update the value of the node to match.
-                newNodes[totalNewNodes] = _editBranchValue(lastNode, _value);
-                totalNewNodes += 1;
-            } else {
-                // We've found a branch node, but it doesn't contain our key.
-                // Reinsert the old branch for now.
-                newNodes[totalNewNodes] = lastNode;
-                totalNewNodes += 1;
-                // Create a new leaf node, slicing our remainder since the first byte points
-                // to our branch node.
-                newNodes[totalNewNodes] = _makeLeafNode(Lib_BytesUtils.slice(keyRemainder, 1), _value);
-                totalNewNodes += 1;
-            }
-        } else {
-            // Our last node is either an extension node or a leaf node with a different key.
-            bytes memory lastNodeKey = _getNodeKey(lastNode);
-            uint256 sharedNibbleLength = _getSharedNibbleLength(lastNodeKey, keyRemainder);
- 
-            if (sharedNibbleLength != 0) {
-                // We've got some shared nibbles between the last node and our key remainder.
-                // We'll need to insert an extension node that covers these shared nibbles.
-                bytes memory nextNodeKey = Lib_BytesUtils.slice(lastNodeKey, 0, sharedNibbleLength);
-                newNodes[totalNewNodes] = _makeExtensionNode(nextNodeKey, _getNodeHash(_value));
-                totalNewNodes += 1;
- 
-                // Cut down the keys since we've just covered these shared nibbles.
-                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, sharedNibbleLength);
-                keyRemainder = Lib_BytesUtils.slice(keyRemainder, sharedNibbleLength);
-            }
- 
-            // Create an empty branch to fill in.
-            TrieNode memory newBranch = _makeEmptyBranchNode();
- 
-            if (lastNodeKey.length == 0) {
-                // Key remainder was larger than the key for our last node.
-                // The value within our last node is therefore going to be shifted into
-                // a branch value slot.
-                newBranch = _editBranchValue(newBranch, _getNodeValue(lastNode));
-            } else {
-                // Last node key was larger than the key remainder.
-                // We're going to modify some index of our branch.
-                uint8 branchKey = uint8(lastNodeKey[0]);
-                // Move on to the next nibble.
-                lastNodeKey = Lib_BytesUtils.slice(lastNodeKey, 1);
- 
-                if (lastNodeType == NodeType.LeafNode) {
-                    // We're dealing with a leaf node.
-                    // We'll modify the key and insert the old leaf node into the branch index.
-                    TrieNode memory modifiedLastNode = _makeLeafNode(lastNodeKey, _getNodeValue(lastNode));
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
-                } else if (lastNodeKey.length != 0) {
-                    // We're dealing with a shrinking extension node.
-                    // We need to modify the node to decrease the size of the key.
-                    TrieNode memory modifiedLastNode = _makeExtensionNode(lastNodeKey, _getNodeValue(lastNode));
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeHash(modifiedLastNode.encoded));
-                } else {
-                    // We're dealing with an unnecessary extension node.
-                    // We're going to delete the node entirely.
-                    // Simply insert its current value into the branch index.
-                    newBranch = _editBranchIndex(newBranch, branchKey, _getNodeValue(lastNode));
-                }
-            }
- 
-            if (keyRemainder.length == 0) {
-                // We've got nothing left in the key remainder.
-                // Simply insert the value into the branch value slot.
-                newBranch = _editBranchValue(newBranch, _value);
-                // Push the branch into the list of new nodes.
-                newNodes[totalNewNodes] = newBranch;
-                totalNewNodes += 1;
-            } else {
-                // We've got some key remainder to work with.
-                // We'll be inserting a leaf node into the trie.
-                // First, move on to the next nibble.
-                keyRemainder = Lib_BytesUtils.slice(keyRemainder, 1);
-                // Push the branch into the list of new nodes.
-                newNodes[totalNewNodes] = newBranch;
-                totalNewNodes += 1;
-                // Push a new leaf node for our k/v pair.
-                newNodes[totalNewNodes] = _makeLeafNode(keyRemainder, _value);
-                totalNewNodes += 1;
-            }
-        }
- 
-        // Finally, join the old path with our newly created nodes.
-        // Since we're overwriting the last node in the path, we use `_pathLength - 1`.
-        return _joinNodeArrays(_path, _pathLength - 1, newNodes, totalNewNodes);
-    }
- 
-    /**
-     * @notice Computes the trie root from a given path.
-     * @param _nodes Path to some k/v pair.
-     * @param _key Key for the k/v pair.
-     * @return _updatedRoot Root hash for the updated trie.
-     */
-    function _getUpdatedTrieRoot(
-        TrieNode[] memory _nodes,
-        bytes memory _key
-    )
-        private
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = Lib_BytesUtils.toNibbles(_key);
- 
-        // Some variables to keep track of during iteration.
-        TrieNode memory currentNode;
-        NodeType currentNodeType;
-        bytes memory previousNodeHash;
- 
-        // Run through the path backwards to rebuild our root hash.
-        for (uint256 i = _nodes.length; i > 0; i--) {
-            // Pick out the current node.
-            currentNode = _nodes[i - 1];
-            currentNodeType = _getNodeType(currentNode);
- 
-            if (currentNodeType == NodeType.LeafNode) {
-                // Leaf nodes are already correctly encoded.
-                // Shift the key over to account for the nodes key.
-                bytes memory nodeKey = _getNodeKey(currentNode);
-                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
-            } else if (currentNodeType == NodeType.ExtensionNode) {
-                // Shift the key over to account for the nodes key.
-                bytes memory nodeKey = _getNodeKey(currentNode);
-                key = Lib_BytesUtils.slice(key, 0, key.length - nodeKey.length);
- 
-                // If this node is the last element in the path, it'll be correctly encoded
-                // and we can skip this part.
-                Eif (previousNodeHash.length > 0) {
-                    // Re-encode the node based on the previous node.
-                    currentNode = _makeExtensionNode(nodeKey, previousNodeHash);
-                }
-            } else Eif (currentNodeType == NodeType.BranchNode) {
-                // If this node is the last element in the path, it'll be correctly encoded
-                // and we can skip this part.
-                Eif (previousNodeHash.length > 0) {
-                    // Re-encode the node based on the previous node.
-                    uint8 branchKey = uint8(key[key.length - 1]);
-                    key = Lib_BytesUtils.slice(key, 0, key.length - 1);
-                    currentNode = _editBranchIndex(currentNode, branchKey, previousNodeHash);
-                }
-            }
- 
-            // Compute the node hash for the next iteration.
-            previousNodeHash = _getNodeHash(currentNode.encoded);
-        }
- 
-        // Current node should be the root at this point.
-        // Simply return the hash of its encoding.
-        return keccak256(currentNode.encoded);
-    }
- 
-    /**
-     * @notice Parses an RLP-encoded proof into something more useful.
-     * @param _proof RLP-encoded proof to parse.
-     * @return _parsed Proof parsed into easily accessible structs.
-     */
-    function _parseProof(
-        bytes memory _proof
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _parsed
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory nodes = Lib_RLPReader.readList(_proof);
-        TrieNode[] memory proof = new TrieNode[](nodes.length);
- 
-        for (uint256 i = 0; i < nodes.length; i++) {
-            bytes memory encoded = Lib_RLPReader.readBytes(nodes[i]);
-            proof[i] = TrieNode({
-                encoded: encoded,
-                decoded: Lib_RLPReader.readList(encoded)
-            });
-        }
- 
-        return proof;
-    }
- 
-    /**
-     * @notice Picks out the ID for a node. Node ID is referred to as the
-     * "hash" within the specification, but nodes < 32 bytes are not actually
-     * hashed.
-     * @param _node Node to pull an ID for.
-     * @return _nodeID ID for the node, depending on the size of its contents.
-     */
-    function _getNodeID(
-        Lib_RLPReader.RLPItem memory _node
-    )
-        private
-        pure
-        returns (
-            bytes32 _nodeID
-        )
-    {
-        bytes memory nodeID;
- 
-        Iif (_node.length < 32) {
-            // Nodes smaller than 32 bytes are RLP encoded.
-            nodeID = Lib_RLPReader.readRawBytes(_node);
-        } else {
-            // Nodes 32 bytes or larger are hashed.
-            nodeID = Lib_RLPReader.readBytes(_node);
-        }
- 
-        return Lib_BytesUtils.toBytes32(nodeID);
-    }
- 
-    /**
-     * @notice Gets the path for a leaf or extension node.
-     * @param _node Node to get a path for.
-     * @return _path Node path, converted to an array of nibbles.
-     */
-    function _getNodePath(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _path
-        )
-    {
-        return Lib_BytesUtils.toNibbles(Lib_RLPReader.readBytes(_node.decoded[0]));
-    }
- 
-    /**
-     * @notice Gets the key for a leaf or extension node. Keys are essentially
-     * just paths without any prefix.
-     * @param _node Node to get a key for.
-     * @return _key Node key, converted to an array of nibbles.
-     */
-    function _getNodeKey(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _key
-        )
-    {
-        return _removeHexPrefix(_getNodePath(_node));
-    }
- 
-    /**
-     * @notice Gets the path for a node.
-     * @param _node Node to get a value for.
-     * @return _value Node value, as hex bytes.
-     */
-    function _getNodeValue(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            bytes memory _value
-        )
-    {
-        return Lib_RLPReader.readBytes(_node.decoded[_node.decoded.length - 1]);
-    }
- 
-    /**
-     * @notice Computes the node hash for an encoded node. Nodes < 32 bytes
-     * are not hashed, all others are keccak256 hashed.
-     * @param _encoded Encoded node to hash.
-     * @return _hash Hash of the encoded node. Simply the input if < 32 bytes.
-     */
-    function _getNodeHash(
-        bytes memory _encoded
-    )
-        private
-        pure
-        returns (
-            bytes memory _hash
-        )
-    {
-        Iif (_encoded.length < 32) {
-            return _encoded;
-        } else {
-            return abi.encodePacked(keccak256(_encoded));
-        }
-    }
- 
-    /**
-     * @notice Determines the type for a given node.
-     * @param _node Node to determine a type for.
-     * @return _type Type of the node; BranchNode/ExtensionNode/LeafNode.
-     */
-    function _getNodeType(
-        TrieNode memory _node
-    )
-        private
-        pure
-        returns (
-            NodeType _type
-        )
-    {
-        if (_node.decoded.length == BRANCH_NODE_LENGTH) {
-            return NodeType.BranchNode;
-        } else Eif (_node.decoded.length == LEAF_OR_EXTENSION_NODE_LENGTH) {
-            bytes memory path = _getNodePath(_node);
-            uint8 prefix = uint8(path[0]);
- 
-            if (prefix == PREFIX_LEAF_EVEN || prefix == PREFIX_LEAF_ODD) {
-                return NodeType.LeafNode;
-            } else Eif (prefix == PREFIX_EXTENSION_EVEN || prefix == PREFIX_EXTENSION_ODD) {
-                return NodeType.ExtensionNode;
-            }
-        }
- 
-        revert("Invalid node type");
-    }
- 
-    /**
-     * @notice Utility; determines the number of nibbles shared between two
-     * nibble arrays.
-     * @param _a First nibble array.
-     * @param _b Second nibble array.
-     * @return _shared Number of shared nibbles.
-     */
-    function _getSharedNibbleLength(
-        bytes memory _a,
-        bytes memory _b
-    )
-        private
-        pure
-        returns (
-            uint256 _shared
-        )
-    {
-        uint256 i = 0;
-        while (_a.length > i && _b.length > i && _a[i] == _b[i]) {
-            i++;
-        }
-        return i;
-    }
- 
-    /**
-     * @notice Utility; converts an RLP-encoded node into our nice struct.
-     * @param _raw RLP-encoded node to convert.
-     * @return _node Node as a TrieNode struct.
-     */
-    function _makeNode(
-        bytes[] memory _raw
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes memory encoded = Lib_RLPWriter.writeList(_raw);
- 
-        return TrieNode({
-            encoded: encoded,
-            decoded: Lib_RLPReader.readList(encoded)
-        });
-    }
- 
-    /**
-     * @notice Utility; converts an RLP-decoded node into our nice struct.
-     * @param _items RLP-decoded node to convert.
-     * @return _node Node as a TrieNode struct.
-     */
-    function _makeNode(
-        Lib_RLPReader.RLPItem[] memory _items
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](_items.length);
-        for (uint256 i = 0; i < _items.length; i++) {
-            raw[i] = Lib_RLPReader.readRawBytes(_items[i]);
-        }
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates a new extension node.
-     * @param _key Key for the extension node, unprefixed.
-     * @param _value Value for the extension node.
-     * @return _node New extension node with the given k/v pair.
-     */
-    function _makeExtensionNode(
-        bytes memory _key,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](2);
-        bytes memory key = _addHexPrefix(_key, false);
-        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
-        raw[1] = Lib_RLPWriter.writeBytes(_value);
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates a new leaf node.
-     * @dev This function is essentially identical to `_makeExtensionNode`.
-     * Although we could route both to a single method with a flag, it's
-     * more gas efficient to keep them separate and duplicate the logic.
-     * @param _key Key for the leaf node, unprefixed.
-     * @param _value Value for the leaf node.
-     * @return _node New leaf node with the given k/v pair.
-     */
-    function _makeLeafNode(
-        bytes memory _key,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](2);
-        bytes memory key = _addHexPrefix(_key, true);
-        raw[0] = Lib_RLPWriter.writeBytes(Lib_BytesUtils.fromNibbles(key));
-        raw[1] = Lib_RLPWriter.writeBytes(_value);
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Creates an empty branch node.
-     * @return _node Empty branch node as a TrieNode struct.
-     */
-    function _makeEmptyBranchNode()
-        private
-        pure
-        returns (
-            TrieNode memory _node
-        )
-    {
-        bytes[] memory raw = new bytes[](BRANCH_NODE_LENGTH);
-        for (uint256 i = 0; i < raw.length; i++) {
-            raw[i] = RLP_NULL_BYTES;
-        }
-        return _makeNode(raw);
-    }
- 
-    /**
-     * @notice Modifies the value slot for a given branch.
-     * @param _branch Branch node to modify.
-     * @param _value Value to insert into the branch.
-     * @return _updatedNode Modified branch node.
-     */
-    function _editBranchValue(
-        TrieNode memory _branch,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _updatedNode
-        )
-    {
-        bytes memory encoded = Lib_RLPWriter.writeBytes(_value);
-        _branch.decoded[_branch.decoded.length - 1] = Lib_RLPReader.toRLPItem(encoded);
-        return _makeNode(_branch.decoded);
-    }
- 
-    /**
-     * @notice Modifies a slot at an index for a given branch.
-     * @param _branch Branch node to modify.
-     * @param _index Slot index to modify.
-     * @param _value Value to insert into the slot.
-     * @return _updatedNode Modified branch node.
-     */
-    function _editBranchIndex(
-        TrieNode memory _branch,
-        uint8 _index,
-        bytes memory _value
-    )
-        private
-        pure
-        returns (
-            TrieNode memory _updatedNode
-        )
-    {
-        bytes memory encoded = _value.length < 32 ? _value : Lib_RLPWriter.writeBytes(_value);
-        _branch.decoded[_index] = Lib_RLPReader.toRLPItem(encoded);
-        return _makeNode(_branch.decoded);
-    }
- 
-    /**
-     * @notice Utility; adds a prefix to a key.
-     * @param _key Key to prefix.
-     * @param _isLeaf Whether or not the key belongs to a leaf.
-     * @return _prefixedKey Prefixed key.
-     */
-    function _addHexPrefix(
-        bytes memory _key,
-        bool _isLeaf
-    )
-        private
-        pure
-        returns (
-            bytes memory _prefixedKey
-        )
-    {
-        uint8 prefix = _isLeaf ? uint8(0x02) : uint8(0x00);
-        uint8 offset = uint8(_key.length % 2);
-        bytes memory prefixed = new bytes(2 - offset);
-        prefixed[0] = bytes1(prefix + offset);
-        return abi.encodePacked(prefixed, _key);
-    }
- 
-    /**
-     * @notice Utility; removes a prefix from a path.
-     * @param _path Path to remove the prefix from.
-     * @return _unprefixedKey Unprefixed key.
-     */
-    function _removeHexPrefix(
-        bytes memory _path
-    )
-        private
-        pure
-        returns (
-            bytes memory _unprefixedKey
-        )
-    {
-        if (uint8(_path[0]) % 2 == 0) {
-            return Lib_BytesUtils.slice(_path, 2);
-        } else {
-            return Lib_BytesUtils.slice(_path, 1);
-        }
-    }
- 
-    /**
-     * @notice Utility; combines two node arrays. Array lengths are required
-     * because the actual lengths may be longer than the filled lengths.
-     * Array resizing is extremely costly and should be avoided.
-     * @param _a First array to join.
-     * @param _aLength Length of the first array.
-     * @param _b Second array to join.
-     * @param _bLength Length of the second array.
-     * @return _joined Combined node array.
-     */
-    function _joinNodeArrays(
-        TrieNode[] memory _a,
-        uint256 _aLength,
-        TrieNode[] memory _b,
-        uint256 _bLength
-    )
-        private
-        pure
-        returns (
-            TrieNode[] memory _joined
-        )
-    {
-        TrieNode[] memory ret = new TrieNode[](_aLength + _bLength);
- 
-        // Copy elements from the first array.
-        for (uint256 i = 0; i < _aLength; i++) {
-            ret[i] = _a[i];
-        }
- 
-        // Copy elements from the second array.
-        for (uint256 i = 0; i < _bLength; i++) {
-            ret[i + _aLength] = _b[i];
-        }
- 
-        return ret;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html b/coverage/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html deleted file mode 100644 index 1e999e7d4..000000000 --- a/coverage/optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol.html +++ /dev/null @@ -1,548 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/trie/ Lib_SecureMerkleTrie.sol -

-
-
- 63.64% - Statements - 7/11 -
-
- 100% - Branches - 0/0 -
-
- 66.67% - Functions - 4/6 -
-
- 63.64% - Lines - 7/11 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -12× -12× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -20× -20× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -47× -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_MerkleTrie } from "./Lib_MerkleTrie.sol";
- 
-/**
- * @title Lib_SecureMerkleTrie
- */
-library Lib_SecureMerkleTrie {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * @notice Verifies a proof that a given key/value pair is present in the
-     * Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _value Value of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the desired node. Unlike
-     * traditional Merkle trees, this proof is executed top-down and consists
-     * of a list of RLP-encoded nodes that make a path down to the target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the k/v pair exists in the trie, `false` otherwise.
-     */
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.verifyInclusionProof(key, _value, _proof, _root);
-    }
- 
-    /**
-     * @notice Verifies a proof that a given key is *not* present in
-     * the Merkle trie.
-     * @param _key Key of the node to search for, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _verified `true` if the key is not present in the trie, `false` otherwise.
-     */
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _verified
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.verifyExclusionProof(key, _proof, _root);
-    }
- 
-    /**
-     * @notice Updates a Merkle trie and returns a new root hash.
-     * @param _key Key of the node to update, as a hex string.
-     * @param _value Value of the node to update, as a hex string.
-     * @param _proof Merkle trie inclusion proof for the node *nearest* the
-     * target node. If the key exists, we can simply update the value.
-     * Otherwise, we need to modify the trie to handle the new k/v pair.
-     * @param _root Known root of the Merkle trie. Used to verify that the
-     * included proof is correctly constructed.
-     * @return _updatedRoot Root hash of the newly constructed trie.
-     */
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.update(key, _value, _proof, _root);
-    }
- 
-    /**
-     * @notice Retrieves the value associated with a given key.
-     * @param _key Key to search for, as hex bytes.
-     * @param _proof Merkle trie inclusion proof for the key.
-     * @param _root Known root of the Merkle trie.
-     * @return _exists Whether or not the key exists.
-     * @return _value Value of the key if it exists.
-     */
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        internal
-        pure
-        returns (
-            bool _exists,
-            bytes memory _value
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.get(key, _proof, _root);
-    }
- 
-    /**
-     * Computes the root hash for a trie with a single node.
-     * @param _key Key for the single node.
-     * @param _value Value for the single node.
-     * @return _updatedRoot Hash of the trie.
-     */
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        internal
-        pure
-        returns (
-            bytes32 _updatedRoot
-        )
-    {
-        bytes memory key = _getSecureKey(_key);
-        return Lib_MerkleTrie.getSingleNodeRootHash(key, _value);
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Computes the secure counterpart to a key.
-     * @param _key Key to get a secure key from.
-     * @return _secureKey Secure version of the key.
-     */
-    function _getSecureKey(
-        bytes memory _key
-    )
-        private
-        pure
-        returns (
-            bytes memory _secureKey
-        )
-    {
-        return abi.encodePacked(keccak256(_key));
-    }
-}
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/trie/index.html b/coverage/optimistic-ethereum/libraries/trie/index.html deleted file mode 100644 index 8aa2158f9..000000000 --- a/coverage/optimistic-ethereum/libraries/trie/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/trie/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/trie/ -

-
-
- 71.98% - Statements - 149/207 -
-
- 55.88% - Branches - 38/68 -
-
- 81.25% - Functions - 26/32 -
-
- 71.57% - Lines - 146/204 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_MerkleTrie.sol
72.45%142/19655.88%38/6884.62%22/2672.02%139/193
Lib_SecureMerkleTrie.sol
63.64%7/11100%0/066.67%4/663.64%7/11
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html deleted file mode 100644 index 2faa1790a..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_Bytes32Utils.sol -

-
-
- 100% - Statements - 6/6 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 5/5 -
-
- 100% - Lines - 7/7 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -40× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -31× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_Byte32Utils
- */
-library Lib_Bytes32Utils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Converts a bytes32 value to a boolean. Anything non-zero will be converted to "true."
-     * @param _in Input bytes32 value.
-     * @return Bytes32 as a boolean.
-     */
-    function toBool(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        return _in != 0;
-    }
- 
-    /**
-     * Converts a boolean to a bytes32 value.
-     * @param _in Input boolean value.
-     * @return Boolean as a bytes32.
-     */
-    function fromBool(
-        bool _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return bytes32(uint256(_in ? 1 : 0));
-    }
- 
-    /**
-     * Converts a bytes32 value to an address. Takes the *last* 20 bytes.
-     * @param _in Input bytes32 value.
-     * @return Bytes32 as an address.
-     */
-    function toAddress(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            address
-        )
-    {
-        return address(uint160(uint256(_in)));
-    }
- 
-    /**
-     * Converts an address to a bytes32.
-     * @param _in Input address value.
-     * @return Address as a bytes32.
-     */
-    function fromAddress(
-        address _in
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return bytes32(uint256(_in));
-    }
- 
-    /**
-     * Removes the leading zeros from a bytes32 value and returns a new (smaller) bytes value.
-     * @param _in Input bytes32 value.
-     * @return Bytes32 without any leading zeros.
-     */
-    function removeLeadingZeros(
-        bytes32 _in
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        bytes memory out;
- 
-        assembly {
-            // Figure out how many leading zero bytes to remove.
-            let shift := 0
-            for { let i := 0 } and(lt(i, 32), eq(byte(i, _in), 0)) { i := add(i, 1) } {
-                shift := add(shift, 1)
-            }
- 
-            // Reserve some space for our output and fix the free memory pointer.
-            out := mload(0x40)
-            mstore(0x40, add(out, 0x40))
- 
-            // Shift the value and store it into the output bytes.
-            mstore(add(out, 0x20), shl(mul(shift, 8), _in))
- 
-            // Store the new size (with leading zero bytes removed) in the output byte size.
-            mstore(out, sub(32, shift))
-        }
- 
-        return out;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html deleted file mode 100644 index b1d79bba0..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol.html +++ /dev/null @@ -1,728 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_BytesUtils.sol -

-
-
- 100% - Statements - 38/38 -
-
- 63.64% - Branches - 14/22 -
-
- 100% - Functions - 11/11 -
-
- 100% - Lines - 44/44 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -311× -311× -311× -  -308× -  -308× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -308× -  -  -  -  -  -  -  -  -  -  -299× -73× -  -  -226× -  -  -  -  -  -  -  -  -  - - - -  -  - -  -  -  -  -  -  -  -  -  -164× - - -  -  - -  -  -162× -  -  -  -  -  -  -  -  -  - -  -  -  -15× -15× -15× -  -15× -  -  -  -15× -  -  -  -12× -12× -12× -  -12× -  -  -  -12× -  -  -  - - - -  - -  -  -  - -  -  -  -  -  -  -  -  -  -292× -  -292× -9144× -9144× -  -  -292× -  -  -  -  -  -  -  -  -  -26× -  -26× -708× -  -  -26× -  -  -  -  -  -  -  -  -  -  -26× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_BytesUtils
- */
-library Lib_BytesUtils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start,
-        uint256 _length
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        Erequire(_length + 31 >= _length, "slice_overflow");
-        Erequire(_start + _length >= _start, "slice_overflow");
-        require(_bytes.length >= _start + _length, "slice_outOfBounds");
- 
-        bytes memory tempBytes;
- 
-        assembly {
-            switch iszero(_length)
-            case 0 {
-                // Get a location of some free memory and store it in tempBytes as
-                // Solidity does for memory variables.
-                tempBytes := mload(0x40)
- 
-                // The first word of the slice result is potentially a partial
-                // word read from the original array. To read it, we calculate
-                // the length of that partial word and start copying that many
-                // bytes into the array. The first word we copy will start with
-                // data we don't care about, but the last `lengthmod` bytes will
-                // land at the beginning of the contents of the new array. When
-                // we're done copying, we overwrite the full first word with
-                // the actual length of the slice.
-                let lengthmod := and(_length, 31)
- 
-                // The multiplication in the next line is necessary
-                // because when slicing multiples of 32 bytes (lengthmod == 0)
-                // the following copy loop was copying the origin's length
-                // and then ending prematurely not copying everything it should.
-                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
-                let end := add(mc, _length)
- 
-                for {
-                    // The multiplication in the next line has the same exact purpose
-                    // as the one above.
-                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
-                } lt(mc, end) {
-                    mc := add(mc, 0x20)
-                    cc := add(cc, 0x20)
-                } {
-                    mstore(mc, mload(cc))
-                }
- 
-                mstore(tempBytes, _length)
- 
-                //update free-memory pointer
-                //allocating the array padded to 32 bytes like the compiler does now
-                mstore(0x40, and(add(mc, 31), not(31)))
-            }
-            //if we want a zero-length slice let's just return a zero-length array
-            default {
-                tempBytes := mload(0x40)
- 
-                //zero out the 32 bytes slice we are about to return
-                //we need to do it because Solidity does not garbage collect
-                mstore(tempBytes, 0)
- 
-                mstore(0x40, add(tempBytes, 0x20))
-            }
-        }
- 
-        return tempBytes;
-    }
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        if (_bytes.length - _start == 0) {
-            return bytes('');
-        }
- 
-        return slice(_bytes, _start, _bytes.length - _start);
-    }
- 
-    function toBytes32PadLeft(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes32)
-    {
-        bytes32 ret;
-        uint256 len = _bytes.length <= 32 ? _bytes.length : 32;
-        assembly {
-            ret := shr(mul(sub(32, len), 8), mload(add(_bytes, 32)))
-        }
-        return ret;
-    }
- 
-    function toBytes32(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes32)
-    {
-        if (_bytes.length < 32) {
-            bytes32 ret;
-            assembly {
-                ret := mload(add(_bytes, 32))
-            }
-            return ret;
-        }
- 
-        return abi.decode(_bytes,(bytes32)); // will truncate if input length > 32 bytes
-    }
- 
-    function toUint256(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (uint256)
-    {
-        return uint256(toBytes32(_bytes));
-    }
- 
-    function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
-        Erequire(_start + 3 >= _start, "toUint24_overflow");
-        Erequire(_bytes.length >= _start + 3 , "toUint24_outOfBounds");
-        uint24 tempUint;
- 
-        assembly {
-            tempUint := mload(add(add(_bytes, 0x3), _start))
-        }
- 
-        return tempUint;
-    }
- 
-    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
-        Erequire(_start + 1 >= _start, "toUint8_overflow");
-        Erequire(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
-        uint8 tempUint;
- 
-        assembly {
-            tempUint := mload(add(add(_bytes, 0x1), _start))
-        }
- 
-        return tempUint;
-    }
- 
-    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
-        Erequire(_start + 20 >= _start, "toAddress_overflow");
-        Erequire(_bytes.length >= _start + 20, "toAddress_outOfBounds");
-        address tempAddress;
- 
-        assembly {
-            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
-        }
- 
-        return tempAddress;
-    }
- 
-    function toNibbles(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        bytes memory nibbles = new bytes(_bytes.length * 2);
- 
-        for (uint256 i = 0; i < _bytes.length; i++) {
-            nibbles[i * 2] = _bytes[i] >> 4;
-            nibbles[i * 2 + 1] = bytes1(uint8(_bytes[i]) % 16);
-        }
- 
-        return nibbles;
-    }
- 
-    function fromNibbles(
-        bytes memory _bytes
-    )
-        internal
-        pure
-        returns (bytes memory)
-    {
-        bytes memory ret = new bytes(_bytes.length / 2);
- 
-        for (uint256 i = 0; i < ret.length; i++) {
-            ret[i] = (_bytes[i * 2] << 4) | (_bytes[i * 2 + 1]);
-        }
- 
-        return ret;
-    }
- 
-    function equal(
-        bytes memory _bytes,
-        bytes memory _other
-    )
-        internal
-        pure
-        returns (bool)
-    {
-        return keccak256(_bytes) == keccak256(_other);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html deleted file mode 100644 index 8e0c02eee..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_ECDSAUtils.sol -

-
-
- 100% - Statements - 9/9 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 9/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -22× -  -22× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -24× - -  -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -15× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_ECDSAUtils
- */
-library Lib_ECDSAUtils {
- 
-    /**************************************
-     * Internal Functions: ECDSA Recovery *
-     **************************************/
- 
-    /**
-     * Recovers a signed address given a message and signature.
-     * @param _message Message that was originally signed.
-     * @param _isEthSignedMessage Whether or not the user used the `Ethereum Signed Message` prefix.
-     * @param _v Signature `v` parameter.
-     * @param _r Signature `r` parameter.
-     * @param _s Signature `s` parameter.
-     * @return _sender Signer address.
-     */
-    function recover(
-        bytes memory _message,
-        bool _isEthSignedMessage,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        internal
-        pure
-        returns (
-            address _sender
-        )
-    {
-        bytes32 messageHash = getMessageHash(_message, _isEthSignedMessage);
- 
-        return ecrecover(
-            messageHash,
-            _v + 27,
-            _r,
-            _s
-        );
-    }
- 
-    function getMessageHash(
-        bytes memory _message,
-        bool _isEthSignedMessage
-    )
-        internal
-        pure
-        returns (bytes32) {
-        if (_isEthSignedMessage) {
-            return getEthSignedMessageHash(_message);
-        }
-        return getNativeMessageHash(_message);
-    }
- 
- 
-    /*************************************
-     * Private Functions: ECDSA Recovery *
-     *************************************/
- 
-    /**
-     * Gets the native message hash (simple keccak256) for a message.
-     * @param _message Message to hash.
-     * @return _messageHash Native message hash.
-     */
-    function getNativeMessageHash(
-        bytes memory _message
-    )
-        private
-        pure
-        returns (
-            bytes32 _messageHash
-        )
-    {
-        return keccak256(_message);
-    }
- 
-    /**
-     * Gets the hash of a message with the `Ethereum Signed Message` prefix.
-     * @param _message Message to hash.
-     * @return _messageHash Prefixed message hash.
-     */
-    function getEthSignedMessageHash(
-        bytes memory _message
-    )
-        private
-        pure
-        returns (
-            bytes32 _messageHash
-        )
-    {
-        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
-        bytes32 messageHash = keccak256(_message);
-        return keccak256(abi.encodePacked(prefix, messageHash));
-    }
-}
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html deleted file mode 100644 index 5be2cd548..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_ErrorUtils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_ErrorUtils.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title Lib_ErrorUtils
- */
-library Lib_ErrorUtils {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Encodes an error string into raw solidity-style revert data.
-     * (i.e. ascii bytes, prefixed with bytes4(keccak("Error(string))"))
-     * Ref: https://docs.soliditylang.org/en/v0.8.2/control-structures.html?highlight=Error(string)#panic-via-assert-and-error-via-require
-     * @param _reason Reason for the reversion.
-     * @return Standard solidity revert data for the given reason.
-     */
-    function encodeRevertString(
-        string memory _reason
-    )
-        internal
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return abi.encodeWithSignature(
-            "Error(string)",
-            _reason
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html deleted file mode 100644 index 578273032..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/Lib_EthUtils.sol.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_EthUtils.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_EthUtils.sol -

-
-
- 83.33% - Statements - 10/12 -
-
- 100% - Branches - 0/0 -
-
- 85.71% - Functions - 6/7 -
-
- 87.5% - Lines - 14/16 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -34× -  -  -  -  -  -  -34× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -212× -  -  -  -212× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -19× -  -  -  -19× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -27× -27× -  -27× -27× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPWriter } from "../rlp/Lib_RLPWriter.sol";
-import { Lib_Bytes32Utils } from "./Lib_Bytes32Utils.sol";
- 
-/**
- * @title Lib_EthUtils
- */
-library Lib_EthUtils {
- 
-    /***********************************
-     * Internal Functions: Code Access *
-     ***********************************/
- 
-    /**
-     * Gets the code for a given address.
-     * @param _address Address to get code for.
-     * @param _offset Offset to start reading from.
-     * @param _length Number of bytes to read.
-     * @return _code Code read from the contract.
-     */
-    function getCode(
-        address _address,
-        uint256 _offset,
-        uint256 _length
-    )
-        internal
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        assembly {
-            _code := mload(0x40)
-            mstore(0x40, add(_code, add(_length, 0x20)))
-            mstore(_code, _length)
-            extcodecopy(_address, add(_code, 0x20), _offset, _length)
-        }
- 
-        return _code;
-    }
- 
-    /**
-     * Gets the full code for a given address.
-     * @param _address Address to get code for.
-     * @return _code Full code of the contract.
-     */
-    function getCode(
-        address _address
-    )
-        internal
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        return getCode(
-            _address,
-            0,
-            getCodeSize(_address)
-        );
-    }
- 
-    /**
-     * Gets the size of a contract's code in bytes.
-     * @param _address Address to get code size for.
-     * @return _codeSize Size of the contract's code in bytes.
-     */
-    function getCodeSize(
-        address _address
-    )
-        internal
-        view
-        returns (
-            uint256 _codeSize
-        )
-    {
-        assembly {
-            _codeSize := extcodesize(_address)
-        }
- 
-        return _codeSize;
-    }
- 
-    /**
-     * Gets the hash of a contract's code.
-     * @param _address Address to get a code hash for.
-     * @return _codeHash Hash of the contract's code.
-     */
-    function getCodeHash(
-        address _address
-    )
-        internal
-        view
-        returns (
-            bytes32 _codeHash
-        )
-    {
-        assembly {
-            _codeHash := extcodehash(_address)
-        }
- 
-        return _codeHash;
-    }
- 
- 
-    /*****************************************
-     * Internal Functions: Contract Creation *
-     *****************************************/
- 
-    /**
-     * Creates a contract with some given initialization code.
-     * @param _code Contract initialization code.
-     * @return _created Address of the created contract.
-     */
-    function createContract(
-        bytes memory _code
-    )
-        internal
-        returns (
-            address _created
-        )
-    {
-        assembly {
-            _created := create(
-                0,
-                add(_code, 0x20),
-                mload(_code)
-            )
-        }
- 
-        return _created;
-    }
- 
-    /**
-     * Computes the address that would be generated by CREATE.
-     * @param _creator Address creating the contract.
-     * @param _nonce Creator's nonce.
-     * @return _address Address to be generated by CREATE.
-     */
-    function getAddressForCREATE(
-        address _creator,
-        uint256 _nonce
-    )
-        internal
-        pure
-        returns (
-            address _address
-        )
-    {
-        bytes[] memory encoded = new bytes[](2);
-        encoded[0] = Lib_RLPWriter.writeAddress(_creator);
-        encoded[1] = Lib_RLPWriter.writeUint(_nonce);
- 
-        bytes memory encodedList = Lib_RLPWriter.writeList(encoded);
-        return Lib_Bytes32Utils.toAddress(keccak256(encodedList));
-    }
- 
-    /**
-     * Computes the address that would be generated by CREATE2.
-     * @param _creator Address creating the contract.
-     * @param _bytecode Bytecode of the contract to be created.
-     * @param _salt 32 byte salt value mixed into the hash.
-     * @return _address Address to be generated by CREATE2.
-     */
-    function getAddressForCREATE2(
-        address _creator,
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        internal
-        pure
-        returns (address _address)
-    {
-        bytes32 hashedData = keccak256(abi.encodePacked(
-            byte(0xff),
-            _creator,
-            _salt,
-            keccak256(_bytecode)
-        ));
- 
-        return Lib_Bytes32Utils.toAddress(hashedData);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_Math.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_Math.sol.html deleted file mode 100644 index ff97d943c..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/Lib_Math.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_Math.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_Math.sol -

-
-
- 0% - Statements - 0/3 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/1 -
-
- 0% - Lines - 0/3 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_Math
- */
-library Lib_Math {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Calculates the minumum of two numbers.
-     * @param _x First number to compare.
-     * @param _y Second number to compare.
-     * @return Lesser of the two numbers.
-     */
-    function min(
-        uint256 _x,
-        uint256 _y
-    )
-        internal
-        pure
-        returns (
-            uint256
-        )
-    {
-        if (_x < _y) {
-            return _x;
-        }
- 
-        return _y;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html deleted file mode 100644 index 60fb172ca..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol.html +++ /dev/null @@ -1,725 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_MerkleTree.sol -

-
-
- 97.83% - Statements - 45/46 -
-
- 90.91% - Branches - 20/22 -
-
- 100% - Functions - 3/3 -
-
- 97.96% - Lines - 48/49 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -124× -  -  -  -  -123× -  -  -  -123× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -123× -  -  -123× -123× -  -  -123× -  -  -123× -  -  -123× -123× -  -123× -321× -321× -  -321× -5814× -5814× -5814× -  -  -  -  -5814× -  -  -321× -45× -45× -45× -  -  -  -  -45× -  -  -321× -321× -  -  -123× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -102× -  -  -  -  -101× -  -  -  -  -100× -  -  -  -  -99× -  -99× -653× -146× -  -  -  -  -  -  -507× -  -  -  -  -  -  -  -653× -  -  -99× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -  -  -  -  -100× - -  -  -  -  -97× -97× -97× -776× -206× -206× -  -  -  -  -97× -70× -  -  -97× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @title Lib_MerkleTree
- * @author River Keefer
- */
-library Lib_MerkleTree {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Calculates a merkle root for a list of 32-byte leaf hashes.  WARNING: If the number
-     * of leaves passed in is not a power of two, it pads out the tree with zero hashes.
-     * If you do not know the original length of elements for the tree you are verifying,
-     * then this may allow empty leaves past _elements.length to pass a verification check down the line.
-     * Note that the _elements argument is modified, therefore it must not be used again afterwards
-     * @param _elements Array of hashes from which to generate a merkle root.
-     * @return Merkle root of the leaves, with zero hashes for non-powers-of-two (see above).
-     */
-    function getMerkleRoot(
-        bytes32[] memory _elements
-    )
-        internal
-        pure
-        returns (
-            bytes32
-        )
-    {
-        require(
-            _elements.length > 0,
-            "Lib_MerkleTree: Must provide at least one leaf hash."
-        );
- 
-        Iif (_elements.length == 0) {
-            return _elements[0];
-        }
- 
-        uint256[16] memory defaults = [
-            0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563,
-            0x633dc4d7da7256660a892f8f1604a44b5432649cc8ec5cb3ced4c4e6ac94dd1d,
-            0x890740a8eb06ce9be422cb8da5cdafc2b58c0a5e24036c578de2a433c828ff7d,
-            0x3b8ec09e026fdc305365dfc94e189a81b38c7597b3d941c279f042e8206e0bd8,
-            0xecd50eee38e386bd62be9bedb990706951b65fe053bd9d8a521af753d139e2da,
-            0xdefff6d330bb5403f63b14f33b578274160de3a50df4efecf0e0db73bcdd3da5,
-            0x617bdd11f7c0a11f49db22f629387a12da7596f9d1704d7465177c63d88ec7d7,
-            0x292c23a9aa1d8bea7e2435e555a4a60e379a5a35f3f452bae60121073fb6eead,
-            0xe1cea92ed99acdcb045a6726b2f87107e8a61620a232cf4d7d5b5766b3952e10,
-            0x7ad66c0a68c72cb89e4fb4303841966e4062a76ab97451e3b9fb526a5ceb7f82,
-            0xe026cc5a4aed3c22a58cbd3d2ac754c9352c5436f638042dca99034e83636516,
-            0x3d04cffd8b46a874edf5cfae63077de85f849a660426697b06a829c70dd1409c,
-            0xad676aa337a485e4728a0b240d92b3ef7b3c372d06d189322bfd5f61f1e7203e,
-            0xa2fca4a49658f9fab7aa63289c91b7c7b6c832a6d0e69334ff5b0a3483d09dab,
-            0x4ebfd9cd7bca2505f7bef59cc1c12ecc708fff26ae4af19abe852afe9e20c862,
-            0x2def10d13dd169f550f578bda343d9717a138562e0093b380a1120789d53cf10
-        ];
- 
-        // Reserve memory space for our hashes.
-        bytes memory buf = new bytes(64);
- 
-        // We'll need to keep track of left and right siblings.
-        bytes32 leftSibling;
-        bytes32 rightSibling;
- 
-        // Number of non-empty nodes at the current depth.
-        uint256 rowSize = _elements.length;
- 
-        // Current depth, counting from 0 at the leaves
-        uint256 depth = 0;
- 
-        // Common sub-expressions
-        uint256 halfRowSize;         // rowSize / 2
-        bool rowSizeIsOdd;           // rowSize % 2 == 1
- 
-        while (rowSize > 1) {
-            halfRowSize = rowSize / 2;
-            rowSizeIsOdd = rowSize % 2 == 1;
- 
-            for (uint256 i = 0; i < halfRowSize; i++) {
-                leftSibling  = _elements[(2 * i)    ];
-                rightSibling = _elements[(2 * i) + 1];
-                assembly {
-                    mstore(add(buf, 32), leftSibling )
-                    mstore(add(buf, 64), rightSibling)
-                }
- 
-                _elements[i] = keccak256(buf);
-            }
- 
-            if (rowSizeIsOdd) {
-                leftSibling  = _elements[rowSize - 1];
-                rightSibling = bytes32(defaults[depth]);
-                assembly {
-                    mstore(add(buf, 32), leftSibling)
-                    mstore(add(buf, 64), rightSibling)
-                }
- 
-                _elements[halfRowSize] = keccak256(buf);
-            }
- 
-            rowSize = halfRowSize + (rowSizeIsOdd ? 1 : 0);
-            depth++;
-        }
- 
-        return _elements[0];
-    }
- 
-    /**
-     * Verifies a merkle branch for the given leaf hash.  Assumes the original length
-     * of leaves generated is a known, correct input, and does not return true for indices
-     * extending past that index (even if _siblings would be otherwise valid.)
-     * @param _root The Merkle root to verify against.
-     * @param _leaf The leaf hash to verify inclusion of.
-     * @param _index The index in the tree of this leaf.
-     * @param _siblings Array of sibline nodes in the inclusion proof, starting from depth 0 (bottom of the tree).
-     * @param _totalLeaves The total number of leaves originally passed into.
-     * @return Whether or not the merkle branch and leaf passes verification.
-     */
-    function verify(
-        bytes32 _root,
-        bytes32 _leaf,
-        uint256 _index,
-        bytes32[] memory _siblings,
-        uint256 _totalLeaves
-    )
-        internal
-        pure
-        returns (
-            bool
-        )
-    {
-        require(
-            _totalLeaves > 0,
-            "Lib_MerkleTree: Total leaves must be greater than zero."
-        );
- 
-        require(
-            _index < _totalLeaves,
-            "Lib_MerkleTree: Index out of bounds."
-        );
- 
-        require(
-            _siblings.length == _ceilLog2(_totalLeaves),
-            "Lib_MerkleTree: Total siblings does not correctly correspond to total leaves."
-        );
- 
-        bytes32 computedRoot = _leaf;
- 
-        for (uint256 i = 0; i < _siblings.length; i++) {
-            if ((_index & 1) == 1) {
-                computedRoot = keccak256(
-                    abi.encodePacked(
-                        _siblings[i],
-                        computedRoot
-                    )
-                );
-            } else {
-                computedRoot = keccak256(
-                    abi.encodePacked(
-                        computedRoot,
-                        _siblings[i]
-                    )
-                );
-            }
- 
-            _index >>= 1;
-        }
- 
-        return _root == computedRoot;
-    }
- 
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Calculates the integer ceiling of the log base 2 of an input.
-     * @param _in Unsigned input to calculate the log.
-     * @return ceil(log_base_2(_in))
-     */
-    function _ceilLog2(
-        uint256 _in
-    )
-        private
-        pure
-        returns (
-            uint256
-        )
-    {
-        Erequire(
-            _in > 0,
-            "Lib_MerkleTree: Cannot compute ceil(log_2) of 0."
-        );
- 
-        if (_in == 1) {
-            return 0;
-        }
- 
-        // Find the highest set bit (will be floor(log_2)).
-        // Borrowed with <3 from https://github.com/ethereum/solidity-examples
-        uint256 val = _in;
-        uint256 highest = 0;
-        for (uint8 i = 128; i >= 1; i >>= 1) {
-            if (val & (uint(1) << i) - 1 << i != 0) {
-                highest += i;
-                val >>= i;
-            }
-        }
- 
-        // Increment by one if this is not a perfect logarithm.
-        if ((uint(1) << highest) != _in) {
-            highest += 1;
-        }
- 
-        return highest;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html deleted file mode 100644 index 1ccf21bdd..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_ReentrancyGuard.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_ReentrancyGuard.sol -

-
-
- 100% - Statements - 4/4 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 5/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -54× -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -14× -  -14× -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/**
- * @dev Contract module that helps prevent reentrant calls to a function.
- *
- * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
- * available, which can be applied to functions to make sure there are no nested
- * (reentrant) calls to them.
- *
- * Note that because there is a single `nonReentrant` guard, functions marked as
- * `nonReentrant` may not call one another. This can be worked around by making
- * those functions `private`, and then adding `external` `nonReentrant` entry
- * points to them.
- *
- * TIP: If you would like to learn more about reentrancy and alternative ways
- * to protect against it, check out our blog post
- * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
- */
-abstract contract Lib_ReentrancyGuard {
-    // Booleans are more expensive than uint256 or any type that takes up a full
-    // word because each write operation emits an extra SLOAD to first read the
-    // slot's contents, replace the bits taken up by the boolean, and then write
-    // back. This is the compiler's defense against contract upgrades and
-    // pointer aliasing, and it cannot be disabled.
- 
-    // The values being non-zero value makes deployment a bit more expensive,
-    // but in exchange the refund on every call to nonReentrant will be lower in
-    // amount. Since refunds are capped to a percentage of the total
-    // transaction's gas, it is best to keep them low in cases like this one, to
-    // increase the likelihood of the full refund coming into effect.
-    uint256 private constant _NOT_ENTERED = 1;
-    uint256 private constant _ENTERED = 2;
- 
-    uint256 private _status;
- 
-    constructor () {
-        _status = _NOT_ENTERED;
-    }
- 
-    /**
-     * @dev Prevents a contract from calling itself, directly or indirectly.
-     * Calling a `nonReentrant` function from another `nonReentrant`
-     * function is not supported. It is possible to prevent this from happening
-     * by making the `nonReentrant` function external, and make it call a
-     * `private` function that does the actual work.
-     */
-    modifier nonReentrant() {
-        // On the first call to nonReentrant, _notEntered will be true
-        Erequire(_status != _ENTERED, "ReentrancyGuard: reentrant call");
- 
-        // Any calls to nonReentrant after this point will fail
-        _status = _ENTERED;
- 
-        _;
- 
-        // By storing the original value once again, a refund is triggered (see
-        // https://eips.ethereum.org/EIPS/eip-2200)
-        _status = _NOT_ENTERED;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html b/coverage/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html deleted file mode 100644 index 57d0143ce..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol.html +++ /dev/null @@ -1,1193 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/utils/ Lib_RingBuffer.sol -

-
-
- 78.13% - Statements - 50/64 -
-
- 54.17% - Branches - 13/24 -
-
- 81.82% - Functions - 9/11 -
-
- 77.46% - Lines - 55/71 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -578× -578× -  -  -578× -140× -  -  -  -578× -11× -  -  -  -  -  -  -  -  -  -  -11× -  -  -  -  -578× -578× -  -  -578× -578× -578× -  -  -  -  -  -  -  -  -  -  -  -  -  -470× -  -470× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -538× -  -538× -  -  -  -  -535× -535× -  -535× -  -  -535× -  -  -535× -  -  -  -  -535× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  - -  -  -  -  - -  -  -  -  -  -  -  -  - - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -453× -453× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -580× -580× -  -  -  -  -  -  -  -  -  -  -  -  -  -579× -579× -  -579× -579× -579× -  -  -  -  -579× -579× -579× -579× -  -  -  -  -  -579× -579× -  -  -579× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2620× -2620× -  -2620× -2620× -2620× -  -  -  -  -2620× -2620× -2620× -2620× -  -  -  -  -  -2620× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1648× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-library Lib_RingBuffer {
-    using Lib_RingBuffer for RingBuffer;
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct Buffer {
-        uint256 length;
-        mapping (uint256 => bytes32) buf;
-    }
- 
-    struct RingBuffer {
-        bytes32 contextA;
-        bytes32 contextB;
-        Buffer bufferA;
-        Buffer bufferB;
-        uint256 nextOverwritableIndex;
-    }
- 
-    struct RingBufferContext {
-        // contextA
-        uint40 globalIndex;
-        bytes27 extraData;
- 
-        // contextB
-        uint64 currBufferIndex;
-        uint40 prevResetIndex;
-        uint40 currResetIndex;
-    }
- 
- 
-    /*************
-     * Constants *
-     *************/
- 
-    uint256 constant MIN_CAPACITY = 16;
- 
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Pushes a single element to the buffer.
-     * @param _self Buffer to access.
-     * @param _value Value to push to the buffer.
-     * @param _extraData Optional global extra data.
-     */
-    function push(
-        RingBuffer storage _self,
-        bytes32 _value,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
- 
-        // Set a minimum capacity.
-        if (currBuffer.length == 0) {
-            currBuffer.length = MIN_CAPACITY;
-        }
- 
-        // Check if we need to expand the buffer.
-        if (ctx.globalIndex - ctx.currResetIndex >= currBuffer.length) {
-            Iif (ctx.currResetIndex < _self.nextOverwritableIndex) {
-                // We're going to overwrite the inactive buffer.
-                // Bump the buffer index, reset the delete offset, and set our reset indices.
-                ctx.currBufferIndex++;
-                ctx.prevResetIndex = ctx.currResetIndex;
-                ctx.currResetIndex = ctx.globalIndex;
- 
-                // Swap over to the next buffer.
-                currBuffer = _self.getBuffer(ctx.currBufferIndex);
-            } else {
-                // We're not overwriting yet, double the length of the current buffer.
-                currBuffer.length *= 2;
-            }
-        }
- 
-        // Index to write to is the difference of the global and reset indices.
-        uint256 writeHead = ctx.globalIndex - ctx.currResetIndex;
-        currBuffer.buf[writeHead] = _value;
- 
-        // Bump the global index and insert our extra data, then save the context.
-        ctx.globalIndex++;
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Pushes a single element to the buffer.
-     * @param _self Buffer to access.
-     * @param _value Value to push to the buffer.
-     */
-    function push(
-        RingBuffer storage _self,
-        bytes32 _value
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        
-        _self.push(
-            _value,
-            ctx.extraData
-        );
-    }
- 
-    /**
-     * Retrieves an element from the buffer.
-     * @param _self Buffer to access.
-     * @param _index Element index to retrieve.
-     * @return Value of the element at the given index.
-     */
-    function get(
-        RingBuffer storage _self,
-        uint256 _index
-    )
-        internal
-        view
-        returns (
-            bytes32    
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
- 
-        require(
-            _index < ctx.globalIndex,
-            "Index out of bounds."
-        );
- 
-        Buffer storage currBuffer = _self.getBuffer(ctx.currBufferIndex);
-        Buffer storage prevBuffer = _self.getBuffer(ctx.currBufferIndex + 1);
- 
-        Eif (_index >= ctx.currResetIndex) {
-            // We're trying to load an element from the current buffer.
-            // Relative index is just the difference from the reset index.
-            uint256 relativeIndex = _index - ctx.currResetIndex;
- 
-            // Shouldn't happen but why not check.
-            Erequire(
-                relativeIndex < currBuffer.length,
-                "Index out of bounds."
-            );
- 
-            return currBuffer.buf[relativeIndex];
-        } else {
-            // We're trying to load an element from the previous buffer.
-            // Relative index is the difference from the reset index in the other direction.
-            uint256 relativeIndex = ctx.currResetIndex - _index;
- 
-            // Condition only fails in the case that we deleted and flipped buffers.
-            require(
-                ctx.currResetIndex > ctx.prevResetIndex,
-                "Index out of bounds."
-            );
- 
-            // Make sure we're not trying to read beyond the array.
-            require(
-                relativeIndex <= prevBuffer.length,
-                "Index out of bounds."
-            );
- 
-            return prevBuffer.buf[prevBuffer.length - relativeIndex];
-        }
-    }
- 
-    /**
-     * Deletes all elements after (and including) a given index.
-     * @param _self Buffer to access.
-     * @param _index Index of the element to delete from (inclusive).
-     * @param _extraData Optional global extra data.
-     */
-    function deleteElementsAfterInclusive(
-        RingBuffer storage _self,
-        uint40 _index,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
- 
-        Erequire(
-            _index < ctx.globalIndex && _index >= ctx.prevResetIndex,
-            "Index out of bounds."
-        );
- 
-        Iif (_index < ctx.currResetIndex) {
-            // We're switching back to the previous buffer.
-            // Reduce the buffer index, set the current reset index back to match the previous one.
-            // We use the equality of these two values to prevent reading beyond this buffer.
-            ctx.currBufferIndex--;
-            ctx.currResetIndex = ctx.prevResetIndex;
-        }
- 
-        // Set our global index and extra data, save the context.
-        ctx.globalIndex = _index;
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Deletes all elements after (and including) a given index.
-     * @param _self Buffer to access.
-     * @param _index Index of the element to delete from (inclusive).
-     */
-    function deleteElementsAfterInclusive(
-        RingBuffer storage _self,
-        uint40 _index
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        _self.deleteElementsAfterInclusive(
-            _index,
-            ctx.extraData
-        );
-    }
- 
-    /**
-     * Retrieves the current global index.
-     * @param _self Buffer to access.
-     * @return Current global index.
-     */
-    function getLength(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        return ctx.globalIndex;
-    }
- 
-    /**
-     * Changes current global extra data.
-     * @param _self Buffer to access.
-     * @param _extraData New global extra data.
-     */
-    function setExtraData(
-        RingBuffer storage _self,
-        bytes27 _extraData
-    )
-        internal
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        ctx.extraData = _extraData;
-        _self.setContext(ctx);
-    }
- 
-    /**
-     * Retrieves the current global extra data.
-     * @param _self Buffer to access.
-     * @return Current global extra data.
-     */
-    function getExtraData(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            bytes27
-        )
-    {
-        RingBufferContext memory ctx = _self.getContext();
-        return ctx.extraData;
-    }
- 
-    /**
-     * Sets the current ring buffer context.
-     * @param _self Buffer to access.
-     * @param _ctx Current ring buffer context.
-     */
-    function setContext(
-        RingBuffer storage _self,
-        RingBufferContext memory _ctx
-    )
-        internal
-    {
-        bytes32 contextA;
-        bytes32 contextB;
- 
-        uint40 globalIndex = _ctx.globalIndex;
-        bytes27 extraData = _ctx.extraData;
-        assembly {
-            contextA := globalIndex
-            contextA := or(contextA, extraData)
-        }
- 
-        uint64 currBufferIndex = _ctx.currBufferIndex;
-        uint40 prevResetIndex = _ctx.prevResetIndex;
-        uint40 currResetIndex = _ctx.currResetIndex;
-        assembly {
-            contextB := currBufferIndex
-            contextB := or(contextB, shl(64, prevResetIndex))
-            contextB := or(contextB, shl(104, currResetIndex))
-        }
- 
-        Eif (_self.contextA != contextA) {
-            _self.contextA = contextA;
-        }
- 
-        Iif (_self.contextB != contextB) {
-            _self.contextB = contextB;
-        }
-    }
- 
-    /**
-     * Retrieves the current ring buffer context.
-     * @param _self Buffer to access.
-     * @return Current ring buffer context.
-     */
-    function getContext(
-        RingBuffer storage _self
-    )
-        internal
-        view
-        returns (
-            RingBufferContext memory
-        )
-    {
-        bytes32 contextA = _self.contextA;
-        bytes32 contextB = _self.contextB;
- 
-        uint40 globalIndex;
-        bytes27 extraData;
-        assembly {
-            globalIndex := and(contextA, 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF)
-            extraData   := and(contextA, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000)
-        }
- 
-        uint64 currBufferIndex;
-        uint40 prevResetIndex;
-        uint40 currResetIndex;
-        assembly {
-            currBufferIndex :=          and(contextB, 0x000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)
-            prevResetIndex  := shr(64,  and(contextB, 0x00000000000000000000000000000000000000FFFFFFFFFF0000000000000000))
-            currResetIndex  := shr(104, and(contextB, 0x0000000000000000000000000000FFFFFFFFFF00000000000000000000000000))
-        }
- 
-        return RingBufferContext({
-            globalIndex: globalIndex,
-            extraData: extraData,
-            currBufferIndex: currBufferIndex,
-            prevResetIndex: prevResetIndex,
-            currResetIndex: currResetIndex
-        });
-    }
- 
-    /**
-     * Retrieves the a buffer from the ring buffer by index.
-     * @param _self Buffer to access.
-     * @param _which Index of the sub buffer to access.
-     * @return Sub buffer for the index.
-     */
-    function getBuffer(
-        RingBuffer storage _self,
-        uint256 _which
-    )
-        internal
-        view
-        returns (
-            Buffer storage
-        )
-    {
-        return _which % 2 == 0 ? _self.bufferA : _self.bufferB;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/utils/index.html b/coverage/optimistic-ethereum/libraries/utils/index.html deleted file mode 100644 index a87d86505..000000000 --- a/coverage/optimistic-ethereum/libraries/utils/index.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/utils/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/utils/ -

-
-
- 89.07% - Statements - 163/183 -
-
- 67.57% - Branches - 50/74 -
-
- 91.11% - Functions - 41/45 -
-
- 89.27% - Lines - 183/205 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_Bytes32Utils.sol
100%6/6100%0/0100%5/5100%7/7
Lib_BytesUtils.sol
100%38/3863.64%14/22100%11/11100%44/44
Lib_ECDSAUtils.sol
100%9/9100%2/2100%4/4100%9/9
Lib_ErrorUtils.sol
100%1/1100%0/0100%1/1100%1/1
Lib_EthUtils.sol
83.33%10/12100%0/085.71%6/787.5%14/16
Lib_Math.sol
0%0/30%0/20%0/10%0/3
Lib_MerkleTree.sol
97.83%45/4690.91%20/22100%3/397.96%48/49
Lib_ReentrancyGuard.sol
100%4/450%1/2100%2/2100%5/5
Lib_RingBuffer.sol
78.13%50/6454.17%13/2481.82%9/1177.46%55/71
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html b/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html deleted file mode 100644 index 864775242..000000000 --- a/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol.html +++ /dev/null @@ -1,1205 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/wrappers/ Lib_SafeExecutionManagerWrapper.sol -

-
-
- 100% - Statements - 30/30 -
-
- 83.33% - Branches - 5/6 -
-
- 100% - Functions - 16/16 -
-
- 96.77% - Lines - 30/31 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -18× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -12× -  -  -  -  -  -12× -  -  -  -  -  -  -  -  -  -  -  -  -11× -  -  -  -  -  -11× -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -41× - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -43× -  -  -  -  -  -  -43× -  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -146× -146× -  -  -  -  -146× - -  -  -  -  -  -  -  -144× -  -  -  -  -  -  -  -  -  -  -  -145× -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_ErrorUtils } from "../utils/Lib_ErrorUtils.sol";
- 
-/**
- * @title Lib_SafeExecutionManagerWrapper
- * @dev The Safe Execution Manager Wrapper provides functions which facilitate writing OVM safe 
- * code using the standard solidity compiler, by routing all its operations through the Execution 
- * Manager.
- * 
- * Compiler used: solc
- * Runtime target: OVM
- */
-library Lib_SafeExecutionManagerWrapper {
- 
-    /**********************
-     * Internal Functions *
-     **********************/
- 
-    /**
-     * Performs a safe ovmCALL.
-     * @param _gasLimit Gas limit for the call.
-     * @param _target Address to call.
-     * @param _calldata Data to send to the call.
-     * @return _success Whether or not the call reverted.
-     * @return _returndata Data returned by the call.
-     */
-    function safeCALL(
-        uint256 _gasLimit,
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCALL(uint256,address,bytes)",
-                _gasLimit,
-                _target,
-                _calldata
-            )
-        );
- 
-        return abi.decode(returndata, (bool, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmDELEGATECALL.
-     * @param _gasLimit Gas limit for the call.
-     * @param _target Address to call.
-     * @param _calldata Data to send to the call.
-     * @return _success Whether or not the call reverted.
-     * @return _returndata Data returned by the call.
-     */
-    function safeDELEGATECALL(
-        uint256 _gasLimit,
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmDELEGATECALL(uint256,address,bytes)",
-                _gasLimit,
-                _target,
-                _calldata
-            )
-        );
- 
-        return abi.decode(returndata, (bool, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmCREATE call.
-     * @param _gasLimit Gas limit for the creation.
-     * @param _bytecode Code for the new contract.
-     * @return _contract Address of the created contract.
-     */
-    function safeCREATE(
-        uint256 _gasLimit,
-        bytes memory _bytecode
-    )
-        internal
-        returns (
-            address,
-            bytes memory
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            _gasLimit,
-            abi.encodeWithSignature(
-                "ovmCREATE(bytes)",
-                _bytecode
-            )
-        );
- 
-        return abi.decode(returndata, (address, bytes));
-    }
- 
-    /**
-     * Performs a safe ovmEXTCODESIZE call.
-     * @param _contract Address of the contract to query the size of.
-     * @return _EXTCODESIZE Size of the requested contract in bytes.
-     */
-    function safeEXTCODESIZE(
-        address _contract
-    )
-        internal
-        returns (
-            uint256 _EXTCODESIZE
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmEXTCODESIZE(address)",
-                _contract
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmCHAINID call.
-     * @return _CHAINID Result of calling ovmCHAINID.
-     */
-    function safeCHAINID()
-        internal
-        returns (
-            uint256 _CHAINID
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCHAINID()"
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmCALLER call.
-     * @return _CALLER Result of calling ovmCALLER.
-     */
-    function safeCALLER()
-        internal
-        returns (
-            address _CALLER
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCALLER()"
-            )
-        );
- 
-        return abi.decode(returndata, (address));
-    }
- 
-    /**
-     * Performs a safe ovmADDRESS call.
-     * @return _ADDRESS Result of calling ovmADDRESS.
-     */
-    function safeADDRESS()
-        internal
-        returns (
-            address _ADDRESS
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmADDRESS()"
-            )
-        );
- 
-        return abi.decode(returndata, (address));
-    }
- 
-    /**
-     * Performs a safe ovmGETNONCE call.
-     * @return _nonce Result of calling ovmGETNONCE.
-     */
-    function safeGETNONCE()
-        internal
-        returns (
-            uint256 _nonce
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmGETNONCE()"
-            )
-        );
- 
-        return abi.decode(returndata, (uint256));
-    }
- 
-    /**
-     * Performs a safe ovmSETNONCE call.
-     * @param _nonce New account nonce.
-     */
-    function safeSETNONCE(
-        uint256 _nonce
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSETNONCE(uint256)",
-                _nonce
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe ovmCREATEEOA call.
-     * @param _messageHash Message hash which was signed by EOA
-     * @param _v v value of signature (0 or 1)
-     * @param _r r value of signature
-     * @param _s s value of signature
-     */
-    function safeCREATEEOA(
-        bytes32 _messageHash,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmCREATEEOA(bytes32,uint8,bytes32,bytes32)",
-                _messageHash,
-                _v,
-                _r,
-                _s
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe REVERT.
-     * @param _reason String revert reason to pass along with the REVERT.
-     */
-    function safeREVERT(
-        string memory _reason
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmREVERT(bytes)",
-                Lib_ErrorUtils.encodeRevertString(
-                    _reason
-                )
-            )
-        );
-    }
- 
-    /**
-     * Performs a safe "require".
-     * @param _condition Boolean condition that must be true or will revert.
-     * @param _reason String revert reason to pass along with the REVERT.
-     */
-    function safeREQUIRE(
-        bool _condition,
-        string memory _reason
-    )
-        internal
-    {
-        if (!_condition) {
-            safeREVERT(
-                _reason
-            );
-        }
-    }
- 
-    /**
-     * Performs a safe ovmSLOAD call.
-     */
-    function safeSLOAD(
-        bytes32 _key
-    )
-        internal
-        returns (
-            bytes32
-        )
-    {
-        bytes memory returndata = _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSLOAD(bytes32)",
-                _key
-            )
-        );
- 
-        return abi.decode(returndata, (bytes32));
-    }
- 
-    /**
-     * Performs a safe ovmSSTORE call.
-     */
-    function safeSSTORE(
-        bytes32 _key,
-        bytes32 _value
-    )
-        internal
-    {
-        _safeExecutionManagerInteraction(
-            abi.encodeWithSignature(
-                "ovmSSTORE(bytes32,bytes32)",
-                _key,
-                _value
-            )
-        );
-    }
- 
-    /*********************
-     * Private Functions *
-     *********************/
- 
-    /**
-     * Performs an ovm interaction and the necessary safety checks.
-     * @param _gasLimit Gas limit for the interaction.
-     * @param _calldata Data to send to the OVM_ExecutionManager (encoded with sighash).
-     * @return _returndata Data sent back by the OVM_ExecutionManager.
-     */
-    function _safeExecutionManagerInteraction(
-        uint256 _gasLimit,
-        bytes memory _calldata
-    )
-        private
-        returns (
-            bytes memory _returndata
-        )
-    {
-        address ovmExecutionManager = msg.sender;
-        (
-            bool success,
-            bytes memory returndata
-        ) = ovmExecutionManager.call{gas: _gasLimit}(_calldata);
- 
-        if (success == false) {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        } else Iif (returndata.length == 1) {
-            assembly {
-                return(0, 1)
-            }
-        } else {
-            return returndata;
-        }
-    }
- 
-    function _safeExecutionManagerInteraction(
-        bytes memory _calldata
-    )
-        private
-        returns (
-            bytes memory _returndata
-        )
-    {
-        return _safeExecutionManagerInteraction(
-            gasleft(),
-            _calldata
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html b/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html deleted file mode 100644 index 5389cca3c..000000000 --- a/coverage/optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/wrappers/Lib_SafeMathWrapper.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/libraries/wrappers/ Lib_SafeMathWrapper.sol -

-
-
- 21.05% - Statements - 4/19 -
-
- 50% - Branches - 1/2 -
-
- 12.5% - Functions - 1/8 -
-
- 21.05% - Lines - 4/19 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - - -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// Pulled from @openzeppelin/contracts/math/SafeMath.sol
-// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_SafeExecutionManagerWrapper } from "./Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title Lib_SafeMathWrapper
- */
- 
-/**
- * @dev Wrappers over Solidity's arithmetic operations with added overflow
- * checks.
- *
- * Arithmetic operations in Solidity wrap on overflow. This can easily result
- * in bugs, because programmers usually assume that an overflow raises an
- * error, which is the standard behavior in high level programming languages.
- * `SafeMath` restores this intuition by reverting the transaction when an
- * operation overflows.
- *
- * Using this library instead of the unchecked operations eliminates an entire
- * class of bugs, so it's recommended to use it always.
- */
- 
-library Lib_SafeMathWrapper {
-    /**
-     * @dev Returns the addition of two unsigned integers, reverting on
-     * overflow.
-     *
-     * Counterpart to Solidity's `+` operator.
-     *
-     * Requirements:
-     *
-     * - Addition cannot overflow.
-     */
-    function add(uint256 a, uint256 b) internal returns (uint256) {
-        uint256 c = a + b;
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c >= a, "Lib_SafeMathWrapper: addition overflow");
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the subtraction of two unsigned integers, reverting on
-     * overflow (when the result is negative).
-     *
-     * Counterpart to Solidity's `-` operator.
-     *
-     * Requirements:
-     *
-     * - Subtraction cannot overflow.
-     */
-    function sub(uint256 a, uint256 b) internal returns (uint256) {
-        return sub(a, b, "Lib_SafeMathWrapper: subtraction overflow");
-    }
- 
-    /**
-     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
-     * overflow (when the result is negative).
-     *
-     * Counterpart to Solidity's `-` operator.
-     *
-     * Requirements:
-     *
-     * - Subtraction cannot overflow.
-     */
-    function sub(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b <= a, errorMessage);
-        uint256 c = a - b;
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the multiplication of two unsigned integers, reverting on
-     * overflow.
-     *
-     * Counterpart to Solidity's `*` operator.
-     *
-     * Requirements:
-     *
-     * - Multiplication cannot overflow.
-     */
-    function mul(uint256 a, uint256 b) internal returns (uint256) {
-        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
-        // benefit is lost if 'b' is also tested.
-        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
-        Iif (a == 0) {
-            return 0;
-        }
- 
-        uint256 c = a * b;
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(c / a == b, "Lib_SafeMathWrapper: multiplication overflow");
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the integer division of two unsigned integers. Reverts on
-     * division by zero. The result is rounded towards zero.
-     *
-     * Counterpart to Solidity's `/` operator. Note: this function uses a
-     * `revert` opcode (which leaves remaining gas untouched) while Solidity
-     * uses an invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function div(uint256 a, uint256 b) internal returns (uint256) {
-        return div(a, b, "Lib_SafeMathWrapper: division by zero");
-    }
- 
-    /**
-     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
-     * division by zero. The result is rounded towards zero.
-     *
-     * Counterpart to Solidity's `/` operator. Note: this function uses a
-     * `revert` opcode (which leaves remaining gas untouched) while Solidity
-     * uses an invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function div(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b > 0, errorMessage);
-        uint256 c = a / b;
-        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
- 
-        return c;
-    }
- 
-    /**
-     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
-     * Reverts when dividing by zero.
-     *
-     * Counterpart to Solidity's `%` operator. This function uses a `revert`
-     * opcode (which leaves remaining gas untouched) while Solidity uses an
-     * invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function mod(uint256 a, uint256 b) internal returns (uint256) {
-        return mod(a, b, "Lib_SafeMathWrapper: modulo by zero");
-    }
- 
-    /**
-     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
-     * Reverts with custom message when dividing by zero.
-     *
-     * Counterpart to Solidity's `%` operator. This function uses a `revert`
-     * opcode (which leaves remaining gas untouched) while Solidity uses an
-     * invalid opcode to revert (consuming all remaining gas).
-     *
-     * Requirements:
-     *
-     * - The divisor cannot be zero.
-     */
-    function mod(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) {
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(b != 0, errorMessage);
-        return a % b;
-    }
-}
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/libraries/wrappers/index.html b/coverage/optimistic-ethereum/libraries/wrappers/index.html deleted file mode 100644 index 4855727ba..000000000 --- a/coverage/optimistic-ethereum/libraries/wrappers/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/libraries/wrappers/ - - - - - - - -
-
-

- all files optimistic-ethereum/libraries/wrappers/ -

-
-
- 69.39% - Statements - 34/49 -
-
- 75% - Branches - 6/8 -
-
- 70.83% - Functions - 17/24 -
-
- 68% - Lines - 34/50 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Lib_SafeExecutionManagerWrapper.sol
100%30/3083.33%5/6100%16/1696.77%30/31
Lib_SafeMathWrapper.sol
21.05%4/1950%1/212.5%1/821.05%4/19
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/mockOVM/accounts/index.html b/coverage/optimistic-ethereum/mockOVM/accounts/index.html deleted file mode 100644 index d48d74930..000000000 --- a/coverage/optimistic-ethereum/mockOVM/accounts/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/accounts/ - - - - - - - -
-
-

- all files optimistic-ethereum/mockOVM/accounts/ -

-
-
- 0% - Statements - 0/9 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/2 -
-
- 0% - Lines - 0/9 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
mockOVM_ECDSAContractAccount.sol
0%0/90%0/20%0/20%0/9
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html b/coverage/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html deleted file mode 100644 index 41a520f12..000000000 --- a/coverage/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/mockOVM/accounts/ mockOVM_ECDSAContractAccount.sol -

-
-
- 0% - Statements - 0/9 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/2 -
-
- 0% - Lines - 0/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Interface Imports */
-import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol";
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol";
-import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol";
-import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol";
- 
-/**
- * @title mockOVM_ECDSAContractAccount
- */
-contract mockOVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Executes a signed transaction.
-     * @param _transaction Signed EOA transaction.
-     * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message).
-     * param _v Signature `v` parameter.
-     * param _r Signature `r` parameter.
-     * param _s Signature `s` parameter.
-     * @return _success Whether or not the call returned (rather than reverted).
-     * @return _returndata Data returned by the call.
-     */
-    function execute(
-        bytes memory _transaction,
-        Lib_OVMCodec.EOASignatureType _signatureType,
-        uint8, // _v,
-        bytes32, // _r,
-        bytes32 // _s
-    )
-        override
-        public
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE;
-        Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign);
- 
-        // Need to make sure that the transaction nonce is right.
-        Lib_SafeExecutionManagerWrapper.safeREQUIRE(
-            decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(),
-            "Transaction nonce does not match the expected nonce."
-        );
- 
-        // Contract creations are signalled by sending a transaction to the zero address.
-        if (decodedTx.to == address(0)) {
-            (address created, ) = Lib_SafeExecutionManagerWrapper.safeCREATE(
-                decodedTx.gasLimit,
-                decodedTx.data
-            );
- 
-            // If the created address is the ZERO_ADDRESS then we know the deployment failed, though not why
-            return (created != address(0), abi.encode(created));
-        } else {
-            // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps
-            // the nonce of the calling account. Normally an EOA would bump the nonce for both
-            // cases, but since this is a contract we'd end up bumping the nonce twice.
-            Lib_SafeExecutionManagerWrapper.safeSETNONCE(decodedTx.nonce + 1);
- 
-            return Lib_SafeExecutionManagerWrapper.safeCALL(
-                decodedTx.gasLimit,
-                decodedTx.to,
-                decodedTx.data
-            );
-        }
-    }
- 
-    function qall(
-        uint256 _gasLimit,
-        address _to,
-        bytes memory _data
-    )
-        public
-        returns (
-            bool _success,
-            bytes memory _returndata
-        )
-    {
-        return Lib_SafeExecutionManagerWrapper.safeCALL(
-            _gasLimit,
-            _to,
-            _data
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/mockOVM/bridge/index.html b/coverage/optimistic-ethereum/mockOVM/bridge/index.html deleted file mode 100644 index d1417a522..000000000 --- a/coverage/optimistic-ethereum/mockOVM/bridge/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/bridge/ - - - - - - - -
-
-

- all files optimistic-ethereum/mockOVM/bridge/ -

-
-
- 0% - Statements - 0/19 -
-
- 0% - Branches - 0/8 -
-
- 0% - Functions - 0/8 -
-
- 0% - Lines - 0/19 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
mockOVM_CrossDomainMessenger.sol
0%0/140%0/60%0/60%0/14
mockOVM_GenericCrossDomainMessenger.sol
0%0/50%0/20%0/20%0/5
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html deleted file mode 100644 index 47e36cc0a..000000000 --- a/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol.html +++ /dev/null @@ -1,500 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/bridge/mockOVM_CrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/mockOVM/bridge/ mockOVM_CrossDomainMessenger.sol -

-
-
- 0% - Statements - 0/14 -
-
- 0% - Branches - 0/6 -
-
- 0% - Functions - 0/6 -
-
- 0% - Lines - 0/14 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Contract Imports */
-import { iAbs_BaseCrossDomainMessenger } from "../../iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";
- 
-/**
- * @title mockOVM_CrossDomainMessenger
- */
-contract mockOVM_CrossDomainMessenger is iAbs_BaseCrossDomainMessenger {
- 
-    /***********
-     * Structs *
-     ***********/
- 
-    struct ReceivedMessage {
-        uint256 timestamp;
-        address target;
-        address sender;
-        bytes message;
-        uint256 messageNonce;
-        uint32 gasLimit;
-    }
- 
- 
-    /**********************
-     * Contract Variables *
-     **********************/
- 
-    ReceivedMessage[] internal fullReceivedMessages;
-    address internal targetMessengerAddress;
-    uint256 internal lastRelayedMessage;
-    uint256 internal delay;
-    uint256 public messageNonce;
-    address override public xDomainMessageSender;
- 
- 
-    /***************
-     * Constructor *
-     ***************/
- 
-    /**
-     * @param _delay Time in seconds before a message can be relayed.
-     */
-    constructor(
-        uint256 _delay
-    )
-    {
-        delay = _delay;
-    }
- 
- 
-    /********************
-     * Public Functions *
-     ********************/
- 
-    /**
-     * Sets the target messenger address.
-     * @dev Currently, this function is public and therefore allows anyone to modify the target
-     *      messenger for a given xdomain messenger contract. Obviously this shouldn't be allowed,
-     *      but we still need to determine an adequate mechanism for updating this address.
-     * @param _targetMessengerAddress New messenger address.
-     */
-    function setTargetMessengerAddress(
-        address _targetMessengerAddress
-    )
-        public
-    {
-        targetMessengerAddress = _targetMessengerAddress;
-    }
- 
-    /**
-     * Sends a message to another mock xdomain messenger.
-     * @param _target Target for the message.
-     * @param _message Message to send.
-     * @param _gasLimit Amount of gas to send with the call.
-     */
-    function sendMessage(
-        address _target,
-        bytes memory _message,
-        uint32 _gasLimit
-    )
-        override
-        public
-    {
-        mockOVM_CrossDomainMessenger targetMessenger = mockOVM_CrossDomainMessenger(
-            targetMessengerAddress
-        );
- 
-        // Just send it over!
-        targetMessenger.receiveMessage(ReceivedMessage({
-            timestamp: block.timestamp,
-            target: _target,
-            sender: msg.sender,
-            message: _message,
-            messageNonce: messageNonce,
-            gasLimit: _gasLimit
-        }));
- 
-        messageNonce += 1;
-    }
- 
-    /**
-     * Receives a message to be sent later.
-     * @param _message Message to send later.
-     */
-    function receiveMessage(
-        ReceivedMessage memory _message
-    )
-        public
-    {
-        fullReceivedMessages.push(_message);
-    }
- 
-    /**
-     * Checks whether we have messages to relay.
-     * @param _exists Whether or not we have more messages to relay.
-     */
-    function hasNextMessage()
-        public
-        view
-        returns (
-            bool _exists
-        )
-    {
-        return fullReceivedMessages.length > lastRelayedMessage;
-    }
- 
-    /**
-     * Relays the last received message not yet relayed.
-     */
-    function relayNextMessage()
-        public
-    {
-        require(hasNextMessage(), "No pending messages to relay");
-        ReceivedMessage memory nextMessage = fullReceivedMessages[lastRelayedMessage];
-        require(nextMessage.timestamp + delay < block.timestamp, "Message is not ready to be relayed. The delay period is not up yet!");
- 
-        xDomainMessageSender = nextMessage.sender;
-        (bool success,) = nextMessage.target.call{gas: nextMessage.gasLimit}(nextMessage.message);
-        require(success, "Cross-domain message call reverted. Did you set your gas limit high enough?");
-        lastRelayedMessage += 1;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html b/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html deleted file mode 100644 index a584a996b..000000000 --- a/coverage/optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/bridge/mockOVM_GenericCrossDomainMessenger.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/mockOVM/bridge/ mockOVM_GenericCrossDomainMessenger.sol -

-
-
- 0% - Statements - 0/5 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/2 -
-
- 0% - Lines - 0/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/**
- * @title mockOVM_GenericCrossDomainMessenger
- * @dev An experimental alternative mock for local testing.
- */
-contract mockOVM_GenericCrossDomainMessenger {
-    address public xDomainMessageSender;
- 
-    event SentMessage(
-        address _sender,
-        address _target,
-        bytes _message,
-        uint256 _gasLimit
-    );
- 
-    function sendMessage(
-        address _target,
-        bytes memory _message,
-        uint32 _gasLimit
-    )
-        public
-    {
-        emit SentMessage(
-            msg.sender,
-            _target,
-            _message,
-            _gasLimit
-        );
-    }
- 
-    function relayMessage(
-        address _sender,
-        address _target,
-        bytes memory _message,
-        uint256 _gasLimit
-    )
-        public
-    {
-        xDomainMessageSender = _sender;
-        (bool success, ) = _target.call{gas: _gasLimit}(_message);
-        require(success, "Cross-domain message call reverted. Did you set your gas limit high enough?");
-        xDomainMessageSender = address(0);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/mockOVM/verification/index.html b/coverage/optimistic-ethereum/mockOVM/verification/index.html deleted file mode 100644 index f2db23491..000000000 --- a/coverage/optimistic-ethereum/mockOVM/verification/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/verification/ - - - - - - - -
-
-

- all files optimistic-ethereum/mockOVM/verification/ -

-
-
- 50% - Statements - 1/2 -
-
- 100% - Branches - 0/0 -
-
- 22.22% - Functions - 2/9 -
-
- 50% - Lines - 1/2 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
mockOVM_BondManager.sol
50%1/2100%0/022.22%2/950%1/2
-
-
- - - - - - - diff --git a/coverage/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html b/coverage/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html deleted file mode 100644 index e66f2c6fa..000000000 --- a/coverage/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - Code coverage report for optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol - - - - - - - -
-
-

- all files / optimistic-ethereum/mockOVM/verification/ mockOVM_BondManager.sol -

-
-
- 50% - Statements - 1/2 -
-
- 100% - Branches - 0/0 -
-
- 22.22% - Functions - 2/9 -
-
- 50% - Lines - 1/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Interface Imports */
-import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
- 
-/* Contract Imports */
-import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
- 
-/**
- * @title mockOVM_BondManager
- */
-contract mockOVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
-    constructor(
-        address _libAddressManager
-    )
-        Lib_AddressResolver(_libAddressManager)
-    {}
- 
-    function recordGasSpent(
-        bytes32 _preStateRoot,
-        bytes32 _txHash,
-        address _who,
-        uint256 _gasSpent
-    )
-        override
-        public
-    {}
- 
-    function finalize(
-        bytes32 _preStateRoot,
-        address _publisher,
-        uint256 _timestamp
-    )
-        override
-        public
-    {}
- 
-    function deposit()
-        override
-        public
-    {}
- 
-    function startWithdrawal()
-        override
-        public
-    {}
- 
-    function finalizeWithdrawal()
-        override
-        public
-    {}
- 
-    function claim(
-        address _who
-    )
-        override
-        public
-    {}
- 
-    function isCollateralized(
-        address _who
-    )
-        override
-        public
-        view
-        returns (
-            bool
-        )
-    {
-        // Only authenticate sequencer to submit state root batches.
-        return _who == resolve("OVM_Proposer");
-    }
- 
-    function getGasSpent(
-        bytes32, // _preStateRoot,
-        address // _who
-    )
-        override
-        public
-        pure 
-        returns (
-            uint256
-        )
-    {
-        return 0;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/prettify.css b/coverage/prettify.css deleted file mode 100644 index b317a7cda..000000000 --- a/coverage/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/prettify.js b/coverage/prettify.js deleted file mode 100644 index ef51e0386..000000000 --- a/coverage/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/sort-arrow-sprite.png b/coverage/sort-arrow-sprite.png deleted file mode 100644 index 03f704a609c6fd0dbfdac63466a7d7c958b5cbf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/coverage/test-helpers/Helper_GasMeasurer.sol.html b/coverage/test-helpers/Helper_GasMeasurer.sol.html deleted file mode 100644 index e33773a59..000000000 --- a/coverage/test-helpers/Helper_GasMeasurer.sol.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_GasMeasurer.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_GasMeasurer.sol -

-
-
- 100% - Statements - 7/7 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 9/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34  -  -  -  -  -  -  -  -  -  -  -  -47× -47× -  -47× -47× -47× -  -  -  -  -47× -47× -  -  -  -  -47× -  -47× -  -  - 
// SPDX-License-Identifier: UNLICENSED
-// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-contract Helper_GasMeasurer {
-    function measureCallGas(
-        address _target,
-        bytes memory _data
-    )
-        public
-        returns ( uint256 )
-    {
-        uint256 gasBefore;
-        uint256 gasAfter;
- 
-        uint256 calldataStart;
-        uint256 calldataLength;
-        assembly {
-            calldataStart := add(_data,0x20)
-            calldataLength := mload(_data)
-        }
- 
-        bool success;
-        assembly {
-            gasBefore := gas()
-            success := call(gas(), _target, 0, calldataStart, calldataLength, 0, 0)
-            gasAfter := gas()
-        }
-        Erequire(success, "Call failed, but calls we want to measure gas for should succeed!");
- 
-        return gasBefore - gasAfter;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-helpers/Helper_ModifiableStorage.sol.html b/coverage/test-helpers/Helper_ModifiableStorage.sol.html deleted file mode 100644 index f0c0291b2..000000000 --- a/coverage/test-helpers/Helper_ModifiableStorage.sol.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_ModifiableStorage.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_ModifiableStorage.sol -

-
-
- 0% - Statements - 0/5 -
-
- 0% - Branches - 0/2 -
-
- 0% - Functions - 0/4 -
-
- 0% - Lines - 0/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-contract Helper_ModifiableStorage {
-    mapping (address => address) private target;
- 
-    constructor(
-        address _target
-    )
-    {
-        target[address(this)] = _target;
-    }
- 
-    fallback()
-        external
-    {
-        (bool success, bytes memory returndata) = target[address(this)].delegatecall(msg.data);
- 
-        if (success) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
- 
-    function __setStorageSlot(
-        bytes32 _key,
-        bytes32 _value
-    )
-        public
-    {
-        assembly {
-            sstore(_key, _value)
-        }
-    }
- 
-    function __getStorageSlot(
-        bytes32 _key
-    )
-        public
-        view
-        returns (
-            bytes32 _value
-        )
-    {
-        bytes32 value;
-        assembly {
-            value := sload(_key)
-        }
-        return value;
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-helpers/Helper_PrecompileCaller.sol.html b/coverage/test-helpers/Helper_PrecompileCaller.sol.html deleted file mode 100644 index 1c17c6868..000000000 --- a/coverage/test-helpers/Helper_PrecompileCaller.sol.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_PrecompileCaller.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_PrecompileCaller.sol -

-
-
- 75% - Statements - 9/12 -
-
- 50% - Branches - 3/6 -
-
- 100% - Functions - 3/3 -
-
- 75% - Lines - 9/12 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54  -  -  -  -  -  -  -  -  -  -  -  -54× -54× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - - -  -  -  - - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-import { Helper_SimpleProxy } from "./Helper_SimpleProxy.sol";
- 
-contract Helper_PredeployCaller is Helper_SimpleProxy {
-    function callPredeploy(
-        address _predeploy,
-        bytes memory _data
-    )
-        public
-    {
-        Eif (msg.sender == owner) {
-            makeExternalCall(_predeploy, _data);
-        } else {
-            makeExternalCall(target, msg.data);
-        }
-    }
- 
-    function callPredeployAbi(
-        address _predeploy,
-        bytes memory _data
-    )
-        public
-        returns (
-            bytes memory
-        )
-    {
- 
-        bool success;
-        bytes memory returndata;
-        Eif (msg.sender == owner) {
-            (success, returndata) = _predeploy.call(_data);
-        } else {
-            (success, returndata) = target.call(msg.data);
-        }
-        Erequire(success, "Predeploy call reverted");
-        return returndata;
-    }
- 
-    function getL1MessageSender(
-        address _predeploy,
-        bytes memory _data
-    )
-        public
-        returns (
-            address
-        )
-    {
-        callPredeploy(_predeploy, _data);
-        return address(0); // unused: silence compiler
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-helpers/Helper_SimpleProxy.sol.html b/coverage/test-helpers/Helper_SimpleProxy.sol.html deleted file mode 100644 index 431c71e0b..000000000 --- a/coverage/test-helpers/Helper_SimpleProxy.sol.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_SimpleProxy.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_SimpleProxy.sol -

-
-
- 85.71% - Statements - 6/7 -
-
- 75% - Branches - 3/4 -
-
- 100% - Functions - 4/4 -
-
- 88.89% - Lines - 8/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50  -  -  -  -  -  -  -  -  -69× -  -  -  -  -  -271× -  -  -  -  -  -  -  -23× -23× -  -  -  -  -  -  -  -  -  -  -  -325× -  -325× -321× -  -  -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-contract Helper_SimpleProxy {
-    address internal owner;
-    address internal target;
- 
-    constructor()
-    {
-        owner = msg.sender;
-    }
- 
-    fallback()
-        external
-    {
-        makeExternalCall(target, msg.data);
-    }
- 
-    function setTarget(
-        address _target
-    )
-        public
-    {
-        Eif (msg.sender == owner) {
-            target = _target;
-        } else {
-            makeExternalCall(target, msg.data);
-        }
-    }
- 
-    function makeExternalCall(
-        address _target,
-        bytes memory _calldata
-    )
-        internal
-    {
-        (bool success, bytes memory returndata) = _target.call(_calldata);
- 
-        if (success) {
-            assembly {
-                return(add(returndata, 0x20), mload(returndata))
-            }
-        } else {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-helpers/Helper_TestRunner.sol.html b/coverage/test-helpers/Helper_TestRunner.sol.html deleted file mode 100644 index 4034ff256..000000000 --- a/coverage/test-helpers/Helper_TestRunner.sol.html +++ /dev/null @@ -1,647 +0,0 @@ - - - - Code coverage report for test-helpers/Helper_TestRunner.sol - - - - - - - -
-
-

- all files / test-helpers/ Helper_TestRunner.sol -

-
-
- 30.3% - Statements - 20/66 -
-
- 66.67% - Branches - 16/24 -
-
- 80% - Functions - 4/5 -
-
- 33.8% - Lines - 24/71 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -161× -161× -  -  -  -  -  -161× - - -  -  -  -159× - -  -  -  -  -156× -  -156× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -156× - -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  -  -  -  -  - -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -156× -17× -  -  -  -  -  -  -  -  -  -  -83× -87× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -  -  -  -  -  -  -14× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -27× -18× -  - -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Logging */
-import { console } from "hardhat/console.sol";
- 
-/**
- * @title Helper_TestRunner
- */
-contract Helper_TestRunner {
-    struct TestStep {
-        string functionName;
-        bytes functionData;
-        bool expectedReturnStatus;
-        bytes expectedReturnData;
-        bool onlyValidateFlag;
-    }
- 
-    function runSingleTestStep(
-        TestStep memory _step
-    )
-        public
-    {
-        bytes32 namehash = keccak256(abi.encodePacked(_step.functionName));
-        Iif (namehash == keccak256("evmRETURN")) {
-            bytes memory functionData = _step.functionData;
-            assembly {
-                return(add(functionData, 0x20), mload(functionData))
-            }
-        }
-        if (namehash == keccak256("evmREVERT")) {
-            bytes memory functionData = _step.functionData;
-            assembly {
-                revert(add(functionData, 0x20), mload(functionData))
-            }
-        }
-        if (namehash == keccak256("evmINVALID")) {
-            assembly {
-                invalid()
-            }
-        }
- 
-        (bool success, bytes memory returndata) = address(msg.sender).call(_step.functionData);
- 
-        Iif (success != _step.expectedReturnStatus) {
-            if (success == true) {
-                console.log("ERROR: Expected function to revert, but function returned successfully");
-                console.log("Offending Step: %s", _step.functionName);
-                console.log("Return Data:");
-                console.logBytes(returndata);
-                console.log("");
-            } else {
-                (
-                    uint256 _flag,
-                    uint256 _nuisanceGasLeft,
-                    uint256 _ovmGasRefund,
-                    bytes memory _data
-                ) = _decodeRevertData(returndata);
- 
-                console.log("ERROR: Expected function to return successfully, but function reverted");
-                console.log("Offending Step: %s", _step.functionName);
-                console.log("Flag: %s", _flag);
-                console.log("Nuisance Gas Left: %s", _nuisanceGasLeft);
-                console.log("OVM Gas Refund: %s", _ovmGasRefund);
-                console.log("Extra Data:");
-                console.logBytes(_data);
-                console.log("");
-            }
- 
-            _failStep();
-        }
- 
-        if (keccak256(returndata) != keccak256(_step.expectedReturnData)) {
-            Iif (success == true) {
-                console.log("ERROR: Actual return data does not match expected return data");
-                console.log("Offending Step: %s", _step.functionName);
-                console.log("Expected:");
-                console.logBytes(_step.expectedReturnData);
-                console.log("Actual:");
-                console.logBytes(returndata);
-                console.log("");
- 
-                _failStep();
-            } else {
-                (
-                    uint256 _expectedFlag,
-                    uint256 _expectedNuisanceGasLeft,
-                    uint256 _expectedOvmGasRefund,
-                    bytes memory _expectedData
-                ) = _decodeRevertData(_step.expectedReturnData);
- 
-                (
-                    uint256 _flag,
-                    uint256 _nuisanceGasLeft,
-                    uint256 _ovmGasRefund,
-                    bytes memory _data
-                ) = _decodeRevertData(returndata);
- 
-                Eif (
-                    _step.onlyValidateFlag
-                ) {
-                    Iif (
-                        _expectedFlag != _flag
-                    ) {
-                        console.log("ERROR: Actual revert flag does not match expected revert flag data");
-                        console.log("Offending Step: %s", _step.functionName);
-                        console.log("Expected Flag: %s", _expectedFlag);
-                        console.log("Actual Flag: %s", _flag);
-                        _failStep();
-                    }
-                } else {
-                    console.log("ERROR: Actual revert flag data does not match expected revert flag data");
-                    console.log("Offending Step: %s", _step.functionName);
-                    console.log("Expected Flag: %s", _expectedFlag);
-                    console.log("Actual Flag: %s", _flag);
-                    console.log("Expected Nuisance Gas Left: %s", _expectedNuisanceGasLeft);
-                    console.log("Actual Nuisance Gas Left: %s", _nuisanceGasLeft);
-                    console.log("Expected OVM Gas Refund: %s", _expectedOvmGasRefund);
-                    console.log("Actual OVM Gas Refund: %s", _ovmGasRefund);
-                    console.log("Expected Extra Data:");
-                    console.logBytes(_expectedData);
-                    console.log("Actual Extra Data:");
-                    console.logBytes(_data);
-                    console.log("");
-                    _failStep();
-                }
-            }
-        }
- 
-        if (success == false) {
-            assembly {
-                revert(add(returndata, 0x20), mload(returndata))
-            }
-        }
-    }
- 
-    function runMultipleTestSteps(
-        TestStep[] memory _steps
-    )
-        public
-    {
-        for (uint256 i = 0; i < _steps.length; i++) {
-            runSingleTestStep(_steps[i]);
-        }
-    }
- 
-    function _decodeRevertData(
-        bytes memory _revertdata
-    )
-        internal
-        pure
-        returns (
-            uint256 _flag,
-            uint256 _nuisanceGasLeft,
-            uint256 _ovmGasRefund,
-            bytes memory _data
-        )
-    {
-        Iif (_revertdata.length == 0) {
-            return (
-                0,
-                0,
-                0,
-                bytes('')
-            );
-        }
- 
-        return abi.decode(_revertdata, (uint256, uint256, uint256, bytes));
-    }
- 
-    function _failStep()
-        internal
-        pure
-    {
-        revert("Test step failed.");
-    }
-}
- 
-contract Helper_TestRunner_CREATE is Helper_TestRunner {
-    constructor(
-        bytes memory _bytecode,
-        TestStep[] memory _steps
-    )
-    {
-        if (_steps.length > 0) {
-            runMultipleTestSteps(_steps);
-        } else {
-            assembly {
-                return(add(_bytecode, 0x20), mload(_bytecode))
-            }
-        }
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-helpers/Mock_FraudVerifier.sol.html b/coverage/test-helpers/Mock_FraudVerifier.sol.html deleted file mode 100644 index 414282eb3..000000000 --- a/coverage/test-helpers/Mock_FraudVerifier.sol.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for test-helpers/Mock_FraudVerifier.sol - - - - - - - -
-
-

- all files / test-helpers/ Mock_FraudVerifier.sol -

-
-
- 100% - Statements - 4/4 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -21× -  -  -  -21× -  -  -  -  -  -  -  -  -  -  -  -  -46× -  -  -  -12× -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-import { OVM_BondManager } from "./../optimistic-ethereum/OVM/verification/OVM_BondManager.sol";
- 
-contract Mock_FraudVerifier {
-    OVM_BondManager bondManager;
- 
-    mapping (bytes32 => address) transitioners;
- 
-    function setBondManager(OVM_BondManager _bondManager) public {
-        bondManager = _bondManager;
-    }
- 
-    function setStateTransitioner(bytes32 preStateRoot, bytes32 txHash, address addr) public {
-        transitioners[keccak256(abi.encodePacked(preStateRoot, txHash))] = addr;
-    }
- 
-    function getStateTransitioner(
-        bytes32 _preStateRoot,
-        bytes32 _txHash
-    )
-        public
-        view
-        returns (
-            address
-        )
-    {
-        return transitioners[keccak256(abi.encodePacked(_preStateRoot, _txHash))];
-    }
- 
-    function finalize(bytes32 _preStateRoot, address publisher, uint256 timestamp) public {
-        bondManager.finalize(_preStateRoot, publisher, timestamp);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-helpers/TestERC20.sol.html b/coverage/test-helpers/TestERC20.sol.html deleted file mode 100644 index 8aac61ec3..000000000 --- a/coverage/test-helpers/TestERC20.sol.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - Code coverage report for test-helpers/TestERC20.sol - - - - - - - -
-
-

- all files / test-helpers/ TestERC20.sol -

-
-
- 89.47% - Statements - 17/19 -
-
- 37.5% - Branches - 3/8 -
-
- 90% - Functions - 9/10 -
-
- 89.47% - Lines - 17/19 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -21× -21× -21× -  -  -  -18× -18× -  -  -  -25× -25× -25× -  -  -  -18× -18× -  -  -  - - -  -  -  -18× -  -  -18× -18× -  -  -  -  -  -67× -  -  -  -25× -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-// a test ERC20 token with an open mint function
-contract TestERC20 {
-    using SafeMath for uint;
- 
-    string public constant name = 'Test';
-    string public constant symbol = 'TST';
-    uint8 public constant decimals = 18;
-    uint256  public totalSupply;
-    mapping(address => uint) public balanceOf;
-    mapping(address => mapping(address => uint)) public allowance;
- 
-    event Approval(address indexed owner, address indexed spender, uint256 value);
-    event Transfer(address indexed from, address indexed to, uint256 value);
- 
-    constructor() {}
- 
-    function mint(address to, uint256 value) public {
-        totalSupply = totalSupply.add(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(address(0), to, value);
-    }
- 
-    function _approve(address owner, address spender, uint256 value) private {
-        allowance[owner][spender] = value;
-        emit Approval(owner, spender, value);
-    }
- 
-    function _transfer(address from, address to, uint256 value) private {
-        balanceOf[from] = balanceOf[from].sub(value);
-        balanceOf[to] = balanceOf[to].add(value);
-        emit Transfer(from, to, value);
-    }
- 
-    function approve(address spender, uint256 value) external returns (bool) {
-        _approve(msg.sender, spender, value);
-        return true;
-    }
- 
-    function transfer(address to, uint256 value) external returns (bool) {
-        _transfer(msg.sender, to, value);
-        return true;
-    }
- 
-    function transferFrom(address from, address to, uint256 value) external returns (bool) {
-        Iif (allowance[from][msg.sender] != uint(-1)) {
-            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
-        }
-        _transfer(from, to, value);
-        return true;
-    }
-}
- 
-library SafeMath {
-    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
-        Erequire((z = x + y) >= x, 'ds-math-add-overflow');
-    }
- 
-    function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
-        Erequire((z = x - y) <= x, 'ds-math-sub-underflow');
-    }
- 
-    function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
-        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-helpers/index.html b/coverage/test-helpers/index.html deleted file mode 100644 index d957a052c..000000000 --- a/coverage/test-helpers/index.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - Code coverage report for test-helpers/ - - - - - - - -
-
-

- all files test-helpers/ -

-
-
- 52.5% - Statements - 63/120 -
-
- 56.52% - Branches - 26/46 -
-
- 80.65% - Functions - 25/31 -
-
- 53.38% - Lines - 71/133 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
Helper_GasMeasurer.sol
100%7/750%1/2100%1/1100%9/9
Helper_ModifiableStorage.sol
0%0/50%0/20%0/40%0/9
Helper_PrecompileCaller.sol
75%9/1250%3/6100%3/375%9/12
Helper_SimpleProxy.sol
85.71%6/775%3/4100%4/488.89%8/9
Helper_TestRunner.sol
30.3%20/6666.67%16/2480%4/533.8%24/71
Mock_FraudVerifier.sol
100%4/4100%0/0100%4/4100%4/4
TestERC20.sol
89.47%17/1937.5%3/890%9/1089.47%17/19
-
-
- - - - - - - diff --git a/coverage/test-libraries/codec/TestLib_OVMCodec.sol.html b/coverage/test-libraries/codec/TestLib_OVMCodec.sol.html deleted file mode 100644 index 3c1930eb7..000000000 --- a/coverage/test-libraries/codec/TestLib_OVMCodec.sol.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - Code coverage report for test-libraries/codec/TestLib_OVMCodec.sol - - - - - - - -
-
-

- all files / test-libraries/codec/ TestLib_OVMCodec.sol -

-
-
- 0% - Statements - 0/4 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/4 -
-
- 0% - Lines - 0/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_OVMCodec } from "../../optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol";
- 
-/**
- * @title TestLib_OVMCodec
- */
-contract TestLib_OVMCodec {
- 
-    function decodeEIP155Transaction(
-        bytes memory _transaction,
-        bool _isEthSignedMessage
-    )
-        public
-        pure
-        returns (
-            Lib_OVMCodec.EIP155Transaction memory _decoded
-        )
-    {
-        return Lib_OVMCodec.decodeEIP155Transaction(_transaction, _isEthSignedMessage);
-    }
- 
-    function encodeTransaction(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        public
-        pure
-        returns (
-            bytes memory _encoded
-        )
-    {
-        return Lib_OVMCodec.encodeTransaction(_transaction);
-    }
- 
-    function hashTransaction(
-        Lib_OVMCodec.Transaction memory _transaction
-    )
-        public
-        pure
-        returns (
-            bytes32 _hash
-        )
-    {
-        return Lib_OVMCodec.hashTransaction(_transaction);
-    }
- 
-    function decompressEIP155Transaction(
-        bytes memory _transaction
-    )
-        public
-        returns (
-            Lib_OVMCodec.EIP155Transaction memory _decompressed
-        )
-    {
-        return Lib_OVMCodec.decompressEIP155Transaction(_transaction);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/codec/index.html b/coverage/test-libraries/codec/index.html deleted file mode 100644 index 513c5a78e..000000000 --- a/coverage/test-libraries/codec/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for test-libraries/codec/ - - - - - - - -
-
-

- all files test-libraries/codec/ -

-
-
- 0% - Statements - 0/4 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/4 -
-
- 0% - Lines - 0/4 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
TestLib_OVMCodec.sol
0%0/4100%0/00%0/40%0/4
-
-
- - - - - - - diff --git a/coverage/test-libraries/rlp/TestLib_RLPReader.sol.html b/coverage/test-libraries/rlp/TestLib_RLPReader.sol.html deleted file mode 100644 index 946105c3c..000000000 --- a/coverage/test-libraries/rlp/TestLib_RLPReader.sol.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - Code coverage report for test-libraries/rlp/TestLib_RLPReader.sol - - - - - - - -
-
-

- all files / test-libraries/rlp/ TestLib_RLPReader.sol -

-
-
- 90.91% - Statements - 10/11 -
-
- 100% - Branches - 0/0 -
-
- 85.71% - Functions - 6/7 -
-
- 90.91% - Lines - 10/11 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - - -62× -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPReader } from "../../optimistic-ethereum/libraries/rlp/Lib_RLPReader.sol";
- 
-/**
- * @title TestLib_RLPReader
- */
-contract TestLib_RLPReader {
- 
-    function readList(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bytes[] memory
-        )
-    {
-        Lib_RLPReader.RLPItem[] memory decoded = Lib_RLPReader.readList(_in);
-        bytes[] memory out = new bytes[](decoded.length);
-        for (uint256 i = 0; i < out.length; i++) {
-            out[i] = Lib_RLPReader.readRawBytes(decoded[i]);
-        }
-        return out;
-    }
- 
-    function readString(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            string memory
-        )
-    {
-        return Lib_RLPReader.readString(_in);
-    }
- 
-    function readBytes(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bytes memory
-        )
-    {
-        return Lib_RLPReader.readBytes(_in);
-    }
- 
-    function readBytes32(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_RLPReader.readBytes32(_in);
-    }
- 
-    function readUint256(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            uint256
-        )
-    {
-        return Lib_RLPReader.readUint256(_in);
-    }
- 
-    function readBool(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_RLPReader.readBool(_in);
-    }
- 
-    function readAddress(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            address
-        )
-    {
-        return Lib_RLPReader.readAddress(_in);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/rlp/TestLib_RLPWriter.sol.html b/coverage/test-libraries/rlp/TestLib_RLPWriter.sol.html deleted file mode 100644 index 1a3ca073f..000000000 --- a/coverage/test-libraries/rlp/TestLib_RLPWriter.sol.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - Code coverage report for test-libraries/rlp/TestLib_RLPWriter.sol - - - - - - - -
-
-

- all files / test-libraries/rlp/ TestLib_RLPWriter.sol -

-
-
- 62.5% - Statements - 5/8 -
-
- 100% - Branches - 0/0 -
-
- 57.14% - Functions - 4/7 -
-
- 62.5% - Lines - 5/8 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -61× -  -  -  -  -  -  -  -  -  -  -  -139× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RLPWriter } from "../../optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol";
-import { TestERC20 } from "../../test-helpers/TestERC20.sol";
- 
-/**
- * @title TestLib_RLPWriter
- */
-contract TestLib_RLPWriter {
- 
-    function writeBytes(
-        bytes memory _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeBytes(_in);
-    }
- 
-    function writeList(
-        bytes[] memory _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeList(_in);
-    }
- 
-    function writeString(
-        string memory _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeString(_in);
-    }
- 
-    function writeAddress(
-        address _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeAddress(_in);
-    }
- 
-    function writeUint(
-        uint256 _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeUint(_in);
-    }
- 
-    function writeBool(
-        bool _in
-    )
-        public
-        pure
-        returns (
-            bytes memory _out
-        )
-    {
-        return Lib_RLPWriter.writeBool(_in);
-    }
- 
-    function writeAddressWithTaintedMemory(
-        address _in
-    )
-        public
-        returns (
-            bytes memory _out
-        )
-    {
-        new TestERC20();
-        return Lib_RLPWriter.writeAddress(_in);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/rlp/index.html b/coverage/test-libraries/rlp/index.html deleted file mode 100644 index 23f40f43d..000000000 --- a/coverage/test-libraries/rlp/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for test-libraries/rlp/ - - - - - - - -
-
-

- all files test-libraries/rlp/ -

-
-
- 78.95% - Statements - 15/19 -
-
- 100% - Branches - 0/0 -
-
- 71.43% - Functions - 10/14 -
-
- 78.95% - Lines - 15/19 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
TestLib_RLPReader.sol
90.91%10/11100%0/085.71%6/790.91%10/11
TestLib_RLPWriter.sol
62.5%5/8100%0/057.14%4/762.5%5/8
-
-
- - - - - - - diff --git a/coverage/test-libraries/trie/TestLib_MerkleTrie.sol.html b/coverage/test-libraries/trie/TestLib_MerkleTrie.sol.html deleted file mode 100644 index 5ba93e048..000000000 --- a/coverage/test-libraries/trie/TestLib_MerkleTrie.sol.html +++ /dev/null @@ -1,377 +0,0 @@ - - - - Code coverage report for test-libraries/trie/TestLib_MerkleTrie.sol - - - - - - - -
-
-

- all files / test-libraries/trie/ TestLib_MerkleTrie.sol -

-
-
- 60% - Statements - 3/5 -
-
- 100% - Branches - 0/0 -
-
- 60% - Functions - 3/5 -
-
- 60% - Lines - 3/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -32× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_MerkleTrie } from "../../optimistic-ethereum/libraries/trie/Lib_MerkleTrie.sol";
- 
-/**
- * @title TestLib_MerkleTrie
- */
-contract TestLib_MerkleTrie {
- 
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_MerkleTrie.verifyInclusionProof(
-            _key,
-            _value,
-            _proof,
-            _root
-        );
-    }
- 
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_MerkleTrie.verifyExclusionProof(
-            _key,
-            _proof,
-            _root
-        );
-    }
- 
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_MerkleTrie.update(
-            _key,
-            _value,
-            _proof,
-            _root
-        );
-    }
- 
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        return Lib_MerkleTrie.get(
-            _key,
-            _proof,
-            _root
-        );
-    }
- 
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_MerkleTrie.getSingleNodeRootHash(
-            _key,
-            _value
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html b/coverage/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html deleted file mode 100644 index 1735f3dbc..000000000 --- a/coverage/test-libraries/trie/TestLib_SecureMerkleTrie.sol.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - Code coverage report for test-libraries/trie/TestLib_SecureMerkleTrie.sol - - - - - - - -
-
-

- all files / test-libraries/trie/ TestLib_SecureMerkleTrie.sol -

-
-
- 60% - Statements - 3/5 -
-
- 100% - Branches - 0/0 -
-
- 60% - Functions - 3/5 -
-
- 60% - Lines - 3/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_SecureMerkleTrie } from "../../optimistic-ethereum/libraries/trie/Lib_SecureMerkleTrie.sol";
- 
-/**
- * @title TestLib_SecureMerkleTrie
- */
-contract TestLib_SecureMerkleTrie {
- 
-    function verifyInclusionProof(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_SecureMerkleTrie.verifyInclusionProof(
-            _key,
-            _value,
-            _proof,
-            _root
-        );
-    }
- 
-    function verifyExclusionProof(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_SecureMerkleTrie.verifyExclusionProof(
-            _key,
-            _proof,
-            _root
-        );
-    }
- 
-    function update(
-        bytes memory _key,
-        bytes memory _value,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_SecureMerkleTrie.update(
-            _key,
-            _value,
-            _proof,
-            _root
-        );
-    }
- 
-    function get(
-        bytes memory _key,
-        bytes memory _proof,
-        bytes32 _root
-    )
-        public
-        pure
-        returns (
-            bool,
-            bytes memory
-        )
-    {
-        return Lib_SecureMerkleTrie.get(
-            _key,
-            _proof,
-            _root
-        );
-    }
- 
-    function getSingleNodeRootHash(
-        bytes memory _key,
-        bytes memory _value
-    )
-        public
-        pure
-        returns (
-            bytes32
-        )
-    {
-        return Lib_SecureMerkleTrie.getSingleNodeRootHash(
-            _key,
-            _value
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/trie/index.html b/coverage/test-libraries/trie/index.html deleted file mode 100644 index 156eb46c8..000000000 --- a/coverage/test-libraries/trie/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for test-libraries/trie/ - - - - - - - -
-
-

- all files test-libraries/trie/ -

-
-
- 60% - Statements - 6/10 -
-
- 100% - Branches - 0/0 -
-
- 60% - Functions - 6/10 -
-
- 60% - Lines - 6/10 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
TestLib_MerkleTrie.sol
60%3/5100%0/060%3/560%3/5
TestLib_SecureMerkleTrie.sol
60%3/5100%0/060%3/560%3/5
-
-
- - - - - - - diff --git a/coverage/test-libraries/utils/TestLib_Bytes32Utils.sol.html b/coverage/test-libraries/utils/TestLib_Bytes32Utils.sol.html deleted file mode 100644 index d74a5946d..000000000 --- a/coverage/test-libraries/utils/TestLib_Bytes32Utils.sol.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_Bytes32Utils.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_Bytes32Utils.sol -

-
-
- 100% - Statements - 4/4 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 4/4 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_Bytes32Utils } from "../../optimistic-ethereum/libraries/utils/Lib_Bytes32Utils.sol";
- 
-/**
- * @title TestLib_Byte32Utils
- */
-contract TestLib_Bytes32Utils {
- 
-    function toBool(
-        bytes32 _in
-    )
-        public
-        pure
-        returns (
-            bool _out
-        )
-    {
-        return Lib_Bytes32Utils.toBool(_in);
-    }
- 
-    function fromBool(
-        bool _in
-    )
-        public
-        pure
-        returns (
-            bytes32 _out
-        )
-    {
-        return Lib_Bytes32Utils.fromBool(_in);
-    }
- 
-    function toAddress(
-        bytes32 _in
-    )
-        public
-        pure
-        returns (
-            address _out
-        )
-    {
-        return Lib_Bytes32Utils.toAddress(_in);
-    }
- 
-    function fromAddress(
-        address _in
-    )
-        public
-        pure
-        returns (
-            bytes32 _out
-        )
-    {
-        return Lib_Bytes32Utils.fromAddress(_in);
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/utils/TestLib_BytesUtils.sol.html b/coverage/test-libraries/utils/TestLib_BytesUtils.sol.html deleted file mode 100644 index 1da9a7b70..000000000 --- a/coverage/test-libraries/utils/TestLib_BytesUtils.sol.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_BytesUtils.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_BytesUtils.sol -

-
-
- 88.89% - Statements - 8/9 -
-
- 100% - Branches - 0/0 -
-
- 87.5% - Functions - 7/8 -
-
- 88.89% - Lines - 8/9 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  - -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_BytesUtils } from "../../optimistic-ethereum/libraries/utils/Lib_BytesUtils.sol";
-import { TestERC20 } from "../../test-helpers/TestERC20.sol";
- 
-/**
- * @title TestLib_BytesUtils
- */
-contract TestLib_BytesUtils {
- 
-    function concat(
-        bytes memory _preBytes,
-        bytes memory _postBytes
-    )
-        public
-        pure
-        returns (bytes memory)
-    {
-        return abi.encodePacked(
-            _preBytes,
-            _postBytes
-        );
-    }
- 
-    function slice(
-        bytes memory _bytes,
-        uint256 _start,
-        uint256 _length
-    )
-        public
-        pure
-        returns (bytes memory)
-    {
-        return Lib_BytesUtils.slice(
-            _bytes,
-            _start,
-            _length
-        );
-    }
- 
-    function toBytes32(
-        bytes memory _bytes
-    )
-        public
-        pure
-        returns (bytes32)
-    {
-        return Lib_BytesUtils.toBytes32(
-            _bytes
-        );
-    }
- 
-    function toUint256(
-        bytes memory _bytes
-    )
-        public
-        pure
-        returns (uint256)
-    {
-        return Lib_BytesUtils.toUint256(
-            _bytes
-        );
-    }
- 
-    function toNibbles(
-        bytes memory _bytes
-    )
-        public
-        pure
-        returns (bytes memory)
-    {
-        return Lib_BytesUtils.toNibbles(
-            _bytes
-        );
-    }
- 
-    function fromNibbles(
-        bytes memory _bytes
-    )
-        public
-        pure
-        returns (bytes memory)
-    {
-        return Lib_BytesUtils.fromNibbles(
-            _bytes
-        );
-    }
- 
-    function equal(
-        bytes memory _bytes,
-        bytes memory _other
-    )
-        public
-        pure
-        returns (bool)
-    {
-        return Lib_BytesUtils.equal(
-            _bytes,
-            _other
-        );
-    }
- 
-    function sliceWithTaintedMemory(
-        bytes memory _bytes,
-        uint256 _start,
-        uint256 _length
-    )
-        public
-        returns (bytes memory)
-    {
-        new TestERC20();
-        return Lib_BytesUtils.slice(
-            _bytes,
-            _start,
-            _length
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/utils/TestLib_ECDSAUtils.sol.html b/coverage/test-libraries/utils/TestLib_ECDSAUtils.sol.html deleted file mode 100644 index 9327fbbb2..000000000 --- a/coverage/test-libraries/utils/TestLib_ECDSAUtils.sol.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_ECDSAUtils.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_ECDSAUtils.sol -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 1/1 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10× -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
- 
-/* Library Imports */
-import { Lib_ECDSAUtils } from "../../optimistic-ethereum/libraries/utils/Lib_ECDSAUtils.sol";
- 
-/**
- * @title TestLib_ECDSAUtils
- */
-contract TestLib_ECDSAUtils {
- 
-    function recover(
-        bytes memory _message,
-        bool _isEthSignedMessage,
-        uint8 _v,
-        bytes32 _r,
-        bytes32 _s
-    )
-        public
-        pure
-        returns (
-            address _sender
-        )
-    {
-        return Lib_ECDSAUtils.recover(
-            _message,
-            _isEthSignedMessage,
-            _v,
-            _r,
-            _s
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/utils/TestLib_EthUtils.sol.html b/coverage/test-libraries/utils/TestLib_EthUtils.sol.html deleted file mode 100644 index 2bf8a5405..000000000 --- a/coverage/test-libraries/utils/TestLib_EthUtils.sol.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_EthUtils.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_EthUtils.sol -

-
-
- 14.29% - Statements - 1/7 -
-
- 100% - Branches - 0/0 -
-
- 14.29% - Functions - 1/7 -
-
- 14.29% - Lines - 1/7 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -14× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-// @unsupported: ovm
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_EthUtils } from "../../optimistic-ethereum/libraries/utils/Lib_EthUtils.sol";
- 
-/**
- * @title TestLib_EthUtils
- */
-contract TestLib_EthUtils {
- 
-    function getCode(
-        address _address,
-        uint256 _offset,
-        uint256 _length
-    )
-        public
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        return Lib_EthUtils.getCode(
-            _address,
-            _offset,
-            _length
-        );
-    }
- 
-    function getCode(
-        address _address
-    )
-        public
-        view
-        returns (
-            bytes memory _code
-        )
-    {
-        return Lib_EthUtils.getCode(
-            _address
-        );
-    }
- 
-    function getCodeSize(
-        address _address
-    )
-        public
-        view
-        returns (
-            uint256 _codeSize
-        )
-    {
-        return Lib_EthUtils.getCodeSize(
-            _address
-        );
-    }
- 
-    function getCodeHash(
-        address _address
-    )
-        public
-        view
-        returns (
-            bytes32 _codeHash
-        )
-    {
-        return Lib_EthUtils.getCodeHash(
-            _address
-        );
-    }
- 
-    function createContract(
-        bytes memory _code
-    )
-        public
-        returns (
-            address _created
-        )
-    {
-        return Lib_EthUtils.createContract(
-            _code
-        );
-    }
- 
-    function getAddressForCREATE(
-        address _creator,
-        uint256 _nonce
-    )
-        public
-        pure
-        returns (
-            address _address
-        )
-    {
-        return Lib_EthUtils.getAddressForCREATE(
-            _creator,
-            _nonce
-        );
-    }
- 
-    function getAddressForCREATE2(
-        address _creator,
-        bytes memory _bytecode,
-        bytes32 _salt
-    )
-        public
-        pure
-        returns (address _address)
-    {
-        return Lib_EthUtils.getAddressForCREATE2(
-            _creator,
-            _bytecode,
-            _salt
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/utils/TestLib_MerkleTree.sol.html b/coverage/test-libraries/utils/TestLib_MerkleTree.sol.html deleted file mode 100644 index 0e685493b..000000000 --- a/coverage/test-libraries/utils/TestLib_MerkleTree.sol.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_MerkleTree.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_MerkleTree.sol -

-
-
- 100% - Statements - 2/2 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 2/2 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -16× -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -100× -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_MerkleTree } from "../../optimistic-ethereum/libraries/utils/Lib_MerkleTree.sol";
- 
-/**
- * @title TestLib_MerkleTree
- */
-contract TestLib_MerkleTree {
- 
-    function getMerkleRoot(
-        bytes32[] memory _elements
-    )
-        public
-       pure 
-        returns (
-            bytes32
-        )
-    {
-        return Lib_MerkleTree.getMerkleRoot(
-            _elements
-        );
-    }
- 
-    function verify(
-        bytes32 _root,
-        bytes32 _leaf,
-        uint256 _index,
-        bytes32[] memory _siblings,
-        uint256 _totalLeaves
-    )
-        public
-        pure
-        returns (
-            bool
-        )
-    {
-        return Lib_MerkleTree.verify(
-            _root,
-            _leaf,
-            _index,
-            _siblings,
-            _totalLeaves
-        );
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/utils/TestLib_RingBuffer.sol.html b/coverage/test-libraries/utils/TestLib_RingBuffer.sol.html deleted file mode 100644 index a958378e1..000000000 --- a/coverage/test-libraries/utils/TestLib_RingBuffer.sol.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - Code coverage report for test-libraries/utils/TestLib_RingBuffer.sol - - - - - - - -
-
-

- all files / test-libraries/utils/ TestLib_RingBuffer.sol -

-
-
- 0% - Statements - 0/5 -
-
- 100% - Branches - 0/0 -
-
- 0% - Functions - 0/5 -
-
- 0% - Lines - 0/5 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
// SPDX-License-Identifier: MIT
-pragma solidity >0.5.0 <0.8.0;
-pragma experimental ABIEncoderV2;
- 
-/* Library Imports */
-import { Lib_RingBuffer } from "../../optimistic-ethereum/libraries/utils/Lib_RingBuffer.sol";
- 
-/**
- * @title TestLib_RingBuffer
- */
-contract TestLib_RingBuffer {
-    using Lib_RingBuffer for Lib_RingBuffer.RingBuffer;
-    
-    Lib_RingBuffer.RingBuffer internal buf;
- 
-    function push(
-        bytes32 _value,
-        bytes27 _extraData
-    )
-        public
-    {
-        buf.push(
-            _value,
-            _extraData
-        );
-    }
- 
-    function get(
-        uint256 _index
-    )
-        public
-        view
-        returns (
-            bytes32    
-        )
-    {
-        return buf.get(_index);
-    }
- 
-    function deleteElementsAfterInclusive(
-        uint40 _index,
-        bytes27 _extraData
-    )
-        internal
-    {
-        return buf.deleteElementsAfterInclusive(
-            _index,
-            _extraData
-        );
-    }
- 
-    function getLength()
-        internal
-        view
-        returns (
-            uint40
-        )
-    {
-        return buf.getLength();
-    }
- 
-    function getExtraData()
-        internal
-        view
-        returns (
-            bytes27
-        )
-    {
-        return buf.getExtraData();
-    }
-}
- 
-
-
- - - - - - - diff --git a/coverage/test-libraries/utils/index.html b/coverage/test-libraries/utils/index.html deleted file mode 100644 index 9a77798b4..000000000 --- a/coverage/test-libraries/utils/index.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - Code coverage report for test-libraries/utils/ - - - - - - - -
-
-

- all files test-libraries/utils/ -

-
-
- 57.14% - Statements - 16/28 -
-
- 100% - Branches - 0/0 -
-
- 55.56% - Functions - 15/27 -
-
- 57.14% - Lines - 16/28 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
TestLib_Bytes32Utils.sol
100%4/4100%0/0100%4/4100%4/4
TestLib_BytesUtils.sol
88.89%8/9100%0/087.5%7/888.89%8/9
TestLib_ECDSAUtils.sol
100%1/1100%0/0100%1/1100%1/1
TestLib_EthUtils.sol
14.29%1/7100%0/014.29%1/714.29%1/7
TestLib_MerkleTree.sol
100%2/2100%0/0100%2/2100%2/2
TestLib_RingBuffer.sol
0%0/5100%0/00%0/50%0/5
-
-
- - - - - - - From 4a8689e9597ecb6434036ad4b0cc7570cc323ad2 Mon Sep 17 00:00:00 2001 From: maurelian Date: Thu, 25 Mar 2021 16:35:59 -0400 Subject: [PATCH 05/10] Add test coverage artifacts to gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 0c41e546d..f6de287d5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ cache/ yarn-error.log build/ .DS_STORE + +# Coverage output +coverage/ +coverage.json From 6be570db85600f83b457db6493f6c7ff1e90e68e Mon Sep 17 00:00:00 2001 From: Maurelian Date: Thu, 25 Mar 2021 16:39:51 -0400 Subject: [PATCH 06/10] Add test coverage instructions to README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 60789d347..eef98f9ab 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,16 @@ Run specific tests by giving a path to the file you want to run: yarn test ./test/path/to/my/test.spec.ts ``` +### Measuring test coverage: +```shell +yarn test-coverage +``` + +The output is most easily viewable by opening the html file in your browser: +```shell +open ./coverage/index.html +``` + ### Compiling and Building Easiest way is to run the primary build script: ```shell From 076bbada73921ec73618b7145ddddfc2cf70f179 Mon Sep 17 00:00:00 2001 From: Maurelian Date: Wed, 31 Mar 2021 19:47:51 -0400 Subject: [PATCH 07/10] Lint --- hardhat.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 53eaacebc..1d1680021 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,5 +1,5 @@ import { HardhatUserConfig } from 'hardhat/types' -import "solidity-coverage" +import 'solidity-coverage' import { DEFAULT_ACCOUNTS_HARDHAT, From a7167e3d0fdebe3effa4b05e04a2cfd28b75928e Mon Sep 17 00:00:00 2001 From: Maurelian Date: Thu, 1 Apr 2021 19:44:47 -0400 Subject: [PATCH 08/10] Add coveralls to gh actions --- .github/workflows/build-test-lint-contracts.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build-test-lint-contracts.yml b/.github/workflows/build-test-lint-contracts.yml index 14e757d77..3b4b64d5a 100644 --- a/.github/workflows/build-test-lint-contracts.yml +++ b/.github/workflows/build-test-lint-contracts.yml @@ -48,3 +48,12 @@ jobs: - name: Test run: yarn test + + + - name: Test Coverage + run: yarn test-coverage + + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} From 9bd0976f44d04d903d5a95ec887684c7767abdef Mon Sep 17 00:00:00 2001 From: Maurelian Date: Thu, 1 Apr 2021 20:03:31 -0400 Subject: [PATCH 09/10] Allow jobs to pass when a test fails due to coverage --- .github/workflows/build-test-lint-contracts.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-lint-contracts.yml b/.github/workflows/build-test-lint-contracts.yml index 3b4b64d5a..598806411 100644 --- a/.github/workflows/build-test-lint-contracts.yml +++ b/.github/workflows/build-test-lint-contracts.yml @@ -52,8 +52,9 @@ jobs: - name: Test Coverage run: yarn test-coverage + continue-on-error: true - - name: Coveralls + - name: Publish to Coveralls uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} From 642e32e3ba9ae466fcbbe6919937c4e41a904862 Mon Sep 17 00:00:00 2001 From: Maurelian Date: Thu, 1 Apr 2021 20:19:27 -0400 Subject: [PATCH 10/10] Parallelize --- .github/workflows/build-test-lint-contracts.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-lint-contracts.yml b/.github/workflows/build-test-lint-contracts.yml index 598806411..e0da0f6cf 100644 --- a/.github/workflows/build-test-lint-contracts.yml +++ b/.github/workflows/build-test-lint-contracts.yml @@ -54,7 +54,19 @@ jobs: run: yarn test-coverage continue-on-error: true - - name: Publish to Coveralls + - name: Coveralls Parallel uses: coverallsapp/github-action@master with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.github_token }} + flag-name: run-${{ matrix.test_number }} + parallel: true + + finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true