gnosis / gnosis/pm-js

Documentation about `deposit` and `approve`

Open
#116 0 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
JavaScript
Stars
64
Forks
20
PR merge metrics
No merged PRs in 30d

Description

In #109 from @srameshr came the following question:

> Also what does the following do?
>
> ```js
> [gnosis.etherToken.constructor, await gnosis.etherToken.deposit.sendTransaction({ value: depositValue })],
> [gnosis.etherToken.constructor, await gnosis.etherToken.approve.sendTransaction(event.address, depositValue)],
> [event.constructor, await event.buyAllOutcomes.sendTransaction(depositValue)],
> ```
>
> What is deposit, approve doing here? Assume intention of the user here is just to buy some tokens and nothing else.

Information answering that question should be included in the docs.

Contributor guide

No contributing guide indexed for this repository

Research direction

Use the quoted JavaScript sequence as the entry point and locate the documentation area covering token purchases. Explain what `deposit` and `approve` do in this sequence, including why they are used when the user only wants to buy tokens. Done means the docs answer the quoted question clearly and accurately.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.