create account

Discord Escrow Bot Powered by STEEM Blockchain by reazuliqbal

View this thread on: hive.blogpeakd.comecency.com
· @reazuliqbal · (edited)
$110.45
Discord Escrow Bot Powered by STEEM Blockchain
![cover.png](https://ipfs.busy.org/ipfs/QmT4AJ39zk6Hgcu1fqqG59ixEL1ShGhQSEmHGcqnhqMX2L)


## Repository
https://github.com/CodeBull/EscrowBot

EscrowBot can be used to facilitate safe exchange of asset(s) between two members (both steem user) from Discord server using Steem Blockchain's escrow functionalities. This bot was inspired by my other project [BDCommunityDiscordBot](https://github.com/CodeBull/BDCommunityDiscordBot) and currently is in use on [STEEM.com.bd](https://discord.gg/6zWpukW) and [Steemit Bangladesh](https://discord.gg/aTBDUPF) Discord server.

## How it works?

A registered user can initiate any amount of STEEM or SBD escrow transfer to another registered user. Both will get a DM with escrow transaction preview and a SteemConnect link to initiate or approval. After that, the beneficiary can do the agreed task(s) (eg. transfer of fiat to the initiator) and notify the initiator. Initiator if satisfied can release the escrowed fund to the beneficiary or can dispute the transfer. If the initiator doesn't release after the job was done, the beneficiary can also dispute too. If disputed by any party, a *Dispute Handler* of that server will try to solve the issue(s) and decide who should get the escrowed fund.

This bot can be added on multiple servers, users need to register only once. When the bot is added to a new server, it will try to create *User* and *Dispute Handler* roles and automatically assign server owner as *Dispute Handler*. Each server can have different dispute handlers, they can only release escrows created from their respective servers.


## Commands

This bot has 3 levels of users. General User, Dispute Handlers, and Owner(s). Every registered user is General user and gets a predefined role. Server owner gets Dispute Handler role automatically.

### General User

`register [STEEM USERNAME]`

Links Discord account with Steem account.

`verify [STEEM USERNAME]`

Verifies if a Discord member owns the Steem account.

`balance [STEEM USERNAME]`

Shows STEEM and SBD the account holds.

`exchange [AMOUNT] [CURRENCY] [DISCORD MEMBER]`

Initiates an escrow transfer. Both parties will get a DM from the Bot with the respective link to initiate or approve.

`release [ESCROW ID]`

Generates a hot sign link to release the escrowed fund.

`dispute [ESCROW ID]`

Generates a hot sign link to dispute the transaction.

`status [ESCROW ID]`

Shows current status of the escrow from blockchain.

`price [AMOUNT] [CURRENCY]`

Shows the current price of X amount of Y currency in USD and BDT (can be changed).

### Dispute Handler

`agent-release [ESCROW ID] [DISCORD MEMBER]`

Release the escrowed fund to the Discord member (his/her steem username) after dispute resolution.

### Owner

`set [KEY] [VALUE]`

Saves or changes setting key and value in the database.

`invite`

Generate invite link to add the Bot on other servers.

`servers`

Generate a table with servers and their owners who are currently using the bot.


## Usage Examples

 - Peer to Peer STEEM/SBD to Fiat exchange
 - Exchange of service for STEEM/SBD
 - Valuables exchange between two peers
 - Safe domain transfer

and many more...

## Technologies

 - Node JS
 - Discord.js
 - Discord.js Commando
 - MongoDB
 - Mongoose
 - SteemConnect SDK
 - Steem JS

## Installation

 - Create a [Discord bot](https://discordapp.com/developers/applications/me) and grab its token.
 - Get your [Bitly API](https://dev.bitly.com/) token. Bitly is used to shorten long SteemConnect links as those look ugly in Discord DMs.
 - Rename `env.example` to `.env` and add you Bot token there
 - Make required changes to `.env` file
 - Change `OWNER_ID` in `src/config.js` to your Discord user ID.
 - Make other changed in `src/config.js` if needed.
 - Open terminal and type `npm install` to install all the dependencies.
 - Run `npm start` to start the bot in production mode or `npm run dev` to start in development mode.

You can run this bot on Heroku. I included Heorku `Procfile` too.

## Roadmap

 - Add more administration commands
 - Add statistics commands

## Contributing

When contributing to this repository, please first discuss the change you wish to make via issue or any other method with the (owner) of this repository. But you are free to make your own copy and use it.

## GitHub Account

https://github.com/CodeBull

<sup>Icon made by [Smashicons](https://www.flaticon.com/authors/smashicons) from [flaticon.com](https://www.flaticon.com) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/)</sup>
๐Ÿ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 4 others
๐Ÿ‘Ž  ,
properties (23)
authorreazuliqbal
permlinkdiscord-escrow-bot-powered-by-steem-blockchain
categoryutopian-io
json_metadata{"community":"busy","app":"steemit/0.1","format":"markdown","tags":["utopian-io","development","steem","busy","bot"],"links":["https://github.com/CodeBull/EscrowBot","https://github.com/CodeBull/BDCommunityDiscordBot","https://discord.gg/6zWpukW","https://discord.gg/aTBDUPF","https://discordapp.com/developers/applications/me","https://dev.bitly.com/","https://github.com/CodeBull","https://www.flaticon.com/authors/smashicons","https://www.flaticon.com","http://creativecommons.org/licenses/by/3.0/"],"image":["https://ipfs.busy.org/ipfs/QmT4AJ39zk6Hgcu1fqqG59ixEL1ShGhQSEmHGcqnhqMX2L"]}
created2018-07-11 08:14:36
last_update2018-07-12 10:06:09
depth0
children9
last_payout2018-07-18 08:14:36
cashout_time1969-12-31 23:59:59
total_payout_value84.059 HBD
curator_payout_value26.390 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,540
author_reputation61,984,354,446,410
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,258,070
net_rshares52,318,292,158,585
author_curate_reward""
vote details (70)
@codingdefined ·
$0.04
Thank you for your contribution. A great Bot for the BD Community. Though how you are doing a dispute fix, someone might have said they have transferred the amount whereas the other party might have said that they have not received the money.

Why are you using BITLY?, you should also explain that in your post.


Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2222232).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
๐Ÿ‘  , ,
properties (23)
authorcodingdefined
permlinkre-reazuliqbal-discord-escrow-bot-powered-by-steem-blockchain-20180712t095259246z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2222232","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-07-12 09:53:00
last_update2018-07-12 09:53:00
depth1
children1
last_payout2018-07-19 09:53:00
cashout_time1969-12-31 23:59:59
total_payout_value0.043 HBD
curator_payout_value0.001 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length804
author_reputation544,331,111,861,777
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,390,132
net_rshares21,193,754,640
author_curate_reward""
vote details (3)
@reazuliqbal ·
Yes, I should have talked about it. SteemConnect links are very long and *scary* for some users, also looks very bad in a Discord DM, That is the reason I am using Bitly.

In our servers we are asking for payment proofs (for fiat currency), some digital assets can be verified through blockchain e.g. SteemMonstesr cards.

Thank you for looking into it and for your valuable feedback. :)
properties (22)
authorreazuliqbal
permlinkre-codingdefined-re-reazuliqbal-discord-escrow-bot-powered-by-steem-blockchain-20180712t100004710z
categoryutopian-io
json_metadata{"community":"busy","app":"busy/2.5.2","format":"markdown","tags":["utopian-io"],"users":[],"links":[],"image":[]}
created2018-07-12 10:00:06
last_update2018-07-12 10:00:06
depth2
children0
last_payout2018-07-19 10:00:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length387
author_reputation61,984,354,446,410
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,390,794
net_rshares0
@duque ·
que buena informacion de mucho interรฉs y ayuda
properties (22)
authorduque
permlinkre-reazuliqbal-discord-escrow-bot-powered-by-steem-blockchain-20180711t081507876z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-07-11 08:15:51
last_update2018-07-11 08:15:51
depth1
children0
last_payout2018-07-18 08:15:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length46
author_reputation787,503,542,576
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,258,173
net_rshares0
@minnowsupport ·
<p>Congratulations!  This post has been upvoted from the communal account, @minnowsupport, by reazuliqbal from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows.  Please find us at the <a href="https://discord.gg/HYj4yvw"> Peace, Abundance, and Liberty Network (PALnet) Discord Channel</a>.  It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.</p> <p>If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=102530.639667%20VESTS">50SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=205303.639667%20VESTS">100SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=514303.639667%20VESTS">250SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=1025303.639667%20VESTS">500SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=2053030.639667%20VESTS">1000SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&amp;delegatee=minnowsupport&amp;vesting_shares=10253030.639667%20VESTS">5000SP</a>. <br><strong>Be sure to leave at least 50SP undelegated on your account.</strong></p>
properties (22)
authorminnowsupport
permlinkre-discord-escrow-bot-powered-by-steem-blockchain-20180716t190809z
categoryutopian-io
json_metadata"{"app": "beem/0.19.48"}"
created2018-07-16 19:08:09
last_update2018-07-16 19:08:09
depth1
children0
last_payout2018-07-23 19:08:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,707
author_reputation148,902,805,319,183
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,904,630
net_rshares0
@sneaky-ninja ·
re-reazuliqbal-discord-escrow-bot-powered-by-steem-blockchain-20180715t065454811z
![sneaky-ninja-sword-xs.jpg](https://steemitimages.com/DQmde7XXhkKjmxyqBbBPTwkaiuXXrtQe6qXoWmCDZL1nD2B/sneaky-ninja-sword-xs.jpg)
Sneaky Ninja Attack! You have just been defended with a 6.06% upvote!
I was summoned by @newbiegames. I have done their bidding and now I will vanish...

woosh
A portion of the proceeds from your bid was used in support of youarehope and tarc.

[Abuse Policy]( https://steemit.com/steemit/@sneaky-ninja/new-sneaky-ninja-abuse-policy-must-read-for-all-users)
[Rules]( https://steemit.com/steemit/@sneaky-ninja/sneaky-ninja-reminder-of-rules)
[How to use Sneaky Ninja]( https://steemit.com/steemit/@sneaky-ninja/reminder-how-to-use-sneaky-ninja)
[How it works]( https://steemit.com/steemit/@sneaky-ninja/sneaky-ninja-reminder-of-how-he-works-vote-worth-usd160-now)
[Victim of grumpycat?](https://steemit.com/we-resist/@firedream/resistance-started)
properties (22)
authorsneaky-ninja
permlinkre-reazuliqbal-discord-escrow-bot-powered-by-steem-blockchain-20180715t065454811z
categoryutopian-io
json_metadata{"app":"postpromoter/2.0.0"}
created2018-07-15 06:54:54
last_update2018-07-15 06:54:54
depth1
children0
last_payout2018-07-22 06:54:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length877
author_reputation6,929,108,306,933
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,728,097
net_rshares0
@steemhq ·
re-reazuliqbal-discord-escrow-bot-powered-by-steem-blockchain-20180712t032227188z
![YOU JUST GOT UPVOTED](https://www.steemhq.com/CommunityBotUpvote.png)

**Congratulations,**
you just received a 22.50% upvote from @steemhq - Community Bot!

***Wanna join and receive free upvotes yourself?***
Vote for `steemhq.witness` on [Steemit](https://steemit.com/~witnesses) or directly on [SteemConnect](https://steemconnect.com/sign/account-witness-vote?witness=steemhq.witness&approve=1 "This link will take you away from steemit.com") and join the [Community Witness](https://www.steemhq.com/witness).
![](https://steemitimages.com/0x0/https://www.steemhq.com/steemhq_voting.gif)

This service was brought to you by [SteemHQ.com](https://www.steemhq.com)
properties (22)
authorsteemhq
permlinkre-reazuliqbal-discord-escrow-bot-powered-by-steem-blockchain-20180712t032227188z
categoryutopian-io
json_metadata{"app":"communitybot/1.1.0"}
created2018-07-12 03:22:27
last_update2018-07-12 03:22:27
depth1
children0
last_payout2018-07-19 03:22:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length667
author_reputation4,219,992,220,673
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,359,141
net_rshares0
@trigabytesteemit ·
This is awesome! You are definitely thinking about the future with this type of creation. Are there any competitors for this type of escrow service or is this the first of its kind? I remember Ross #Ulbricht had something like this in place for Silk Road which was constantly dealing with shipping confirmations of tangible goods. Doe this just handle digital assets or can this escrow service be applied to the handling/transferring of physical goods purchased through #Steem ?
properties (22)
authortrigabytesteemit
permlinkre-reazuliqbal-discord-escrow-bot-powered-by-steem-blockchain-20180808t132356855z
categoryutopian-io
json_metadata{"tags":["utopian-io","ulbricht","steem"],"app":"steemit/0.1"}
created2018-08-08 13:23:57
last_update2018-08-08 13:23:57
depth1
children1
last_payout2018-08-15 13:23:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length478
author_reputation60,410,025,083
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,526,967
net_rshares0
@reazuliqbal ·
It could be the first if you are thinking about Steem blockchain and Discord. Its main purpose is to protect exchange of digital assets like STEEM/SBD, but I think you can extend it to support physical goods too.
properties (22)
authorreazuliqbal
permlinkre-trigabytesteemit-re-reazuliqbal-discord-escrow-bot-powered-by-steem-blockchain-20180808t132911387z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-08-08 13:29:18
last_update2018-08-08 13:29:18
depth2
children0
last_payout2018-08-15 13:29:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length212
author_reputation61,984,354,446,410
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id67,527,451
net_rshares0
@utopian-io ·
Hey @reazuliqbal
**Thanks for contributing on Utopian**.
Weโ€™re already looking forward to your next contribution!

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
๐Ÿ‘  
properties (23)
authorutopian-io
permlinkre-discord-escrow-bot-powered-by-steem-blockchain-20180712t095508z
categoryutopian-io
json_metadata"{"app": "beem/0.19.42"}"
created2018-07-12 09:55:09
last_update2018-07-12 09:55:09
depth1
children0
last_payout2018-07-19 09:55:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length303
author_reputation152,955,367,999,756
root_title"Discord Escrow Bot Powered by STEEM Blockchain"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,390,339
net_rshares5,073,842,492
author_curate_reward""
vote details (1)