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

Designing A Tool For Forwarding Funds To A Function #1

Open
spm32 opened this issue May 2, 2019 · 20 comments
Open

Designing A Tool For Forwarding Funds To A Function #1

spm32 opened this issue May 2, 2019 · 20 comments

Comments

@spm32
Copy link

spm32 commented May 2, 2019

Task

Design a smart contract structure for the following task. Whether it’s one contract, or many, we’re looking for the most secure, extensible, and scalable architecture. This task below is what you are designing for.

User story

As a developer, we'd like the ability to specify a destination address and have that forward to a specific contract function.

Current behaviour

Currently, developers are required to specify a destination address. This is great for allowing their users to convert and deposit funds into their non-custodial wallet. Currently, developers users go through multiple steps to get the deposit into their wallet, and then to select purchase, execute the transaction and then wait for confirmation on-chain. What it misses is the ability to go straight to executing the function on our smart contract.

Wanted behaviour

We want a developer to build functionality that will allow other developers to:

  1. Specify a contract (Upload source/ABI)

  2. Returns known functions

  3. Specify the functions that they would like accessible.

  4. Deploy a contract which will execute a specific address forwarder for each function specified in step 3.

  5. Returns one or more transaction id's.

  6. Transactions confirm / Contracts are now setup to each individually execute a specific function.

Our purpose for this bounty is to simplify developer experiences working with our API. Ensuring that they can concentrate all their efforts on getting their project to market and/or serving their current users. We want a developer to build the functionality for Tool For Forwarding Funds To A Contract while adhering to our [feature-addition-guidelines]. Here are some more feature guidelines:

Extensibility.

Code Style.

Used establish patterns where applicable.

Generally Readable.

Tests: Testable? Good coverage?

Security/Defensiveness: Permission checks? Whitelisting? Exception handling?

Performance: Correct algorithms selected? Edge cases?

Definition of done

You have successfully completed this, when:

  1. Flowchart // Can be scribbled on a whiteboard. Just needs to be legible. Use this as a check-in point for the competition. Can deliver feedback if it’s the right direction, etc...
  2. Schema //
  3. Design explanation // Example breakdown (if helpful)
    Deliberately excluded & included with reasoning.
    Security concerns // Dependencies, technical implementation risks.
    Time to market // How fast can it be executed on now to implement, AND for other developers in the future. Remember we’re targeting developers, and want to cater for the slowest member of the pack. Aka new developers to the space.
    Target developer experience level // From 1-10. 1 being only use jsFiddle, 10 being Vitalik.

Submission

Please submit your work by making a pull request to the Github repository.

Supporting Information

The best design will accommodate compatibility with centralized API’s. If it were PayPal contract you’d find relevant to share account activity similar to the following:

GET requests examples

Accounts: Activity changes on user “ACCO-123”
Transfers: Updated status on the transfer “TRAN-123”
Payment Methods: Card Expired “PAYM-123”
Contacts: Lookup “CONT”.

Example request on a centralized API

 {  
     "source":"account:AC-WYUR7ZZ6UMU",
     "sourceCurrency":"USD",
     "sourceAmount":"5",
     "dest":"bitcoin:15CriXWTRoJmQdBzdikw6tEmSuwxMozWWq",
     "destCurrency":"BTC", 
     "message": "Payment for [email protected]",
     "autoConfirm":true  
   }

Transfer life-cycle overview if helpful:

Live example of similar exemplar can be found here.
@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 500.0 DAI (500.0 USD @ $1.0/DAI) attached to it as part of the sendwyre fund.

@gitcoinbot
Copy link

gitcoinbot commented May 3, 2019

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 1 month, 1 week from now.
Please review their action plans below:

1) e18r has been approved to start work.

I created an interaction diagram that sums up my understanding of the requirement. Please Check it out here.

  1. The user uploads her contract code to Sendwyre.
  2. Sendwyre deploys the main contract in the Ethereum blockchain.
  3. The user specifies a list of functions she wants associated with standalone Ethereum addresses.
  4. The Forwarding Tool uses the main contract's ABI to create one forward contract per accessible function.
  5. Each forward contract's default function will implement the same function declaration as the function it is forwarding to.
  6. The Forwarding Tool deploys the forward contracts and returns a list of their addresses.

Learn more on the Gitcoin Issue Details page.

@Skyge
Copy link

Skyge commented May 3, 2019

@ceresstation How can I try current behaviour.

@Skyge
Copy link

Skyge commented May 4, 2019

In order to provide a flowchart, I think I should know more details, so I think try current behavior is necessary.

@nickolasteixeira
Copy link
Contributor

Hi @Skyge - The fastest way to get started is to look at our Widget docs here. When you are on the page, scroll down and find one of the implementations. You'll see a JavaScript snippet of code. In that snippet, you'll see an object like so.

operation: { type: "debitcard", dest: "ethereum:0x98B031783d0efb1E65C4072C6576BaCa0736A912", sourceCurrency: "USD", destCurrency: "ETH", destAmount: 0.03 }

We want you to replace the dest value to another address that would allow you to forward funds to another function. Does that make sense?

Feel free to also check out our transfers API here. The same logic applies here. Under the dest value, you would input an address that would allow you to forward funds to a function.

@Skyge
Copy link

Skyge commented May 7, 2019

@nickolasteixeira Yeah, I understand your literal meaning, we need a tool to raplace dest value, but I am confused with Wanted behaviour

1. Specify a contract (Upload source/ABI)

2. Returns known functions

I am sorry, I can not find any contact with each other.

@e18r
Copy link

e18r commented May 10, 2019

Hi @ceresstation @nickolasteixeira @alexvotofuture, thank you for approving me to work on this issue. I will start working on this on Monday at around 14:00 UTC. Any feedback on my interaction diagram much appreciated.

@gitcoinbot
Copy link

@e18r Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@e18r
Copy link

e18r commented May 13, 2019

Working on it right now

@e18r
Copy link

e18r commented May 13, 2019

@ceresstation @nickolasteixeira Today I got acquainted with the application and the API. I created a test account and read the documentation. I already have a few ideas of how this could be done. Tomorrow I will start writing the deliverable.

@e18r
Copy link

e18r commented May 14, 2019

Today I created most of the document, including the diagrams. Tomorrow it will be ready.

@e18r
Copy link

e18r commented May 16, 2019

Hi @ceresstation @nickolasteixeira @alexvotofuture, please check out my work at #2. Thank you!

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 500.0 DAI (500.0 USD @ $1.0/DAI) has been submitted by:

  1. @e18r

@alexvotofuture please take a look at the submitted work:


@alexvotofuture
Copy link

Hey @e18r , thanks so much for submitting, and sorry for the long delay. We will be reviewing your submission with the Wyre team tomorrow.

@e18r
Copy link

e18r commented May 23, 2019

@alexvotofuture thank you so much for taking the time to review this. I really appreciate it :)

@MikeD123
Copy link

Just put some questions to your PR @e18r - If anyone else had any questions or points of confusion just let me know! 🙌

Hope everyone has had an awesome week 👌

@spm32
Copy link
Author

spm32 commented May 31, 2019

Hi @e18r have you had a chance to look into the comments Mike provided?

@e18r
Copy link

e18r commented May 31, 2019

Hello @ceresstation, I did. Please check out my response here.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 500.0 DAI (500.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @e18r.

@e18r
Copy link

e18r commented Jun 20, 2019

@alexvotofuture @ceresstation @MikeD123 @nickolasteixeira Thank you. Until next time.

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

No branches or pull requests

7 participants