@@ -169,6 +169,110 @@ module KMIR-SPL-TOKEN
169169 rule #isSPLRentGetFunc("solana_sysvar::rent::<impl Sysvar for solana_rent::Rent>::get") => true
170170```
171171
172+ ## Slice metadata for SPL account buffers
173+
174+ ``` k
175+ // Account data (&mut [u8]) length hints (Account::LEN)
176+ rule #maybeDynamicSize(
177+ dynamicSize(_),
178+ SPLDataBuffer(
179+ Aggregate(variantIdx(0),
180+ ListItem(Aggregate(variantIdx(0), ListItem(Range(_)))) // mint
181+ ListItem(Aggregate(variantIdx(0), ListItem(Range(_)))) // owner
182+ ListItem(Integer(_, 64, false)) // amount
183+ ListItem(_DELEG) // delegate COption
184+ ListItem(Integer(_, 8, false)) // state
185+ ListItem(_IS_NATIVE) // is_native COption
186+ ListItem(Integer(_, 64, false)) // delegated_amount
187+ ListItem(_CLOSE) // close_authority COption
188+ )
189+ )
190+ )
191+ => dynamicSize(165)
192+ [priority(30)]
193+
194+ rule #maybeDynamicSize(
195+ dynamicSize(_),
196+ SPLDataBorrow(_, SPLDataBuffer(
197+ Aggregate(variantIdx(0),
198+ ListItem(Aggregate(variantIdx(0), ListItem(Range(_))))
199+ ListItem(Aggregate(variantIdx(0), ListItem(Range(_))))
200+ ListItem(Integer(_, 64, false))
201+ ListItem(_DELEG)
202+ ListItem(Integer(_, 8, false))
203+ ListItem(_IS_NATIVE)
204+ ListItem(Integer(_, 64, false))
205+ ListItem(_CLOSE)
206+ )
207+ ))
208+ )
209+ => dynamicSize(165)
210+ [priority(30)]
211+
212+ rule #maybeDynamicSize(
213+ dynamicSize(_),
214+ SPLDataBorrowMut(_, SPLDataBuffer(
215+ Aggregate(variantIdx(0),
216+ ListItem(Aggregate(variantIdx(0), ListItem(Range(_))))
217+ ListItem(Aggregate(variantIdx(0), ListItem(Range(_))))
218+ ListItem(Integer(_, 64, false))
219+ ListItem(_DELEG)
220+ ListItem(Integer(_, 8, false))
221+ ListItem(_IS_NATIVE)
222+ ListItem(Integer(_, 64, false))
223+ ListItem(_CLOSE)
224+ )
225+ ))
226+ )
227+ => dynamicSize(165)
228+ [priority(30)]
229+
230+ // Mint data (&mut [u8]) length hints (Mint::LEN)
231+ rule #maybeDynamicSize(
232+ dynamicSize(_),
233+ SPLDataBuffer(
234+ Aggregate(variantIdx(0),
235+ ListItem(_AUTH) // mint_authority COption
236+ ListItem(Integer(_, 64, false)) // supply
237+ ListItem(Integer(_, 8, false)) // decimals
238+ ListItem(BoolVal(_)) // is_initialized
239+ ListItem(_FREEZE) // freeze_authority COption
240+ )
241+ )
242+ )
243+ => dynamicSize(82)
244+ [priority(30)]
245+
246+ rule #maybeDynamicSize(
247+ dynamicSize(_),
248+ SPLDataBorrow(_, SPLDataBuffer(
249+ Aggregate(variantIdx(0),
250+ ListItem(_AUTH)
251+ ListItem(Integer(_, 64, false))
252+ ListItem(Integer(_, 8, false))
253+ ListItem(BoolVal(_))
254+ ListItem(_FREEZE)
255+ )
256+ ))
257+ )
258+ => dynamicSize(82)
259+ [priority(30)]
260+
261+ rule #maybeDynamicSize(
262+ dynamicSize(_),
263+ SPLDataBorrowMut(_, SPLDataBuffer(
264+ Aggregate(variantIdx(0),
265+ ListItem(_AUTH)
266+ ListItem(Integer(_, 64, false))
267+ ListItem(Integer(_, 8, false))
268+ ListItem(BoolVal(_))
269+ ListItem(_FREEZE)
270+ )
271+ ))
272+ )
273+ => dynamicSize(82)
274+ [priority(30)]
275+ ```
172276
173277## Cheatcode handling
174278``` {.k .symbolic}
0 commit comments