This repository was archived by the owner on Feb 14, 2025. It is now read-only.
This repository was archived by the owner on Feb 14, 2025. It is now read-only.
Improve Unused arguments rule #1
Open
Description
Currently, the rule finds unused function arguments. However, Cairo programs commonly use the pattern:
struct BatchConfig:
member general_config : GeneralConfig*
member signed_min_oracle_prices : OraclePrice*
member signed_max_oracle_prices : OraclePrice*
member n_oracle_prices : felt
member min_expiration_timestamp : felt
end
func batch_config_new(
general_config : GeneralConfig*, signed_min_oracle_prices : OraclePrice*,
signed_max_oracle_prices : OraclePrice*, n_oracle_prices, min_expiration_timestamp) -> (
batch_config : BatchConfig*):
let (fp_val, pc_val) = get_fp_and_pc()
return (batch_config=cast(fp_val - 2 - BatchConfig.SIZE, BatchConfig*))
end
We need to
- check the usage of cast(fp_val - 2 - STRUCT.SIZE, STRUCT*)
- check that all struct members and function parameters match in number and type
Metadata
Metadata
Assignees
Labels
No labels