Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

disperse source realm

Package disperse provides methods to disperse coins or GRC20 tokens among multiple addresses.

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/) - [the original disperse app on etherscan](https://etherscan.io/address/0xd152f549545093347a162dce210e7293f1452150#code) - [the gno disperse web app](https://gno-disperse.netlify.app/)

Variables 1

var ErrNotEnoughCoin, ErrNumAddrValMismatch, ErrInvalidAddress, ErrNegativeCoinAmount, ErrMismatchBetweenSentAndParams, ErrArgLenAndSentLenMismatch, ErrInvalidAmount

1var (
2	ErrNotEnoughCoin                = errors.New("disperse: not enough coin sent in")
3	ErrNumAddrValMismatch           = errors.New("disperse: number of addresses and values to send doesn't match")
4	ErrInvalidAddress               = errors.New("disperse: invalid address")
5	ErrNegativeCoinAmount           = errors.New("disperse: coin amount cannot be negative")
6	ErrMismatchBetweenSentAndParams = errors.New("disperse: mismatch between coins sent and params called")
7	ErrArgLenAndSentLenMismatch     = errors.New("disperse: mismatch between coins sent and args called")
8	ErrInvalidAmount                = errors.New("disperse: invalid amount")
9)
source

Functions 4

func DisperseGRC20

crossing Action
1func DisperseGRC20(cur realm, addresses []address, amounts []int64, symbols []string)
source

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

func DisperseGRC20String

crossing Action
1func DisperseGRC20String(cur realm, addresses string, tokens string)
source

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

func DisperseUgnot

crossing Action
1func DisperseUgnot(cur realm, addresses []address, coins chain.Coins)
source

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

func DisperseUgnotString

crossing Action
1func DisperseUgnotString(cur realm, addresses string, amounts string)
source

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

Imports 8

Source Files 5