File: contracts/token/src/lib.rs lines 147 to 153 versus lines 215 to 221
Issue: Identical guards, identical body, identical intent. The two doc comments even repeat the same sentence about not letting a holder dodge a freeze:
pub fn burn(env: Env, from: Address, amount: i128) {
Self::_check_paused(&env);
from.require_auth();
assert!(amount > 0, "amount must be positive");
assert!(!Self::_is_frozen(&env, &from), "account is frozen");
Self::_burn(&env, &from, amount);
}
burn_self is the same five lines. Two names for one behaviour doubles the entry-point surface that every future guard change must be applied to consistently, which is exactly the drift that produced [96], and it confuses SEP-41 clients about which entry point is canonical. It also inflates WASM size for nothing.
Fix: Delete burn_self and keep the standard-named burn. If the name is already deployed somewhere and must be preserved, make it a one-line delegate to Self::burn.
File:
contracts/token/src/lib.rslines 147 to 153 versus lines 215 to 221Issue: Identical guards, identical body, identical intent. The two doc comments even repeat the same sentence about not letting a holder dodge a freeze:
burn_selfis the same five lines. Two names for one behaviour doubles the entry-point surface that every future guard change must be applied to consistently, which is exactly the drift that produced [96], and it confuses SEP-41 clients about which entry point is canonical. It also inflates WASM size for nothing.Fix: Delete
burn_selfand keep the standard-namedburn. If the name is already deployed somewhere and must be preserved, make it a one-line delegate toSelf::burn.