pub fn validate(&self, run_result: &RunResult, from_id: u32) -> bool {
        if self.allowed_sudt_proxy_creator_account_id.is_empty()
            || self.sudt_proxy_code_hashes.is_empty()
        {
            return true;
        }
        if self
            .allowed_sudt_proxy_creator_account_id
            .contains(&from_id)
        {
            return true;
        }

        if run_result.write.new_scripts.is_empty() {
            return true;
        }

        for k in run_result.write.write_data.keys() {
            debug!(
                "allowlist: from_id: {:?}, code_hash: {:?}",
                &from_id,
                hex::encode(k.as_slice())
            );

            // Contract create syscall stores code in write_data.
            // check code hash is sudt proxy contract
            if self.sudt_proxy_code_hashes.contains(k) {
                return false;
            }
        }
        true
    }
/// Only accounts in allow list could create sUDT proxy contract.
Only accounts in allow list could create sUDT proxy contract.
Only accounts in allow list could create sUDT proxy contract .
pub fn validate(&self, run_result: &RunResult, from_id: u32) -> bool {
        if self.allowed_sudt_proxy_creator_account_id.is_empty()
            || self.sudt_proxy_code_hashes.is_empty()
        {
            return true;
        }
        if self
            .allowed_sudt_proxy_creator_account_id
            .contains(&from_id)
        {
            return true;
        }
        if run_result.write.new_scripts.is_empty() {
            return true;
        }
        for k in run_result.write.write_data.keys() {
            debug!(
                "allowlist: from_id: {:?}, code_hash: {:?}",
                &from_id,
                hex::encode(k.as_slice())
            );
            // Contract create syscall stores code in write_data.
            // check code hash is sudt proxy contract
            if self.sudt_proxy_code_hashes.contains(k) {
                return false;
            }
        }
        true
    }
pub fn validate ( & self , run_result : & RunResult , from_id : u32 ) -> bool { if self . allowed_sudt_proxy_creator_account_id . is_empty ( ) || self . sudt_proxy_code_hashes . is_empty ( ) { return true ; } if self . allowed_sudt_proxy_creator_account_id . contains ( & from_id ) { return true ; } if run_result . write . new_scripts . is_empty ( ) { return true ; } for k in run_result . write . write_data . keys ( ) { debug ! ( " " from_id hex encode ( k as_slice ( ) ) ) ; // Contract create syscall stores code in write_data. // check code hash is sudt proxy contract if self . sudt_proxy_code_hashes . contains ( k ) { return false ; } } true }
Only accounts in allow list could create sUDT proxy contract.
Only accounts in allow list could create sUDT proxy contract .
&self
run_result
&RunResult
from_id
u32
&self
run_result
&RunResult
from_id
u32