Skip to content

Commit ecb86d4

Browse files
committed
Add warnign
1 parent 4591105 commit ecb86d4

File tree

1 file changed

+3
-3
lines changed
  • examples/sol-anchor-contract/programs/sol-anchor-contract/src

1 file changed

+3
-3
lines changed

examples/sol-anchor-contract/programs/sol-anchor-contract/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub mod sol_anchor_contract {
4646
.checked_mul(loan_qty)
4747
.ok_or(ErrorCode::Overflow)?;
4848

49-
// Note : f64 should not be used in smart contracts, but we use it here so it gets displayed nicely in the logs.
49+
// WARNING : f64 SHOULD NOT BE USED IN SMART CONTRACTS, IT IS USED HERE ONLY FOR LOGGING PURPOSES
5050
// lets get the maximum loan value based on computation
5151
// i.e {} * 10^({})
5252
// loan_max_value * 10^(loan_price.expo)
@@ -78,12 +78,12 @@ pub mod sol_anchor_contract {
7878
.checked_mul(collateral_qty)
7979
.ok_or(ErrorCode::Overflow)?;
8080

81-
// Note : f64 should not be used in smart contracts, but we use it here so it gets displayed nicely in the logs.
81+
// WARNING : f64 SHOULD NOT BE USED IN SMART CONTRACTS, IT IS USED HERE ONLY FOR LOGGING PURPOSES
8282
// lets get the minimum collateral value based on computation
8383
// i.e {} * 10^({})
8484
// i.e collateral_min_value * 10^(collateral_price.expo)
8585
let exponent: i32 = collateral_price.expo;
86-
let result = (BASE).powi(exponent.abs());
86+
let result = BASE.powi(exponent.abs());
8787
let result: f64 = if exponent < 0 { 1.0 / result } else { result };
8888
let result_collateral_value = collateral_min_value as f64 * result;
8989

0 commit comments

Comments
 (0)