Search Apps Documentation Source Content File Folder Download Copy Actions Download

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/))

Functions

DisperseGRC20

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

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

# 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

DisperseGRC20String

func DisperseGRC20String(cur realm, addresses string, tokens string)
Execute

DisperseGRC20String receives a string of addresses and a string of tokens and parses them to be used in DisperseGRC20

Params

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 "DisperseGRC20String" -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 "DisperseGRC20String" -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

func DisperseUgnot(cur realm, addresses []address, coins chain.Coins)
Execute

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

Params

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

DisperseUgnotString

func DisperseUgnotString(cur realm, addresses string, amounts string)
Execute

DisperseUgnotString receives a string of addresses and a string of amounts and parses them to be used in DisperseUgnot

Params

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 "DisperseUgnotString" -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 "DisperseUgnotString" -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