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 []std.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 "https://rpc.gno.land:443" 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 "staging" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land:443" call.tx

DisperseGRC20String

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

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

Params

Command

gnokey query -remote "https://rpc.gno.land:443" 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 "staging" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land:443" call.tx

DisperseUgnot

func DisperseUgnot(cur realm, addresses []std.Address, coins std.Coins)

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

gnokey query -remote "https://rpc.gno.land:443" 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 "staging" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land:443" call.tx

DisperseUgnotString

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

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

Params

Command

gnokey query -remote "https://rpc.gno.land:443" 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 "staging" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land:443" call.tx