Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't let people loop native usdt #48

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions contracts/suilend/sources/obligation.move
Original file line number Diff line number Diff line change
Expand Up @@ -782,19 +782,21 @@ module suilend::obligation {
// === Private Functions ===
public(package) fun is_looped<P>(obligation: &Obligation<P>): bool {
let target_reserve_array_indices = vector[
1, 2, 5, 7, 3, 9
1, 2, 5, 7, 19, 20, 3, 9
];

// The vector target_reserve_array_indices maps to disabled_pairings_map
// by corresponding indices of each element
// target_reserve_index --> pairings disabled
let disabled_pairings_map = vector[
vector[2, 5, 7], // 1 --> [2, 5, 7]
vector[1, 5, 7], // 2 --> [1, 5, 7]
vector[1, 2, 7], // 5 --> [1, 2, 7]
vector[1, 2, 5], // 7 --> [1, 2, 5]
vector[9],
vector[3]
vector[2, 5, 7, 19, 20], // 1 --> [2, 5, 7, 19, 20]
vector[1, 5, 7, 19, 20], // 2 --> [1, 5, 7, 19, 20]
vector[1, 2, 7, 19, 20], // 5 --> [1, 2, 7, 19, 20]
vector[1, 2, 5, 19, 20], // 7 --> [1, 2, 5, 19, 20]
vector[1, 2, 5, 7, 20], // 19 --> [1, 2, 5, 7, 20]
vector[1, 2, 5, 7, 19], // 20 --> [1, 2, 5, 7, 19]
vector[9], // 3 --> [9]
vector[3] // 9 --> [3]
];

let mut i = 0;
Expand Down
Loading