https://github.com/streamr-dev/brubeck-rewards
Token distribution smart contract + script
https://github.com/streamr-dev/brubeck-rewards
Last synced: 5 months ago
JSON representation
Token distribution smart contract + script
- Host: GitHub
- URL: https://github.com/streamr-dev/brubeck-rewards
- Owner: streamr-dev
- Created: 2021-11-03T14:23:44.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-19T17:22:19.000Z (over 1 year ago)
- Last Synced: 2025-07-18T06:51:38.460Z (5 months ago)
- Language: TypeScript
- Size: 9 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Token distribution contract
[](https://github.com/streamr-dev/brubeck-rewards/actions/workflows/ci.yaml)
## Smart contract
1. Deploy the contract, argument = address of the token to distribute
1. Send distributed tokens into contract
1. Send native token into the contract (stipends to recipients so that they can transfer the token forward)
1. Call send, arguments = (array of the intended targets' addresses, respective array of token wei amounts)
1. Call withdrawAll to return any extra tokens and native tokens to the deployer
## Usage
To run the Stream-team distribution:
1. Send tokens to the [distributor contract](https://polygonscan.com/address/0x4f9c39FD42010c1bDFf33e8176caf66b9F5F356b#readContract)
1. Clone this repo and/or `cd brubeck-rewards` (enter commands from repository root)
1. Save the CSV file to `data/stream-team/2022-11-01.csv` (use today's date!)
1. export KEY=0x1234567890123456789012345678901234567890123456789012345678901234 (find the "distributor" private key in 1password)
1. `scripts/stream-team.sh`
## Costs
Gas measurements using index.js
```
batch 10, gas 179857 (18000/target)
batch 30, gas 486143 (16200/target)
batch 100, gas 1558330 (15600/target)
```