Skip to content

Commit

Permalink
fix(system-contracts): correct loading of exp to memory in modexp
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaMasych committed Oct 9, 2024
1 parent e12a3b5 commit 40d4473
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions system-contracts/SystemContractsHashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
"contractName": "Modexp",
"bytecodePath": "contracts-preprocessed/precompiles/artifacts/Modexp.yul.zbin",
"sourceCodePath": "contracts-preprocessed/precompiles/Modexp.yul",
"bytecodeHash": "0x010000256ad1144a358b198908db757d778826c181e6e55629319ad2d342fc53",
"sourceCodeHash": "0xfb4399a7f9c73fb29a3e6319af8edfe330e28fd72e1a35224fcd42d520c26193"
"bytecodeHash": "0x01000025e23981181c4edbf5e386f44acc1fd5e63a76148f94f9faab33ebfcf2",
"sourceCodeHash": "0x8b76dadc324881a1d1427d7bad1314537e4a278eefd41108742b14a3ea957b82"
},
{
"contractName": "EcAdd",
Expand Down
2 changes: 1 addition & 1 deletion system-contracts/contracts/precompiles/Modexp.yul
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object "Modexp" {
// Copy input base, exp and mod from calldata to memory
calldatacopy(0, 96, baseLen)
calldatacopy(MAX_BASE_BYTES_SUPPORTED(), add(96, baseLen), expLen)
calldatacopy(MAX_EXP_BYTES_SUPPORTED(), add(add(96, baseLen), expLen), modLen)
calldatacopy(add(MAX_BASE_BYTES_SUPPORTED(), MAX_EXP_BYTES_SUPPORTED()), add(add(96, baseLen), expLen), modLen)

let precompileParams := unsafePackPrecompileParams(
0, // input offset in words
Expand Down

0 comments on commit 40d4473

Please sign in to comment.