https://github.com/gravityblast/idle-batched-mint
https://github.com/gravityblast/idle-batched-mint
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gravityblast/idle-batched-mint
- Owner: gravityblast
- License: other
- Created: 2020-12-21T21:37:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-07T22:25:13.000Z (over 5 years ago)
- Last Synced: 2025-01-05T22:40:53.554Z (over 1 year ago)
- Language: JavaScript
- Size: 525 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IdleBatchedMint
The `IdleBatchedMint` contract allows to queue multiple deposits of underlying tokens and
send them to its `IdleToken` contract to mint Idle tokens in batches, allowing multiple users to
avoid paying high gas fees for the final `mintIdleToken` transaction.
## Example:
* User A calls `IdleBatchedMint.deposit(uint256 amount)`
* User B calls `IdleBatchedMint.deposit(uint256 amount)`
* User C calls `IdleBatchedMint.deposit(uint256 amount)`
* Any user can call `IdleBatchedMint.executeBatch(bool _skipRebalance)`
After the last step, the `IdleBatchedMint` contract is the owner of the Idle tokens, but at any point in time,
users A, B, and C can call `IdleBatchedMint.withdraw(uint256 batchId)` to withdraw their own Idle tokens.
## Setup
`yarn install`
## Tests
`npx hardhat test`
## Integration test with network fork
Start a mainnet fork:
```
export IDLE_INFURA_KEY=YOUR_INFURA_KEY
./fork.sh mainnet # or ./fork.sh kovan
```
Run the integration test:
```
npx hardhat run scripts/integration_test.js --network local
```
### Deploy
```
export MAINNET_PRIVATE_KEY=YOUR_MAINNET_KEY # without 0x prefix
npx hardhat run scripts/deploy.js --network YOUR_CONFIGURED_NETWORK
```
## Batches stats
```
npx hardhat stats --network kovan --address 0xB9f068bDAe0D7C4796A04f59d0DEF33Ac784AfB4
```