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

fix: implement arbitrary notifications, update block ingestor hash #4167

Open
wants to merge 4 commits into
base: feat/3534-redo-arbitrary
Choose a base branch
from

Conversation

Nortsova
Copy link
Contributor

@Nortsova Nortsova commented Jan 23, 2025

Description

  • Implement notifications for arbitrary transactions

Testing

Important

Before testing:

  • Open block-ingestor branch: feat: send notifications for arbitrary transactions block-ingestor#321
  • Ensure that block-ingestor and cDapp have this variable in .env file: MAGICBELL_DEV_KEY=267869931 (the number should be the same for block-ingestor and cDapp)
  • Run App locally (npm run dev, node scripts/create-data.js, npm run frontend)
  • Stop block-ingestor in the docker desktop
  • Run block-ingestor: npm run dev --notifications

Step 1. Create Custom transaction action ("Manage Colony" -> "Custom transactions")
Step 2. Contract address 0xeF841fe1611ce41bFCf0265097EFaf50486F5111
ABI input:

[{"type":"constructor","payable":false,"inputs":[{"type":"string","name":"_name"},{"type":"string","name":"_symbol"},{"type":"uint8","name":"_decimals"}]},{"type":"event","anonymous":false,"name":"Approval","inputs":[{"type":"address","name":"src","indexed":true},{"type":"address","name":"guy","indexed":true},{"type":"uint256","name":"wad","indexed":false}]},{"type":"event","anonymous":false,"name":"Burn","inputs":[{"type":"address","name":"guy","indexed":true},{"type":"uint256","name":"wad","indexed":false}]},{"type":"event","anonymous":false,"name":"LogSetAuthority","inputs":[{"type":"address","name":"authority","indexed":true}]},{"type":"event","anonymous":false,"name":"LogSetOwner","inputs":[{"type":"address","name":"owner","indexed":true}]},{"type":"event","anonymous":false,"name":"MetaTransactionExecuted","inputs":[{"type":"address","name":"user","indexed":false},{"type":"address","name":"relayerAddress","indexed":false},{"type":"bytes","name":"functionSignature","indexed":false}]},{"type":"event","anonymous":false,"name":"Mint","inputs":[{"type":"address","name":"guy","indexed":true},{"type":"uint256","name":"wad","indexed":false}]},{"type":"event","anonymous":false,"name":"Transfer","inputs":[{"type":"address","name":"src","indexed":true},{"type":"address","name":"dst","indexed":true},{"type":"uint256","name":"wad","indexed":false}]},{"type":"function","name":"DOMAIN_SEPARATOR","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32"}]},{"type":"function","name":"PERMIT_TYPEHASH","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bytes32"}]},{"type":"function","name":"allowance","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"src"},{"type":"address","name":"guy"}],"outputs":[{"type":"uint256"}]},{"type":"function","name":"approve","constant":false,"payable":false,"inputs":[{"type":"address","name":"guy"},{"type":"uint256","name":"wad"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"authority","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address"}]},{"type":"function","name":"balanceOf","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"src"}],"outputs":[{"type":"uint256"}]},{"type":"function","name":"burn","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"wad"}],"outputs":[]},{"type":"function","name":"burn","constant":false,"payable":false,"inputs":[{"type":"address","name":"guy"},{"type":"uint256","name":"wad"}],"outputs":[]},{"type":"function","name":"decimals","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint8"}]},{"type":"function","name":"executeMetaTransaction","constant":false,"stateMutability":"payable","payable":true,"inputs":[{"type":"address","name":"_user"},{"type":"bytes","name":"_payload"},{"type":"bytes32","name":"_sigR"},{"type":"bytes32","name":"_sigS"},{"type":"uint8","name":"_sigV"}],"outputs":[{"type":"bytes"}]},{"type":"function","name":"getMetatransactionNonce","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"_user"}],"outputs":[{"type":"uint256","name":"nonce"}]},{"type":"function","name":"locked","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"bool"}]},{"type":"function","name":"mint","constant":false,"payable":false,"inputs":[{"type":"address","name":"guy"},{"type":"uint256","name":"wad"}],"outputs":[]},{"type":"function","name":"mint","constant":false,"payable":false,"inputs":[{"type":"uint256","name":"wad"}],"outputs":[]},{"type":"function","name":"name","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string"}]},{"type":"function","name":"nonces","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"_user"}],"outputs":[{"type":"uint256","name":"nonce"}]},{"type":"function","name":"owner","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"address"}]},{"type":"function","name":"permit","constant":false,"payable":false,"inputs":[{"type":"address","name":"owner"},{"type":"address","name":"spender"},{"type":"uint256","name":"value"},{"type":"uint256","name":"deadline"},{"type":"uint8","name":"v"},{"type":"bytes32","name":"r"},{"type":"bytes32","name":"s"}],"outputs":[]},{"type":"function","name":"setAuthority","constant":false,"payable":false,"inputs":[{"type":"address","name":"authority_"}],"outputs":[]},{"type":"function","name":"setOwner","constant":false,"payable":false,"inputs":[{"type":"address","name":"owner_"}],"outputs":[]},{"type":"function","name":"symbol","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string"}]},{"type":"function","name":"totalSupply","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256"}]},{"type":"function","name":"transfer","constant":false,"payable":false,"inputs":[{"type":"address","name":"dst"},{"type":"uint256","name":"wad"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"transferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"src"},{"type":"address","name":"dst"},{"type":"uint256","name":"wad"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"unlock","constant":false,"payable":false,"inputs":[],"outputs":[]},{"type":"function","name":"verify","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"_user"},{"type":"uint256","name":"_nonce"},{"type":"uint256","name":"_chainId"},{"type":"bytes","name":"_payload"},{"type":"bytes32","name":"_sigR"},{"type":"bytes32","name":"_sigS"},{"type":"uint8","name":"_sigV"}],"outputs":[{"type":"bool"}]}]

Step 3. Submit Action with Permissions
Step 4. Verify that you received a notification about Custom transaction being created:
image

Step 5. There is no need to test Reputation and Multi-sig decisions because all motions uses the same code, but you still can do a couple of tests there :)

image image

Resolves #3917

@Nortsova Nortsova requested a review from a team as a code owner January 23, 2025 13:25
@Nortsova Nortsova marked this pull request as draft January 23, 2025 13:25
@Nortsova Nortsova self-assigned this Jan 23, 2025
@Nortsova Nortsova marked this pull request as ready for review January 24, 2025 09:50
@Nortsova Nortsova force-pushed the feat/3534-redo-arbitrary branch from 9ae7042 to 184472a Compare January 24, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant