Conversation
|
✔️ Deploy Preview for yield-protocol-info ready! 🔨 Explore the source changes: 702cb15 🔍 Inspect the deploy log: https://app.netlify.com/sites/yield-protocol-info/deploys/6152a54a94033b0008c8e436 😎 Browse the preview: https://deploy-preview-10--yield-protocol-info.netlify.app/ |
src/state/actions/contracts.ts
Outdated
|
|
||
| roleBytesSeen.forEach(async (hex_signature: any) => { | ||
| const promise = axios | ||
| .get('https://www.4byte.directory/api/v1/signatures/', { params: { hex_signature } }) |
There was a problem hiding this comment.
The way the 4byte.directory api currently works, we can only query 1 signature at a time. However, I have been in touch with the site maintainer and submitted a pr to allow for querying multiple hex_signatures in one call.
tbh - Since we are probably just going to use these on a handful of contracts where the fn names won't change I could see an argument for hardcoding these into the initial state and just fetching unrecognized ones -- or perhaps even ditching the fetching altogether
Anyways, it works for now
This adds a new tab "Roles" which is similar to Contracts except instead of displaying events, the current roles are displayed.
Added some logic in
updateEventsto determine the current roles. Basically just starts from the 1st event and iterates through, keeping track of who was granted/revoked which permissions.Added a new prop to the redux store under contracts called "RoleNames". This is populated by making a call to www.4bytes.com api and providing the role name argument from the Grant/RevokeRole events.