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

docs: small documentation fix for the multisig payment #209

Merged
merged 3 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions packages/docs/docs/guides/4-request-payment/1-multisig.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/**
* # Multisig payments for ERC20
* # Pay a request with a Multisig
*
* ## Pay through a proxy-contract with a multisig
* Imports
*
* It is planned to embedded the payment through mutlisig contracts in the payment-processor package. But, for now, it needs to be done manually.
*
* The imports you will need:
*/

import { Contract, ContractTransaction, Signer } from 'ethers';

// TODO export this from @requestnetwork/payment-processor
import {
encodeApproveErc20,
encodePayErc20Request,
Expand All @@ -16,7 +18,7 @@ import { getRequestPaymentValues } from '@requestnetwork/payment-processor/dist/
import { ClientTypes } from '@requestnetwork/types';

/**
* [Gnosis multisig](https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol) partial abi
* In this example, we will use the [Gnosis multisig](https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol). here its partial abi:
*/
const multisigAbi = [
'function submitTransaction(address _destination, uint _value, bytes _data) returns (uint)',
Expand All @@ -37,7 +39,8 @@ export const payEthWithMultisig = async (
};

/**
* ### Approve ERC20 spending
* ### Pay ERC20 request
* #### Approve ERC20 spending
*/
export const approveErc20WithMultisig = async (
request: ClientTypes.IRequestData,
Expand All @@ -50,7 +53,7 @@ export const approveErc20WithMultisig = async (
return multisigContract.submitTransaction(tokenAddress, 0, encodeApproveErc20(request, signer));
};
/**
* ### Pay ERC20 request
* #### Pay ERC20 request
*/
export const payErc20WithMultisig = async (
request: ClientTypes.IRequestData,
Expand Down
3 changes: 0 additions & 3 deletions packages/payment-processor/src/payment/erc20-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export async function payErc20ProxyRequest(
/**
* Encodes the call to pay a request through the ERC20 proxy contract, can be used with a Multisig contract.
* @param request request to pay
* @param multisigAddress multisig contract used to pay the request.
* @param signerOrProvider the Web3 provider, or signer. Defaults to window.ethereum.
* @param amount optionally, the amount to pay. Defaults to remaining amount of the request.
*/
Expand Down Expand Up @@ -94,7 +93,6 @@ export async function hasErc20Approval(
/**
* Processes the approval transaction of the targeted ERC20.
* @param request request to pay
* @param account account that will be used to pay the request
* @param provider the web3 provider. Defaults to Etherscan.
* @param overrides optionally, override default transaction values, like gas.
*/
Expand All @@ -118,7 +116,6 @@ export async function approveErc20(
/**
* Encodes the approval call, can be used with a Multisig contract.
* @param request the request to pay
* @param multisigAddress multisig contract for which to approve the ERC20
* @param signerOrProvider the Web3 provider, or signer. Defaults to window.ethereum.
*/
export function encodeApproveErc20(
Expand Down