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/))
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
Command
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/demo/disperse" -func "DisperseGRC20" -args "" -args "" -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test9" -remote "https://rpc.test9.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test9.testnets.gno.land" 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 "test9" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test9.testnets.gno.land" call.tx
DisperseUgnot parses receivers and amounts and sends out ugnot The function will send out the coins to the addresses and return the leftover coins to the caller if there are any to return
Command
# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.
gnokey maketx call -pkgpath "gno.land/r/demo/disperse" -func "DisperseUgnot" -args "" -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test9" -remote "https://rpc.test9.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test9.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/demo/disperse" -func "DisperseUgnot" -args "" -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test9" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test9.testnets.gno.land" call.tx