diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/libraries/Utils.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/libraries/Utils.sol index 4299dff80d..6ab2c5a387 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/libraries/Utils.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/libraries/Utils.sol @@ -168,10 +168,4 @@ library Utils { return (success, value); } - function isStringsEqual( - string memory a, - string memory b - ) internal pure returns (bool) { - return keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b)); - } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/Constants.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/Constants.sol index 1d2abea24c..1212be3210 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/Constants.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/Constants.sol @@ -21,3 +21,7 @@ pragma solidity ^0.8.8; library Constants { uint256 constant decimals_factor = 1000; } +struct TokenInfo { + uint32 network; + string tokenAddress; +} diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/GeniidataClient.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/GeniidataClient.sol index c9b78ea3f2..6354fc6014 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/GeniidataClient.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/GeniidataClient.sol @@ -24,7 +24,7 @@ import "../libraries/Utils.sol"; library GeniidataClient { function getTokenBalance( - string[] memory secrets, + string memory secret, string memory identityString, string memory tokenName, uint8 tokenDecimals @@ -40,7 +40,7 @@ library GeniidataClient { ) ); HttpHeader[] memory headers = new HttpHeader[](1); - headers[0] = HttpHeader("api-key", secrets[1]); + headers[0] = HttpHeader("api-key", secret); // https://geniidata.readme.io/reference/get-brc20-tick-list-copy (bool success, string memory value) = Http.GetString( diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/MoralisClient.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/MoralisClient.sol index 42ad05ce7f..58add95490 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/MoralisClient.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/MoralisClient.sol @@ -21,178 +21,203 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; import "../libraries/Json.sol"; import "../openzeppelin/Strings.sol"; +import "../libraries/Identities.sol"; struct SolanaTokenBalance { - string mint; - string amount; + string mint; + string amount; } struct EvmTokenBalance { - string tokenAddress; - string balance; + string tokenAddress; + string balance; } library MoralisClient { - function getSolanaNativeBalance( - string memory url, - string memory apiKey, - string memory account - ) internal returns (bool, string memory) { - url = string(abi.encodePacked(url, "/", account, "/balance")); + function getSolanaNativeBalance( + uint32 network, + string memory apiKey, + string memory account + ) internal returns (bool, string memory) { + string memory url = string( + abi.encodePacked(getNetworkUrl(network), "/", account, "/balance") + ); - HttpHeader[] memory headers = new HttpHeader[](1); - headers[0] = HttpHeader("X-API-Key", apiKey); - (bool balanceSuccess, string memory balanceResponse) = Http.Get( - url, - headers - ); - if (balanceSuccess) { - (bool solanaSuccess, string memory solana) = Json.getString( - balanceResponse, - "/solana" - ); - if (solanaSuccess) { - return (solanaSuccess, solana); - } else { - return (false, ""); - } - } else { - return (false, ""); - } - } + HttpHeader[] memory headers = new HttpHeader[](1); + headers[0] = HttpHeader("X-API-Key", apiKey); + (bool balanceSuccess, string memory balanceResponse) = Http.Get( + url, + headers + ); + if (balanceSuccess) { + (bool solanaSuccess, string memory solana) = Json.getString( + balanceResponse, + "/solana" + ); + if (solanaSuccess) { + return (solanaSuccess, solana); + } else { + return (false, ""); + } + } else { + return (false, ""); + } + } - function getSolanaTokensBalance( - string memory url, - string memory apiKey, - string memory account - ) internal returns (bool, SolanaTokenBalance[] memory) { - url = string(abi.encodePacked(url, "/", account, "/tokens")); - HttpHeader[] memory headers = new HttpHeader[](1); - headers[0] = HttpHeader("X-API-Key", apiKey); - (bool tokensSuccess, string memory tokensResponse) = Http.Get( - url, - headers - ); - if (tokensSuccess) { - (bool arrayLenSuccess, int64 arrayLen) = Json.getArrayLen( - tokensResponse, - "" - ); - if (arrayLenSuccess) { - SolanaTokenBalance[] memory balances = new SolanaTokenBalance[]( - uint256(int256(arrayLen)) - ); - for (uint256 i = 0; i < uint256(int256(arrayLen)); i++) { - (bool mintSuccess, string memory mint) = Json.getString( - tokensResponse, - string( - abi.encodePacked("/", Strings.toString(i), "/mint") - ) - ); - (bool amountSuccess, string memory amount) = Json.getString( - tokensResponse, - string( - abi.encodePacked( - "/", - Strings.toString(i), - "/amount" - ) - ) - ); - if (!mintSuccess || !amountSuccess) { - return (false, new SolanaTokenBalance[](0)); - } else { - balances[i] = SolanaTokenBalance(mint, amount); - } - } - return (true, balances); - } else { - return (false, new SolanaTokenBalance[](0)); - } - } else { - return (false, new SolanaTokenBalance[](0)); - } - } + function getSolanaTokensBalance( + uint32 network, + string memory apiKey, + string memory account + ) internal returns (bool, SolanaTokenBalance[] memory) { + string memory url = string( + abi.encodePacked(getNetworkUrl(network), "/", account, "/tokens") + ); + HttpHeader[] memory headers = new HttpHeader[](1); + headers[0] = HttpHeader("X-API-Key", apiKey); + (bool tokensSuccess, string memory tokensResponse) = Http.Get( + url, + headers + ); + if (tokensSuccess) { + (bool arrayLenSuccess, int64 arrayLen) = Json.getArrayLen( + tokensResponse, + "" + ); + if (arrayLenSuccess) { + SolanaTokenBalance[] memory balances = new SolanaTokenBalance[]( + uint256(int256(arrayLen)) + ); + for (uint256 i = 0; i < uint256(int256(arrayLen)); i++) { + (bool mintSuccess, string memory mint) = Json.getString( + tokensResponse, + string( + abi.encodePacked("/", Strings.toString(i), "/mint") + ) + ); + (bool amountSuccess, string memory amount) = Json.getString( + tokensResponse, + string( + abi.encodePacked( + "/", + Strings.toString(i), + "/amount" + ) + ) + ); + if (!mintSuccess || !amountSuccess) { + return (false, new SolanaTokenBalance[](0)); + } else { + balances[i] = SolanaTokenBalance(mint, amount); + } + } + return (true, balances); + } else { + return (false, new SolanaTokenBalance[](0)); + } + } else { + return (false, new SolanaTokenBalance[](0)); + } + } - function getErcTokensBalance( - string memory url, - string memory apiKey, - string memory account, - string memory chain, - string[] memory tokenAddresses - ) internal returns (bool, EvmTokenBalance[] memory) { - url = string( - abi.encodePacked(url, "/", account, "/erc20", "?chain=", chain) - ); - HttpHeader[] memory headers = new HttpHeader[](1); - headers[0] = HttpHeader("X-API-Key", apiKey); - if (tokenAddresses.length > 0) { - url = string(abi.encodePacked(url, "&")); - } - for (uint256 i = 0; i < tokenAddresses.length; i++) { - url = string( - abi.encodePacked( - url, - "token_addresses[", - Strings.toString(i), - "]=", - tokenAddresses[i] - ) - ); - if (i != tokenAddresses.length - 1) { - url = string(abi.encodePacked(url, "&")); - } - } - (bool tokensSuccess, string memory tokensResponse) = Http.Get( - url, - headers - ); - if (tokensSuccess) { - (bool arrayLenSuccess, int64 arrayLen) = Json.getArrayLen( - tokensResponse, - "" - ); - if (arrayLenSuccess) { - EvmTokenBalance[] memory balances = new EvmTokenBalance[]( - uint256(int256(arrayLen)) - ); - for (uint256 i = 0; i < uint256(int256(arrayLen)); i++) { - ( - bool tokenAddressSuccess, - string memory tokenAddress - ) = Json.getString( - tokensResponse, - string( - abi.encodePacked( - "/", - Strings.toString(i), - "/token_address" - ) - ) - ); - (bool balanceSuccess, string memory balance) = Json - .getString( - tokensResponse, - string( - abi.encodePacked( - "/", - Strings.toString(i), - "/balance" - ) - ) - ); - if (!tokenAddressSuccess || !balanceSuccess) { - return (false, new EvmTokenBalance[](0)); - } else { - balances[i] = EvmTokenBalance(tokenAddress, balance); - } - } - return (true, balances); - } else { - return (false, new EvmTokenBalance[](0)); - } - } else { - return (false, new EvmTokenBalance[](0)); - } - } + function getErcTokensBalance( + uint32 network, + string memory apiKey, + string memory account, + string memory chain, + string[] memory tokenAddresses + ) internal returns (bool, EvmTokenBalance[] memory) { + string memory url = string( + abi.encodePacked( + getNetworkUrl(network), + "/", + account, + "/erc20", + "?chain=", + chain + ) + ); + HttpHeader[] memory headers = new HttpHeader[](1); + headers[0] = HttpHeader("X-API-Key", apiKey); + if (tokenAddresses.length > 0) { + url = string(abi.encodePacked(url, "&")); + } + for (uint256 i = 0; i < tokenAddresses.length; i++) { + url = string( + abi.encodePacked( + url, + "token_addresses[", + Strings.toString(i), + "]=", + tokenAddresses[i] + ) + ); + if (i != tokenAddresses.length - 1) { + url = string(abi.encodePacked(url, "&")); + } + } + (bool tokensSuccess, string memory tokensResponse) = Http.Get( + url, + headers + ); + if (tokensSuccess) { + (bool arrayLenSuccess, int64 arrayLen) = Json.getArrayLen( + tokensResponse, + "" + ); + if (arrayLenSuccess) { + EvmTokenBalance[] memory balances = new EvmTokenBalance[]( + uint256(int256(arrayLen)) + ); + for (uint256 i = 0; i < uint256(int256(arrayLen)); i++) { + ( + bool tokenAddressSuccess, + string memory tokenAddress + ) = Json.getString( + tokensResponse, + string( + abi.encodePacked( + "/", + Strings.toString(i), + "/token_address" + ) + ) + ); + (bool balanceSuccess, string memory balance) = Json + .getString( + tokensResponse, + string( + abi.encodePacked( + "/", + Strings.toString(i), + "/balance" + ) + ) + ); + if (!tokenAddressSuccess || !balanceSuccess) { + return (false, new EvmTokenBalance[](0)); + } else { + balances[i] = EvmTokenBalance(tokenAddress, balance); + } + } + return (true, balances); + } else { + return (false, new EvmTokenBalance[](0)); + } + } else { + return (false, new EvmTokenBalance[](0)); + } + } + function isSupportedNetwork(uint32 network) internal pure returns (bool) { + return network == Web3Networks.Solana; + } + + function getNetworkUrl( + uint32 network + ) internal pure returns (string memory url) { + if (network == Web3Networks.Solana) { + url = "https://solana-gateway.moralis.io/account/mainnet"; + } else if (network == Web3Networks.Ethereum) { + url = "https://deep-index.moralis.io/api/v2.2"; + } + } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/NoderealClient.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/NoderealClient.sol index 73bdf98ff4..5772af8da7 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/NoderealClient.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/NoderealClient.sol @@ -21,11 +21,12 @@ pragma solidity ^0.8.8; import "../libraries/Http.sol"; import "../libraries/Identities.sol"; import "../libraries/Utils.sol"; +import "../openzeppelin/Strings.sol"; library NoderealClient { function getTokenBalance( - uint32 network, - string[] memory secrets, + uint32 network, + string memory secret, string memory tokenContractAddress, string memory account ) internal returns (bool, uint256) { @@ -33,11 +34,9 @@ library NoderealClient { string memory request; string memory encodePackedUrl = string( - abi.encodePacked(getNetworkUrl(network), secrets[0]) + abi.encodePacked(getNetworkUrl(network), secret) ); - if ( - keccak256(bytes(tokenContractAddress)) == keccak256("Native Token") - ) { + if (Strings.equal(tokenContractAddress, "Native Token")) { // Use eth_getBalance method request = string( abi.encodePacked( @@ -71,21 +70,19 @@ library NoderealClient { } else { return (false, 0); } - } + } - function isSupportedNetwork(uint32 network) internal pure returns (bool) { - return network == Web3Networks.Bsc || network == Web3Networks.Ethereum; - } + function isSupportedNetwork(uint32 network) internal pure returns (bool) { + return network == Web3Networks.Bsc || network == Web3Networks.Ethereum; + } - function getNetworkUrl(uint32 network) - internal - pure - returns (string memory url) - { - if (network == Web3Networks.Bsc) { - url = "https://bsc-mainnet.nodereal.io/v1/"; - } else if (network == Web3Networks.Ethereum) { - url = "https://eth-mainnet.nodereal.io/v1/"; - } - } + function getNetworkUrl( + uint32 network + ) internal pure returns (string memory url) { + if (network == Web3Networks.Bsc) { + url = "https://bsc-mainnet.nodereal.io/v1/"; + } else if (network == Web3Networks.Ethereum) { + url = "https://eth-mainnet.nodereal.io/v1/"; + } + } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenHoldingAmount.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenHoldingAmount.sol index 957b5ee14d..508673d81a 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenHoldingAmount.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenHoldingAmount.sol @@ -26,7 +26,6 @@ import "./Constants.sol"; import "../libraries/StringShift.sol"; abstract contract TokenHoldingAmount is DynamicAssertion { - mapping(string => string) internal tokenNames; mapping(string => uint256[]) internal tokenRanges; function execute( Identity[] memory identities, @@ -50,17 +49,15 @@ abstract contract TokenHoldingAmount is DynamicAssertion { string memory tokenLowercaseName = abi.decode(params, (string)); - if ( - keccak256(abi.encodePacked(tokenNames[tokenLowercaseName])) == - keccak256(abi.encodePacked("")) - ) { - revert("Token not supported or not found"); - } + require( + tokenRanges[tokenLowercaseName].length > 0, + "Token not supported or not found" + ); uint256 balance = queryTotalBalance( identities, secrets, - tokenNames[tokenLowercaseName] + tokenLowercaseName ); (uint256 index, uint256 min, int256 max) = calculateRange( @@ -71,7 +68,7 @@ abstract contract TokenHoldingAmount is DynamicAssertion { string[] memory assertions = assembleAssertions( min, max, - tokenNames[tokenLowercaseName] + tokenLowercaseName ); bool result = index > 0 || balance > 0; diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenMapping.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenMapping.sol index dfce614069..d5b2251d48 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenMapping.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenMapping.sol @@ -29,6 +29,7 @@ import { Mmss } from "./brc20/Mmss.sol"; import { Ordi } from "./brc20/Ordi.sol"; import { Rats } from "./brc20/Rats.sol"; import { Sats } from "./brc20/Sats.sol"; +import { BRC20 } from "./brc20/BRC20.sol"; // erc20 import { Ada } from "./erc20/Ada.sol"; @@ -73,352 +74,273 @@ import { Usdd } from "./erc20/Usdd.sol"; contract TokenMapping is TokenQueryLogic { constructor() { // btcs - tokenNames["btcs"] = Btcs.getTokenName(); tokenRanges["btcs"] = Btcs.getTokenRanges(); - tokenNetworks["btcs"] = Btcs.getTokenNetworks(); + for (uint8 i = 0; i < BRC20.getBrc20TokenInfo().length; i++) { + tokenInfo["btcs"].push(BRC20.getBrc20TokenInfo()[i]); + } // cats - tokenNames["cats"] = Cats.getTokenName(); tokenRanges["cats"] = Cats.getTokenRanges(); - tokenNetworks["cats"] = Cats.getTokenNetworks(); + for (uint8 i = 0; i < BRC20.getBrc20TokenInfo().length; i++) { + tokenInfo["cats"].push(BRC20.getBrc20TokenInfo()[i]); + } // long - tokenNames["long"] = Long.getTokenName(); tokenRanges["long"] = Long.getTokenRanges(); - tokenNetworks["long"] = Long.getTokenNetworks(); + for (uint8 i = 0; i < BRC20.getBrc20TokenInfo().length; i++) { + tokenInfo["long"].push(BRC20.getBrc20TokenInfo()[i]); + } - // long - tokenNames["mmss"] = Mmss.getTokenName(); + // mmss tokenRanges["mmss"] = Mmss.getTokenRanges(); - tokenNetworks["mmss"] = Mmss.getTokenNetworks(); + for (uint8 i = 0; i < BRC20.getBrc20TokenInfo().length; i++) { + tokenInfo["mmss"].push(BRC20.getBrc20TokenInfo()[i]); + } // ordi - tokenNames["ordi"] = Ordi.getTokenName(); tokenRanges["ordi"] = Ordi.getTokenRanges(); - tokenNetworks["ordi"] = Ordi.getTokenNetworks(); + for (uint8 i = 0; i < BRC20.getBrc20TokenInfo().length; i++) { + tokenInfo["ordi"].push(BRC20.getBrc20TokenInfo()[i]); + } // rats - tokenNames["rats"] = Rats.getTokenName(); tokenRanges["rats"] = Rats.getTokenRanges(); - tokenNetworks["rats"] = Rats.getTokenNetworks(); + for (uint8 i = 0; i < BRC20.getBrc20TokenInfo().length; i++) { + tokenInfo["rats"].push(BRC20.getBrc20TokenInfo()[i]); + } // sats - tokenNames["sats"] = Sats.getTokenName(); tokenRanges["sats"] = Sats.getTokenRanges(); - tokenNetworks["sats"] = Sats.getTokenNetworks(); + for (uint8 i = 0; i < BRC20.getBrc20TokenInfo().length; i++) { + tokenInfo["sats"].push(BRC20.getBrc20TokenInfo()[i]); + } // ada - tokenNames["ada"] = Ada.getTokenName(); tokenRanges["ada"] = Ada.getTokenRanges(); - tokenNetworks["ada"] = Ada.getTokenNetworks(); - tokenAddresses["ada"][Web3Networks.Bsc] = Ada.getTokenBscAddress(); - tokenAddresses["ada"][Web3Networks.Ethereum] = Ada - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Ada.getTokenInfo().length; i++) { + tokenInfo["ada"].push(Ada.getTokenInfo()[i]); + } // amp - tokenNames["amp"] = Amp.getTokenName(); tokenRanges["amp"] = Amp.getTokenRanges(); - tokenNetworks["amp"] = Amp.getTokenNetworks(); - tokenAddresses["amp"][Web3Networks.Bsc] = Amp.getTokenBscAddress(); - tokenAddresses["amp"][Web3Networks.Ethereum] = Amp - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Amp.getTokenInfo().length; i++) { + tokenInfo["amp"].push(Amp.getTokenInfo()[i]); + } // atom - tokenNames["atom"] = Atom.getTokenName(); tokenRanges["atom"] = Atom.getTokenRanges(); - tokenNetworks["atom"] = Atom.getTokenNetworks(); - tokenAddresses["atom"][Web3Networks.Bsc] = Atom.getTokenBscAddress(); - tokenAddresses["atom"][Web3Networks.Ethereum] = Atom - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Atom.getTokenInfo().length; i++) { + tokenInfo["atom"].push(Atom.getTokenInfo()[i]); + } // bch - tokenNames["bch"] = Bch.getTokenName(); tokenRanges["bch"] = Bch.getTokenRanges(); - tokenNetworks["bch"] = Bch.getTokenNetworks(); - tokenAddresses["bch"][Web3Networks.Bsc] = Bch.getTokenBscAddress(); - tokenAddresses["bch"][Web3Networks.Ethereum] = Bch - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Bch.getTokenInfo().length; i++) { + tokenInfo["bch"].push(Bch.getTokenInfo()[i]); + } // bean - tokenNames["bean"] = Bean.getTokenName(); tokenRanges["bean"] = Bean.getTokenRanges(); - tokenNetworks["bean"] = Bean.getTokenNetworks(); - tokenAddresses["bean"][Web3Networks.Bsc] = Bean.getTokenBscAddress(); - tokenAddresses["bean"][Web3Networks.Ethereum] = Bean - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Bean.getTokenInfo().length; i++) { + tokenInfo["bean"].push(Bean.getTokenInfo()[i]); + } // bnb - tokenNames["bnb"] = Bnb.getTokenName(); tokenRanges["bnb"] = Bnb.getTokenRanges(); - tokenNetworks["bnb"] = Bnb.getTokenNetworks(); - tokenAddresses["bnb"][Web3Networks.Bsc] = Bnb.getTokenBscAddress(); - tokenAddresses["bnb"][Web3Networks.Ethereum] = Bnb - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Bnb.getTokenInfo().length; i++) { + tokenInfo["bnb"].push(Bnb.getTokenInfo()[i]); + } // comp - tokenNames["comp"] = Comp.getTokenName(); tokenRanges["comp"] = Comp.getTokenRanges(); - tokenNetworks["comp"] = Comp.getTokenNetworks(); - tokenAddresses["comp"][Web3Networks.Bsc] = Comp.getTokenBscAddress(); - tokenAddresses["comp"][Web3Networks.Ethereum] = Comp - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Comp.getTokenInfo().length; i++) { + tokenInfo["comp"].push(Comp.getTokenInfo()[i]); + } // cro - tokenNames["cro"] = Cro.getTokenName(); tokenRanges["cro"] = Cro.getTokenRanges(); - tokenNetworks["cro"] = Cro.getTokenNetworks(); - tokenAddresses["cro"][Web3Networks.Bsc] = Cro.getTokenBscAddress(); - tokenAddresses["cro"][Web3Networks.Ethereum] = Cro - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Cro.getTokenInfo().length; i++) { + tokenInfo["cro"].push(Cro.getTokenInfo()[i]); + } // crv - tokenNames["crv"] = Crv.getTokenName(); tokenRanges["crv"] = Crv.getTokenRanges(); - tokenNetworks["crv"] = Crv.getTokenNetworks(); - tokenAddresses["crv"][Web3Networks.Bsc] = Crv.getTokenBscAddress(); - tokenAddresses["crv"][Web3Networks.Ethereum] = Crv - .getTokenEthereumAddress(); - - // cvx - tokenNames["cvx"] = Cvx.getTokenName(); - tokenRanges["cvx"] = Cvx.getTokenRanges(); - tokenNetworks["cvx"] = Cvx.getTokenNetworks(); - tokenAddresses["cvx"][Web3Networks.Bsc] = Cvx.getTokenBscAddress(); - tokenAddresses["cvx"][Web3Networks.Ethereum] = Cvx - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Crv.getTokenInfo().length; i++) { + tokenInfo["crv"].push(Crv.getTokenInfo()[i]); + } // dai - tokenNames["dai"] = Dai.getTokenName(); tokenRanges["dai"] = Dai.getTokenRanges(); - tokenNetworks["dai"] = Dai.getTokenNetworks(); - tokenAddresses["dai"][Web3Networks.Bsc] = Dai.getTokenBscAddress(); - tokenAddresses["dai"][Web3Networks.Ethereum] = Dai - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Dai.getTokenInfo().length; i++) { + tokenInfo["dai"].push(Dai.getTokenInfo()[i]); + } // doge - tokenNames["doge"] = Doge.getTokenName(); tokenRanges["doge"] = Doge.getTokenRanges(); - tokenNetworks["doge"] = Doge.getTokenNetworks(); - tokenAddresses["doge"][Web3Networks.Bsc] = Doge.getTokenBscAddress(); - tokenAddresses["doge"][Web3Networks.Ethereum] = Doge - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Doge.getTokenInfo().length; i++) { + tokenInfo["doge"].push(Doge.getTokenInfo()[i]); + } // dydx - tokenNames["dydx"] = Dydx.getTokenName(); tokenRanges["dydx"] = Dydx.getTokenRanges(); - tokenNetworks["dydx"] = Dydx.getTokenNetworks(); - tokenAddresses["dydx"][Web3Networks.Bsc] = Dydx.getTokenBscAddress(); - tokenAddresses["dydx"][Web3Networks.Ethereum] = Dydx - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Dydx.getTokenInfo().length; i++) { + tokenInfo["dydx"].push(Dydx.getTokenInfo()[i]); + } // etc - tokenNames["etc"] = Etc.getTokenName(); tokenRanges["etc"] = Etc.getTokenRanges(); - tokenNetworks["etc"] = Etc.getTokenNetworks(); - tokenAddresses["etc"][Web3Networks.Bsc] = Etc.getTokenBscAddress(); - tokenAddresses["etc"][Web3Networks.Ethereum] = Etc - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Etc.getTokenInfo().length; i++) { + tokenInfo["etc"].push(Etc.getTokenInfo()[i]); + } // eth - tokenNames["eth"] = Eth.getTokenName(); tokenRanges["eth"] = Eth.getTokenRanges(); - tokenNetworks["eth"] = Eth.getTokenNetworks(); - tokenAddresses["eth"][Web3Networks.Bsc] = Eth.getTokenBscAddress(); - tokenAddresses["eth"][Web3Networks.Ethereum] = Eth - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Eth.getTokenInfo().length; i++) { + tokenInfo["eth"].push(Eth.getTokenInfo()[i]); + } // fil - tokenNames["fil"] = Fil.getTokenName(); tokenRanges["fil"] = Fil.getTokenRanges(); - tokenNetworks["fil"] = Fil.getTokenNetworks(); - tokenAddresses["fil"][Web3Networks.Bsc] = Fil.getTokenBscAddress(); - tokenAddresses["fil"][Web3Networks.Ethereum] = Fil - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Fil.getTokenInfo().length; i++) { + tokenInfo["fil"].push(Fil.getTokenInfo()[i]); + } // grt - tokenNames["grt"] = Grt.getTokenName(); tokenRanges["grt"] = Grt.getTokenRanges(); - tokenNetworks["grt"] = Grt.getTokenNetworks(); - tokenAddresses["grt"][Web3Networks.Bsc] = Grt.getTokenBscAddress(); - tokenAddresses["grt"][Web3Networks.Ethereum] = Grt - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Grt.getTokenInfo().length; i++) { + tokenInfo["grt"].push(Grt.getTokenInfo()[i]); + } // gtc - tokenNames["gtc"] = Gtc.getTokenName(); tokenRanges["gtc"] = Gtc.getTokenRanges(); - tokenNetworks["gtc"] = Gtc.getTokenNetworks(); - tokenAddresses["gtc"][Web3Networks.Bsc] = Gtc.getTokenBscAddress(); - tokenAddresses["gtc"][Web3Networks.Ethereum] = Gtc - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Gtc.getTokenInfo().length; i++) { + tokenInfo["gtc"].push(Gtc.getTokenInfo()[i]); + } // gusd - tokenNames["gusd"] = Gusd.getTokenName(); tokenRanges["gusd"] = Gusd.getTokenRanges(); - tokenNetworks["gusd"] = Gusd.getTokenNetworks(); - tokenAddresses["gusd"][Web3Networks.Bsc] = Gusd.getTokenBscAddress(); - tokenAddresses["gusd"][Web3Networks.Ethereum] = Gusd - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Gusd.getTokenInfo().length; i++) { + tokenInfo["gusd"].push(Gusd.getTokenInfo()[i]); + } // imx - tokenNames["imx"] = Imx.getTokenName(); tokenRanges["imx"] = Imx.getTokenRanges(); - tokenNetworks["imx"] = Imx.getTokenNetworks(); - tokenAddresses["imx"][Web3Networks.Bsc] = Imx.getTokenBscAddress(); - tokenAddresses["imx"][Web3Networks.Ethereum] = Imx - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Imx.getTokenInfo().length; i++) { + tokenInfo["imx"].push(Imx.getTokenInfo()[i]); + } // inj - tokenNames["inj"] = Inj.getTokenName(); tokenRanges["inj"] = Inj.getTokenRanges(); - tokenNetworks["inj"] = Inj.getTokenNetworks(); - tokenAddresses["inj"][Web3Networks.Bsc] = Inj.getTokenBscAddress(); - tokenAddresses["inj"][Web3Networks.Ethereum] = Inj - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Inj.getTokenInfo().length; i++) { + tokenInfo["inj"].push(Inj.getTokenInfo()[i]); + } // leo - tokenNames["leo"] = Leo.getTokenName(); tokenRanges["leo"] = Leo.getTokenRanges(); - tokenNetworks["leo"] = Leo.getTokenNetworks(); - tokenAddresses["leo"][Web3Networks.Bsc] = Leo.getTokenBscAddress(); - tokenAddresses["leo"][Web3Networks.Ethereum] = Leo - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Leo.getTokenInfo().length; i++) { + tokenInfo["leo"].push(Leo.getTokenInfo()[i]); + } // link - tokenNames["link"] = Link.getTokenName(); tokenRanges["link"] = Link.getTokenRanges(); - tokenNetworks["link"] = Link.getTokenNetworks(); - tokenAddresses["link"][Web3Networks.Bsc] = Link.getTokenBscAddress(); - tokenAddresses["link"][Web3Networks.Ethereum] = Link - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Link.getTokenInfo().length; i++) { + tokenInfo["link"].push(Link.getTokenInfo()[i]); + } // lit - tokenNames["lit"] = Lit.getTokenName(); tokenRanges["lit"] = Lit.getTokenRanges(); - tokenNetworks["lit"] = Lit.getTokenNetworks(); - tokenAddresses["lit"][Web3Networks.Bsc] = Lit.getTokenBscAddress(); - tokenAddresses["lit"][Web3Networks.Ethereum] = Lit - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Lit.getTokenInfo().length; i++) { + tokenInfo["lit"].push(Lit.getTokenInfo()[i]); + } // matic - tokenNames["matic"] = Matic.getTokenName(); tokenRanges["matic"] = Matic.getTokenRanges(); - tokenNetworks["matic"] = Matic.getTokenNetworks(); - tokenAddresses["matic"][Web3Networks.Bsc] = Matic.getTokenBscAddress(); - tokenAddresses["matic"][Web3Networks.Ethereum] = Matic - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Matic.getTokenInfo().length; i++) { + tokenInfo["matic"].push(Matic.getTokenInfo()[i]); + } // mcrt - tokenNames["mcrt"] = Mcrt.getTokenName(); tokenRanges["mcrt"] = Mcrt.getTokenRanges(); - tokenNetworks["mcrt"] = Mcrt.getTokenNetworks(); - tokenAddresses["mcrt"][Web3Networks.Bsc] = Mcrt.getTokenBscAddress(); - tokenAddresses["mcrt"][Web3Networks.Ethereum] = Mcrt - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Mcrt.getTokenInfo().length; i++) { + tokenInfo["mcrt"].push(Mcrt.getTokenInfo()[i]); + } // nfp - tokenNames["nfp"] = Nfp.getTokenName(); tokenRanges["nfp"] = Nfp.getTokenRanges(); - tokenNetworks["nfp"] = Nfp.getTokenNetworks(); - tokenAddresses["nfp"][Web3Networks.Bsc] = Nfp.getTokenBscAddress(); - tokenAddresses["nfp"][Web3Networks.Ethereum] = Nfp - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Nfp.getTokenInfo().length; i++) { + tokenInfo["nfp"].push(Nfp.getTokenInfo()[i]); + } // people - tokenNames["people"] = People.getTokenName(); tokenRanges["people"] = People.getTokenRanges(); - tokenNetworks["people"] = People.getTokenNetworks(); - tokenAddresses["people"][Web3Networks.Bsc] = People - .getTokenBscAddress(); - tokenAddresses["people"][Web3Networks.Ethereum] = People - .getTokenEthereumAddress(); + for (uint8 i = 0; i < People.getTokenInfo().length; i++) { + tokenInfo["people"].push(People.getTokenInfo()[i]); + } // shib - tokenNames["shib"] = Shib.getTokenName(); tokenRanges["shib"] = Shib.getTokenRanges(); - tokenNetworks["shib"] = Shib.getTokenNetworks(); - tokenAddresses["shib"][Web3Networks.Bsc] = Shib.getTokenBscAddress(); - tokenAddresses["shib"][Web3Networks.Ethereum] = Shib - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Shib.getTokenInfo().length; i++) { + tokenInfo["shib"].push(Shib.getTokenInfo()[i]); + } // sol - tokenNames["sol"] = Sol.getTokenName(); tokenRanges["sol"] = Sol.getTokenRanges(); - tokenNetworks["sol"] = Sol.getTokenNetworks(); - tokenAddresses["sol"][Web3Networks.Bsc] = Sol.getTokenBscAddress(); - tokenAddresses["sol"][Web3Networks.Ethereum] = Sol - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Sol.getTokenInfo().length; i++) { + tokenInfo["sol"].push(Sol.getTokenInfo()[i]); + } // spaceid - tokenNames["spaceid"] = SpaceId.getTokenName(); tokenRanges["spaceid"] = SpaceId.getTokenRanges(); - tokenNetworks["spaceid"] = SpaceId.getTokenNetworks(); - tokenAddresses["spaceid"][Web3Networks.Bsc] = SpaceId - .getTokenBscAddress(); - tokenAddresses["spaceid"][Web3Networks.Ethereum] = SpaceId - .getTokenEthereumAddress(); + for (uint8 i = 0; i < SpaceId.getTokenInfo().length; i++) { + tokenInfo["spaceid"].push(SpaceId.getTokenInfo()[i]); + } // ton - tokenNames["ton"] = Ton.getTokenName(); tokenRanges["ton"] = Ton.getTokenRanges(); - tokenNetworks["ton"] = Ton.getTokenNetworks(); - tokenAddresses["ton"][Web3Networks.Bsc] = Ton.getTokenBscAddress(); - tokenAddresses["ton"][Web3Networks.Ethereum] = Ton - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Ton.getTokenInfo().length; i++) { + tokenInfo["ton"].push(Ton.getTokenInfo()[i]); + } // trx - tokenNames["trx"] = Trx.getTokenName(); tokenRanges["trx"] = Trx.getTokenRanges(); - tokenNetworks["trx"] = Trx.getTokenNetworks(); - tokenAddresses["trx"][Web3Networks.Bsc] = Trx.getTokenBscAddress(); - tokenAddresses["trx"][Web3Networks.Ethereum] = Trx - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Trx.getTokenInfo().length; i++) { + tokenInfo["trx"].push(Trx.getTokenInfo()[i]); + } // tusd - tokenNames["tusd"] = Tusd.getTokenName(); tokenRanges["tusd"] = Tusd.getTokenRanges(); - tokenNetworks["tusd"] = Tusd.getTokenNetworks(); - tokenAddresses["tusd"][Web3Networks.Bsc] = Tusd.getTokenBscAddress(); - tokenAddresses["tusd"][Web3Networks.Ethereum] = Tusd - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Tusd.getTokenInfo().length; i++) { + tokenInfo["tusd"].push(Tusd.getTokenInfo()[i]); + } // uni - tokenNames["uni"] = Uni.getTokenName(); tokenRanges["uni"] = Uni.getTokenRanges(); - tokenNetworks["uni"] = Uni.getTokenNetworks(); - tokenAddresses["uni"][Web3Networks.Bsc] = Uni.getTokenBscAddress(); - tokenAddresses["uni"][Web3Networks.Ethereum] = Uni - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Uni.getTokenInfo().length; i++) { + tokenInfo["uni"].push(Uni.getTokenInfo()[i]); + } // usdc - tokenNames["usdc"] = Usdc.getTokenName(); tokenRanges["usdc"] = Usdc.getTokenRanges(); - tokenNetworks["usdc"] = Usdc.getTokenNetworks(); - tokenAddresses["usdc"][Web3Networks.Bsc] = Usdc.getTokenBscAddress(); - tokenAddresses["usdc"][Web3Networks.Ethereum] = Usdc - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Usdc.getTokenInfo().length; i++) { + tokenInfo["usdc"].push(Usdc.getTokenInfo()[i]); + } // usdd - tokenNames["usdd"] = Usdd.getTokenName(); tokenRanges["usdd"] = Usdd.getTokenRanges(); - tokenNetworks["usdd"] = Usdd.getTokenNetworks(); - tokenAddresses["usdd"][Web3Networks.Bsc] = Usdd.getTokenBscAddress(); - tokenAddresses["usdd"][Web3Networks.Ethereum] = Usdd - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Usdd.getTokenInfo().length; i++) { + tokenInfo["usdd"].push(Usdd.getTokenInfo()[i]); + } // usdt - tokenNames["usdt"] = Usdt.getTokenName(); tokenRanges["usdt"] = Usdt.getTokenRanges(); - tokenNetworks["usdt"] = Usdt.getTokenNetworks(); - tokenAddresses["usdt"][Web3Networks.Bsc] = Usdt.getTokenBscAddress(); - tokenAddresses["usdt"][Web3Networks.Ethereum] = Usdt - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Usdt.getTokenInfo().length; i++) { + tokenInfo["usdt"].push(Usdt.getTokenInfo()[i]); + } // wbtc - tokenNames["wbtc"] = Wbtc.getTokenName(); tokenRanges["wbtc"] = Wbtc.getTokenRanges(); - tokenNetworks["wbtc"] = Wbtc.getTokenNetworks(); - tokenAddresses["wbtc"][Web3Networks.Bsc] = Wbtc.getTokenBscAddress(); - tokenAddresses["wbtc"][Web3Networks.Ethereum] = Wbtc - .getTokenEthereumAddress(); + for (uint8 i = 0; i < Wbtc.getTokenInfo().length; i++) { + tokenInfo["wbtc"].push(Wbtc.getTokenInfo()[i]); + } } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenQueryLogic.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenQueryLogic.sol index 0e12b8e687..0db17c665c 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenQueryLogic.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/TokenQueryLogic.sol @@ -23,12 +23,12 @@ import "../libraries/Utils.sol"; import { TokenHoldingAmount } from "./TokenHoldingAmount.sol"; import { NoderealClient } from "./NoderealClient.sol"; import { GeniidataClient } from "./GeniidataClient.sol"; +import "./MoralisClient.sol"; +import "../openzeppelin/Strings.sol"; +import "./Constants.sol"; abstract contract TokenQueryLogic is TokenHoldingAmount { - mapping(string => mapping(uint32 => string)) tokenAddresses; - mapping(string => string) internal tokenBscAddress; - mapping(string => string) internal tokenEthereumAddress; - mapping(string => uint32[]) internal tokenNetworks; + mapping(string => TokenInfo[]) internal tokenInfo; // TODO fix it for erc20 token, same token for different networks has different decimals. function getTokenDecimals() internal pure override returns (uint8) { @@ -47,12 +47,14 @@ abstract contract TokenQueryLogic is TokenHoldingAmount { if (identityToStringSuccess) { uint256 totalBalance = 0; - string memory tokenContractAddress = tokenAddresses[tokenName][ + string memory tokenContractAddress = getTokenAddress( + tokenName, network - ]; + ); + if (GeniidataClient.isSupportedNetwork(network)) { uint256 balance = GeniidataClient.getTokenBalance( - secrets, + secrets[0], identityString, tokenName, getTokenDecimals() @@ -60,33 +62,96 @@ abstract contract TokenQueryLogic is TokenHoldingAmount { totalBalance += balance; } else if (NoderealClient.isSupportedNetwork(network)) { (bool success, uint256 balance) = NoderealClient - .getTokenBalance( + .getTokenBalance( network, - secrets, + secrets[1], tokenContractAddress, identityString ); if (success) { totalBalance += balance; } + } else if (MoralisClient.isSupportedNetwork(network)) { + if (Strings.equal(tokenContractAddress, "Native Token")) { + ( + bool success, + string memory solanaTokenBalance + ) = MoralisClient.getSolanaNativeBalance( + network, + secrets[2], + identityString + ); + + if (success) { + (bool parsedStatus, uint256 parsedAmount) = Utils + .parseDecimal( + solanaTokenBalance, + getTokenDecimals() + ); + if (parsedStatus) { + totalBalance += parsedAmount; + } + } + } else { + ( + bool success, + SolanaTokenBalance[] memory solanaTokenBalance + ) = MoralisClient.getSolanaTokensBalance( + network, + secrets[2], + identityString + ); + + if (success) { + for (uint i = 0; i < solanaTokenBalance.length; i++) { + if ( + Strings.equal( + solanaTokenBalance[i].mint, + tokenContractAddress + ) + ) { + ( + bool parsedStatus, + uint256 parsedAmount + ) = Utils.parseDecimal( + solanaTokenBalance[i].amount, + getTokenDecimals() + ); + if (parsedStatus) { + totalBalance += parsedAmount; + } + } + } + } + } } return totalBalance; } return 0; } - function isSupportedNetwork(string memory tokenName, uint32 network) - internal - view - override - returns (bool) - { - uint32[] memory networks = tokenNetworks[tokenName]; - for (uint32 i = 0; i < networks.length; i++) { - if (network == networks[i]) { - return true; - } + function isSupportedNetwork( + string memory tokenName, + uint32 network + ) internal view override returns (bool) { + TokenInfo[] memory infoArray = tokenInfo[tokenName]; + for (uint32 i = 0; i < infoArray.length; i++) { + if (network == infoArray[i].network) { + return true; + } } return false; } + + function getTokenAddress( + string memory tokenName, + uint32 network + ) internal view returns (string memory) { + for (uint i = 0; i < tokenInfo[tokenName].length; i++) { + if (tokenInfo[tokenName][i].network == network) { + return tokenInfo[tokenName][i].tokenAddress; + } + } + revert("Token address not found for the specified network"); + } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/BRC20.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/BRC20.sol index 22b4473ccb..06fb2ff1d7 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/BRC20.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/BRC20.sol @@ -32,4 +32,13 @@ library BRC20 { networks[4] = Web3Networks.BitcoinP2wsh; return networks; } + function getBrc20TokenInfo() internal pure returns (TokenInfo[] memory) { + uint32[] memory networks = BRC20.getDefaultTokenNetworks(); + TokenInfo[] memory tokenInfoList = new TokenInfo[](networks.length); + for (uint i = 0; i < networks.length; i++) { + tokenInfoList[i] = TokenInfo(networks[i], ""); + } + + return tokenInfoList; + } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Btcs.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Btcs.sol index 0fbbadb08a..6a5c28acc5 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Btcs.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Btcs.sol @@ -23,10 +23,6 @@ import "../Constants.sol"; import "./BRC20.sol"; library Btcs { - function getTokenName() internal pure returns (string memory) { - return "btcs"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); ranges[0] = 0 * Constants.decimals_factor; @@ -40,8 +36,4 @@ library Btcs { ranges[8] = 800 * Constants.decimals_factor; return ranges; } - - function getTokenNetworks() internal pure returns (uint32[] memory) { - return BRC20.getDefaultTokenNetworks(); - } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Cats.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Cats.sol index 228025ef8e..dbb03c3e66 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Cats.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Cats.sol @@ -23,10 +23,6 @@ import "../Constants.sol"; import "./BRC20.sol"; library Cats { - function getTokenName() internal pure returns (string memory) { - return "cats"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); ranges[0] = 0 * Constants.decimals_factor; @@ -39,8 +35,4 @@ library Cats { ranges[7] = 800000 * Constants.decimals_factor; return ranges; } - - function getTokenNetworks() internal pure returns (uint32[] memory) { - return BRC20.getDefaultTokenNetworks(); - } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Long.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Long.sol index 9d60fe0d54..371355ccf5 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Long.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Long.sol @@ -23,10 +23,6 @@ import "../Constants.sol"; import "./BRC20.sol"; library Long { - function getTokenName() internal pure returns (string memory) { - return "long"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); ranges[0] = 0 * Constants.decimals_factor; @@ -40,8 +36,4 @@ library Long { ranges[8] = 3000 * Constants.decimals_factor; return ranges; } - - function getTokenNetworks() internal pure returns (uint32[] memory) { - return BRC20.getDefaultTokenNetworks(); - } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Mmss.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Mmss.sol index 4f515a0a25..c8472ee4bd 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Mmss.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Mmss.sol @@ -23,10 +23,6 @@ import "../Constants.sol"; import "./BRC20.sol"; library Mmss { - function getTokenName() internal pure returns (string memory) { - return "mmss"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); ranges[0] = 0 * Constants.decimals_factor; @@ -40,8 +36,4 @@ library Mmss { ranges[8] = 2000 * Constants.decimals_factor; return ranges; } - - function getTokenNetworks() internal pure returns (uint32[] memory) { - return BRC20.getDefaultTokenNetworks(); - } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Ordi.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Ordi.sol index aeb0869782..08d43254b0 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Ordi.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Ordi.sol @@ -23,10 +23,6 @@ import "../Constants.sol"; import "./BRC20.sol"; library Ordi { - function getTokenName() internal pure returns (string memory) { - return "ordi"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); ranges[0] = 0 * Constants.decimals_factor; @@ -39,8 +35,4 @@ library Ordi { ranges[7] = 500 * Constants.decimals_factor; return ranges; } - - function getTokenNetworks() internal pure returns (uint32[] memory) { - return BRC20.getDefaultTokenNetworks(); - } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Rats.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Rats.sol index 94b53f3e7d..af1864fe83 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Rats.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Rats.sol @@ -23,10 +23,6 @@ import "../Constants.sol"; import "./BRC20.sol"; library Rats { - function getTokenName() internal pure returns (string memory) { - return "rats"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); ranges[0] = 0 * Constants.decimals_factor; @@ -40,8 +36,4 @@ library Rats { ranges[8] = 2000000 * Constants.decimals_factor; return ranges; } - - function getTokenNetworks() internal pure returns (uint32[] memory) { - return BRC20.getDefaultTokenNetworks(); - } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Sats.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Sats.sol index 39e2de7b45..8ebed6a63d 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Sats.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/brc20/Sats.sol @@ -23,10 +23,6 @@ import "../Constants.sol"; import "./BRC20.sol"; library Sats { - function getTokenName() internal pure returns (string memory) { - return "sats"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); ranges[0] = 0 * Constants.decimals_factor; @@ -40,8 +36,4 @@ library Sats { ranges[8] = 6000000000 * Constants.decimals_factor; return ranges; } - - function getTokenNetworks() internal pure returns (uint32[] memory) { - return BRC20.getDefaultTokenNetworks(); - } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Ada.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Ada.sol index 36e21a30bc..ae8b78b35b 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Ada.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Ada.sol @@ -19,19 +19,8 @@ pragma solidity ^0.8.8; import "../../libraries/Identities.sol"; import "../Constants.sol"; -library Ada { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x3EE2200Efb3400fAbB9AacF31297cBdD1d435D47"; - } - - function getTokenEthereumAddress() internal pure returns (string memory) { - return ""; - } - - function getTokenName() internal pure returns (string memory) { - return "ada"; - } +library Ada { function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](7); ranges[0] = 0 * Constants.decimals_factor; @@ -44,10 +33,12 @@ library Ada { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory networks = new TokenInfo[](1); + networks[0] = TokenInfo( + Web3Networks.Bsc, + "0x3EE2200Efb3400fAbB9AacF31297cBdD1d435D47" + ); return networks; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Amp.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Amp.sol index 71547c6643..22e70864fa 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Amp.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Amp.sol @@ -21,18 +21,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Amp { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xff20817765cb7f73d4bde2e66e067e58d11095c2"; - } - - function getTokenName() internal pure returns (string memory) { - return "amp"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +36,13 @@ library Amp { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory networks = new TokenInfo[](1); + networks[0] = TokenInfo( + Web3Networks.Ethereum, + "0xff20817765cb7f73d4bde2e66e067e58d11095c2" + ); return networks; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Atom.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Atom.sol index 7b3680c958..1aab28b818 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Atom.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Atom.sol @@ -22,18 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Atom { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x0eb3a705fc54725037cc9e008bdede697f62f335"; - } - - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x8D983cb9388EaC77af0474fA441C4815500Cb7BB"; - } - - function getTokenName() internal pure returns (string memory) { - return "atom"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); ranges[0] = 0 * Constants.decimals_factor; @@ -45,11 +33,17 @@ library Atom { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory networks = new TokenInfo[](2); + networks[0] = TokenInfo( + Web3Networks.Ethereum, + "0x8D983cb9388EaC77af0474fA441C4815500Cb7BB" + ); + networks[1] = TokenInfo( + Web3Networks.Bsc, + "0x0eb3a705fc54725037cc9e008bdede697f62f335" + ); return networks; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bch.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bch.sol index b5e00e0238..71d352cb1c 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bch.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bch.sol @@ -22,17 +22,6 @@ import "../Constants.sol"; import "../../libraries/Identities.sol"; library Bch { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x8fF795a6F4D97E7887C79beA79aba5cc76444aDf"; - } - - function getTokenEthereumAddress() internal pure returns (string memory) { - return ""; - } - function getTokenName() internal pure returns (string memory) { - return "bch"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); @@ -49,10 +38,18 @@ library Bch { return ranges; } function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; + uint32[] memory networks = new uint32[](1); + networks[0] = Web3Networks.Bsc; + + return networks; + } + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory networks = new TokenInfo[](1); + networks[0] = TokenInfo( + Web3Networks.Bsc, + "0x8fF795a6F4D97E7887C79beA79aba5cc76444aDf" + ); return networks; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bean.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bean.sol index df88fe1494..b1f2062f79 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bean.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bean.sol @@ -22,15 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Bean { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x07da81e9a684ab87fad7206b3bc8d0866f48cc7c"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xba7b9936a965fac23bb7a8190364fa60622b3cff"; - } - function getTokenName() internal pure returns (string memory) { - return "bean"; - } function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](5); ranges[0] = 0 * Constants.decimals_factor; @@ -41,11 +32,17 @@ library Bean { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory networks = new TokenInfo[](2); + networks[0] = TokenInfo( + Web3Networks.Bsc, + "0x07da81e9a684ab87fad7206b3bc8d0866f48cc7c" + ); + networks[1] = TokenInfo( + Web3Networks.Ethereum, + "0xba7b9936a965fac23bb7a8190364fa60622b3cff" + ); return networks; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bnb.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bnb.sol index 9c5a523d86..883ed12a07 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bnb.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Bnb.sol @@ -22,16 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Bnb { - function getTokenBscAddress() internal pure returns (string memory) { - return "Native Token"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xb8c77482e45f1f44de1745f52c74426c631bdd52"; - } - function getTokenName() internal pure returns (string memory) { - return "bnb"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -47,11 +37,14 @@ library Bnb { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory networks = new TokenInfo[](2); + networks[0] = TokenInfo(Web3Networks.Bsc, "Native Token"); + networks[1] = TokenInfo( + Web3Networks.Ethereum, + "0xb8c77482e45f1f44de1745f52c74426c631bdd52" + ); return networks; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Comp.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Comp.sol index 0d3d105b84..9837077cc4 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Comp.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Comp.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Comp { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xc00e94cb662c3520282e6f5717214004a7f26888"; - } - - function getTokenName() internal pure returns (string memory) { - return "comp"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,14 @@ library Comp { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0xc00e94cb662c3520282e6f5717214004a7f26888" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Cro.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Cro.sol index fbbdc70329..a3f3cdd492 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Cro.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Cro.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Cro { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b"; - } - - function getTokenName() internal pure returns (string memory) { - return "cro"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](7); ranges[0] = 0 * Constants.decimals_factor; @@ -45,11 +34,17 @@ library Cro { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory networks = new TokenInfo[](2); + networks[0] = TokenInfo( + Web3Networks.Ethereum, + "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b" + ); + networks[1] = TokenInfo( + Web3Networks.Solana, + "DvjMYMVeXgKxaixGKpzQThLoG98nc7HSU7eanzsdCboA" + ); return networks; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Crv.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Crv.sol index d994331a1c..70a3df533e 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Crv.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Crv.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Crv { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xdac17f958d2ee523a2206206994597c13d831ec7"; - } - - function getTokenName() internal pure returns (string memory) { - return "crv"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,14 @@ library Crv { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0xdac17f958d2ee523a2206206994597c13d831ec7" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Cvx.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Cvx.sol index dace7238e4..29c305fe9f 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Cvx.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Cvx.sol @@ -22,16 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Cvx { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b"; - } - function getTokenName() internal pure returns (string memory) { - return "cvx"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -47,11 +37,14 @@ library Cvx { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Dai.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Dai.sol index 3ba6f18939..312190d213 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Dai.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Dai.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Dai { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x6b175474e89094c44da98b954eedeac495271d0f"; - } - - function getTokenName() internal pure returns (string memory) { - return "dai"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); ranges[0] = 0 * Constants.decimals_factor; @@ -47,11 +36,22 @@ library Dai { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](3); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x6b175474e89094c44da98b954eedeac495271d0f" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3" + ); + tokenInfoList[2] = TokenInfo( + Web3Networks.Solana, + "EjmyN6qEC1Tf1JxiG1ae7UTJhUxSwk1TCWNWqxWV4J6o" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Doge.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Doge.sol index 8e34521a69..4d57e9adde 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Doge.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Doge.sol @@ -21,17 +21,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Doge { - function getTokenBscAddress() internal pure returns (string memory) { - return "0xba2ae424d960c26247dd6c32edc70b295c744c43"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return ""; - } - - function getTokenName() internal pure returns (string memory) { - return "doge"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](7); ranges[0] = 0 * Constants.decimals_factor; @@ -44,11 +33,13 @@ library Doge { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory networks = new TokenInfo[](1); + networks[0] = TokenInfo( + Web3Networks.Bsc, + "0xba2ae424d960c26247dd6c32edc70b295c744c43" + ); return networks; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Dydx.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Dydx.sol index ade6482c90..44643a3050 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Dydx.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Dydx.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Dydx { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x92d6c1e31e14520e676a687f0a93788b716beff5"; - } - - function getTokenName() internal pure returns (string memory) { - return "dydx"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,14 @@ library Dydx { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x92d6c1e31e14520e676a687f0a93788b716beff5" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Etc.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Etc.sol index 6afa9e119c..8d75ca8913 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Etc.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Etc.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Etc { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x3d6545b08693dae087e957cb1180ee38b9e3c25e"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return ""; - } - - function getTokenName() internal pure returns (string memory) { - return "etc"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); ranges[0] = 0 * Constants.decimals_factor; @@ -44,11 +33,13 @@ library Etc { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Bsc, + "0x3d6545b08693dae087e957cb1180ee38b9e3c25e" + ); + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Eth.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Eth.sol index 04c04d1b9f..790ee62235 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Eth.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Eth.sol @@ -19,19 +19,8 @@ pragma solidity ^0.8.8; import "../../libraries/Identities.sol"; - +import "../Constants.sol"; library Eth { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x2170ed0880ac9a755fd29b2688956bd959f933f8"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "Native Token"; - } - - function getTokenName() internal pure returns (string memory) { - return "eth"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); @@ -50,11 +39,15 @@ library Eth { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo(Web3Networks.Ethereum, "Native Token"); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0x2170ed0880ac9a755fd29b2688956bd959f933f8" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Fil.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Fil.sol index 66f0187011..96cacf572e 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Fil.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Fil.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Fil { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x0d8ce2a99bb6e3b7db580ed848240e4a0f9ae153"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return ""; - } - - function getTokenName() internal pure returns (string memory) { - return "fil"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); ranges[0] = 0 * Constants.decimals_factor; @@ -44,11 +33,14 @@ library Fil { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Bsc, + "0x0d8ce2a99bb6e3b7db580ed848240e4a0f9ae153" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Grt.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Grt.sol index 488afad488..9e98958be9 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Grt.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Grt.sol @@ -21,17 +21,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Grt { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x52ce071bd9b1c4b00a0b92d298c512478cad67e8"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xc944e90c64b2c07662a292be6244bdf05cda44a7"; - } - - function getTokenName() internal pure returns (string memory) { - return "grt"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -47,11 +36,18 @@ library Grt { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0xc944e90c64b2c07662a292be6244bdf05cda44a7" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0x52ce071bd9b1c4b00a0b92d298c512478cad67e8" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Gtc.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Gtc.sol index 2e7e3f2ac9..2adf3e89fa 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Gtc.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Gtc.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Gtc { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xde30da39c46104798bb5aa3fe8b9e0e1f348163f"; - } - - function getTokenName() internal pure returns (string memory) { - return "gtc"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,14 @@ library Gtc { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0xde30da39c46104798bb5aa3fe8b9e0e1f348163f" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Gusd.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Gusd.sol index fdb4e12302..b4f3ae0518 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Gusd.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Gusd.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Gusd { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd"; - } - - function getTokenName() internal pure returns (string memory) { - return "gusd"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,14 @@ library Gusd { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Imx.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Imx.sol index bd03d62f2f..d541d914c3 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Imx.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Imx.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Imx { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xf57e7e7c23978c3caec3c3548e3d615c346e79ff"; - } - - function getTokenName() internal pure returns (string memory) { - return "imx"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); ranges[0] = 0 * Constants.decimals_factor; @@ -46,11 +35,14 @@ library Imx { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0xf57e7e7c23978c3caec3c3548e3d615c346e79ff" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Inj.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Inj.sol index fd39b68c89..ff7066a3b1 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Inj.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Inj.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Inj { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b"; - } - - function getTokenName() internal pure returns (string memory) { - return "inj"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); ranges[0] = 0 * Constants.decimals_factor; @@ -44,11 +33,14 @@ library Inj { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Leo.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Leo.sol index 6de696e0af..b0b5b87a83 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Leo.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Leo.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Leo { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x2af5d2ad76741191d15dfe7bf6ac92d4bd912ca3"; - } - - function getTokenName() internal pure returns (string memory) { - return "leo"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); ranges[0] = 0 * Constants.decimals_factor; @@ -44,11 +33,13 @@ library Leo { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x2af5d2ad76741191d15dfe7bf6ac92d4bd912ca3" + ); + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Link.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Link.sol index b66846b83a..7381aa18e0 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Link.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Link.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Link { - function getTokenBscAddress() internal pure returns (string memory) { - return "0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x514910771af9ca656af840dff83e8264ecf986ca"; - } - - function getTokenName() internal pure returns (string memory) { - return "link"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,17 @@ library Link { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Bsc, + "0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Ethereum, + "0x514910771af9ca656af840dff83e8264ecf986ca" + ); + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Lit.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Lit.sol index 955bbd1744..b56d82d0f4 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Lit.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Lit.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Lit { - function getTokenBscAddress() internal pure returns (string memory) { - return "0xb59490ab09a0f526cc7305822ac65f2ab12f9723"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xb59490ab09a0f526cc7305822ac65f2ab12f9723"; - } - - function getTokenName() internal pure returns (string memory) { - return "lit"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,18 @@ library Lit { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Bsc, + "0xb59490ab09a0f526cc7305822ac65f2ab12f9723" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Ethereum, + "0xb59490ab09a0f526cc7305822ac65f2ab12f9723" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Matic.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Matic.sol index c6ca4f0993..3ffe1a7da2 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Matic.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Matic.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Matic { - function getTokenBscAddress() internal pure returns (string memory) { - return "0xcc42724c6683b7e57334c4e856f4c9965ed682bd"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0"; - } - - function getTokenName() internal pure returns (string memory) { - return "matic"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,18 @@ library Matic { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Bsc, + "0xcc42724c6683b7e57334c4e856f4c9965ed682bd" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Ethereum, + "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Mcrt.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Mcrt.sol index 47e8e76c35..06679c145e 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Mcrt.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Mcrt.sol @@ -22,16 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Mcrt { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x4b8285aB433D8f69CB48d5Ad62b415ed1a221e4f"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xde16ce60804a881e9f8c4ebb3824646edecd478d"; - } - function getTokenName() internal pure returns (string memory) { - return "mcrt"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](6); ranges[0] = 0 * Constants.decimals_factor; @@ -43,11 +33,21 @@ library Mcrt { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory networks = new TokenInfo[](3); + networks[0] = TokenInfo( + Web3Networks.Ethereum, + "0xde16ce60804a881e9f8c4ebb3824646edecd478d" + ); + networks[1] = TokenInfo( + Web3Networks.Bsc, + "0x4b8285aB433D8f69CB48d5Ad62b415ed1a221e4f" + ); + networks[2] = TokenInfo( + Web3Networks.Solana, + "FADm4QuSUF1K526LvTjvbJjKzeeipP6bj5bSzp3r6ipq" + ); return networks; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Nfp.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Nfp.sol index 6c726f56c0..15ea59bc90 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Nfp.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Nfp.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Nfp { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x75e8ddb518bb757b4282cd5b83bb70d4101d12fb"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return ""; - } - - function getTokenName() internal pure returns (string memory) { - return "nfp"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,14 @@ library Nfp { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Bsc, + "0x75e8ddb518bb757b4282cd5b83bb70d4101d12fb" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/People.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/People.sol index 63d24c437c..2d1e319655 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/People.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/People.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library People { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x7a58c0be72be218b41c608b7fe7c5bb630736c71"; - } - - function getTokenName() internal pure returns (string memory) { - return "people"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,14 @@ library People { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x7a58c0be72be218b41c608b7fe7c5bb630736c71" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Shib.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Shib.sol index 03450855ce..19f3bbc133 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Shib.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Shib.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Shib { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce"; - } - - function getTokenName() internal pure returns (string memory) { - return "shib"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](8); ranges[0] = 0 * Constants.decimals_factor; @@ -46,11 +35,13 @@ library Shib { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce" + ); + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Sol.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Sol.sol index 79a69b85d7..cebf725c19 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Sol.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Sol.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Sol { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x570a5d26f7765ecb712c0924e4de545b89fd43df"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x5288738df1aeb0894713de903e1d0c001eeb7644"; - } - - function getTokenName() internal pure returns (string memory) { - return "sol"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,18 @@ library Sol { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](3); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x5288738df1aeb0894713de903e1d0c001eeb7644" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0x570a5d26f7765ecb712c0924e4de545b89fd43df" + ); + tokenInfoList[2] = TokenInfo(Web3Networks.Solana, "Native Token"); + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/SpaceId.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/SpaceId.sol index 8579e1f43a..61b6b7c7c3 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/SpaceId.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/SpaceId.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library SpaceId { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x2dff88a56767223a5529ea5960da7a3f5f766406"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x2dff88a56767223a5529ea5960da7a3f5f766406"; - } - - function getTokenName() internal pure returns (string memory) { - return "spaceid"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,17 @@ library SpaceId { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x2dff88a56767223a5529ea5960da7a3f5f766406" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0x2dff88a56767223a5529ea5960da7a3f5f766406" + ); + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Ton.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Ton.sol index 1bb62a4482..4b98effaab 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Ton.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Ton.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Ton { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x76a797a59ba2c17726896976b7b3747bfd1d220f"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x582d872a1b094fc48f5de31d3b73f2d9be47def1"; - } - - function getTokenName() internal pure returns (string memory) { - return "ton"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,17 @@ library Ton { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x582d872a1b094fc48f5de31d3b73f2d9be47def1" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0x76a797a59ba2c17726896976b7b3747bfd1d220f" + ); + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Trx.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Trx.sol index 0329108a72..53e97dabe0 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Trx.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Trx.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Trx { - function getTokenBscAddress() internal pure returns (string memory) { - return "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x50327c6c5a14dcade707abad2e27eb517df87ab5"; - } - - function getTokenName() internal pure returns (string memory) { - return "trx"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,17 @@ library Trx { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x50327c6c5a14dcade707abad2e27eb517df87ab5" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3" + ); + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Tusd.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Tusd.sol index cc26b63c58..b439da5001 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Tusd.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Tusd.sol @@ -22,16 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Tusd { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x40af3827F39D0EAcBF4A168f8D4ee67c121D11c9"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x0000000000085d4780b73119b644ae5ecd22b376"; - } - function getTokenName() internal pure returns (string memory) { - return "tusd"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -47,11 +37,18 @@ library Tusd { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x0000000000085d4780b73119b644ae5ecd22b376" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0x40af3827F39D0EAcBF4A168f8D4ee67c121D11c9" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Uni.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Uni.sol index 9a5c0ef047..3dd612746b 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Uni.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Uni.sol @@ -22,16 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Uni { - function getTokenBscAddress() internal pure returns (string memory) { - return "0xbf5140a22578168fd562dccf235e5d43a02ce9b1"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"; - } - function getTokenName() internal pure returns (string memory) { - return "uni"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); ranges[0] = 0 * Constants.decimals_factor; @@ -46,11 +36,22 @@ library Uni { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](3); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0xbf5140a22578168fd562dccf235e5d43a02ce9b1" + ); + tokenInfoList[2] = TokenInfo( + Web3Networks.Solana, + "8FU95xFJhUUkyyCLU13HSzDLs7oC4QZdXQHL6SCeab36" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdc.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdc.sol index 6fc3e503b3..a74f219901 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdc.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdc.sol @@ -6,16 +6,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Usdc { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"; - } - function getTokenName() internal pure returns (string memory) { - return "usdc"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](9); ranges[0] = 0 * Constants.decimals_factor; @@ -30,11 +20,22 @@ library Usdc { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](3); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d" + ); + tokenInfoList[2] = TokenInfo( + Web3Networks.Solana, + "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdd.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdd.sol index 8543184fd4..142d8750f0 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdd.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdd.sol @@ -22,16 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Usdd { - function getTokenBscAddress() internal pure returns (string memory) { - return "0xd17479997f34dd9156deef8f95a52d81d265be9c"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x0c10bf8fcb7bf5412187a595ab97a3609160b5c6"; - } - function getTokenName() internal pure returns (string memory) { - return "usdd"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -47,11 +37,18 @@ library Usdd { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x0c10bf8fcb7bf5412187a595ab97a3609160b5c6" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0xd17479997f34dd9156deef8f95a52d81d265be9c" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdt.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdt.sol index acdb77a198..9177d69361 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdt.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Usdt.sol @@ -22,17 +22,6 @@ import "../../libraries/Identities.sol"; import "../Constants.sol"; library Usdt { - function getTokenBscAddress() internal pure returns (string memory) { - return "0x55d398326f99059ff775485246999027b3197955"; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0xdac17f958d2ee523a2206206994597c13d831ec7"; - } - - function getTokenName() internal pure returns (string memory) { - return "usdt"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](10); ranges[0] = 0 * Constants.decimals_factor; @@ -48,11 +37,18 @@ library Usdt { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](2); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0xdac17f958d2ee523a2206206994597c13d831ec7" + ); + tokenInfoList[1] = TokenInfo( + Web3Networks.Bsc, + "0x55d398326f99059ff775485246999027b3197955" + ); + + return tokenInfoList; } } diff --git a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Wbtc.sol b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Wbtc.sol index c6e3600df7..6c29f3ff4c 100644 --- a/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Wbtc.sol +++ b/tee-worker/litentry/core/assertion-build/src/dynamic/contracts/token_holding_amount/erc20/Wbtc.sol @@ -19,18 +19,8 @@ pragma solidity ^0.8.8; import "../../libraries/Identities.sol"; - +import "../Constants.sol"; library Wbtc { - function getTokenBscAddress() internal pure returns (string memory) { - return ""; - } - function getTokenEthereumAddress() internal pure returns (string memory) { - return "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"; - } - function getTokenName() internal pure returns (string memory) { - return "wbtc"; - } - function getTokenRanges() internal pure returns (uint256[] memory) { uint256[] memory ranges = new uint256[](14); @@ -53,11 +43,14 @@ library Wbtc { return ranges; } - function getTokenNetworks() internal pure returns (uint32[] memory) { - uint32[] memory networks = new uint32[](2); - networks[0] = Web3Networks.Ethereum; - networks[1] = Web3Networks.Bsc; - return networks; + function getTokenInfo() internal pure returns (TokenInfo[] memory) { + TokenInfo[] memory tokenInfoList = new TokenInfo[](1); + tokenInfoList[0] = TokenInfo( + Web3Networks.Ethereum, + "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599" + ); + + return tokenInfoList; } }