File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
16
16
- Upgrade ` dusk-wasmtime ` to version ` 17 `
17
17
18
+ ### Fixed
19
+
20
+ - Fix overflow in gas limit calculation in inter-contract call
21
+
18
22
## [ 0.15.0] - 2024-01-24
19
23
20
24
### Changed
Original file line number Diff line number Diff line change @@ -209,7 +209,9 @@ pub(crate) fn c(
209
209
let callee_limit = if gas_limit > 0 && gas_limit < caller_remaining {
210
210
gas_limit
211
211
} else {
212
- caller_remaining * GAS_PASS_PCT / 100
212
+ let div = caller_remaining / 100 * GAS_PASS_PCT ;
213
+ let rem = caller_remaining % 100 * GAS_PASS_PCT / 100 ;
214
+ div + rem
213
215
} ;
214
216
215
217
let with_memory = |memory : & mut [ u8 ] | -> Result < _ , Error > {
You can’t perform that action at this time.
0 commit comments