Foresight Screen
Overview
Screen is a new namespace in the Foresight API that includes additional security checks for various kinds of unsigned transactions, including: regular transactions and ERC-4337 userOps.
The core simulation engine is the same one used in the Preview endpoint. It consist of your usual transaction simulation (what assets will move if the tx executes) contextualized with meaning so that the user understands exactly what they're about to do.
Not just what assets will move, but also why those assets will move. E.g. "You're about to claim 100 USDT in rewards".
Screen takes that enriched simulation up a notch, by also screening all of the main addresses involved (the destination contract / EOA, the token contracts that transfer value in the transaction) against an aggregated dataset of:
- OFAC-sanctioned addresses
- Malicious contract lists / repositories
- Scam / spam tokens lists
It also performs additional checks on the execution contract, including status of source code verification.
Finally, if an origin URL for the transaction provided, it will screen the URL for presence in an aggregated dataset of scam / phishing websites.
How to use these samples
This page will list sample payloads (all originating from real transactions that happened onchain at some point) that demonstrate the advanced capabilities of Foresight Screen.
A number of these examples include a blockNumber
so that the chain's state is recreated when performing the simulation, for demonstration purposes.
But in practice, you'll likely use these endpoints only against the latest state of the chain.
To try them yourself, simply head to the doc pages for screen and screen4337. Enter the chain, the query params (if any are listed) and send a POST request with JSON payload of the example, to recreate the transaction in the Screen simulator.
Unsafe transaction payloads
Approve spam token
Payload
{
"transaction": {
"from": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a",
"to": "0x635701cc5fe41fe8abd02aa74beb02e3540e9bb2",
"value": "0x0",
"data": "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
}
Query Params
{
"chain": "eth"
}
Response
{
"simulation": {
"txTypeVersion": 2,
"chain": "eth",
"accountAddress": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a",
"classificationData": {
"type": "approveToken",
"source": {
"type": "human"
},
"description": "Will approve malicious token to be spent by contract 0x0000.",
"protocol": {},
"sent": [
{
"action": "paidGas",
"from": {
"name": "This wallet",
"address": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a"
},
"to": {
"name": null,
"address": null
},
"amount": "0",
"token": {
"symbol": "ETH",
"name": "ETH",
"decimals": 18,
"address": "ETH"
}
}
],
"received": [],
"approved": {
"spender": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"amount": "Unlimited",
"token": {
"symbol": "Visit aBonusLP.com to claim $9283 in rewards",
"name": "# aBonusLP.com",
"decimals": 0,
"address": "0x635701CC5fE41FE8AbD02aa74Beb02e3540E9BB2"
}
}
},
"rawTransactionData": {
"fromAddress": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a",
"toAddress": "0x635701CC5fE41FE8AbD02aa74Beb02e3540E9BB2",
"gasUsed": 47172
}
},
"toAddress": {
"address": "0x635701CC5fE41FE8AbD02aa74Beb02e3540E9BB2",
"isContract": true,
"isVerified": false,
"isToken": true,
"risksDetected": [
{
"type": "maliciousContract"
}
]
},
"tokens": [
{
"address": "0x635701CC5fE41FE8AbD02aa74Beb02e3540E9BB2",
"symbol": "Visit aBonusLP.com to claim $9283 in rewards",
"name": "# aBonusLP.com",
"isVerified": false,
"risksDetected": [
{
"type": "maliciousContract"
}
]
}
]
}
Approve fake USDT token
Payload
{
"transaction": {
"from": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a",
"to": "0x18b5751460b161223b434677202d96970f5f3931",
"value": "0x0",
"data": "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
}
Query Params
{
"chain": "eth"
}
Response
{
"simulation": {
"txTypeVersion": 2,
"chain": "eth",
"accountAddress": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a",
"classificationData": {
"type": "approveToken",
"source": {
"type": "human"
},
"description": "Will approve malicious token to be spent by contract 0x0000.",
"protocol": {},
"sent": [
{
"action": "paidGas",
"from": {
"name": "This wallet",
"address": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a"
},
"to": {
"name": null,
"address": null
},
"amount": "0",
"token": {
"symbol": "ETH",
"name": "ETH",
"decimals": 18,
"address": "ETH"
}
}
],
"received": [],
"approved": {
"spender": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"amount": "Unlimited",
"token": {
"symbol": "USDT",
"name": "Tether",
"decimals": 18,
"address": "0x18B5751460B161223b434677202d96970F5F3931"
}
}
},
"rawTransactionData": {
"fromAddress": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a",
"toAddress": "0x18B5751460B161223b434677202d96970F5F3931",
"gasUsed": 46406
}
},
"toAddress": {
"address": "0x18B5751460B161223b434677202d96970F5F3931",
"isContract": true,
"isVerified": true,
"isToken": true,
"risksDetected": [
{
"type": "maliciousContract"
}
]
},
"tokens": [
{
"address": "0x18B5751460B161223b434677202d96970F5F3931",
"symbol": "USDT",
"name": "Tether",
"isVerified": true,
"risksDetected": [
{
"type": "maliciousContract"
}
]
}
]
}
Tornado cash deposit
Payload
{
"transaction": {
"from": "0x09b5027eF3a3b7332EE90321E558baD9C4447AFA",
"to": "0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b",
"value": "0x0de0b6b3a7640000",
"data": "0x13d98d1300000000000000000000000047ce0c6ed5b0ce3d3a51fdb1c52dc66a7c3c293612fde592ffd065242435c4b559ef9e961c5146da5ff59df466f3c3dbf7aeb49600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000"
}
}
Query Params
{
"chain": "eth",
"blockNumber": 15173075
}
Response
{
"simulation": {
"txTypeVersion": 2,
"chain": "eth",
"accountAddress": "0x09b5027eF3a3b7332EE90321E558baD9C4447AFA",
"classificationData": {
"type": "depositToExchange",
"source": {
"type": "human"
},
"description": "Will deposit 1 ETH.",
"protocol": {},
"sent": [
{
"action": "deposited",
"from": {
"name": "Tx Initiator (this wallet)",
"address": "0x09b5027eF3a3b7332EE90321E558baD9C4447AFA"
},
"to": {
"name": "Tornado.Cash: Router",
"address": "0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b"
},
"amount": "1",
"token": {
"symbol": "ETH",
"name": "ETH",
"decimals": 18,
"address": "ETH"
}
},
{
"action": "paidGas",
"from": {
"name": "This wallet",
"address": "0x09b5027eF3a3b7332EE90321E558baD9C4447AFA"
},
"to": {
"name": null,
"address": null
},
"amount": "0",
"token": {
"symbol": "ETH",
"name": "ETH",
"decimals": 18,
"address": "ETH"
}
}
],
"received": []
},
"rawTransactionData": {
"fromAddress": "0x09b5027eF3a3b7332EE90321E558baD9C4447AFA",
"toAddress": "0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b",
"gasUsed": 924652
}
},
"toAddress": {
"address": "0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b",
"isContract": true,
"isVerified": true,
"isToken": false,
"risksDetected": [
{
"type": "OFAC"
}
]
},
"tokens": []
}
Phishing contract with bad origin URL
Payload
{
"transaction": {
"from": "0xF6b0FD263e417d017219E18902A44Edd7D0aD4A0",
"to": "0x0000626d6DC72989e3809920C67D01a7fe030000",
"value": "0x0db09a5fd78e690",
"data": "0x1e83409a0000000000000000000000006a0b8b5fbc29e4c525bd699be34eefd0c341d256"
}
}
Query Params
{
"chain": "eth",
"blockNumber": 18317718,
"originUrl": "https://phantom-airdrop.com"
}
Response
{
"simulation": {
"txTypeVersion": 2,
"chain": "eth",
"accountAddress": "0xF6b0FD263e417d017219E18902A44Edd7D0aD4A0",
"classificationData": {
"type": "unclassified",
"source": {
"type": null
},
"description": "Will call function 'claim' on malicious contract 0x0000.",
"protocol": {},
"sent": [
{
"action": "sent",
"from": {
"name": "This wallet",
"address": "0xF6b0FD263e417d017219E18902A44Edd7D0aD4A0"
},
"to": {
"name": null,
"address": "0x0000626d6DC72989e3809920C67D01a7fe030000"
},
"amount": "0.06165362842644648",
"token": {
"symbol": "ETH",
"name": "ETH",
"decimals": 18,
"address": "ETH"
}
},
{
"action": "paidGas",
"from": {
"name": "This wallet",
"address": "0xF6b0FD263e417d017219E18902A44Edd7D0aD4A0"
},
"to": {
"name": null,
"address": null
},
"amount": "0",
"token": {
"symbol": "ETH",
"name": "ETH",
"decimals": 18,
"address": "ETH"
}
}
],
"received": []
},
"rawTransactionData": {
"fromAddress": "0xF6b0FD263e417d017219E18902A44Edd7D0aD4A0",
"toAddress": "0x0000626d6DC72989e3809920C67D01a7fe030000",
"gasUsed": 67645
}
},
"toAddress": {
"address": "0x0000626d6DC72989e3809920C67D01a7fe030000",
"isContract": true,
"isVerified": false,
"isToken": false,
"risksDetected": [
{
"type": "badActor"
},
{
"type": "maliciousContract"
}
]
},
"tokens": [],
"url": {
"domain": "phantom-airdrop.com",
"risksDetected": [
{
"type": "blacklisted"
}
]
}
}
Bybit hack initial transaction
Payload
{
"transaction": {
"from": "0x1Db92e2EeBC8E0c075a02BeA49a2935BcD2dFCF4",
"to": "0x96221423681A6d52E184D440a8eFCEbB105C7242",
"data": "0xa9059cbb000000000000000000000000bdd077f651ebe7f7b3ce16fe5f2b025be29695160000000000000000000000000000000000000000000000000000000000000000",
"value": "0x"
}
}
Query Params
{
"chain": "eth",
"blockNumber": 21895237
}
Response
{
"simulation": {
"txTypeVersion": 2,
"chain": "eth",
"accountAddress": "0x1Db92e2EeBC8E0c075a02BeA49a2935BcD2dFCF4",
"classificationData": {
"type": "unclassified",
"source": {
"type": null
},
"description": "Will call function 'transfer' on malicious contract 0x9622.",
"protocol": {},
"sent": [
{
"action": "paidGas",
"from": {
"name": "This wallet",
"address": "0x1Db92e2EeBC8E0c075a02BeA49a2935BcD2dFCF4"
},
"to": {
"name": null,
"address": null
},
"amount": "0",
"token": {
"symbol": "ETH",
"name": "ETH",
"decimals": 18,
"address": "ETH"
}
}
],
"received": []
},
"rawTransactionData": {
"fromAddress": "0x1Db92e2EeBC8E0c075a02BeA49a2935BcD2dFCF4",
"toAddress": "0x96221423681A6d52E184D440a8eFCEbB105C7242",
"gasUsed": 43919
}
},
"toAddress": {
"address": "0x96221423681A6d52E184D440a8eFCEbB105C7242",
"isContract": true,
"isVerified": false,
"isToken": false,
"risksDetected": [
{
"type": "badActor"
}
]
},
"tokens": []
}
Safe transaction payloads
Approve MKR
Payload
{
"transaction": {
"from": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a",
"to": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
"value": "0x0",
"data": "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
}
Query Params
{
"chain": "eth"
}
Response
{
"simulation": {
"txTypeVersion": 2,
"chain": "eth",
"accountAddress": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a",
"classificationData": {
"type": "approveToken",
"source": {
"type": "human"
},
"description": "Will approve MKR for trade by 0x0000.",
"protocol": {},
"sent": [
{
"action": "paidGas",
"from": {
"name": "This wallet",
"address": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a"
},
"to": {
"name": null,
"address": null
},
"amount": "0",
"token": {
"symbol": "ETH",
"name": "ETH",
"decimals": 18,
"address": "ETH"
}
}
],
"received": [],
"approved": {
"spender": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"amount": "Unlimited",
"token": {
"symbol": "MKR",
"name": "Maker",
"decimals": 18,
"address": "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2"
}
}
},
"rawTransactionData": {
"fromAddress": "0xb587526953Ad321C1aB2eA26F7311d2aA1A98a4a",
"toAddress": "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",
"gasUsed": 48613
}
},
"toAddress": {
"address": "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",
"isContract": true,
"isVerified": true,
"isToken": true,
"risksDetected": [
{
"type": "tokenAdminPrivileges"
}
]
},
"tokens": [
{
"address": "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",
"symbol": "MKR",
"name": "Maker",
"isVerified": true,
"risksDetected": [
{
"type": "tokenAdminPrivileges"
}
]
}
]
}
Repay Loan
Payload
{
"transaction": {
"from": "0xA976eA51b9ba3232706aF125a92e32788Dc08Ddc",
"to": "0x4e59541306910aD6dC1daC0AC9dFB29bD9F15c67",
"value": "0x0",
"data": "0x37671f93000000000000000000000000000000000000000000000000553920baefe6ba20000000000000000000000000a976ea51b9ba3232706af125a92e32788dc08ddc000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000"
}
}
Query Params
{
"chain": "eth",
"blockNumber": 19829055,
"originUrl": "https://curve.fi"
}
Response
{
"simulation": {
"txTypeVersion": 2,
"chain": "eth",
"accountAddress": "0xA976eA51b9ba3232706aF125a92e32788Dc08Ddc",
"classificationData": {
"type": "repayLoan",
"source": {
"type": "human"
},
"description": "Will repay 6.14 crvUSD.",
"protocol": {},
"sent": [
{
"action": "repaid",
"from": {
"name": "Initiator (this wallet)",
"address": "0xA976eA51b9ba3232706aF125a92e32788Dc08Ddc"
},
"to": {
"name": "Curve.fi: crvUSD Controller",
"address": "0x4e59541306910aD6dC1daC0AC9dFB29bD9F15c67"
},
"amount": "6.140365682479679488",
"token": {
"symbol": "crvUSD",
"name": "Curve.Fi USD Stablecoin",
"decimals": 18,
"address": "0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E"
}
},
{
"action": "paidGas",
"from": {
"name": "This wallet",
"address": "0xA976eA51b9ba3232706aF125a92e32788Dc08Ddc"
},
"to": {
"name": null,
"address": null
},
"amount": "0",
"token": {
"symbol": "ETH",
"name": "ETH",
"decimals": 18,
"address": "ETH"
}
}
],
"received": [
{
"action": "collateralWithdrawn",
"from": {
"name": "Curve.fi: LLAMMA - crvUSD AMM",
"address": "0xE0438Eb3703bF871E31Ce639bd351109c88666ea"
},
"to": {
"name": "Initiator (this wallet)",
"address": "0xA976eA51b9ba3232706aF125a92e32788Dc08Ddc"
},
"amount": "0.00024691",
"token": {
"symbol": "WBTC",
"name": "Wrapped BTC",
"decimals": 8,
"address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
}
}
]
},
"rawTransactionData": {
"fromAddress": "0xA976eA51b9ba3232706aF125a92e32788Dc08Ddc",
"toAddress": "0x4e59541306910aD6dC1daC0AC9dFB29bD9F15c67",
"gasUsed": 620543
}
},
"toAddress": {
"address": "0x4e59541306910aD6dC1daC0AC9dFB29bD9F15c67",
"isContract": true,
"isVerified": true,
"isToken": false,
"risksDetected": []
},
"tokens": [
{
"address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"symbol": "WBTC",
"name": "Wrapped BTC",
"isVerified": true,
"risksDetected": [
{
"type": "tokenAdminPrivileges"
}
]
},
{
"address": "0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E",
"symbol": "crvUSD",
"name": "Curve.Fi USD Stablecoin",
"isVerified": true,
"risksDetected": []
}
],
"url": {
"domain": "curve.fi",
"risksDetected": []
}
}
4337 - Claim NFT in rewards
Payload
{
"userOp": {
"sender": "0x2BfC7957Ec0d635B899Fe096126071Ae0352E432",
"nonce": 7,
"initCode": "0x",
"callData": "0x9e5d4c4900000000000000000000000002ff4cf1e5522bdc6f85ccb383dd1d2521460613000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024ce3f865f00000000000000000000000000000000000000000000000000000000000026fa00000000000000000000000000000000000000000000000000000000",
"callGasLimit": 143831,
"verificationGasLimit": 54805,
"preVerificationGas": 50504,
"maxFeePerGas": 54075000000,
"maxPriorityFeePerGas": 1575000000,
"signature": "0x1cf2dd8f4ea99f4b89a851b86c212069e842ed5f1f40b611ccdbcad5fdde60e70c612cba166b88363f7cc26a947cfc1a027c884b884972fdcc8eca7f659c3b441c",
"paymasterAndData": "0x000031dd6d9d3a133e663660b959162870d755d4000000000000000000000000760bed25663be6bae0a19d692f0571b9f5b97ac500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000041114c3167da726d96654d903fd5cdfb6b21df4755d12da3a17ede1c6a5a899e866ce92f860e603315f892d1f30369db97a6366e29b71b017119038fd2df4894401b00000000000000000000000000000000000000000000000000000000000000"
}
}
Query Params
{
"chain": "avalanche",
"blockNumber": 34886962
}
Response
{
"simulation": {
"txTypeVersion": 2,
"chain": "avalanche",
"accountAddress": "0x2BfC7957Ec0d635B899Fe096126071Ae0352E432",
"classificationData": {
"type": "claimRewards",
"source": {
"type": "human"
},
"description": "Will claim nargus's Collection #13000000000000000002 in rewards.",
"protocol": {},
"sent": [],
"received": [
{
"action": "rewardsReceived",
"amount": "1",
"nft": {
"name": "nargus's Collection",
"id": "13000000000000000002",
"symbol": "ZERO",
"address": "0x5C9D0140177b7d700cd7B93E6140918246E463b8"
},
"from": {
"name": null,
"address": "0x02FF4CF1E5522bdc6f85CCB383dD1D2521460613"
},
"to": {
"name": "This wallet",
"address": "0x2BfC7957Ec0d635B899Fe096126071Ae0352E432"
}
}
]
},
"rawTransactionData": {
"fromAddress": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
"toAddress": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"gasUsed": 249222
}
},
"toAddress": {
"address": "0x02FF4CF1E5522bdc6f85CCB383dD1D2521460613",
"isContract": true,
"isVerified": true,
"isToken": false,
"risksDetected": []
},
"tokens": [
{
"address": "0x5C9D0140177b7d700cd7B93E6140918246E463b8",
"symbol": "ZERO",
"name": "nargus's Collection",
"isVerified": true,
"risksDetected": []
}
]
}
4337 - Send token
Payload
{
"userOp": {
"sender": "0xE29b2b2ae6BF3377e8E1d7981E5d2A0874b86496",
"nonce": 3,
"initCode": "0x",
"callData": "0x51945447000000000000000000000000f17e65822b568b3903685a7c9f496cf7656cc6c20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000f5b99585e3b90f097c5ea27de9619195ef0f1996000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000",
"callGasLimit": 105426,
"verificationGasLimit": 102817,
"preVerificationGas": 46600,
"maxFeePerGas": 15037071767,
"maxPriorityFeePerGas": 15037071767,
"signature": "0x00000000fa004b0829d606ca0bf233e2b7e2100786926b335ef99d65462bd70a24bf3b6318e8104a1fc4ff5e574bd71a751f0b13d9ad59df1920524bc68c0be85978c92a1b",
"paymasterAndData": "0x67f21be69a16c314a0b7da537309b2f3addde031000000000000000000000000000000000000000000000000000000006546b9b40000000000000000000000000000000000000000000000000000000000000000e73e89471ac1bddde49bfb33053a4a90d562dda748ea57bf19b236bc40375de24790f2e8e7e7e30212ef88ae05723c524b632edd1b95d6e5275781085173214d1c"
}
}
Query Params
{
"chain": "eth",
"blockNumber": 18501346
}
Response
{
"simulation": {
"txTypeVersion": 2,
"chain": "eth",
"accountAddress": "0xE29b2b2ae6BF3377e8E1d7981E5d2A0874b86496",
"classificationData": {
"type": "sendToken",
"source": {
"type": "human"
},
"description": "Will send 0.10 BICO.",
"protocol": {},
"sent": [
{
"action": "sent",
"from": {
"name": "Proxy (EIP-1967 Transparent)",
"address": "0xE29b2b2ae6BF3377e8E1d7981E5d2A0874b86496"
},
"to": {
"name": "vipkazah.eth",
"address": "0xf5B99585e3b90f097c5Ea27de9619195eF0F1996"
},
"amount": "0.1",
"token": {
"symbol": "BICO",
"name": "Biconomy Token",
"decimals": 18,
"address": "0xF17e65822b568B3903685a7c9F496CF7656Cc6C2"
}
}
],
"received": []
},
"rawTransactionData": {
"fromAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"toAddress": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"gasUsed": 173351
}
},
"toAddress": {
"address": "0xF17e65822b568B3903685a7c9F496CF7656Cc6C2",
"isContract": true,
"isVerified": true,
"isToken": true,
"risksDetected": []
},
"tokens": [
{
"address": "0xF17e65822b568B3903685a7c9F496CF7656Cc6C2",
"symbol": "BICO",
"name": "Biconomy Token",
"isVerified": true,
"risksDetected": []
}
]
}
Updated 16 days ago