Line data Source code
1 : #include "fd_sysvar_rent.h" 2 : #include "../../types/fd_cast.h" 3 : 4 : /* https://github.com/solana-labs/solana/blob/8f2c8b8388a495d2728909e30460aa40dcc5d733/sdk/program/src/rent.rs#L36 */ 5 42204 : #define ACCOUNT_STORAGE_OVERHEAD (128) 6 : 7 : ulong 8 : fd_rent_exempt_minimum_balance( fd_rent_t const * rent, 9 42204 : ulong data_len ) { 10 : /* https://github.com/anza-xyz/agave/blob/d2124a995f89e33c54f41da76bfd5b0bd5820898/sdk/program/src/rent.rs#L74 */ 11 42204 : return fd_rust_cast_double_to_ulong( (double)((data_len + ACCOUNT_STORAGE_OVERHEAD) * rent->lamports_per_uint8_year) * rent->exemption_threshold ); 12 42204 : }