filswan / swan-faucet

Simple smart contract based ERC20 faucet for Ethereum
MIT License
1 stars 2 forks source link

ticket #19 checkFaucetBalance function before SendMultiTokens #21

Closed rykci closed 2 years ago

rykci commented 2 years ago

checkFaucetBalance compares faucet balance with tokenAmounts

call sendMultiTokens with updated arrays return status with the tx_hash

ex json:

[
    {
        "address": "0xe11A86849d99F524cAC3E7A0Ec1241828e332C62",
        "result": 0
    },
    {
        "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        "result": -1,
        "err": "running out of tokens"
    },
    {
        "tx_hash": "0xebfc43ae5a55c2a3ebabf1e17d23406c3fbbe5082039604e6dc66d9f7cdb9f74"
    }
]