Created
August 1, 2022 12:43
-
-
Save casweeney/4718797ba14dfd8b247fd47efa932bdc to your computer and use it in GitHub Desktop.
Assignment given by Kevin at Web3Bridge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Collect funds in a payable `stake()` function and track individual `balances` with a mapping: | |
// ( Make sure to add a `Stake(address,uint256)` event and emit) | |
// After some `deadline` allow anyone to call an `execute()` function | |
// If the deadline has passed and the threshold is met, it should call `exampleExternalContract.complete{value: address(this).balance}()` | |
// If the `threshold` was not met, allow everyone to call a `withdraw()` function | |
// Add a `withdraw()` function to let users withdraw their balance | |
// Add a `timeLeft()` view function that returns the time left before the deadline for the frontend | |
// Add the `receive()` special function that receives eth and calls stake() | |
// receive() payable external { | |
// stake(); | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment