We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ac38650 + 3228361 commit bb2f3fcCopy full SHA for bb2f3fc
piecrust/CHANGELOG.md
@@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
16
- Upgrade `dusk-wasmtime` to version `17`
17
18
+### Fixed
19
+
20
+- Fix overflow in gas limit calculation in inter-contract call
21
22
## [0.15.0] - 2024-01-24
23
24
### Changed
piecrust/src/imports.rs
@@ -209,7 +209,9 @@ pub(crate) fn c(
209
let callee_limit = if gas_limit > 0 && gas_limit < caller_remaining {
210
gas_limit
211
} else {
212
- caller_remaining * GAS_PASS_PCT / 100
+ let div = caller_remaining / 100 * GAS_PASS_PCT;
213
+ let rem = caller_remaining % 100 * GAS_PASS_PCT / 100;
214
+ div + rem
215
};
216
217
let with_memory = |memory: &mut [u8]| -> Result<_, Error> {
0 commit comments