mirror of
				https://github.com/Instadapp/trustwallet-assets.git
				synced 2024-07-29 22:37:31 +00:00 
			
		
		
		
	Enforce explorer check for ERC20 and BEP20 tokens. (#4631)
Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									cdf04cf598
								
							
						
					
					
						commit
						933f67125d
					
				| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
    "name": "Vox Finance",
 | 
			
		||||
    "website": "https://app.vox.finance/",
 | 
			
		||||
    "short_description": "Yield farming token with low supply and 2% burn rate.",
 | 
			
		||||
    "explorer": "https://etherscan.io/address/0x12D102F06da35cC0111EB58017fd2Cd28537d0e1",
 | 
			
		||||
    "explorer": "https://etherscan.io/token/0x12D102F06da35cC0111EB58017fd2Cd28537d0e1",
 | 
			
		||||
    "socials": [
 | 
			
		||||
        {
 | 
			
		||||
            "name": "Twitter",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
    "name": "TENS",
 | 
			
		||||
    "website": "https://tenspeed.finance/",
 | 
			
		||||
    "short_description": "TenSpeed is the next generation of high yield deflationary farming, utilizing the TENS cryptocurrency which has been programmed to decrease in total supply the more active trading, yield farming and moving tokens becomes.",
 | 
			
		||||
    "explorer": "https://etherscan.io/address/0x776ca7ded9474829ea20ad4a5ab7a6ffdb64c796",
 | 
			
		||||
    "explorer": "https://etherscan.io/token/0x776CA7dEd9474829ea20AD4a5Ab7a6fFdB64C796",
 | 
			
		||||
    "socials": [
 | 
			
		||||
        {
 | 
			
		||||
            "name": "Discord",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,5 +2,5 @@
 | 
			
		|||
    "name": "BakerKingSwap",
 | 
			
		||||
    "website": "https://bakerkingswap.com/",
 | 
			
		||||
    "short_description": "Bakerking is fork from bakeryswap to make more secured, low fees, faster, easily earn from farming.",
 | 
			
		||||
    "explorer": "https://etherscan.io/address/0x9af7c46a4ebdfb1e11b5f94196c288c885f37bcd"
 | 
			
		||||
    "explorer": "https://etherscan.io/token/0x9aF7c46A4ebdfB1e11B5F94196C288c885F37bCD"
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -2,5 +2,5 @@
 | 
			
		|||
    "name": "CASHBACK Token",
 | 
			
		||||
    "website": "https://cashback.so",
 | 
			
		||||
    "short_description": "Cashback E-commerce Exchange was born from new ideas based on great start-up technologies and has had certain achievements in the market.",
 | 
			
		||||
    "explorer": "https://etherscan.io/address/0xa8ec2b2f021b55d7d594c8d12bbd6d23c05245d7"
 | 
			
		||||
    "explorer": "https://etherscan.io/token/0xA8eC2B2F021B55d7d594c8d12Bbd6d23C05245D7"
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -113,8 +113,12 @@ function isAssetInfoOK(chain: string, address: string, errors: string[], warning
 | 
			
		|||
                let matchCount = 0;
 | 
			
		||||
                explorersAlt.forEach(exp => { if (exp.toLowerCase() == explorerActualLower) { ++matchCount; }});
 | 
			
		||||
                if (matchCount == 0) {
 | 
			
		||||
                    // none matchs
 | 
			
		||||
                    warnings.push(`Unexpected explorer, ${explorerActual} instead of ${explorerExpected} (${explorersAlt.join(', ')})`);
 | 
			
		||||
                    // none matches, this is warning/error
 | 
			
		||||
                    if (chain.toLowerCase() == "ethereum" || chain.toLowerCase() == "smartchain") {
 | 
			
		||||
                        errors.push(`Incorrect explorer, ${explorerActual} instead of ${explorerExpected} (${explorersAlt.join(', ')})`);
 | 
			
		||||
                    } else {
 | 
			
		||||
                        warnings.push(`Unexpected explorer, ${explorerActual} instead of ${explorerExpected} (${explorersAlt.join(', ')})`);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user