disperse package

Overview

Package disperse provides methods to disperse coins or GRC20 tokens among multiple addresses. The disperse package is an implementation of an existing service that allows users to send coins or GRC20 tokens to multiple addresses on the Ethereum blockchain. Usage: To use disperse, you can either use \`DisperseUgnot\` to send coins or \`DisperseGRC20\` to send GRC20 tokens to multiple addresses. Example: Dispersing 200 coins to two addresses: - DisperseUgnotString("g1dmt3sa5ucvecxuhf3j6ne5r0e3z4x7h6c03xc0,g1akeqsvhucjt8gf5yupyzjxsjd29wv8fayng37c", "150,50") Dispersing 200 worth of a GRC20 token "TEST" to two addresses: - DisperseGRC20String("g1dmt3sa5ucvecxuhf3j6ne5r0e3z4x7h6c03xc0,g1akeqsvhucjt8gf5yupyzjxsjd29wv8fayng37c", "150TEST,50TEST") Reference: - \[the original dispere app]([https://disperse.app/](https://disperse.app/)) - \[the original disperse app on etherscan]([https://etherscan.io/address/0xd152f549545093347a162dce210e7293f1452150#code](https://etherscan.io/address/0xd152f549545093347a162dce210e7293f1452150#code)) - \[the gno disperse web app]([https://gno-disperse.netlify.app/](https://gno-disperse.netlify.app/))

Function

DisperseGRC20

func DisperseGRC20(cur realm, addresses []address, amounts []int64, symbols []string)

DisperseGRC20 disperses tokens to multiple addresses Note that it is necessary to approve the realm to spend the tokens before calling this function see the corresponding filetests for examples

Params

Command

gnokey query -remote "tcp://0.0.0.0:26657" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/demo/disperse" -func "DisperseGRC20"  -args "" -args "" -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "zenao-dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "tcp://0.0.0.0:26657" call.tx