Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENSToken added #43

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/__tests__/testTxHashes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ const testTxHashes = {
disperseToken: '0x4f32fc855204597a1c3bf5dad15e1636ca1a56bc920578a5b233c50ce0035853',
disperseEther: '0x0218f4ea6f52110919badb90636cc72563e5b80160f7fcf575df9dca1fe8eb9c',
},
ENSToken: {
approve: '0x069d6005adbfa59da8cb453e766661a9c29ed2c365b068db6e9b1ef2afdfba14',
claimTokens: '0x8cb22ce766007a82ef5a47d20a8ab12f3ce708c24542e5286668615b66c2d4ee',
delegate: '0x9e99d58aac7eb76a93007318373f5dbcdfe024f0077163024b8109048ced91c3',
delegateBySig: '0xddf3a077d1be6c5e868cf0d271180844bf5ca0af7163d151c4fc9cef1c9d5265',
permit: '0x5a7875f2b9385e12e98aa25ca791d9211fe5e593ccf737b0f74ad97c63baec40',
transfer: '0xdbef5114dab90c4fd3c47aa1c227826ceab6cad78da8dac6ddd1da79b8f49d87',
transferFrom: '0x50506ac62e736e71b30356695f71dd42bc048a731dc6aaed366f113471fdc1e0',
}
}

// test multiple roles for a single tx
Expand Down
162 changes: 162 additions & 0 deletions src/core/contractInterpreters/ENSToken_0xc183.json
Original file line number Diff line number Diff line change
@@ -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": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When tokens get transferred, the delegate gets changed too. We need an interpretation for that action also,

There's a section in the contribution docs regarding "multi-sided transaction"

"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"
}
}
}
}
}
1 change: 1 addition & 0 deletions src/core/contractInterpreters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const contractInterpreters = {
'0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F': require('./SushiSwap_0xd9e1.json'),
'0x2e2234b3a848f895a60b2071f90303cd02f7491d': require('./BatchTransfer_0x2e22.json'),
'0xd152f549545093347a162dce210e7293f1452150': require('./DisperseApp_0xd152.json'),
'0xc18360217d8f7ab5e7c516566761ea12ce7f9d72': require('./ENSToken_0xc183.json'),
// '0x0baccdd05a729ab8b56e09ef19c15f953e10885f': require('./NFTLoanFacilitator_0x0bac.json'), will add once filled out
}

Expand Down