From 7cb1bd1e9ac1170d8c389d4a9b04f939909b2d4e Mon Sep 17 00:00:00 2001 From: Maxi Date: Wed, 7 Sep 2022 21:37:13 -0300 Subject: [PATCH] ENSToken added --- src/__tests__/testTxHashes.ts | 9 + .../contractInterpreters/ENSToken_0xc183.json | 162 ++++++++++++++++++ src/core/contractInterpreters/index.ts | 1 + 3 files changed, 172 insertions(+) create mode 100644 src/core/contractInterpreters/ENSToken_0xc183.json diff --git a/src/__tests__/testTxHashes.ts b/src/__tests__/testTxHashes.ts index f812ff2..5730f6f 100644 --- a/src/__tests__/testTxHashes.ts +++ b/src/__tests__/testTxHashes.ts @@ -64,6 +64,15 @@ const testTxHashes = { redeem: '0xf1f6e7aff98668f78398871484bdcd50afc12a923029a6c025f8835a3ef4a936', }, GnosisSafe: {}, + ENSToken: { + approve: '0x069d6005adbfa59da8cb453e766661a9c29ed2c365b068db6e9b1ef2afdfba14', + claimTokens: '0x8cb22ce766007a82ef5a47d20a8ab12f3ce708c24542e5286668615b66c2d4ee', + delegate: '0x9e99d58aac7eb76a93007318373f5dbcdfe024f0077163024b8109048ced91c3', + delegateBySig: '0xddf3a077d1be6c5e868cf0d271180844bf5ca0af7163d151c4fc9cef1c9d5265', + permit: '0x5a7875f2b9385e12e98aa25ca791d9211fe5e593ccf737b0f74ad97c63baec40', + transfer: '0xdbef5114dab90c4fd3c47aa1c227826ceab6cad78da8dac6ddd1da79b8f49d87', + transferFrom: '0x50506ac62e736e71b30356695f71dd42bc048a731dc6aaed366f113471fdc1e0', + }, } // test multiple roles for a single tx diff --git a/src/core/contractInterpreters/ENSToken_0xc183.json b/src/core/contractInterpreters/ENSToken_0xc183.json new file mode 100644 index 0000000..7de51e5 --- /dev/null +++ b/src/core/contractInterpreters/ENSToken_0xc183.json @@ -0,0 +1,162 @@ +{ + "contractAddress": "0xc18360217d8f7ab5e7c516566761ea12ce7f9d72", + "contractOfficialName": "ENSToken", + "contractName": "ENSToken", + "entityName": "Ethereum Name Service", + "writeFunctions": { + "approve": { + "action": "approved", + "exampleDescriptionTemplate": "{userName} {action} {spender} as spender", + "exampleDescription": "Carlos.eth approved Alice.eth as spender", + "keywords": { + "spender": { + "key": "spender", + "filters": { + "eventName": "Approval", + "owner": "{userAddress}" + }, + "defaultValue": "unknown spender" + }, + "tokenName": { + "key": "contractSymbol", + "filters": { + "eventName": "Approval", + "owner": "{userAddress}" + }, + "defaultValue": "unknown" + } + } + }, + "claimTokens": { + "action": "claimed", + "exampleDescriptionTemplate": "{userName} {action} {amountClaimed} {tokenName}", + "exampleDescription": "Carlos.eth claimed 0.1 ENS", + "keywords": { + "amountClaimed": { + "key": "amount", + "filters": { + "eventName": "Claim", + "claimant": "{userAddress}" + }, + "defaultValue": "unknown" + }, + "tokenName": { + "key": "contractSymbol", + "filters": { + "eventName": "Transfer", + "to": "{userAddress}" + }, + "defaultValue": "unknown" + } + } + }, + "delegate": { + "action": "delegated", + "exampleDescriptionTemplate": "{userName} {action} to {toDelegate}", + "exampleDescription": "Carlos.eth delegated to Alice.eth", + "keywords": { + "toDelegate": { + "key": "toDelegate", + "filters": { + "eventName": "DelegateChanged" + }, + "defaultValue": "unknown" + } + } + }, + "delegateBySig": { + "action": "delegated", + "exampleDescriptionTemplate": "{userName} {action} to {toDelegate}", + "exampleDescription": "Carlos.eth delegated to Alice.eth", + "keywords": { + "toDelegate": { + "key": "toDelegate", + "filters": { + "eventName": "DelegateChanged" + }, + "defaultValue": "unknown" + } + } + }, + "permit": { + "action": "approved", + "exampleDescriptionTemplate": "{userName} {action} {spender} as spender", + "exampleDescription": "Carlos.eth approved Alice.eth as spender", + "keywords": { + "spender": { + "key": "spender", + "filters": { + "eventName": "Approval" + }, + "defaultValue": "unknown spender" + }, + "tokenName": { + "key": "contractSymbol", + "filters": { + "eventName": "Approval" + }, + "defaultValue": "unknown" + } + } + }, + "transfer": { + "action": "tranferred", + "exampleDescriptionTemplate": "{userName} {action} {amountToken} {tokenName} to {toUser}", + "exampleDescription": "Carlos.eth transferred 1 ENS to Alice.eth", + "keywords": { + "amountToken": { + "key": "value", + "filters": { + "eventName": "Transfer", + "from": "{userAddress}" + }, + "defaultValue": "unknown" + }, + "tokenName": { + "key": "contractSymbol", + "filters": { + "eventName": "Transfer", + "from": "{userAddress}" + }, + "defaultValue": "unknown" + }, + "toUser": { + "key": "to", + "filters": { + "eventName": "Transfer", + "from": "{userAddress}" + }, + "defaultValue": "unknown user" + } + } + }, + "transferFrom": { + "action": "tranferred", + "exampleDescriptionTemplate": "{userName} {action} {amountToken} {tokenName} to {toUser}", + "exampleDescription": "Carlos.eth transferred 1 ENS to Alice.eth", + "keywords": { + "amountToken": { + "key": "value", + "filters": { + "eventName": "Transfer" + }, + "defaultValue": "unknown" + }, + "tokenName": { + "key": "contractSymbol", + "filters": { + "eventName": "Transfer" + }, + "defaultValue": "unknown" + }, + "toUser": { + "key": "to", + "filters": { + "eventName": "Transfer" + }, + "defaultValue": "unknown user" + } + } + } + } +} diff --git a/src/core/contractInterpreters/index.ts b/src/core/contractInterpreters/index.ts index ebf2e09..6158fad 100644 --- a/src/core/contractInterpreters/index.ts +++ b/src/core/contractInterpreters/index.ts @@ -33,6 +33,7 @@ const contractInterpreters = { '0x7be8076f4ea4a4ad08075c2508e481d6c946d12b': require('./WyvernExchange_0x7be8.json'), '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2': require('./WETH9_0xc02a.json'), '0xf1f3ca6268f330fda08418db12171c3173ee39c9': require('./ZapperNFT_0xeabb.json'), + '0xc18360217d8f7ab5e7c516566761ea12ce7f9d72': require('./ENSToken_0xc183.json'), // '0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F': require('./SushiSwapRouter_0xd9e1.json'), // '0x0baccdd05a729ab8b56e09ef19c15f953e10885f': require('./NFTLoanFacilitator_0x0bac.json'), will add once filled out }