---
# System prepended metadata

title: Bitminutes integration V1
tags: [specs]

---

###### tags: `specs`

# Bitminutes integration V1

Gooddollar is an ERC20/ERC677 on both Fuse and Ethereum networks.
Integration will be done over the Fuse network. Bitminutes will have the ability to convert G$s to other crypto via FuseSwap and use the Fuse bridge to transfer the crypto to binance/ethereum.

### Fuse
-  rpc: rpc.fuse.io
-  G$ contract: 0x495d133B938596C9984d462F007B676bDc57eCEC

### Integration
- ERC677 https://github.com/GoodDollar/GoodContracts/blob/master/contracts/token/ERC677/ERC677.sol

#### GoodDollar wallet:
- Gooddollar wallet users will perform a `transferAndCall(bitminutesAddress, amount, mobileNumberHash)`
Which is part of the ERC677 standard.

#### Bitminutes
- bitminutes will listen to the `Transfer(address indexed from, address indexed to, uint256 value, bytes data)` event
```
ethers.getContractAt("ERC677",g$addressOnFuse)
...request/listen events
```
- bitminutes will hold an index of keccak256(mobile) -> userid
- bitminutes will credit the mobile number hash in `data` with `value` G$s worth of bitminutes
- the official rate of G$ in DAI can be extracted from our subgraph via graphql query see example: https://reqbin.com/hihrptbj

#### Example
- perform transferAndCall txes through https://explorer.fuse.io/address/0x495d133B938596C9984d462F007B676bDc57eCEC/write-contract
- See transaction 0xb6764442fb8627599e1f2ade12cccb2e5db817c075df804440256bd415266407:
https://explorer.fuse.io/tx/0xb6764442fb8627599e1f2ade12cccb2e5db817c075df804440256bd415266407/logs
there are two Transfer events one the regular ERC20 event and the second is the ERC677 event with the `data` field. with the hex bytes value of `0x2b393732353037333139303933` when converted to UTF8 it equals `+972507319093`
![](https://i.imgur.com/bwdVHQb.png)


# Bitminutes integration V2

Using the new `GoodDollar vendor API` we can further automate the process.
Bitminutes will have a button/QR code on their website "Top up with G$s"
The button will open a a `Payment link` in the following format:


Once the user confirms the transaction the wallet will perform a `transferAndCall` with the `data` equal to the payment link data field.
The wallet will also perform an http POST callback to the bitminutes supplied callback url.


