DAOTOOL101 #8: CSV Airdrop for Easy and Safe Transfers
0x6E5c
April 26th, 2022

Author(s): zerohash | Tet#7609

Editor(s): koala | koala#4988

Last updated: 26th April 2022


What is CSV Airdrop (Safe App)?

On-chain reward distribution within a DAO community is often tiresome and expensive if there are no tools to simplify it. Communities will have to execute transactions for each reward recipient and pay transaction fees multiple times - the cost and chore adds up overtime.

This is where CSV Airdrop comes into play, enabling DAO communities that uses the Gnosis Safe multi-signature wallet to easily payout rewards to all contributors in a single transaction, involving multiple token types.

Send arbitrarily many distinct tokens, to arbitrarily many distinct accounts with various different values from a CSV file in a single Safe transaction!

- Benjamin Smith, CSV Airdrop developer


How to prepare the transfer file?

As the name suggests, the transfer file should be in .csv format. There are five parameters users have to be familiar with in order to us the app.

Transfer files are expected to be in CSV format with the following required columns:

  • token_type: Indicates the type of token standard being transferred. For native tokens, users can specify token_type = native. For non-native ERC-20 tokens, users will have to specify token_type = erc20. For NFT transfers, be it ERC-721 or ERC-1155, users will have to specify token_type = nft.
  • token_address: The token contract address for the token being transferred. This can be left blank if it is a native token.
  • receiver: The wallet address of the receiver.
  • amount: The total amount of token the receiver should receive in this transaction for a particular token. For NFT tokens, this can be left blank.
  • id: This parameter is reserved for NFT tokens only, such as ERC-721 and ERC-1155. It should be left blank for ERC-20 tokens and native tokens.

Note: The explanation above assumes the Gnosis Safe is on the Ethereum mainnet. For non-Ethereum safe, the native token will be the respective blockchain’s native token. (i.e. $MATIC for Polygon chain, $BNB for Binance chain, $AVAX for Avalanche chain, and etc.)


Sending distinct ERC-20 tokens to multiple addresses

The following section details how DAO Treasuries can use the built-in Gnosis Safe CSV Airdrop application to send multiple types of ERC-20 tokens to multiple wallet addresses. The following example of transferring ERC-20 tokens will be done using the $PEOPLE and #USDT token.

1. Navigate Gnosis Safe and locate the CSV Airdrop app, as shown below. Make sure to bookmark it!

Make sure to bookmark it!
Make sure to bookmark it!

2. Upload your .csv file with the appropriate details. Here, we are transferring both $PEOPLE token and $USDT token to multiple users in one transaction.

The .csv file must detail the token contract address, receiver wallet address, as well as the amount to be received. Make sure you specify these 3 parameters for it to function. We do not need to specify the token_type for ERC-20 transfers as token_type parameter is set to erc20 by default.

Note: Make sure you have the correct token contract address and wallet address. This can be checked on Etherscan.

Sending 2 types of ERC-20 tokens to 9 different addresses.
Sending 2 types of ERC-20 tokens to 9 different addresses.

Sending 2 types of ERC-20 tokens to 9 different addresses.

A sample of the code used in the .csv file can be seen in the following code block.

token_address, receiver, amount 0x7a58c0be72be218b41c608b7fe7c5bb630736c71,0x3317AD9eDa6942b5a7BE5BA83346C0Ea82C3C26C,260600 0x7a58c0be72be218b41c608b7fe7c5bb630736c72,0xe8d27d05d78f0D1c1cD6E44d21253E4916B41cdE,5000 0x7a58c0be72be218b41c608b7fe7c5bb630736c73,0xa9952D7C14f3C96bd49f241a1a0113b5e5bAe8e5,5000 0x7a58c0be72be218b41c608b7fe7c5bb630736c74,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,29000 0x7a58c0be72be218b41c608b7fe7c5bb630736c75,0x534Db4d2f6715D9c7023Bd938b0f62D72eE871eF,7000 0x7a58c0be72be218b41c608b7fe7c5bb630736c76,0xcba855790c30c176a812f7d42bb58597c0b46130,3000 0x7a58c0be72be218b41c608b7fe7c5bb630736c77,0x9eeec61e6af4939a74c2572b73378168fa125025,1000 0x7a58c0be72be218b41c608b7fe7c5bb630736c78,0xd10d827c8f1d7fb381a2d3d355c7293518963611,2000 0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,0x7f0cEE1044269A8b3D809438Ffd77baCA4d72103,500

3. Check the information of each recipient and their token amount.

Clean summary view of the assets being transferred.
Clean summary view of the assets being transferred.

Clean summary view of the assets being transferred.

4. Click submit and sign the transaction with your wallet.

Check the message before signing.
Check the message before signing.

Check the message before signing.

5. Once the transaction is successful, it will look as the following.

Successful transaction.
Successful transaction.

Successful transaction.


Sending ERC-20 and ERC-721 tokens to multiple addresses

Our next section will detail the process of sending ERC-20 or ERC-721 token standards to multiple wallet addresses. This example is to show users how CSV Airdrop can be used to send both ERC-20 tokens and ERC-721 NFT tokens in one single transaction to multiple addresses.

1. Navigate Gnosis Safe and locate the CSV Airdrop app, as shown here.

Make sure to bookmark it!
Make sure to bookmark it!

Make sure to bookmark it!

2. Upload your .csv file with the appropriate details. In this transaction we are sending both $ETH, Ethereum’s native token, some ERC-20 tokens, as well as a few types of ERC-721 NFTs.

Sending 5 types of ERC-20 tokens and 4 types of ERC-721 NFTs.
Sending 5 types of ERC-20 tokens and 4 types of ERC-721 NFTs.

Sending 5 types of ERC-20 tokens and 4 types of ERC-721 NFTs.

A sample of the code used in the .csv file can be seen in the following code block. Notice there are empty column entries. This is because the corresponding parameter does not apply to this transfer.

token_type,token_address,receiver,amount,id,
native,,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,13.869
erc20,0x7A58c0Be72BE218B41C608b7Fe7C5bB630736C71,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,828
erc20,0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,10.53245,
erc20,0xdAC17F958D2ee523a2206206994597C13D831ec7,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,90,
erc20,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,4.92,
nft,0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,,19825082214515299146110977039460911730864772022035037295506704429982787514017
nft,0xC53Dc593b69c67A209Cf70d4172078c9125449bB,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,,1834
nft,0x19b703f65aA7E1E775BD06c2aa0D0d08c80f1C45,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,,4702
nft,0x0fB73942cdffd45ccC8517061ae7430cDdde6b50,0x6E5cc01c94fFaB8A1db9e70A8caC19767f239443,,8
  1. Check the information of each recipient and their token amount.
Verify the transfer summary. The first part summarises the ERC-20 assets. The second part summarises the NFT assets.
Verify the transfer summary. The first part summarises the ERC-20 assets. The second part summarises the NFT assets.

Verify the transfer summary. The first part summarises the ERC-20 assets. The second part summarises the NFT assets.

4. Click submit and sign the transaction with your wallet.

Check the message before signing.
Check the message before signing.

Check the message before signing.

5. Once the transaction is successful, it will look as the following.

Successful transaction.
Successful transaction.

Successful transaction.


This concludes our tooling article for CSV Airdrop. The app is a really useful one that enables the Gnosis Safe to send assets to multiple users in one transaction and save on time and gas fees. Kudos to the developer for creating such a convenient app for Gnosis.

Subscribe for updates
Receive new entries by PeopleDAO directly to your inbox.
Collectors
View
#1
#2
#3
View collectors
This entry has been permanently stored on-chain and signed by its creator.