Giter Site home page Giter Site logo

relexdistributor's Introduction

Token Distributor

This application distributes Relex Life Token to other wallets from a user's owned wallet. It asks user to provide full path of a distribution spreadsheet in CSV format that has columns of data seperated by comma. The defintion of columns are shown and explained in the following example.

Example

An example of the content of a distribution spreadsheet in CSV format is shown as below.

[destination address],[quantity],[contract address],[source private key]
0x65513ecd11fd3a5b1fefdcc6a500b025008405a2,100000,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x555ee11fbddc0e49a9bab358a8941ad95ffdb48f,200000.123,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0xe08f0bccbca8192620259aa402b29f7b862575d3,300000,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x7ed638621dbb927c947b0ca064abd051cdc93124,12345.654,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x81b7e08f65bdf5648606c89998a9cc8164397647,65432,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x8a91de6b7625a1c0940f4dae084d864c3ce5fe0c,123456,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x65513ecd11fd3a5b1fefdcc6a500b025008405a2,98765.456789,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x555ee11fbddc0e49a9bab358a8941ad95ffdb48f,123,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x9e737dfc1da73c1c0a0c3ca43bb036966003c471,321,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x229115f344a13defba6470d61a3182b60c0d4979,4567.1234,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x63243370ed17a16a1c212b265b4514cbdce23e6f,12,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx
0x23a4cc796859203c5920a3c727c24b2aaf80f407,1.2,0x4a42d2c580f83dce404acad18dab26db11a1750e,c215231c3b5e8baa4f231e70bf0a981a4b0f8c974bebb3ba54ede4f27e2d0xxx

Compiling

To compile this application from the source code, you need to install .NET Core 2.1 SDK, which is available at [this link] (https://www.microsoft.com/net/download)

Deployment

This application is developed against Microsoft Azure Function App. To compile this application, you need to install .NET Core 2.1 Runtime, which is available at [this link] (https://www.microsoft.com/net/download) To deploy this application, you need to create an Azure account and have a Function App 2.0 created in place as the host to this application.

relexdistributor's People

Contributors

5he11 avatar

Watchers

 avatar

relexdistributor's Issues

What if the source account has too little ethereum?

This is current version line 92
var gas = await function.EstimateGasAsync(from, null, null, to, amountInEthereumFormat);

In a robust implementation, we probably want to be able to do a test run that doesn't actually do transactions but just adds up the Ethereum amounts needed so that we can make sure that the account has enough to fund the gas needed. We also probably want to be able to adjust gas amounts off of the machine recommendation as a program parameter.

Output parsing

This is line 83:
Console.Write("Sending {0} Relex tokens to {1}... ", amount, to);

But the CSV has the first column being addresses and the second column being amounts so shouldn't it be
Console.Write("Sending {1} Relex tokens to {0}... ", amount, to);

Insufficient comment

Here are lines 84 and 85 of the current version
//the real transactional amount needs to be multiplied by the decimals of Relex Token
amount *= (long)Math.Pow(10, RelexDecimals);

For someone who is not that familiar (it's been a long time since I had anything to do with C of any variant), you probably want a little more detail explaining what you are doing here. Why must the stated transactional amount need to be modified?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.