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

Enhance server capabilities for miniwallet and sms callbacks #6

Closed
wants to merge 9 commits into from

Conversation

johnwhitton
Copy link
Collaborator

@johnwhitton johnwhitton commented Aug 17, 2022

This PR is to work on functionality documented in #5

TODO

Notes
Start of with just using an environment variable for Contract Address
Owners (not Operators) should be deploying AssetManager.sol
Enhance: deploy_AssetManager to save address and hash to a file (can be used by relayer, client and demo for instantiation)
Existing one-wallet deploy logic should be enhance to call getCode to ensure the contract is deployed (mainly for eth-ganache)
Change all GANACHE reference to loclanet
  • Develop User API's

    • Develop User API's for Deposit, withdraw and approve (using Request functionality)
    • Document the API's in Postman
    • Create a swagger ui for Local and testnet use
  • Add User Functionality to Client

    • Update the Client to include deposit, withdraw and approve functionality
  • Create Operator API's (transfer and pay)

  • Create Creator API's (transferRequest and billingRequest) should support multiple requests in one call

  • Creator Functionality

    • Integrate Creators (transfer and pay) functionality with SMS
    • Creator calls the creator (transferRequest and billingRequest) API's
    • Operator sends SMS to user to approve the transfer or payment
    • User approves via SMS which triggers a twilio webhook for the operator to execute the pay or transfer API
  • Additional development tasks

    • Configure the Twilio webhook to call the Creator API's
    • Deploy Testnet version with webhook functionality
  • Acceptance Criteria

    • All API's are documented (e.g. Postman)
    • Swagger Client running in Testnet
    • docs.modulo.com is updated
    • Complete end to end tests are written
    • End to End testing (client, server, miniwallet) of all user functions
    • API Testing (server, miniwallet) for all Operator Functions
    • API Testing (server miniwallet) for all Creator Functions

@johnwhitton
Copy link
Collaborator Author

Manual local deploy

ohnlaptop miniwallet (jw-server) $ npx hardhat deploy --network hardhatNode
Nothing to compile
No need to generate any newer typings.
✅ Generated documentation for 36 contracts
 ·-----------------|--------------|----------------·
 |  Contract Name  ·  Size (KiB)  ·  Change (KiB)  │
 ··················|··············|·················
 |  AssetManager   ·       9.131  ·                │
 ·-----------------|--------------|----------------·
operators: ["0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","0x90F79bf6EB2c4f870365E785982E1f101E93b906"]
AssetManager deployed to: 0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9
AssetManager Operator Threshold: 10
operatorCount : 3
Operator [0]: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
Operator [1]: 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
Operator [2]: 0x90F79bf6EB2c4f870365E785982E1f101E93b906
AssetManager Global User Auth Limit: 1000000.0
AssetManager Global User Auth Limit: 100000.0

@polymorpher
Copy link
Owner

It's insecure to rely on automatically managed contracts in deployment. We need set up our own proxy, understand the exact code within, and manage our own record and step-by-step calls during the use of proxy and follow-up contract upgrades.

There also should not be "User APIs". See comments in #5

I am not following Operator API or Creator API. I need more details to understand the "Creator Functionality". I am not sure whether it is needed. The documented flow in the Wiki envisions all setup performed at the client side. There should not be any (REST) API.

The current client and server do not support network switch so I don't think we need to concern testnet at this time

@polymorpher
Copy link
Owner

Can #7 be merged in with this? Alternatively can the mini-wallet functionalities be removed from this PR?

@johnwhitton johnwhitton mentioned this pull request Sep 1, 2022
4 tasks
@johnwhitton
Copy link
Collaborator Author

Closing this as work was completed under
#7 which created a separate miniserver and removed swagger
#8 which renamed AssetManager to MiniWallet and updated Approve functionality to allow payments

@johnwhitton johnwhitton closed this Sep 1, 2022
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.

2 participants