Skip to content

Instantly share code, notes, and snippets.

@cmdzro
cmdzro / distribute.ts
Last active September 20, 2022 07:24
This script distributes ERC-20 tokens using a gnosis safe multisend transaction. Learn more about it in this article: https://mirror.xyz/0xa1AC2cC82249A44892802a99CA84c4ed1072B29C/lL8AYV_b4VzTbojuZEprrxD7-RTTap2IMIS8qIObfl8
import { ethers } from "hardhat"
import Safe, { EthersAdapter } from "@gnosis.pm/safe-core-sdk"
import { MetaTransactionData } from "@gnosis.pm/safe-core-sdk-types"
import SafeServiceClient from "@gnosis.pm/safe-service-client"
import { BigNumber } from "@ethersproject/bignumber"
const safeAddress = "0xAAA" // on rinkeby testnet
const tokenAddress = "0xBBB" // on rinkeby testnet
const transactionServiceUrl = "https://safe-transaction.rinkeby.gnosis.io/" // on rinkeby testnet