Skip to content

Commit

Permalink
chore: improve assert descriptions in crowdfund.vy (vyperlang#3064)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
Co-authored-by: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 7, 2023
1 parent 4f76614 commit a87fb8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/crowdfund.vy
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def __init__(_beneficiary: address, _goal: uint256, _timelimit: uint256):
@external
@payable
def participate():
assert block.timestamp < self.deadline, "deadline not met (yet)"
assert block.timestamp < self.deadline, "deadline has expired"

self.funders[msg.sender] += msg.value

# Enough money was raised! Send funds to the beneficiary
@external
def finalize():
assert block.timestamp >= self.deadline, "deadline has passed"
assert self.balance >= self.goal, "the goal has not been reached"
assert block.timestamp >= self.deadline, "deadline has not expired yet"
assert self.balance >= self.goal, "goal has not been reached"

selfdestruct(self.beneficiary)

Expand Down

0 comments on commit a87fb8c

Please sign in to comment.